feat: Add Command bar for improved productivity (#3352)
Co-authored-by: Fayaz Ahmed <15716057+fayazara@users.noreply.github.com>
This commit is contained in:
parent
1e3f255ece
commit
e849759e15
21 changed files with 818 additions and 108 deletions
|
@ -8,7 +8,7 @@
|
|||
icon="ion-checkmark"
|
||||
emoji="✅"
|
||||
:is-loading="isLoading"
|
||||
@click="() => toggleStatus(STATUS_TYPE.RESOLVED)"
|
||||
@click="onCmdResolveConversation"
|
||||
>
|
||||
{{ this.$t('CONVERSATION.HEADER.RESOLVE_ACTION') }}
|
||||
</woot-button>
|
||||
|
@ -19,7 +19,7 @@
|
|||
icon="ion-refresh"
|
||||
emoji="👀"
|
||||
:is-loading="isLoading"
|
||||
@click="() => toggleStatus(STATUS_TYPE.OPEN)"
|
||||
@click="onCmdOpenConversation"
|
||||
>
|
||||
{{ this.$t('CONVERSATION.HEADER.REOPEN_ACTION') }}
|
||||
</woot-button>
|
||||
|
@ -29,7 +29,7 @@
|
|||
color-scheme="primary"
|
||||
icon="ion-person"
|
||||
:is-loading="isLoading"
|
||||
@click="() => toggleStatus(STATUS_TYPE.OPEN)"
|
||||
@click="onCmdOpenConversation"
|
||||
>
|
||||
{{ this.$t('CONVERSATION.HEADER.OPEN_ACTION') }}
|
||||
</woot-button>
|
||||
|
@ -118,6 +118,11 @@ import {
|
|||
startOfTomorrow,
|
||||
startOfWeek,
|
||||
} from 'date-fns';
|
||||
import {
|
||||
CMD_REOPEN_CONVERSATION,
|
||||
CMD_RESOLVE_CONVERSATION,
|
||||
CMD_SNOOZE_CONVERSATION,
|
||||
} from '../../routes/dashboard/commands/commandBarBusEvents';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
@ -135,9 +140,7 @@ export default {
|
|||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
currentChat: 'getSelectedChat',
|
||||
}),
|
||||
...mapGetters({ currentChat: 'getSelectedChat' }),
|
||||
isOpen() {
|
||||
return this.currentChat.status === wootConstants.STATUS_TYPE.OPEN;
|
||||
},
|
||||
|
@ -170,6 +173,16 @@ export default {
|
|||
};
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
bus.$on(CMD_SNOOZE_CONVERSATION, this.onCmdSnoozeConversation);
|
||||
bus.$on(CMD_REOPEN_CONVERSATION, this.onCmdOpenConversation);
|
||||
bus.$on(CMD_RESOLVE_CONVERSATION, this.onCmdResolveConversation);
|
||||
},
|
||||
destroyed() {
|
||||
bus.$off(CMD_SNOOZE_CONVERSATION, this.onCmdSnoozeConversation);
|
||||
bus.$off(CMD_REOPEN_CONVERSATION, this.onCmdOpenConversation);
|
||||
bus.$off(CMD_RESOLVE_CONVERSATION, this.onCmdResolveConversation);
|
||||
},
|
||||
methods: {
|
||||
async handleKeyEvents(e) {
|
||||
const allConversations = document.querySelectorAll(
|
||||
|
@ -204,6 +217,18 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
onCmdSnoozeConversation(snoozeType) {
|
||||
this.toggleStatus(
|
||||
this.STATUS_TYPE.SNOOZED,
|
||||
this.snoozeTimes[snoozeType] || null
|
||||
);
|
||||
},
|
||||
onCmdOpenConversation() {
|
||||
this.toggleStatus(this.STATUS_TYPE.OPEN);
|
||||
},
|
||||
onCmdResolveConversation() {
|
||||
this.toggleStatus(this.STATUS_TYPE.RESOLVED);
|
||||
},
|
||||
showOpenButton() {
|
||||
return this.isResolved || this.isSnoozed;
|
||||
},
|
||||
|
|
|
@ -64,8 +64,20 @@ export default {
|
|||
this.$store.dispatch('inboxAssignableAgents/fetch', { inboxId });
|
||||
}
|
||||
},
|
||||
'currentChat.id'() {
|
||||
this.fetchLabels();
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.fetchLabels();
|
||||
},
|
||||
methods: {
|
||||
fetchLabels() {
|
||||
if (!this.currentChat.id) {
|
||||
return;
|
||||
}
|
||||
this.$store.dispatch('conversationLabels/get', this.currentChat.id);
|
||||
},
|
||||
onToggleContactPanel() {
|
||||
this.$emit('contact-panel-toggle');
|
||||
},
|
||||
|
|
|
@ -38,6 +38,11 @@ import { mixin as clickaway } from 'vue-clickaway';
|
|||
import alertMixin from 'shared/mixins/alertMixin';
|
||||
import EmailTranscriptModal from './EmailTranscriptModal';
|
||||
import ResolveAction from '../../buttons/ResolveAction';
|
||||
import {
|
||||
CMD_MUTE_CONVERSATION,
|
||||
CMD_SEND_TRANSCRIPT,
|
||||
CMD_UNMUTE_CONVERSATION,
|
||||
} from '../../../routes/dashboard/commands/commandBarBusEvents';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
@ -47,36 +52,35 @@ export default {
|
|||
mixins: [alertMixin, clickaway],
|
||||
data() {
|
||||
return {
|
||||
showConversationActions: false,
|
||||
showEmailActionsModal: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
currentChat: 'getSelectedChat',
|
||||
}),
|
||||
...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);
|
||||
},
|
||||
methods: {
|
||||
mute() {
|
||||
this.$store.dispatch('muteConversation', this.currentChat.id);
|
||||
this.showAlert(this.$t('CONTACT_PANEL.MUTED_SUCCESS'));
|
||||
this.toggleConversationActions();
|
||||
},
|
||||
unmute() {
|
||||
this.$store.dispatch('unmuteConversation', this.currentChat.id);
|
||||
this.showAlert(this.$t('CONTACT_PANEL.UNMUTED_SUCCESS'));
|
||||
this.toggleConversationActions();
|
||||
},
|
||||
toggleEmailActionsModal() {
|
||||
this.showEmailActionsModal = !this.showEmailActionsModal;
|
||||
this.hideConversationActions();
|
||||
},
|
||||
toggleConversationActions() {
|
||||
this.showConversationActions = !this.showConversationActions;
|
||||
},
|
||||
hideConversationActions() {
|
||||
this.showConversationActions = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -33,6 +33,8 @@ describe('MoveActions', () => {
|
|||
beforeEach(() => {
|
||||
window.bus = {
|
||||
$emit: jest.fn(),
|
||||
$on: jest.fn(),
|
||||
$off: jest.fn(),
|
||||
};
|
||||
|
||||
state = {
|
||||
|
|
|
@ -79,5 +79,50 @@
|
|||
"BUTTON": {
|
||||
"REFRESH": "Refresh"
|
||||
}
|
||||
},
|
||||
"COMMAND_BAR": {
|
||||
"SEARCH_PLACEHOLDER": "Search or jump to",
|
||||
"SECTIONS": {
|
||||
"GENERAL": "General",
|
||||
"REPORTS": "Reports",
|
||||
"CONVERSATION": "Conversation",
|
||||
"CHANGE_ASSIGNEE": "Change Assignee",
|
||||
"CHANGE_TEAM": "Change Team",
|
||||
"ADD_LABEL": "Add label to the conversation",
|
||||
"REMOVE_LABEL": "Remove label from the conversation",
|
||||
"SETTINGS": "Settings"
|
||||
},
|
||||
"COMMANDS": {
|
||||
"GO_TO_CONVERSATION_DASHBOARD": "Go to Conversation Dashboard",
|
||||
"GO_TO_CONTACTS_DASHBOARD": "Go to Contacts Dashboard",
|
||||
"GO_TO_REPORTS_OVERVIEW": "Go to Reports Overview",
|
||||
"GO_TO_AGENT_REPORTS": "Go to Agent Reports",
|
||||
"GO_TO_LABEL_REPORTS": "Go to Label Reports",
|
||||
"GO_TO_INBOX_REPORTS": "Go to Inbox Reports",
|
||||
"GO_TO_TEAM_REPORTS": "Go to Team Reports",
|
||||
"GO_TO_SETTINGS_AGENTS": "Go to Agent Settings",
|
||||
"GO_TO_SETTINGS_TEAMS": "Go to Team Settings",
|
||||
"GO_TO_SETTINGS_INBOXES": "Go to Inbox Settings",
|
||||
"GO_TO_SETTINGS_LABELS": "Go to Label Settings",
|
||||
"GO_TO_SETTINGS_CANNED_RESPONSES": "Go to Canned Response Settings",
|
||||
"GO_TO_SETTINGS_APPLICATIONS": "Go to Application Settings",
|
||||
"GO_TO_SETTINGS_ACCOUNT": "Go to Account Settings",
|
||||
"GO_TO_SETTINGS_PROFILE": "Go to Profile Settings",
|
||||
"GO_TO_NOTIFICATIONS": "Go to Notifications",
|
||||
|
||||
"ADD_LABELS_TO_CONVERSATION": "Add label to the conversation",
|
||||
"ASSIGN_AN_AGENT": "Assign an agent",
|
||||
"ASSIGN_A_TEAM": "Assign a team",
|
||||
"MUTE_CONVERSATION": "Mute conversation",
|
||||
"UNMUTE_CONVERSATION": "Unmute conversation",
|
||||
"REMOVE_LABEL_FROM_CONVERSATION": "Remove label from the conversation",
|
||||
"REOPEN_CONVERSATION": "Reopen conversation",
|
||||
"RESOLVE_CONVERSATION": "Resolve conversation",
|
||||
"SEND_TRANSCRIPT": "Send an email transcript",
|
||||
"SNOOZE_CONVERSATION": "Snooze Conversation",
|
||||
"UNTIL_NEXT_REPLY": "Until next reply",
|
||||
"UNTIL_NEXT_WEEK": "Until next week",
|
||||
"UNTIL_TOMORROW": "Until tomorrow"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,9 +7,7 @@ export default {
|
|||
this.inboxId
|
||||
);
|
||||
},
|
||||
...mapGetters({
|
||||
currentUser: 'getCurrentUser',
|
||||
}),
|
||||
...mapGetters({ currentUser: 'getCurrentUser' }),
|
||||
isAgentSelected() {
|
||||
return this.currentChat?.meta?.assignee;
|
||||
},
|
||||
|
|
41
app/javascript/dashboard/mixins/conversation/labelMixin.js
Normal file
41
app/javascript/dashboard/mixins/conversation/labelMixin.js
Normal file
|
@ -0,0 +1,41 @@
|
|||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
...mapGetters({ accountLabels: 'labels/getLabels' }),
|
||||
savedLabels() {
|
||||
return this.$store.getters['conversationLabels/getConversationLabels'](
|
||||
this.conversationId
|
||||
);
|
||||
},
|
||||
activeLabels() {
|
||||
return this.accountLabels.filter(({ title }) =>
|
||||
this.savedLabels.includes(title)
|
||||
);
|
||||
},
|
||||
inactiveLabels() {
|
||||
return this.accountLabels.filter(
|
||||
({ title }) => !this.savedLabels.includes(title)
|
||||
);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
addLabelToConversation(value) {
|
||||
const result = this.activeLabels.map(item => item.title);
|
||||
result.push(value.title);
|
||||
this.onUpdateLabels(result);
|
||||
},
|
||||
removeLabelFromConversation(value) {
|
||||
const result = this.activeLabels
|
||||
.map(label => label.title)
|
||||
.filter(label => label !== value);
|
||||
this.onUpdateLabels(result);
|
||||
},
|
||||
async onUpdateLabels(selectedLabels) {
|
||||
this.$store.dispatch('conversationLabels/update', {
|
||||
conversationId: this.conversationId,
|
||||
labels: selectedLabels,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
22
app/javascript/dashboard/mixins/conversation/teamMixin.js
Normal file
22
app/javascript/dashboard/mixins/conversation/teamMixin.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
...mapGetters({ teams: 'teams/getTeams' }),
|
||||
hasAnAssignedTeam() {
|
||||
return !!this.currentChat?.meta?.team;
|
||||
},
|
||||
teamsList() {
|
||||
if (this.hasAnAssignedTeam) {
|
||||
return [
|
||||
{
|
||||
id: 0,
|
||||
name: 'None',
|
||||
},
|
||||
...this.teams,
|
||||
];
|
||||
}
|
||||
return this.teams;
|
||||
},
|
||||
},
|
||||
};
|
|
@ -3,16 +3,19 @@
|
|||
<sidebar :route="currentRoute" :class="sidebarClassName"></sidebar>
|
||||
<section class="app-content columns" :class="contentClassName">
|
||||
<router-view></router-view>
|
||||
<command-bar />
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sidebar from '../../components/layout/Sidebar';
|
||||
import CommandBar from './commands/commandbar.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Sidebar,
|
||||
CommandBar,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
export const ICON_ADD_LABEL = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19.75 2A2.25 2.25 0 0 1 22 4.25v5.462a3.25 3.25 0 0 1-.952 2.298l-8.5 8.503a3.255 3.255 0 0 1-4.597.001L3.489 16.06a3.25 3.25 0 0 1-.003-4.596l8.5-8.51A3.25 3.25 0 0 1 14.284 2h5.465Zm0 1.5h-5.465c-.465 0-.91.185-1.239.513l-8.512 8.523a1.75 1.75 0 0 0 .015 2.462l4.461 4.454a1.755 1.755 0 0 0 2.477 0l8.5-8.503a1.75 1.75 0 0 0 .513-1.237V4.25a.75.75 0 0 0-.75-.75ZM17 5.502a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_ASSIGN_AGENT = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M17.5 12a5.5 5.5 0 1 1 0 11 5.5 5.5 0 0 1 0-11Zm-5.478 2a6.474 6.474 0 0 0-.708 1.5h-7.06a.75.75 0 0 0-.75.75v.907c0 .656.286 1.279.783 1.706C5.545 19.945 7.44 20.501 10 20.501c.599 0 1.162-.03 1.688-.091.25.5.563.964.93 1.38-.803.141-1.676.21-2.618.21-2.89 0-5.128-.656-6.691-2a3.75 3.75 0 0 1-1.305-2.843v-.907A2.25 2.25 0 0 1 4.254 14h7.768Zm4.697.588-.069.058-2.515 2.517-.041.05-.035.058-.032.078-.012.043-.01.086.003.088.019.085.032.078.025.042.05.066 2.516 2.516a.5.5 0 0 0 .765-.638l-.058-.069L15.711 18h4.79a.5.5 0 0 0 .491-.41L21 17.5a.5.5 0 0 0-.41-.492L20.5 17h-4.789l1.646-1.647a.5.5 0 0 0 .058-.637l-.058-.07a.5.5 0 0 0-.638-.058ZM10 2.004a5 5 0 1 1 0 10 5 5 0 0 1 0-10Zm0 1.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_MUTE_CONVERSATION = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.92 3.316c.806-.717 2.08-.145 2.08.934v15.496c0 1.078-1.274 1.65-2.08.934l-4.492-3.994a.75.75 0 0 0-.498-.19H4.25A2.25 2.25 0 0 1 2 14.247V9.75a2.25 2.25 0 0 1 2.25-2.25h3.68a.75.75 0 0 0 .498-.19l4.491-3.993Zm.58 1.49L9.425 8.43A2.25 2.25 0 0 1 7.93 9H4.25a.75.75 0 0 0-.75.75v4.497c0 .415.336.75.75.75h3.68a2.25 2.25 0 0 1 1.495.57l4.075 3.623V4.807ZM16.22 9.22a.75.75 0 0 1 1.06 0L19 10.94l1.72-1.72a.75.75 0 1 1 1.06 1.06L20.06 12l1.72 1.72a.75.75 0 1 1-1.06 1.06L19 13.06l-1.72 1.72a.75.75 0 1 1-1.06-1.06L17.94 12l-1.72-1.72a.75.75 0 0 1 0-1.06Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_UNMUTE_CONVERSATION = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M15 4.25c0-1.079-1.274-1.65-2.08-.934L8.427 7.309a.75.75 0 0 1-.498.19H4.25A2.25 2.25 0 0 0 2 9.749v4.497a2.25 2.25 0 0 0 2.25 2.25h3.68a.75.75 0 0 1 .498.19l4.491 3.994c.806.716 2.081.144 2.081-.934V4.25ZM9.425 8.43 13.5 4.807v14.382l-4.075-3.624a2.25 2.25 0 0 0-1.495-.569H4.25a.75.75 0 0 1-.75-.75V9.75a.75.75 0 0 1 .75-.75h3.68a2.25 2.25 0 0 0 1.495-.569ZM18.992 5.897a.75.75 0 0 1 1.049.157A9.959 9.959 0 0 1 22 12a9.96 9.96 0 0 1-1.96 5.946.75.75 0 0 1-1.205-.892A8.459 8.459 0 0 0 20.5 12a8.459 8.459 0 0 0-1.665-5.054.75.75 0 0 1 .157-1.049Z" fill="#212121"/><path d="M17.143 8.37a.75.75 0 0 1 1.017.302c.536.99.84 2.125.84 3.328a6.973 6.973 0 0 1-.84 3.328.75.75 0 0 1-1.32-.714c.42-.777.66-1.666.66-2.614s-.24-1.837-.66-2.614a.75.75 0 0 1 .303-1.017Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_REMOVE_LABEL = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19.75 2A2.25 2.25 0 0 1 22 4.25v5.462a3.25 3.25 0 0 1-.952 2.298l-.026.026a6.473 6.473 0 0 0-1.43-.692l.395-.395a1.75 1.75 0 0 0 .513-1.237V4.25a.75.75 0 0 0-.75-.75h-5.466c-.464 0-.91.185-1.238.513l-8.512 8.523a1.75 1.75 0 0 0 .015 2.462l4.461 4.454a1.755 1.755 0 0 0 2.33.13c.165.487.386.947.654 1.374a3.256 3.256 0 0 1-4.043-.442L3.489 16.06a3.25 3.25 0 0 1-.004-4.596l8.5-8.51a3.25 3.25 0 0 1 2.3-.953h5.465ZM17 5.502a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM17.5 23a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11Zm-2.354-7.854a.5.5 0 0 1 .708 0l1.646 1.647 1.646-1.647a.5.5 0 0 1 .708.708L18.207 17.5l1.647 1.646a.5.5 0 0 1-.708.708L17.5 18.207l-1.646 1.647a.5.5 0 0 1-.708-.708l1.647-1.646-1.647-1.646a.5.5 0 0 1 0-.708Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_REOPEN_CONVERSATION = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19.25 2a.75.75 0 0 0-.743.648l-.007.102v5.69l-4.574-4.56a6.41 6.41 0 0 0-8.878-.179l-.186.18a6.41 6.41 0 0 0 0 9.063l8.845 8.84a.75.75 0 0 0 1.06-1.062l-8.845-8.838a4.91 4.91 0 0 1 6.766-7.112l.178.17L17.438 9.5H11.75a.75.75 0 0 0-.743.648L11 10.25c0 .38.282.694.648.743l.102.007h7.5a.75.75 0 0 0 .743-.648L20 10.25v-7.5a.75.75 0 0 0-.75-.75Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_RESOLVE_CONVERSATION = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2Zm0 1.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17Zm-1.25 9.94 4.47-4.47a.75.75 0 0 1 1.133.976l-.073.084-5 5a.75.75 0 0 1-.976.073l-.084-.073-2.5-2.5a.75.75 0 0 1 .976-1.133l.084.073 1.97 1.97 4.47-4.47-4.47 4.47Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_SEND_TRANSCRIPT = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19.75 11.5a.75.75 0 0 1 .743.648l.007.102v5a4.75 4.75 0 0 1-4.533 4.745L15.75 22h-7.5c-.98 0-1.813-.626-2.122-1.5h9.622l.184-.005a3.25 3.25 0 0 0 3.06-3.06L19 17.25v-5a.75.75 0 0 1 .75-.75Zm-2.5-2a.75.75 0 0 1 .743.648l.007.102v7a2.25 2.25 0 0 1-2.096 2.245l-.154.005h-10a2.25 2.25 0 0 1-2.245-2.096L3.5 17.25v-7a.75.75 0 0 1 1.493-.102L5 10.25v7c0 .38.282.694.648.743L5.75 18h10a.75.75 0 0 0 .743-.648l.007-.102v-7a.75.75 0 0 1 .75-.75ZM6.218 6.216l3.998-3.996a.75.75 0 0 1 .976-.073l.084.072 4.004 3.997a.75.75 0 0 1-.976 1.134l-.084-.073-2.72-2.714v9.692a.75.75 0 0 1-.648.743l-.102.007a.75.75 0 0 1-.743-.648L10 14.255V4.556L7.279 7.277a.75.75 0 0 1-.977.072l-.084-.072a.75.75 0 0 1-.072-.977l.072-.084 3.998-3.996-3.998 3.996Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_SNOOZE_CONVERSATION = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8.245 13.003a.75.75 0 0 1 .661 1.104l-.057.09-4.622 6.302h4.018a.75.75 0 0 1 .743.648l.007.102a.75.75 0 0 1-.649.743L8.245 22H2.748a.75.75 0 0 1-.662-1.104l.057-.09 4.621-6.302H2.75a.75.75 0 0 1-.743-.648l-.007-.102a.75.75 0 0 1 .648-.743l.102-.007h5.496ZM21.252 2c.6 0 .943.66.639 1.145l-.06.083-8.492 10.269h7.913a.75.75 0 0 1 .743.648l.007.102a.75.75 0 0 1-.648.743l-.102.007h-9.504a.75.75 0 0 1-.639-1.144l.06-.084 8.49-10.27-7.911.001a.75.75 0 0 1-.743-.648l-.007-.102a.75.75 0 0 1 .648-.743L11.748 2h9.504Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_SNOOZE_UNTIL_NEXT_REPLY = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9.277 16.221a.75.75 0 0 1-1.061 1.06l-4.997-5.003a.75.75 0 0 1 0-1.06L8.217 6.22a.75.75 0 0 1 1.061 1.06L5.557 11h7.842c1.595 0 2.81.242 3.889.764l.246.126a6.203 6.203 0 0 1 2.576 2.576c.61 1.14.89 2.418.89 4.135a.75.75 0 0 1-1.5 0c0-1.484-.228-2.52-.713-3.428a4.702 4.702 0 0 0-1.96-1.96c-.838-.448-1.786-.676-3.094-.709L13.4 12.5H5.562l3.715 3.721Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_SNOOZE_UNTIL_NEXT_WEEK = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7.75 7a.75.75 0 0 0-.75.75v4c0 .414.336.75.75.75h8.5a.75.75 0 0 0 .75-.75v-4a.75.75 0 0 0-.75-.75h-8.5Zm.75 4V8.5h7V11h-7Z" fill="currentColor"/><path d="M17.75 21A3.25 3.25 0 0 0 21 17.75V6.25A3.25 3.25 0 0 0 17.75 3H6.25A3.25 3.25 0 0 0 3 6.25v11.5A3.25 3.25 0 0 0 6.25 21h11.5ZM19.5 6.25v11.5a1.75 1.75 0 0 1-1.75 1.75H6.25a1.75 1.75 0 0 1-1.75-1.75V6.25c0-.966.784-1.75 1.75-1.75h11.5c.966 0 1.75.784 1.75 1.75Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_SNOOZE_UNTIL_TOMORRROW = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7.5 8.744C7.847 8.362 8.415 8 9.25 8c1.152 0 1.894.792 2.155 1.661.253.847.1 1.895-.62 2.618a8.092 8.092 0 0 1-.793.67l-.04.031c-.28.216-.53.412-.75.63-.255.256-.464.535-.585.89h2.133a.75.75 0 0 1 0 1.5h-3a.75.75 0 0 1-.75-.75c0-1.247.524-2.083 1.144-2.701.296-.296.618-.545.89-.756l.003-.002c.286-.221.508-.393.685-.57.272-.274.367-.725.246-1.13-.115-.381-.37-.591-.718-.591-.353 0-.535.137-.64.253a.843.843 0 0 0-.148.229v.003a.75.75 0 0 1-1.428-.462l.035-.096a2.343 2.343 0 0 1 .43-.683ZM13.25 8a.75.75 0 0 1 .75.75v2.75h1.5V8.75a.75.75 0 0 1 1.5 0v6.47a.75.75 0 0 1-1.5 0V13h-2.25a.75.75 0 0 1-.75-.75v-3.5a.75.75 0 0 1 .75-.75Z" fill="currentColor"/><path d="M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12s4.477 10 10 10 10-4.477 10-10ZM3.5 12a8.5 8.5 0 1 1 17 0 8.5 8.5 0 0 1-17 0Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_CONVERSATION_DASHBOARD = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none"><path d="M10.55 2.532a2.25 2.25 0 0 1 2.9 0l6.75 5.692c.507.428.8 1.057.8 1.72v9.803a1.75 1.75 0 0 1-1.75 1.75h-3.5a1.75 1.75 0 0 1-1.75-1.75v-5.5a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25v5.5a1.75 1.75 0 0 1-1.75 1.75h-3.5A1.75 1.75 0 0 1 3 19.747V9.944c0-.663.293-1.292.8-1.72l6.75-5.692zm1.933 1.147a.75.75 0 0 0-.966 0L4.767 9.37a.75.75 0 0 0-.267.573v9.803c0 .138.112.25.25.25h3.5a.25.25 0 0 0 .25-.25v-5.5c0-.967.784-1.75 1.75-1.75h3.5c.966 0 1.75.783 1.75 1.75v5.5c0 .138.112.25.25.25h3.5a.25.25 0 0 0 .25-.25V9.944a.75.75 0 0 0-.267-.573l-6.75-5.692z" fill="currentColor"></path></g></svg>`;
|
||||
export const ICON_CONTACT_DASHBOARD = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none"><path d="M17.754 14a2.249 2.249 0 0 1 2.25 2.249v.575c0 .894-.32 1.76-.902 2.438c-1.57 1.834-3.957 2.739-7.102 2.739c-3.146 0-5.532-.905-7.098-2.74a3.75 3.75 0 0 1-.898-2.435v-.577a2.249 2.249 0 0 1 2.249-2.25h11.501zm0 1.5H6.253a.749.749 0 0 0-.75.749v.577c0 .536.192 1.054.54 1.461c1.253 1.468 3.219 2.214 5.957 2.214s4.706-.746 5.962-2.214a2.25 2.25 0 0 0 .541-1.463v-.575a.749.749 0 0 0-.749-.75zM12 2.004a5 5 0 1 1 0 10a5 5 0 0 1 0-10zm0 1.5a3.5 3.5 0 1 0 0 7a3.5 3.5 0 0 0 0-7z" fill="currentColor"></path></g></svg>`;
|
||||
export const ICON_REPORTS_OVERVIEW = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none"><path d="M16.749 2h4.554l.1.014l.099.028l.06.026c.08.034.153.085.219.15l.04.044l.044.057l.054.09l.039.09l.019.064l.014.064l.009.095v4.532a.75.75 0 0 1-1.493.102l-.007-.102V4.559l-6.44 6.44a.75.75 0 0 1-.976.073L13 11L9.97 8.09l-5.69 5.689a.75.75 0 0 1-1.133-.977l.073-.084l6.22-6.22a.75.75 0 0 1 .976-.072l.084.072l3.03 2.91L19.438 3.5h-2.69a.75.75 0 0 1-.742-.648l-.007-.102a.75.75 0 0 1 .648-.743L16.75 2zM3.75 17a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5a.75.75 0 0 1 .75-.75zm5.75-3.25a.75.75 0 0 0-1.5 0v7.5a.75.75 0 0 0 1.5 0v-7.5zM13.75 15a.75.75 0 0 1 .75.75v5.5a.75.75 0 0 1-1.5 0v-5.5a.75.75 0 0 1 .75-.75zm5.75-4.25a.75.75 0 0 0-1.5 0v10.5a.75.75 0 0 0 1.5 0v-10.5z" fill="currentColor"></path></g></svg>`;
|
||||
export const ICON_AGENT_REPORTS = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none"><path d="M4 13.999L13 14a2 2 0 0 1 1.995 1.85L15 16v1.5C14.999 21 11.284 22 8.5 22c-2.722 0-6.335-.956-6.495-4.27L2 17.5v-1.501c0-1.054.816-1.918 1.85-1.995L4 14zM15.22 14H20c1.054 0 1.918.816 1.994 1.85L22 16v1c-.001 3.062-2.858 4-5 4a7.16 7.16 0 0 1-2.14-.322c.336-.386.607-.827.802-1.327A6.19 6.19 0 0 0 17 19.5l.267-.006c.985-.043 3.086-.363 3.226-2.289L20.5 17v-1a.501.501 0 0 0-.41-.492L20 15.5h-4.051a2.957 2.957 0 0 0-.595-1.34L15.22 14H20h-4.78zM4 15.499l-.1.01a.51.51 0 0 0-.254.136a.506.506 0 0 0-.136.253l-.01.101V17.5c0 1.009.45 1.722 1.417 2.242c.826.445 2.003.714 3.266.753l.317.005l.317-.005c1.263-.039 2.439-.308 3.266-.753c.906-.488 1.359-1.145 1.412-2.057l.005-.186V16a.501.501 0 0 0-.41-.492L13 15.5l-9-.001zM8.5 3a4.5 4.5 0 1 1 0 9a4.5 4.5 0 0 1 0-9zm9 2a3.5 3.5 0 1 1 0 7a3.5 3.5 0 0 1 0-7zm-9-.5c-1.654 0-3 1.346-3 3s1.346 3 3 3s3-1.346 3-3s-1.346-3-3-3zm9 2c-1.103 0-2 .897-2 2s.897 2 2 2s2-.897 2-2s-.897-2-2-2z" fill="currentColor"></path></g></svg>`;
|
||||
export const ICON_LABEL_REPORTS = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none"><path d="M19.75 2A2.25 2.25 0 0 1 22 4.25v5.462a3.25 3.25 0 0 1-.952 2.298l-8.5 8.503a3.255 3.255 0 0 1-4.597.001L3.489 16.06a3.25 3.25 0 0 1-.003-4.596l8.5-8.51A3.25 3.25 0 0 1 14.284 2h5.465zm0 1.5h-5.465c-.465 0-.91.185-1.239.513l-8.512 8.523a1.75 1.75 0 0 0 .015 2.462l4.461 4.454a1.755 1.755 0 0 0 2.477 0l8.5-8.503a1.75 1.75 0 0 0 .513-1.237V4.25a.75.75 0 0 0-.75-.75zM17 5.502a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3z" fill="currentColor"></path></g></svg>`;
|
||||
export const ICON_INBOX_REPORTS = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none"><path d="M6.25 3h11.5a3.25 3.25 0 0 1 3.245 3.066L21 6.25v11.5a3.25 3.25 0 0 1-3.066 3.245L17.75 21H6.25a3.25 3.25 0 0 1-3.245-3.066L3 17.75V6.25a3.25 3.25 0 0 1 3.066-3.245L6.25 3h11.5h-11.5zM4.5 14.5v3.25a1.75 1.75 0 0 0 1.606 1.744l.144.006h11.5a1.75 1.75 0 0 0 1.744-1.607l.006-.143V14.5h-3.825a3.752 3.752 0 0 1-3.475 2.995l-.2.005a3.752 3.752 0 0 1-3.632-2.812l-.043-.188H4.5v3.25v-3.25zm13.25-10H6.25a1.75 1.75 0 0 0-1.744 1.606L4.5 6.25V13H9a.75.75 0 0 1 .743.648l.007.102a2.25 2.25 0 0 0 4.495.154l.005-.154a.75.75 0 0 1 .648-.743L15 13h4.5V6.25a1.75 1.75 0 0 0-1.607-1.744L17.75 4.5z" fill="currentColor"></path></g></svg>`;
|
||||
export const ICON_TEAM_REPORTS = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><g fill="none"><path d="M14.75 15c.966 0 1.75.784 1.75 1.75l-.001.962c.117 2.19-1.511 3.297-4.432 3.297c-2.91 0-4.567-1.09-4.567-3.259v-1c0-.966.784-1.75 1.75-1.75h5.5zm0 1.5h-5.5a.25.25 0 0 0-.25.25v1c0 1.176.887 1.759 3.067 1.759c2.168 0 2.995-.564 2.933-1.757V16.75a.25.25 0 0 0-.25-.25zm-11-6.5h4.376a4.007 4.007 0 0 0-.095 1.5H3.75a.25.25 0 0 0-.25.25v1c0 1.176.887 1.759 3.067 1.759c.462 0 .863-.026 1.207-.077a2.743 2.743 0 0 0-1.173 1.576l-.034.001C3.657 16.009 2 14.919 2 12.75v-1c0-.966.784-1.75 1.75-1.75zm16.5 0c.966 0 1.75.784 1.75 1.75l-.001.962c.117 2.19-1.511 3.297-4.432 3.297l-.169-.002a2.755 2.755 0 0 0-1.218-1.606c.387.072.847.108 1.387.108c2.168 0 2.995-.564 2.933-1.757V11.75a.25.25 0 0 0-.25-.25h-4.28a4.05 4.05 0 0 0-.096-1.5h4.376zM12 8a3 3 0 1 1 0 6a3 3 0 0 1 0-6zm0 1.5a1.5 1.5 0 1 0 0 3a1.5 1.5 0 0 0 0-3zM6.5 3a3 3 0 1 1 0 6a3 3 0 0 1 0-6zm11 0a3 3 0 1 1 0 6a3 3 0 0 1 0-6zm-11 1.5a1.5 1.5 0 1 0 0 3a1.5 1.5 0 0 0 0-3zm11 0a1.5 1.5 0 1 0 0 3a1.5 1.5 0 0 0 0-3z" fill="currentColor"></path></g></svg>`;
|
||||
export const ICON_ASSIGN_TEAM = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M17.5 12a5.5 5.5 0 1 1 0 11 5.5 5.5 0 0 1 0-11Zm0 2-.09.007a.5.5 0 0 0-.402.402L17 14.5V17L14.498 17l-.09.008a.5.5 0 0 0-.402.402l-.008.09.008.09a.5.5 0 0 0 .402.402l.09.008H17v2.503l.008.09a.5.5 0 0 0 .402.402l.09.008.09-.008a.5.5 0 0 0 .402-.402l.008-.09V18l2.504.001.09-.008a.5.5 0 0 0 .402-.402l.008-.09-.008-.09a.5.5 0 0 0-.403-.402l-.09-.008H18v-2.5l-.008-.09a.5.5 0 0 0-.402-.403L17.5 14Zm-3.246-4c.835 0 1.563.454 1.951 1.13a6.44 6.44 0 0 0-1.518.509.736.736 0 0 0-.433-.139H9.752a.75.75 0 0 0-.75.75v4.249c0 1.41.974 2.594 2.286 2.915a6.42 6.42 0 0 0 .735 1.587l-.02-.001a4.501 4.501 0 0 1-4.501-4.501V12.25A2.25 2.25 0 0 1 9.752 10h4.502Zm-6.848 0a3.243 3.243 0 0 0-.817 1.5H4.25a.75.75 0 0 0-.75.75v2.749a2.501 2.501 0 0 0 3.082 2.433c.085.504.24.985.453 1.432A4.001 4.001 0 0 1 2 14.999V12.25a2.25 2.25 0 0 1 2.096-2.245L4.25 10h3.156Zm12.344 0A2.25 2.25 0 0 1 22 12.25v.56A6.478 6.478 0 0 0 17.5 11l-.245.005A3.21 3.21 0 0 0 16.6 10h3.15ZM18.5 4a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5ZM12 3a3 3 0 1 1 0 6 3 3 0 0 1 0-6ZM5.5 4a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Zm13 1.5a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm-6.5-1a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm-6.5 1a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_NOTIFICATION = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 1.996a7.49 7.49 0 0 1 7.496 7.25l.004.25v4.097l1.38 3.156a1.25 1.25 0 0 1-1.145 1.75L15 18.502a3 3 0 0 1-5.995.177L9 18.499H4.275a1.251 1.251 0 0 1-1.147-1.747L4.5 13.594V9.496c0-4.155 3.352-7.5 7.5-7.5ZM13.5 18.5l-3 .002a1.5 1.5 0 0 0 2.993.145l.006-.147ZM12 3.496c-3.32 0-6 2.674-6 6v4.41L4.656 17h14.697L18 13.907V9.509l-.004-.225A5.988 5.988 0 0 0 12 3.496Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_USER_PROFILE = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10.125 13.995a2.737 2.737 0 0 0-.617 1.5h-5.26a.749.749 0 0 0-.748.75v.577c0 .536.191 1.054.539 1.461 1.177 1.379 2.984 2.12 5.469 2.205.049.57.273 1.09.617 1.508h-.129c-3.145 0-5.531-.905-7.098-2.739A3.75 3.75 0 0 1 2 16.822v-.578c0-1.19.925-2.164 2.095-2.243l.154-.006h5.876Zm4.621-2.5h3c.648 0 1.18.492 1.244 1.123l.007.127-.001 1.25h1.25c.967 0 1.75.784 1.75 1.75v4.5a1.75 1.75 0 0 1-1.75 1.75h-8a1.75 1.75 0 0 1-1.75-1.75v-4.5c0-.966.784-1.75 1.75-1.75h1.25v-1.25c0-.647.492-1.18 1.123-1.243l.127-.007h3-3Zm5.5 4h-8a.25.25 0 0 0-.25.25v4.5c0 .138.112.25.25.25h8a.25.25 0 0 0 .25-.25v-4.5a.25.25 0 0 0-.25-.25Zm-2.75-2.5h-2.5v1h2.5v-1ZM9.997 2a5 5 0 1 1 0 10 5 5 0 0 1 0-10Zm0 1.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_CANNED_RESPONSE = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M21 7.511a3.247 3.247 0 0 1 1.5 2.739v6c0 2.9-2.35 5.25-5.25 5.25h-9A3.247 3.247 0 0 1 5.511 20H17.25A3.75 3.75 0 0 0 21 16.25V7.511ZM5.25 4h11.5a3.25 3.25 0 0 1 3.245 3.066L20 7.25v8.5a3.25 3.25 0 0 1-3.066 3.245L16.75 19H5.25a3.25 3.25 0 0 1-3.245-3.066L2 15.75v-8.5a3.25 3.25 0 0 1 3.066-3.245L5.25 4ZM18.5 8.899l-7.15 3.765a.75.75 0 0 1-.603.042l-.096-.042L3.5 8.9v6.85a1.75 1.75 0 0 0 1.606 1.744l.144.006h11.5a1.75 1.75 0 0 0 1.744-1.607l.006-.143V8.899ZM16.75 5.5H5.25a1.75 1.75 0 0 0-1.744 1.606l-.004.1L11 11.152l7.5-3.947A1.75 1.75 0 0 0 16.75 5.5Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_LABELS = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M19.75 2A2.25 2.25 0 0 1 22 4.25v5.462a3.25 3.25 0 0 1-.952 2.298l-8.5 8.503a3.255 3.255 0 0 1-4.597.001L3.489 16.06a3.25 3.25 0 0 1-.003-4.596l8.5-8.51A3.25 3.25 0 0 1 14.284 2h5.465Zm0 1.5h-5.465c-.465 0-.91.185-1.239.513l-8.512 8.523a1.75 1.75 0 0 0 .015 2.462l4.461 4.454a1.755 1.755 0 0 0 2.477 0l8.5-8.503a1.75 1.75 0 0 0 .513-1.237V4.25a.75.75 0 0 0-.75-.75ZM17 5.502a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_ACCOUNT_SETTINGS = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8.75 3h6.5a.75.75 0 0 1 .743.648L16 3.75V7h1.75A3.25 3.25 0 0 1 21 10.25v6.5A3.25 3.25 0 0 1 17.75 20H6.25A3.25 3.25 0 0 1 3 16.75v-6.5A3.25 3.25 0 0 1 6.25 7H8V3.75a.75.75 0 0 1 .648-.743L8.75 3h6.5-6.5Zm9 5.5H6.25a1.75 1.75 0 0 0-1.75 1.75v6.5c0 .966.784 1.75 1.75 1.75h11.5a1.75 1.75 0 0 0 1.75-1.75v-6.5a1.75 1.75 0 0 0-1.75-1.75Zm-3.25-4h-5V7h5V4.5Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_INBOXES = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.25 3h11.5a3.25 3.25 0 0 1 3.245 3.066L21 6.25v11.5a3.25 3.25 0 0 1-3.066 3.245L17.75 21H6.25a3.25 3.25 0 0 1-3.245-3.066L3 17.75V6.25a3.25 3.25 0 0 1 3.066-3.245L6.25 3h11.5-11.5ZM4.5 14.5v3.25a1.75 1.75 0 0 0 1.606 1.744l.144.006h11.5a1.75 1.75 0 0 0 1.744-1.607l.006-.143V14.5h-3.825a3.752 3.752 0 0 1-3.475 2.995l-.2.005a3.752 3.752 0 0 1-3.632-2.812l-.043-.188H4.5v3.25-3.25Zm13.25-10H6.25a1.75 1.75 0 0 0-1.744 1.606L4.5 6.25V13H9a.75.75 0 0 1 .743.648l.007.102a2.25 2.25 0 0 0 4.495.154l.005-.154a.75.75 0 0 1 .648-.743L15 13h4.5V6.25a1.75 1.75 0 0 0-1.607-1.744L17.75 4.5Z" fill="currentColor"/></svg>`;
|
||||
export const ICON_APPS = `<svg role="img" class="ninja-icon ninja-icon--fluent" width="18" height="18" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m18.492 2.33 3.179 3.179a2.25 2.25 0 0 1 0 3.182l-2.584 2.584A2.25 2.25 0 0 1 21 13.5v5.25A2.25 2.25 0 0 1 18.75 21H5.25A2.25 2.25 0 0 1 3 18.75V5.25A2.25 2.25 0 0 1 5.25 3h5.25a2.25 2.25 0 0 1 2.225 1.915L15.31 2.33a2.25 2.25 0 0 1 3.182 0ZM4.5 18.75c0 .414.336.75.75.75l5.999-.001.001-6.75H4.5v6Zm8.249.749h6.001a.75.75 0 0 0 .75-.75V13.5a.75.75 0 0 0-.75-.75h-6.001v6.75Zm-2.249-15H5.25a.75.75 0 0 0-.75.75v6h6.75v-6a.75.75 0 0 0-.75-.75Zm2.25 4.81v1.94h1.94l-1.94-1.94Zm3.62-5.918-3.178 3.178a.75.75 0 0 0 0 1.061l3.179 3.179a.75.75 0 0 0 1.06 0l3.18-3.179a.75.75 0 0 0 0-1.06l-3.18-3.18a.75.75 0 0 0-1.06 0Z" fill="currentColor"/></svg>`;
|
|
@ -0,0 +1,16 @@
|
|||
// General Actions - Switch conversation tabs
|
||||
export const CMD_SWITCH_TAB = 'CMD_SWITCH_TAB';
|
||||
|
||||
// General Actions - Switch conversation status
|
||||
export const CMD_SWITCH_STATUS = 'CMD_SWITCH_STATUS';
|
||||
|
||||
// Conversation Actions
|
||||
export const CMD_MUTE_CONVERSATION = 'CMD_MUTE_CONVERSATION';
|
||||
export const CMD_UNMUTE_CONVERSATION = 'CMD_UNMUTE_CONVERSATION';
|
||||
export const CMD_SEND_TRANSCRIPT = 'CMD_SEND_TRANSCRIPT';
|
||||
export const CMD_TOGGLE_CONTACT_SIDEBAR = 'CMD_TOGGLE_CONTACT_SIDEBAR';
|
||||
|
||||
// Status Commands
|
||||
export const CMD_REOPEN_CONVERSATION = 'CMD_REOPEN_CONVERSATION';
|
||||
export const CMD_RESOLVE_CONVERSATION = 'CMD_RESOLVE_CONVERSATION';
|
||||
export const CMD_SNOOZE_CONVERSATION = 'CMD_SNOOZE_CONVERSATION';
|
|
@ -0,0 +1,68 @@
|
|||
<!-- eslint-disable vue/attribute-hyphenation -->
|
||||
<template>
|
||||
<ninja-keys
|
||||
ref="ninjakeys"
|
||||
:no-auto-load-md-icons="true"
|
||||
hideBreadcrumbs
|
||||
:placeholder="placeholder"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import 'ninja-keys';
|
||||
import conversationHotKeysMixin from './conversationHotKeys';
|
||||
import goToCommandHotKeys from './goToCommandHotKeys';
|
||||
import agentMixin from 'dashboard/mixins/agentMixin';
|
||||
import conversationLabelMixin from 'dashboard/mixins/conversation/labelMixin';
|
||||
import conversationTeamMixin from 'dashboard/mixins/conversation/teamMixin';
|
||||
import adminMixin from 'dashboard/mixins/isAdmin';
|
||||
|
||||
export default {
|
||||
mixins: [
|
||||
adminMixin,
|
||||
agentMixin,
|
||||
conversationHotKeysMixin,
|
||||
conversationLabelMixin,
|
||||
conversationTeamMixin,
|
||||
goToCommandHotKeys,
|
||||
],
|
||||
|
||||
data() {
|
||||
return {
|
||||
placeholder: this.$t('COMMAND_BAR.SEARCH_PLACEHOLDER'),
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
accountId() {
|
||||
return this.$store.getters.getCurrentAccountId;
|
||||
},
|
||||
routeName() {
|
||||
return this.$route.name;
|
||||
},
|
||||
hotKeys() {
|
||||
return [...this.conversationHotKeys, ...this.goToCommandHotKeys];
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
routeName() {
|
||||
this.setCommandbarData();
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.setCommandbarData();
|
||||
},
|
||||
methods: {
|
||||
setCommandbarData() {
|
||||
this.$refs.ninjakeys.data = this.hotKeys;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
ninja-keys {
|
||||
--ninja-accent-color: var(--w-500);
|
||||
--ninja-font-family: 'Inter';
|
||||
z-index: 9999;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,277 @@
|
|||
import { mapGetters } from 'vuex';
|
||||
import wootConstants from '../../../constants';
|
||||
import {
|
||||
CMD_MUTE_CONVERSATION,
|
||||
CMD_REOPEN_CONVERSATION,
|
||||
CMD_RESOLVE_CONVERSATION,
|
||||
CMD_SEND_TRANSCRIPT,
|
||||
CMD_SNOOZE_CONVERSATION,
|
||||
CMD_UNMUTE_CONVERSATION,
|
||||
} from './commandBarBusEvents';
|
||||
|
||||
import {
|
||||
ICON_ADD_LABEL,
|
||||
ICON_ASSIGN_AGENT,
|
||||
ICON_ASSIGN_TEAM,
|
||||
ICON_MUTE_CONVERSATION,
|
||||
ICON_REMOVE_LABEL,
|
||||
ICON_REOPEN_CONVERSATION,
|
||||
ICON_RESOLVE_CONVERSATION,
|
||||
ICON_SEND_TRANSCRIPT,
|
||||
ICON_SNOOZE_CONVERSATION,
|
||||
ICON_SNOOZE_UNTIL_NEXT_REPLY,
|
||||
ICON_SNOOZE_UNTIL_NEXT_WEEK,
|
||||
ICON_SNOOZE_UNTIL_TOMORRROW,
|
||||
ICON_UNMUTE_CONVERSATION,
|
||||
} from './CommandBarIcons';
|
||||
|
||||
const OPEN_CONVERSATION_ACTIONS = [
|
||||
{
|
||||
id: 'resolve_conversation',
|
||||
title: 'COMMAND_BAR.COMMANDS.RESOLVE_CONVERSATION',
|
||||
section: 'COMMAND_BAR.SECTIONS.CONVERSATION',
|
||||
icon: ICON_RESOLVE_CONVERSATION,
|
||||
handler: () => bus.$emit(CMD_RESOLVE_CONVERSATION),
|
||||
},
|
||||
{
|
||||
id: 'snooze_conversation',
|
||||
title: 'COMMAND_BAR.COMMANDS.SNOOZE_CONVERSATION',
|
||||
icon: ICON_SNOOZE_CONVERSATION,
|
||||
children: ['until_next_reply', 'until_tomorrow', 'until_next_week'],
|
||||
},
|
||||
{
|
||||
id: 'until_next_reply',
|
||||
title: 'COMMAND_BAR.COMMANDS.UNTIL_NEXT_REPLY',
|
||||
parent: 'snooze_conversation',
|
||||
icon: ICON_SNOOZE_UNTIL_NEXT_REPLY,
|
||||
handler: () => bus.$emit(CMD_SNOOZE_CONVERSATION, 'nextReply'),
|
||||
},
|
||||
{
|
||||
id: 'until_tomorrow',
|
||||
title: 'COMMAND_BAR.COMMANDS.UNTIL_TOMORROW',
|
||||
parent: 'snooze_conversation',
|
||||
icon: ICON_SNOOZE_UNTIL_TOMORRROW,
|
||||
handler: () => bus.$emit(CMD_SNOOZE_CONVERSATION, 'tomorrow'),
|
||||
},
|
||||
{
|
||||
id: 'until_next_week',
|
||||
title: 'COMMAND_BAR.COMMANDS.UNTIL_NEXT_WEEK',
|
||||
parent: 'snooze_conversation',
|
||||
icon: ICON_SNOOZE_UNTIL_NEXT_WEEK,
|
||||
handler: () => bus.$emit(CMD_SNOOZE_CONVERSATION, 'nextWeek'),
|
||||
},
|
||||
];
|
||||
|
||||
const RESOLVED_CONVERSATION_ACTIONS = [
|
||||
{
|
||||
id: 'reopen_conversation',
|
||||
title: 'COMMAND_BAR.COMMANDS.REOPEN_CONVERSATION',
|
||||
section: 'COMMAND_BAR.SECTIONS.CONVERSATION',
|
||||
icon: ICON_REOPEN_CONVERSATION,
|
||||
handler: () => bus.$emit(CMD_REOPEN_CONVERSATION),
|
||||
},
|
||||
];
|
||||
|
||||
const SEND_TRANSCRIPT_ACTION = {
|
||||
id: 'send_transcript',
|
||||
title: 'COMMAND_BAR.COMMANDS.SEND_TRANSCRIPT',
|
||||
section: 'COMMAND_BAR.SECTIONS.CONVERSATION',
|
||||
icon: ICON_SEND_TRANSCRIPT,
|
||||
handler: () => bus.$emit(CMD_SEND_TRANSCRIPT),
|
||||
};
|
||||
|
||||
const UNMUTE_ACTION = {
|
||||
id: 'unmute_conversation',
|
||||
title: 'COMMAND_BAR.COMMANDS.UNMUTE_CONVERSATION',
|
||||
section: 'COMMAND_BAR.SECTIONS.CONVERSATION',
|
||||
icon: ICON_UNMUTE_CONVERSATION,
|
||||
handler: () => bus.$emit(CMD_UNMUTE_CONVERSATION),
|
||||
};
|
||||
|
||||
const MUTE_ACTION = {
|
||||
id: 'mute_conversation',
|
||||
title: 'COMMAND_BAR.COMMANDS.MUTE_CONVERSATION',
|
||||
section: 'COMMAND_BAR.SECTIONS.CONVERSATION',
|
||||
icon: ICON_MUTE_CONVERSATION,
|
||||
handler: () => bus.$emit(CMD_MUTE_CONVERSATION),
|
||||
};
|
||||
|
||||
export const isAConversationRoute = routeName =>
|
||||
[
|
||||
'inbox_conversation',
|
||||
'conversation_through_inbox',
|
||||
'conversations_through_label',
|
||||
'conversations_through_team',
|
||||
].includes(routeName);
|
||||
|
||||
export default {
|
||||
watch: {
|
||||
assignableAgents() {
|
||||
this.setCommandbarData();
|
||||
},
|
||||
currentChat() {
|
||||
this.setCommandbarData();
|
||||
},
|
||||
teamsList() {
|
||||
this.setCommandbarData();
|
||||
},
|
||||
activeLabels() {
|
||||
this.setCommandbarData();
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({ currentChat: 'getSelectedChat' }),
|
||||
inboxId() {
|
||||
return this.currentChat?.inbox_id;
|
||||
},
|
||||
conversationId() {
|
||||
return this.currentChat?.id;
|
||||
},
|
||||
statusActions() {
|
||||
const isOpen =
|
||||
this.currentChat?.status === wootConstants.STATUS_TYPE.OPEN;
|
||||
const isSnoozed =
|
||||
this.currentChat?.status === wootConstants.STATUS_TYPE.SNOOZED;
|
||||
const isResolved =
|
||||
this.currentChat?.status === wootConstants.STATUS_TYPE.RESOLVED;
|
||||
|
||||
let actions = [];
|
||||
if (isOpen) {
|
||||
actions = OPEN_CONVERSATION_ACTIONS;
|
||||
} else if (isResolved || isSnoozed) {
|
||||
actions = RESOLVED_CONVERSATION_ACTIONS;
|
||||
}
|
||||
return this.prepareActions(actions);
|
||||
},
|
||||
assignAgentActions() {
|
||||
const agentOptions = this.agentsList.map(agent => ({
|
||||
id: `agent-${agent.id}`,
|
||||
title: agent.name,
|
||||
parent: 'assign_an_agent',
|
||||
section: this.$t('COMMAND_BAR.SECTIONS.CHANGE_ASSIGNEE'),
|
||||
agentInfo: agent,
|
||||
icon: ICON_ASSIGN_AGENT,
|
||||
handler: this.onChangeAssignee,
|
||||
}));
|
||||
return [
|
||||
{
|
||||
id: 'assign_an_agent',
|
||||
title: this.$t('COMMAND_BAR.COMMANDS.ASSIGN_AN_AGENT'),
|
||||
section: this.$t('COMMAND_BAR.SECTIONS.CONVERSATION'),
|
||||
icon: ICON_ASSIGN_AGENT,
|
||||
children: agentOptions.map(option => option.id),
|
||||
},
|
||||
...agentOptions,
|
||||
];
|
||||
},
|
||||
assignTeamActions() {
|
||||
const teamOptions = this.teamsList.map(team => ({
|
||||
id: `team-${team.id}`,
|
||||
title: team.name,
|
||||
parent: 'assign_a_team',
|
||||
section: this.$t('COMMAND_BAR.SECTIONS.CHANGE_TEAM'),
|
||||
teamInfo: team,
|
||||
icon: ICON_ASSIGN_TEAM,
|
||||
handler: this.onChangeTeam,
|
||||
}));
|
||||
return [
|
||||
{
|
||||
id: 'assign_a_team',
|
||||
title: this.$t('COMMAND_BAR.COMMANDS.ASSIGN_A_TEAM'),
|
||||
section: this.$t('COMMAND_BAR.SECTIONS.CONVERSATION'),
|
||||
icon: ICON_ASSIGN_TEAM,
|
||||
children: teamOptions.map(option => option.id),
|
||||
},
|
||||
...teamOptions,
|
||||
];
|
||||
},
|
||||
|
||||
addLabelActions() {
|
||||
const availableLabels = this.inactiveLabels.map(label => ({
|
||||
id: label.title,
|
||||
title: `#${label.title}`,
|
||||
parent: 'add_a_label_to_the_conversation',
|
||||
section: this.$t('COMMAND_BAR.SECTIONS.ADD_LABEL'),
|
||||
icon: ICON_ADD_LABEL,
|
||||
handler: action => this.addLabelToConversation({ title: action.id }),
|
||||
}));
|
||||
return [
|
||||
...availableLabels,
|
||||
{
|
||||
id: 'add_a_label_to_the_conversation',
|
||||
title: this.$t('COMMAND_BAR.COMMANDS.ADD_LABELS_TO_CONVERSATION'),
|
||||
section: this.$t('COMMAND_BAR.SECTIONS.CONVERSATION'),
|
||||
icon: ICON_ADD_LABEL,
|
||||
children: this.inactiveLabels.map(label => label.title),
|
||||
},
|
||||
];
|
||||
},
|
||||
removeLabelActions() {
|
||||
const activeLabels = this.activeLabels.map(label => ({
|
||||
id: label.title,
|
||||
title: `#${label.title}`,
|
||||
parent: 'remove_a_label_to_the_conversation',
|
||||
section: this.$t('COMMAND_BAR.SECTIONS.REMOVE_LABEL'),
|
||||
icon: ICON_REMOVE_LABEL,
|
||||
handler: action => this.removeLabelFromConversation(action.id),
|
||||
}));
|
||||
return [
|
||||
...activeLabels,
|
||||
{
|
||||
id: 'remove_a_label_to_the_conversation',
|
||||
title: this.$t('COMMAND_BAR.COMMANDS.REMOVE_LABEL_FROM_CONVERSATION'),
|
||||
section: this.$t('COMMAND_BAR.SECTIONS.CONVERSATION'),
|
||||
icon: ICON_REMOVE_LABEL,
|
||||
children: this.activeLabels.map(label => label.title),
|
||||
},
|
||||
];
|
||||
},
|
||||
labelActions() {
|
||||
if (this.activeLabels.length) {
|
||||
return [...this.addLabelActions, ...this.removeLabelActions];
|
||||
}
|
||||
return this.addLabelActions;
|
||||
},
|
||||
conversationAdditionalActions() {
|
||||
return this.prepareActions([
|
||||
this.currentChat.muted ? UNMUTE_ACTION : MUTE_ACTION,
|
||||
SEND_TRANSCRIPT_ACTION,
|
||||
]);
|
||||
},
|
||||
conversationHotKeys() {
|
||||
if (isAConversationRoute(this.$route.name)) {
|
||||
return [
|
||||
...this.statusActions,
|
||||
...this.conversationAdditionalActions,
|
||||
...this.assignAgentActions,
|
||||
...this.assignTeamActions,
|
||||
...this.labelActions,
|
||||
];
|
||||
}
|
||||
|
||||
return [];
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
onChangeAssignee(action) {
|
||||
this.$store.dispatch('assignAgent', {
|
||||
conversationId: this.currentChat.id,
|
||||
agentId: action.agentInfo.id,
|
||||
});
|
||||
},
|
||||
onChangeTeam(action) {
|
||||
this.$store.dispatch('assignTeam', {
|
||||
conversationId: this.currentChat.id,
|
||||
teamId: action.teamInfo.id,
|
||||
});
|
||||
},
|
||||
prepareActions(actions) {
|
||||
return actions.map(action => ({
|
||||
...action,
|
||||
title: this.$t(action.title),
|
||||
section: this.$t(action.section),
|
||||
}));
|
||||
},
|
||||
},
|
||||
};
|
|
@ -0,0 +1,173 @@
|
|||
import {
|
||||
ICON_ACCOUNT_SETTINGS,
|
||||
ICON_AGENT_REPORTS,
|
||||
ICON_APPS,
|
||||
ICON_CANNED_RESPONSE,
|
||||
ICON_CONTACT_DASHBOARD,
|
||||
ICON_CONVERSATION_DASHBOARD,
|
||||
ICON_INBOXES,
|
||||
ICON_INBOX_REPORTS,
|
||||
ICON_LABELS,
|
||||
ICON_LABEL_REPORTS,
|
||||
ICON_NOTIFICATION,
|
||||
ICON_REPORTS_OVERVIEW,
|
||||
ICON_TEAM_REPORTS,
|
||||
ICON_USER_PROFILE,
|
||||
} from './CommandBarIcons';
|
||||
import { frontendURL } from '../../../helper/URLHelper';
|
||||
|
||||
const GO_TO_COMMANDS = [
|
||||
{
|
||||
id: 'goto_conversation_dashboard',
|
||||
title: 'COMMAND_BAR.COMMANDS.GO_TO_CONVERSATION_DASHBOARD',
|
||||
section: 'COMMAND_BAR.SECTIONS.GENERAL',
|
||||
icon: ICON_CONVERSATION_DASHBOARD,
|
||||
path: accountId => `accounts/${accountId}/dashboard`,
|
||||
role: ['administrator', 'agent'],
|
||||
},
|
||||
{
|
||||
id: 'goto_contacts_dashboard',
|
||||
title: 'COMMAND_BAR.COMMANDS.GO_TO_CONTACTS_DASHBOARD',
|
||||
section: 'COMMAND_BAR.SECTIONS.GENERAL',
|
||||
icon: ICON_CONTACT_DASHBOARD,
|
||||
path: accountId => `accounts/${accountId}/contacts`,
|
||||
role: ['administrator', 'agent'],
|
||||
},
|
||||
{
|
||||
id: 'open_reports_overview',
|
||||
section: 'COMMAND_BAR.SECTIONS.REPORTS',
|
||||
title: 'COMMAND_BAR.COMMANDS.GO_TO_REPORTS_OVERVIEW',
|
||||
icon: ICON_REPORTS_OVERVIEW,
|
||||
path: accountId => `accounts/${accountId}/reports/overview`,
|
||||
role: ['administrator'],
|
||||
},
|
||||
{
|
||||
id: 'open_agent_reports',
|
||||
section: 'COMMAND_BAR.SECTIONS.REPORTS',
|
||||
title: 'COMMAND_BAR.COMMANDS.GO_TO_AGENT_REPORTS',
|
||||
icon: ICON_AGENT_REPORTS,
|
||||
path: accountId => `accounts/${accountId}/reports/agent`,
|
||||
role: ['administrator'],
|
||||
},
|
||||
{
|
||||
id: 'open_label_reports',
|
||||
section: 'COMMAND_BAR.SECTIONS.REPORTS',
|
||||
title: 'COMMAND_BAR.COMMANDS.GO_TO_LABEL_REPORTS',
|
||||
icon: ICON_LABEL_REPORTS,
|
||||
path: accountId => `accounts/${accountId}/reports/label`,
|
||||
role: ['administrator'],
|
||||
},
|
||||
{
|
||||
id: 'open_inbox_reports',
|
||||
section: 'COMMAND_BAR.SECTIONS.REPORTS',
|
||||
title: 'COMMAND_BAR.COMMANDS.GO_TO_INBOX_REPORTS',
|
||||
icon: ICON_INBOX_REPORTS,
|
||||
path: accountId => `accounts/${accountId}/reports/inboxes`,
|
||||
role: ['administrator'],
|
||||
},
|
||||
{
|
||||
id: 'open_team_reports',
|
||||
section: 'COMMAND_BAR.SECTIONS.REPORTS',
|
||||
title: 'COMMAND_BAR.COMMANDS.GO_TO_TEAM_REPORTS',
|
||||
icon: ICON_TEAM_REPORTS,
|
||||
path: accountId => `accounts/${accountId}/reports/teams`,
|
||||
role: ['administrator'],
|
||||
},
|
||||
{
|
||||
id: 'open_agent_settings',
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
title: 'COMMAND_BAR.COMMANDS.GO_TO_SETTINGS_AGENTS',
|
||||
icon: ICON_AGENT_REPORTS,
|
||||
path: accountId => `accounts/${accountId}/settings/agents/list`,
|
||||
role: ['administrator'],
|
||||
},
|
||||
{
|
||||
id: 'open_team_settings',
|
||||
title: 'COMMAND_BAR.COMMANDS.GO_TO_SETTINGS_TEAMS',
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
icon: ICON_TEAM_REPORTS,
|
||||
path: accountId => `accounts/${accountId}/settings/teams/list`,
|
||||
role: ['administrator'],
|
||||
},
|
||||
{
|
||||
id: 'open_inbox_settings',
|
||||
title: 'COMMAND_BAR.COMMANDS.GO_TO_SETTINGS_INBOXES',
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
icon: ICON_INBOXES,
|
||||
path: accountId => `accounts/${accountId}/settings/inboxes/list`,
|
||||
role: ['administrator'],
|
||||
},
|
||||
{
|
||||
id: 'open_label_settings',
|
||||
title: 'COMMAND_BAR.COMMANDS.GO_TO_SETTINGS_LABELS',
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
icon: ICON_LABELS,
|
||||
path: accountId => `accounts/${accountId}/settings/labels/list`,
|
||||
role: ['administrator'],
|
||||
},
|
||||
{
|
||||
id: 'open_canned_response_settings',
|
||||
title: 'COMMAND_BAR.COMMANDS.GO_TO_SETTINGS_CANNED_RESPONSES',
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
icon: ICON_CANNED_RESPONSE,
|
||||
path: accountId => `accounts/${accountId}/settings/canned-response/list`,
|
||||
role: ['administrator', 'agent'],
|
||||
},
|
||||
{
|
||||
id: 'open_applications_settings',
|
||||
title: 'COMMAND_BAR.COMMANDS.GO_TO_SETTINGS_APPLICATIONS',
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
icon: ICON_APPS,
|
||||
path: accountId => `accounts/${accountId}/settings/applications`,
|
||||
role: ['administrator'],
|
||||
},
|
||||
{
|
||||
id: 'open_account_settings',
|
||||
title: 'COMMAND_BAR.COMMANDS.GO_TO_SETTINGS_ACCOUNT',
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
icon: ICON_ACCOUNT_SETTINGS,
|
||||
path: accountId => `accounts/${accountId}/settings/general`,
|
||||
role: ['administrator'],
|
||||
},
|
||||
{
|
||||
id: 'open_profile_settings',
|
||||
title: 'COMMAND_BAR.COMMANDS.GO_TO_SETTINGS_PROFILE',
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
icon: ICON_USER_PROFILE,
|
||||
path: accountId => `accounts/${accountId}/profile/settings`,
|
||||
role: ['administrator', 'agent'],
|
||||
},
|
||||
{
|
||||
id: 'open_notifications',
|
||||
title: 'COMMAND_BAR.COMMANDS.GO_TO_NOTIFICATIONS',
|
||||
section: 'COMMAND_BAR.SECTIONS.SETTINGS',
|
||||
icon: ICON_NOTIFICATION,
|
||||
path: accountId => `accounts/${accountId}/notifications`,
|
||||
role: ['administrator', 'agent'],
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
goToCommandHotKeys() {
|
||||
let commands = GO_TO_COMMANDS;
|
||||
|
||||
if (!this.isAdmin) {
|
||||
commands = commands.filter(command => command.role.includes('agent'));
|
||||
}
|
||||
|
||||
return commands.map(command => ({
|
||||
id: command.id,
|
||||
section: this.$t(command.section),
|
||||
title: this.$t(command.title),
|
||||
icon: command.icon,
|
||||
handler: () => this.openRoute(command.path(this.accountId)),
|
||||
}));
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
openRoute(url) {
|
||||
this.$router.push(frontendURL(url));
|
||||
},
|
||||
},
|
||||
};
|
|
@ -0,0 +1,11 @@
|
|||
import { isAConversationRoute } from '../conversationHotKeys';
|
||||
|
||||
describe('isAConversationRoute', () => {
|
||||
it('returns true if conversation route name is provided', () => {
|
||||
expect(isAConversationRoute('inbox_conversation')).toBe(true);
|
||||
expect(isAConversationRoute('conversation_through_inbox')).toBe(true);
|
||||
expect(isAConversationRoute('conversations_through_label')).toBe(true);
|
||||
expect(isAConversationRoute('conversations_through_team')).toBe(true);
|
||||
expect(isAConversationRoute('dashboard')).toBe(false);
|
||||
});
|
||||
});
|
|
@ -99,8 +99,6 @@
|
|||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import alertMixin from 'shared/mixins/alertMixin';
|
||||
import agentMixin from '../../../mixins/agentMixin';
|
||||
|
||||
import AccordionItem from 'dashboard/components/Accordion/AccordionItem';
|
||||
import ContactConversations from './ContactConversations.vue';
|
||||
import ConversationAction from './ConversationAction.vue';
|
||||
|
@ -123,7 +121,7 @@ export default {
|
|||
ConversationAction,
|
||||
draggable,
|
||||
},
|
||||
mixins: [alertMixin, agentMixin, uiSettingsMixin],
|
||||
mixins: [alertMixin, uiSettingsMixin],
|
||||
props: {
|
||||
conversationId: {
|
||||
type: [Number, String],
|
||||
|
@ -148,7 +146,6 @@ export default {
|
|||
computed: {
|
||||
...mapGetters({
|
||||
currentChat: 'getSelectedChat',
|
||||
teams: 'teams/getTeams',
|
||||
currentUser: 'getCurrentUser',
|
||||
uiFlags: 'inboxAssignableAgents/getUIFlags',
|
||||
}),
|
||||
|
|
|
@ -64,7 +64,8 @@ import alertMixin from 'shared/mixins/alertMixin';
|
|||
import ContactDetailsItem from './ContactDetailsItem.vue';
|
||||
import MultiselectDropdown from 'shared/components/ui/MultiselectDropdown.vue';
|
||||
import ConversationLabels from './labels/LabelBox.vue';
|
||||
import agentMixin from '../../../mixins/agentMixin';
|
||||
import agentMixin from 'dashboard/mixins/agentMixin';
|
||||
import teamMixin from 'dashboard/mixins/conversation/teamMixin';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
@ -72,7 +73,7 @@ export default {
|
|||
MultiselectDropdown,
|
||||
ConversationLabels,
|
||||
},
|
||||
mixins: [agentMixin, alertMixin],
|
||||
mixins: [agentMixin, alertMixin, teamMixin],
|
||||
props: {
|
||||
conversationId: {
|
||||
type: [Number, String],
|
||||
|
@ -86,21 +87,8 @@ export default {
|
|||
computed: {
|
||||
...mapGetters({
|
||||
currentChat: 'getSelectedChat',
|
||||
teams: 'teams/getTeams',
|
||||
currentUser: 'getCurrentUser',
|
||||
}),
|
||||
teamsList() {
|
||||
if (this.assignedTeam) {
|
||||
return [
|
||||
{
|
||||
id: 0,
|
||||
name: 'None',
|
||||
},
|
||||
...this.teams,
|
||||
];
|
||||
}
|
||||
return this.teams;
|
||||
},
|
||||
assignedAgent: {
|
||||
get() {
|
||||
return this.currentChat.meta.assignee;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
:description="label.description"
|
||||
:show-close="true"
|
||||
:bg-color="label.color"
|
||||
@click="removeItem"
|
||||
@click="removeLabelFromConversation"
|
||||
/>
|
||||
|
||||
<div class="dropdown-wrap">
|
||||
|
@ -29,8 +29,8 @@
|
|||
v-if="showSearchDropdownLabel"
|
||||
:account-labels="accountLabels"
|
||||
:selected-labels="savedLabels"
|
||||
@add="addItem"
|
||||
@remove="removeItem"
|
||||
@add="addLabelToConversation"
|
||||
@remove="removeLabelFromConversation"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -46,6 +46,7 @@ import Spinner from 'shared/components/Spinner';
|
|||
import LabelDropdown from 'shared/components/ui/label/LabelDropdown';
|
||||
import AddLabel from 'shared/components/ui/dropdown/AddLabel';
|
||||
import { mixin as clickaway } from 'vue-clickaway';
|
||||
import conversationLabelMixin from 'dashboard/mixins/conversation/labelMixin';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
@ -54,7 +55,7 @@ export default {
|
|||
AddLabel,
|
||||
},
|
||||
|
||||
mixins: [clickaway],
|
||||
mixins: [clickaway, conversationLabelMixin],
|
||||
props: {
|
||||
conversationId: {
|
||||
type: Number,
|
||||
|
@ -70,77 +71,18 @@ export default {
|
|||
},
|
||||
|
||||
computed: {
|
||||
savedLabels() {
|
||||
return this.$store.getters['conversationLabels/getConversationLabels'](
|
||||
this.conversationId
|
||||
);
|
||||
},
|
||||
|
||||
...mapGetters({
|
||||
conversationUiFlags: 'conversationLabels/getUIFlags',
|
||||
labelUiFlags: 'conversationLabels/getUIFlags',
|
||||
accountLabels: 'labels/getLabels',
|
||||
}),
|
||||
|
||||
activeLabels() {
|
||||
return this.accountLabels.filter(({ title }) =>
|
||||
this.savedLabels.includes(title)
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
conversationId(newConversationId, prevConversationId) {
|
||||
if (newConversationId && newConversationId !== prevConversationId) {
|
||||
this.fetchLabels(newConversationId);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
const { conversationId } = this;
|
||||
this.fetchLabels(conversationId);
|
||||
},
|
||||
|
||||
methods: {
|
||||
async onUpdateLabels(selectedLabels) {
|
||||
try {
|
||||
await this.$store.dispatch('conversationLabels/update', {
|
||||
conversationId: this.conversationId,
|
||||
labels: selectedLabels,
|
||||
});
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
}
|
||||
},
|
||||
|
||||
toggleLabels() {
|
||||
this.showSearchDropdownLabel = !this.showSearchDropdownLabel;
|
||||
},
|
||||
|
||||
addItem(value) {
|
||||
const result = this.activeLabels.map(item => item.title);
|
||||
result.push(value.title);
|
||||
this.onUpdateLabels(result);
|
||||
},
|
||||
|
||||
removeItem(value) {
|
||||
const result = this.activeLabels
|
||||
.map(label => label.title)
|
||||
.filter(label => label !== value);
|
||||
this.onUpdateLabels(result);
|
||||
},
|
||||
|
||||
closeDropdownLabel() {
|
||||
this.showSearchDropdownLabel = false;
|
||||
},
|
||||
|
||||
async fetchLabels(conversationId) {
|
||||
if (!conversationId) {
|
||||
return;
|
||||
}
|
||||
this.$store.dispatch('conversationLabels/get', conversationId);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* eslint no-console: 0 */
|
||||
/* eslint no-param-reassign: 0 */
|
||||
import Vue from 'vue';
|
||||
import * as types from '../../mutation-types';
|
||||
import getters, { getSelectedChatConversation } from './getters';
|
||||
|
@ -76,7 +74,7 @@ export const mutations = {
|
|||
const [chat] = getSelectedChatConversation(_state);
|
||||
Vue.set(chat, 'custom_attributes', custom_attributes);
|
||||
},
|
||||
|
||||
|
||||
[types.default.CHANGE_CONVERSATION_STATUS](
|
||||
_state,
|
||||
{ conversationId, status, snoozedUntil }
|
||||
|
@ -89,12 +87,12 @@ export const mutations = {
|
|||
|
||||
[types.default.MUTE_CONVERSATION](_state) {
|
||||
const [chat] = getSelectedChatConversation(_state);
|
||||
chat.muted = true;
|
||||
Vue.set(chat, 'muted', true);
|
||||
},
|
||||
|
||||
[types.default.UNMUTE_CONVERSATION](_state) {
|
||||
const [chat] = getSelectedChatConversation(_state);
|
||||
chat.muted = false;
|
||||
Vue.set(chat, 'muted', false);
|
||||
},
|
||||
|
||||
[types.default.ADD_MESSAGE]({ allConversations, selectedChatId }, message) {
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
"lodash.groupby": "^4.6.0",
|
||||
"marked": "2.0.3",
|
||||
"md5": "^2.3.0",
|
||||
"ninja-keys": "https://github.com/chatwoot/ninja-keys.git#b4c3233f676780af90c607866fa85e404c835902",
|
||||
"posthog-js": "^1.13.7",
|
||||
"prosemirror-markdown": "1.5.1",
|
||||
"prosemirror-state": "1.3.4",
|
||||
|
|
60
yarn.lock
60
yarn.lock
|
@ -1511,6 +1511,19 @@
|
|||
"@types/yargs" "^15.0.0"
|
||||
chalk "^4.0.0"
|
||||
|
||||
"@lit/reactive-element@^1.0.0":
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-1.0.1.tgz#853cacd4d78d79059f33f66f8e7b0e5c34bee294"
|
||||
integrity sha512-nSD5AA2AZkKuXuvGs8IK7K5ZczLAogfDd26zT9l6S7WzvqALdVWcW5vMUiTnZyj5SPcNwNNANj0koeV1ieqTFQ==
|
||||
|
||||
"@material/mwc-icon@0.25.3":
|
||||
version "0.25.3"
|
||||
resolved "https://registry.yarnpkg.com/@material/mwc-icon/-/mwc-icon-0.25.3.tgz#8b646e45f16a449553e89901684c026ff4f465a0"
|
||||
integrity sha512-36076AWZIRSr8qYOLjuDDkxej/HA0XAosrj7TS1ZeLlUBnLUtbDtvc1S7KSa0hqez7ouzOqGaWK24yoNnTa2OA==
|
||||
dependencies:
|
||||
lit "^2.0.0"
|
||||
tslib "^2.0.1"
|
||||
|
||||
"@mdx-js/loader@^1.6.22":
|
||||
version "1.6.22"
|
||||
resolved "https://registry.yarnpkg.com/@mdx-js/loader/-/loader-1.6.22.tgz#d9e8fe7f8185ff13c9c8639c048b123e30d322c4"
|
||||
|
@ -2712,6 +2725,11 @@
|
|||
resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.7.tgz#545158342f949e8fd3bfd813224971ecddc3fac4"
|
||||
integrity sha512-0VBprVqfgFD7Ehb2vd8Lh9TG3jP98gvr8rgehQqzztZNI7o8zS8Ad4jyZneKELphpuE212D8J70LnSNQSyO6bQ==
|
||||
|
||||
"@types/trusted-types@^2.0.2":
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.2.tgz#fc25ad9943bcac11cceb8168db4f275e0e72e756"
|
||||
integrity sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==
|
||||
|
||||
"@types/uglify-js@*":
|
||||
version "3.13.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.13.0.tgz#1cad8df1fb0b143c5aba08de5712ea9d1ff71124"
|
||||
|
@ -7623,6 +7641,11 @@ hosted-git-info@^2.1.4:
|
|||
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9"
|
||||
integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==
|
||||
|
||||
hotkeys-js@3.8.7:
|
||||
version "3.8.7"
|
||||
resolved "https://registry.yarnpkg.com/hotkeys-js/-/hotkeys-js-3.8.7.tgz#c16cab978b53d7242f860ca3932e976b92399981"
|
||||
integrity sha512-ckAx3EkUr5XjDwjEHDorHxRO2Kb7z6Z2Sxul4MbBkN8Nho7XDslQsgMJT+CiJ5Z4TgRxxvKHEpuLE3imzqy4Lg==
|
||||
|
||||
hpack.js@^2.1.6:
|
||||
version "2.1.6"
|
||||
resolved "https://registry.yarnpkg.com/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2"
|
||||
|
@ -9482,6 +9505,30 @@ listr@^0.14.3:
|
|||
p-map "^2.0.0"
|
||||
rxjs "^6.3.3"
|
||||
|
||||
lit-element@^3.0.0:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-3.0.1.tgz#3c545af17d8a46268bc1dd5623a47486e6ff76f4"
|
||||
integrity sha512-vs9uybH9ORyK49CFjoNGN85HM9h5bmisU4TQ63phe/+GYlwvY/3SIFYKdjV6xNvzz8v2MnVC+9+QOkPqh+Q3Ew==
|
||||
dependencies:
|
||||
"@lit/reactive-element" "^1.0.0"
|
||||
lit-html "^2.0.0"
|
||||
|
||||
lit-html@^2.0.0:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-2.0.1.tgz#63241015efa07bc9259b6f96f04abd052d2a1f95"
|
||||
integrity sha512-KF5znvFdXbxTYM/GjpdOOnMsjgRcFGusTnB54ixnCTya5zUR0XqrDRj29ybuLS+jLXv1jji6Y8+g4W7WP8uL4w==
|
||||
dependencies:
|
||||
"@types/trusted-types" "^2.0.2"
|
||||
|
||||
lit@2.0.2, lit@^2.0.0:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/lit/-/lit-2.0.2.tgz#5e6f422924e0732258629fb379556b6d23f7179c"
|
||||
integrity sha512-hKA/1YaSB+P+DvKWuR2q1Xzy/iayhNrJ3aveD0OQ9CKn6wUjsdnF/7LavDOJsKP/K5jzW/kXsuduPgRvTFrFJw==
|
||||
dependencies:
|
||||
"@lit/reactive-element" "^1.0.0"
|
||||
lit-element "^3.0.0"
|
||||
lit-html "^2.0.0"
|
||||
|
||||
load-json-file@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8"
|
||||
|
@ -10203,6 +10250,14 @@ nice-try@^1.0.4:
|
|||
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"
|
||||
integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==
|
||||
|
||||
"ninja-keys@https://github.com/chatwoot/ninja-keys.git#b4c3233f676780af90c607866fa85e404c835902":
|
||||
version "1.1.6"
|
||||
resolved "https://github.com/chatwoot/ninja-keys.git#b4c3233f676780af90c607866fa85e404c835902"
|
||||
dependencies:
|
||||
"@material/mwc-icon" "0.25.3"
|
||||
hotkeys-js "3.8.7"
|
||||
lit "2.0.2"
|
||||
|
||||
no-case@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d"
|
||||
|
@ -14456,6 +14511,11 @@ tslib@^1.9.0, tslib@^1.9.3:
|
|||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
|
||||
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
|
||||
|
||||
tslib@^2.0.1:
|
||||
version "2.3.1"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
|
||||
integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==
|
||||
|
||||
tslib@^2.0.3:
|
||||
version "2.2.0"
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.2.0.tgz#fb2c475977e35e241311ede2693cee1ec6698f5c"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue