2020-08-17 05:55:13 +00:00
|
|
|
<template>
|
|
|
|
<div class="flex-container actions--container">
|
2021-09-29 14:03:51 +00:00
|
|
|
<woot-button
|
|
|
|
v-if="!currentChat.muted"
|
|
|
|
v-tooltip="$t('CONTACT_PANEL.MUTE_CONTACT')"
|
2021-12-14 12:07:25 +00:00
|
|
|
variant="clear"
|
2021-12-01 10:34:02 +00:00
|
|
|
color-scheme="secondary"
|
2021-12-01 05:03:18 +00:00
|
|
|
icon="speaker-mute"
|
2021-09-29 14:03:51 +00:00
|
|
|
@click="mute"
|
|
|
|
/>
|
|
|
|
<woot-button
|
|
|
|
v-else
|
|
|
|
v-tooltip.left="$t('CONTACT_PANEL.UNMUTE_CONTACT')"
|
2021-12-14 12:07:25 +00:00
|
|
|
variant="clear"
|
2021-12-01 10:34:02 +00:00
|
|
|
color-scheme="secondary"
|
2021-12-01 05:03:18 +00:00
|
|
|
icon="speaker-1"
|
2021-09-29 14:03:51 +00:00
|
|
|
@click="unmute"
|
|
|
|
/>
|
|
|
|
<woot-button
|
|
|
|
v-tooltip="$t('CONTACT_PANEL.SEND_TRANSCRIPT')"
|
2021-12-14 12:07:25 +00:00
|
|
|
variant="clear"
|
2021-12-01 10:34:02 +00:00
|
|
|
color-scheme="secondary"
|
2021-12-01 05:03:18 +00:00
|
|
|
icon="share"
|
2021-09-29 14:03:51 +00:00
|
|
|
@click="toggleEmailActionsModal"
|
|
|
|
/>
|
2020-08-17 05:55:13 +00:00
|
|
|
<resolve-action
|
|
|
|
:conversation-id="currentChat.id"
|
|
|
|
:status="currentChat.status"
|
|
|
|
/>
|
|
|
|
<email-transcript-modal
|
|
|
|
v-if="showEmailActionsModal"
|
|
|
|
:show="showEmailActionsModal"
|
|
|
|
:current-chat="currentChat"
|
|
|
|
@cancel="toggleEmailActionsModal"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
import { mixin as clickaway } from 'vue-clickaway';
|
|
|
|
import alertMixin from 'shared/mixins/alertMixin';
|
|
|
|
import EmailTranscriptModal from './EmailTranscriptModal';
|
|
|
|
import ResolveAction from '../../buttons/ResolveAction';
|
2021-11-15 11:52:44 +00:00
|
|
|
import {
|
|
|
|
CMD_MUTE_CONVERSATION,
|
|
|
|
CMD_SEND_TRANSCRIPT,
|
|
|
|
CMD_UNMUTE_CONVERSATION,
|
|
|
|
} from '../../../routes/dashboard/commands/commandBarBusEvents';
|
2020-08-17 05:55:13 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
EmailTranscriptModal,
|
|
|
|
ResolveAction,
|
|
|
|
},
|
|
|
|
mixins: [alertMixin, clickaway],
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showEmailActionsModal: false,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
2021-11-15 11:52:44 +00:00
|
|
|
...mapGetters({ currentChat: 'getSelectedChat' }),
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
bus.$on(CMD_MUTE_CONVERSATION, this.mute);
|
|
|
|
bus.$on(CMD_UNMUTE_CONVERSATION, this.unmute);
|
|
|
|
bus.$on(CMD_SEND_TRANSCRIPT, this.toggleEmailActionsModal);
|
|
|
|
},
|
|
|
|
destroyed() {
|
|
|
|
bus.$off(CMD_MUTE_CONVERSATION, this.mute);
|
|
|
|
bus.$off(CMD_UNMUTE_CONVERSATION, this.unmute);
|
|
|
|
bus.$off(CMD_SEND_TRANSCRIPT, this.toggleEmailActionsModal);
|
2020-08-17 05:55:13 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
mute() {
|
|
|
|
this.$store.dispatch('muteConversation', this.currentChat.id);
|
|
|
|
this.showAlert(this.$t('CONTACT_PANEL.MUTED_SUCCESS'));
|
|
|
|
},
|
2020-10-08 06:32:08 +00:00
|
|
|
unmute() {
|
|
|
|
this.$store.dispatch('unmuteConversation', this.currentChat.id);
|
|
|
|
this.showAlert(this.$t('CONTACT_PANEL.UNMUTED_SUCCESS'));
|
|
|
|
},
|
2020-08-17 05:55:13 +00:00
|
|
|
toggleEmailActionsModal() {
|
|
|
|
this.showEmailActionsModal = !this.showEmailActionsModal;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
2021-09-29 14:03:51 +00:00
|
|
|
.actions--container {
|
|
|
|
align-items: center;
|
|
|
|
|
2021-12-14 12:07:25 +00:00
|
|
|
.resolve-actions {
|
|
|
|
margin-left: var(--space-small);
|
2021-09-29 14:03:51 +00:00
|
|
|
}
|
|
|
|
}
|
2020-09-03 08:41:07 +00:00
|
|
|
|
2020-08-17 05:55:13 +00:00
|
|
|
.more--button {
|
|
|
|
align-items: center;
|
|
|
|
display: flex;
|
2020-09-03 08:41:07 +00:00
|
|
|
margin-left: var(--space-small);
|
2020-08-17 05:55:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.actions--container {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown-pane {
|
2021-04-07 06:13:16 +00:00
|
|
|
right: var(--space-minus-small);
|
2020-08-17 05:55:13 +00:00
|
|
|
top: 48px;
|
|
|
|
}
|
|
|
|
|
2021-03-20 07:38:56 +00:00
|
|
|
.icon {
|
|
|
|
margin-right: var(--space-smaller);
|
|
|
|
min-width: var(--space-normal);
|
2020-08-17 05:55:13 +00:00
|
|
|
}
|
|
|
|
</style>
|