2019-08-14 09:48:44 +00:00
|
|
|
<template>
|
|
|
|
<div class="conv-header">
|
|
|
|
<div class="user">
|
|
|
|
<Thumbnail
|
|
|
|
:src="chat.meta.sender.thumbnail"
|
|
|
|
size="40px"
|
|
|
|
:badge="chat.meta.sender.channel"
|
2019-10-29 18:06:21 +00:00
|
|
|
:username="chat.meta.sender.name"
|
2019-08-14 09:48:44 +00:00
|
|
|
/>
|
2019-11-14 08:16:43 +00:00
|
|
|
<div class="user--profile__meta">
|
2020-02-11 13:51:55 +00:00
|
|
|
<h3 class="user--name text-truncate">
|
2019-11-14 08:16:43 +00:00
|
|
|
{{ chat.meta.sender.name }}
|
|
|
|
</h3>
|
|
|
|
<button
|
|
|
|
class="user--profile__button"
|
|
|
|
@click="$emit('contactPanelToggle')"
|
|
|
|
>
|
|
|
|
{{ viewProfileButtonLabel }}
|
|
|
|
</button>
|
|
|
|
</div>
|
2019-08-14 09:48:44 +00:00
|
|
|
</div>
|
|
|
|
<div class="flex-container">
|
|
|
|
<div class="multiselect-box ion-headphone">
|
|
|
|
<multiselect
|
|
|
|
v-model="currentChat.meta.assignee"
|
|
|
|
:options="agentList"
|
|
|
|
label="name"
|
|
|
|
:allow-empty="true"
|
|
|
|
deselect-label="Remove"
|
|
|
|
placeholder="Select Agent"
|
2019-10-27 13:31:59 +00:00
|
|
|
selected-label=""
|
2019-08-14 09:48:44 +00:00
|
|
|
select-label="Assign"
|
|
|
|
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>
|
|
|
|
<ResolveButton />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
/* eslint no-console: 0 */
|
|
|
|
/* eslint no-param-reassign: 0 */
|
|
|
|
/* eslint no-shadow: 0 */
|
|
|
|
/* global bus */
|
|
|
|
|
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
import Thumbnail from '../Thumbnail';
|
|
|
|
import ResolveButton from '../../buttons/ResolveButton';
|
|
|
|
|
|
|
|
export default {
|
2019-10-27 13:31:59 +00:00
|
|
|
components: {
|
|
|
|
Thumbnail,
|
|
|
|
ResolveButton,
|
|
|
|
},
|
|
|
|
|
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',
|
|
|
|
}),
|
|
|
|
agentList() {
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
confirmed: true,
|
|
|
|
name: 'None',
|
|
|
|
id: 0,
|
|
|
|
role: 'agent',
|
|
|
|
account_id: 0,
|
|
|
|
email: 'None',
|
|
|
|
},
|
|
|
|
...this.agents,
|
|
|
|
];
|
|
|
|
},
|
2019-11-14 08:16:43 +00:00
|
|
|
viewProfileButtonLabel() {
|
2020-02-11 13:51:55 +00:00
|
|
|
return `${
|
|
|
|
this.isContactPanelOpen ? 'Close' : 'Open'
|
|
|
|
} Conversation Details`;
|
2019-11-14 08:16:43 +00:00
|
|
|
},
|
2019-08-14 09:48:44 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
</style>
|