2019-08-14 09:48:44 +00:00
|
|
|
<template>
|
|
|
|
<div class="conv-header">
|
2021-03-02 17:14:04 +00:00
|
|
|
<div class="user">
|
2019-08-14 09:48:44 +00:00
|
|
|
<Thumbnail
|
2020-06-02 17:29:02 +00:00
|
|
|
:src="currentContact.thumbnail"
|
2019-08-14 09:48:44 +00:00
|
|
|
size="40px"
|
2020-07-04 14:16:17 +00:00
|
|
|
:badge="chatMetadata.channel"
|
2020-06-02 17:29:02 +00:00
|
|
|
:username="currentContact.name"
|
2020-07-04 06:12:47 +00:00
|
|
|
:status="currentContact.availability_status"
|
2019-08-14 09:48:44 +00:00
|
|
|
/>
|
2019-11-14 08:16:43 +00:00
|
|
|
<div class="user--profile__meta">
|
2021-03-02 17:14:04 +00:00
|
|
|
<h3 class="user--name text-truncate">
|
2020-06-02 17:29:02 +00:00
|
|
|
{{ currentContact.name }}
|
2019-11-14 08:16:43 +00:00
|
|
|
</h3>
|
|
|
|
<button
|
2020-03-22 06:14:40 +00:00
|
|
|
class="user--profile__button clear button small"
|
2020-08-17 05:55:13 +00:00
|
|
|
@click="$emit('contact-panel-toggle')"
|
2019-11-14 08:16:43 +00:00
|
|
|
>
|
2020-08-17 05:55:13 +00:00
|
|
|
{{
|
2021-03-02 17:14:04 +00:00
|
|
|
`${
|
|
|
|
isContactPanelOpen
|
|
|
|
? $t('CONVERSATION.HEADER.CLOSE')
|
|
|
|
: $t('CONVERSATION.HEADER.OPEN')
|
|
|
|
} ${$t('CONVERSATION.HEADER.DETAILS')}`
|
2020-08-17 05:55:13 +00:00
|
|
|
}}
|
2019-11-14 08:16:43 +00:00
|
|
|
</button>
|
|
|
|
</div>
|
2019-08-14 09:48:44 +00:00
|
|
|
</div>
|
2020-08-17 05:55:13 +00:00
|
|
|
<div
|
2020-09-03 08:41:07 +00:00
|
|
|
class="header-actions-wrap"
|
|
|
|
:class="{ 'has-open-sidebar': isContactPanelOpen }"
|
2020-08-17 05:55:13 +00:00
|
|
|
>
|
2021-04-07 06:15:33 +00:00
|
|
|
<div class="multiselect-box multiselect-wrap--small">
|
|
|
|
<i class="icon ion-headphone" />
|
2019-08-14 09:48:44 +00:00
|
|
|
<multiselect
|
|
|
|
v-model="currentChat.meta.assignee"
|
2020-12-08 18:01:25 +00:00
|
|
|
:allow-empty="true"
|
|
|
|
:deselect-label="$t('CONVERSATION.ASSIGNMENT.REMOVE')"
|
2019-08-14 09:48:44 +00:00
|
|
|
:options="agentList"
|
2020-12-08 18:01:25 +00:00
|
|
|
:placeholder="$t('CONVERSATION.ASSIGNMENT.SELECT_AGENT')"
|
|
|
|
:select-label="$t('CONVERSATION.ASSIGNMENT.ASSIGN')"
|
2020-10-13 07:33:55 +00:00
|
|
|
label="name"
|
2020-07-04 14:16:17 +00:00
|
|
|
selected-label
|
2019-08-14 09:48:44 +00:00
|
|
|
track-by="id"
|
2019-10-27 13:31:59 +00:00
|
|
|
@select="assignAgent"
|
2019-08-14 09:48:44 +00:00
|
|
|
@remove="removeAgent"
|
2019-11-10 17:28:55 +00:00
|
|
|
>
|
|
|
|
<span slot="noResult">{{ $t('AGENT_MGMT.SEARCH.NO_RESULTS') }}</span>
|
|
|
|
</multiselect>
|
2019-08-14 09:48:44 +00:00
|
|
|
</div>
|
2020-08-17 05:55:13 +00:00
|
|
|
<more-actions :conversation-id="currentChat.id" />
|
2019-08-14 09:48:44 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import { mapGetters } from 'vuex';
|
2020-08-17 05:55:13 +00:00
|
|
|
import MoreActions from './MoreActions';
|
2019-08-14 09:48:44 +00:00
|
|
|
import Thumbnail from '../Thumbnail';
|
|
|
|
|
|
|
|
export default {
|
2019-10-27 13:31:59 +00:00
|
|
|
components: {
|
2020-08-17 05:55:13 +00:00
|
|
|
MoreActions,
|
2019-10-27 13:31:59 +00:00
|
|
|
Thumbnail,
|
|
|
|
},
|
|
|
|
|
2019-11-14 08:16:43 +00:00
|
|
|
props: {
|
|
|
|
chat: {
|
|
|
|
type: Object,
|
|
|
|
default: () => {},
|
|
|
|
},
|
|
|
|
isContactPanelOpen: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
},
|
2019-08-14 09:48:44 +00:00
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
currentChatAssignee: null,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
...mapGetters({
|
2019-12-21 17:24:35 +00:00
|
|
|
agents: 'agents/getVerifiedAgents',
|
2019-08-14 09:48:44 +00:00
|
|
|
currentChat: 'getSelectedChat',
|
|
|
|
}),
|
2020-06-02 17:29:02 +00:00
|
|
|
|
2020-07-04 14:16:17 +00:00
|
|
|
chatMetadata() {
|
|
|
|
return this.chat.meta;
|
|
|
|
},
|
|
|
|
|
2020-06-02 17:29:02 +00:00
|
|
|
currentContact() {
|
|
|
|
return this.$store.getters['contacts/getContact'](
|
|
|
|
this.chat.meta.sender.id
|
|
|
|
);
|
|
|
|
},
|
|
|
|
|
2019-08-14 09:48:44 +00:00
|
|
|
agentList() {
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
confirmed: true,
|
2020-10-13 07:33:55 +00:00
|
|
|
name: 'None',
|
2019-08-14 09:48:44 +00:00
|
|
|
id: 0,
|
|
|
|
role: 'agent',
|
|
|
|
account_id: 0,
|
|
|
|
email: 'None',
|
|
|
|
},
|
|
|
|
...this.agents,
|
|
|
|
];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
assignAgent(agent) {
|
2019-10-27 13:31:59 +00:00
|
|
|
this.$store
|
|
|
|
.dispatch('assignAgent', {
|
|
|
|
conversationId: this.currentChat.id,
|
|
|
|
agentId: agent.id,
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
bus.$emit('newToastMessage', this.$t('CONVERSATION.CHANGE_AGENT'));
|
|
|
|
});
|
2019-08-14 09:48:44 +00:00
|
|
|
},
|
|
|
|
|
2019-11-14 08:16:43 +00:00
|
|
|
removeAgent() {},
|
2019-08-14 09:48:44 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
2020-01-01 17:00:43 +00:00
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.text-truncate {
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
2021-03-09 09:56:03 +00:00
|
|
|
|
|
|
|
.conv-header {
|
|
|
|
flex: 0 0 var(--space-jumbo);
|
|
|
|
}
|
2020-01-01 17:00:43 +00:00
|
|
|
</style>
|