diff --git a/app/javascript/dashboard/components/layout/config/sidebarItems/reports.js b/app/javascript/dashboard/components/layout/config/sidebarItems/reports.js index 551256c74..e7e4997fd 100644 --- a/app/javascript/dashboard/components/layout/config/sidebarItems/reports.js +++ b/app/javascript/dashboard/components/layout/config/sidebarItems/reports.js @@ -12,6 +12,7 @@ const reports = accountId => ({ 'label_reports', 'inbox_reports', 'team_reports', + 'sla_reports', ], menuItems: [ { @@ -71,6 +72,14 @@ const reports = accountId => ({ toState: frontendURL(`accounts/${accountId}/reports/teams`), toStateName: 'team_reports', }, + { + icon: 'document-list-clock', + label: 'REPORTS_SLA', + hasSubMenu: false, + featureFlag: FEATURE_FLAGS.SLA, + toState: frontendURL(`accounts/${accountId}/reports/sla`), + toStateName: 'sla_reports', + }, ], }); diff --git a/app/javascript/dashboard/components/widgets/TableHeaderCell.vue b/app/javascript/dashboard/components/widgets/TableHeaderCell.vue new file mode 100644 index 000000000..8e2cd6326 --- /dev/null +++ b/app/javascript/dashboard/components/widgets/TableHeaderCell.vue @@ -0,0 +1,39 @@ + + diff --git a/app/javascript/dashboard/components/widgets/conversation/conversationCardComponents/CardLabels.vue b/app/javascript/dashboard/components/widgets/conversation/conversationCardComponents/CardLabels.vue index c94e5389b..079d1c7bf 100644 --- a/app/javascript/dashboard/components/widgets/conversation/conversationCardComponents/CardLabels.vue +++ b/app/javascript/dashboard/components/widgets/conversation/conversationCardComponents/CardLabels.vue @@ -46,6 +46,11 @@ export default { type: Number, required: true, }, + conversationLabels: { + type: String, + required: false, + default: '', + }, }, data() { return { diff --git a/app/javascript/dashboard/i18n/locale/en/report.json b/app/javascript/dashboard/i18n/locale/en/report.json index c41e8b8a1..27beaa9ef 100644 --- a/app/javascript/dashboard/i18n/locale/en/report.json +++ b/app/javascript/dashboard/i18n/locale/en/report.json @@ -508,15 +508,29 @@ }, "SLA_REPORTS": { "HEADER": "SLA Reports", + "NO_RECORDS": "SLA applied conversations are not available.", + "LOADING": "Loading SLA data...", "METRICS": { "HIT_RATE": { "LABEL": "Hit Rate", "TOOLTIP": "Percentage of SLAs created were completed successfully" }, - "NO_OF_BREACHES": { - "LABEL": "Number of Breaches", - "TOOLTIP": "The total SLA breaches in a certain period." + "NO_OF_MISSES": { + "LABEL": "Number of Misses", + "TOOLTIP": "Total SLA misses in a certain period" + }, + "NO_OF_CONVERSATIONS": { + "LABEL": "Number of Conversations", + "TOOLTIP": "Total number of conversations with SLA" } + }, + "TABLE": { + "HEADER": { + "POLICY": "Policy", + "CONVERSATION": "Conversation", + "AGENT": "Agent" + }, + "VIEW_DETAILS": "View Details" } } } diff --git a/app/javascript/dashboard/i18n/locale/en/settings.json b/app/javascript/dashboard/i18n/locale/en/settings.json index d9834c545..e9ac56f2a 100644 --- a/app/javascript/dashboard/i18n/locale/en/settings.json +++ b/app/javascript/dashboard/i18n/locale/en/settings.json @@ -240,6 +240,7 @@ "CAMPAIGNS": "Campaigns", "ONGOING": "Ongoing", "ONE_OFF": "One off", + "REPORTS_SLA": "SLA", "REPORTS_BOT": "Bot", "REPORTS_AGENT": "Agents", "REPORTS_LABEL": "Labels", diff --git a/app/javascript/dashboard/mixins/conversation/labelMixin.js b/app/javascript/dashboard/mixins/conversation/labelMixin.js index 5d0e17507..6c9e954b6 100644 --- a/app/javascript/dashboard/mixins/conversation/labelMixin.js +++ b/app/javascript/dashboard/mixins/conversation/labelMixin.js @@ -4,6 +4,10 @@ export default { computed: { ...mapGetters({ accountLabels: 'labels/getLabels' }), savedLabels() { + // If conversationLabels is passed as prop, use it + if (this.conversationLabels) + return this.conversationLabels.split(',').map(item => item.trim()); + // Otherwise, get labels from store return this.$store.getters['conversationLabels/getConversationLabels']( this.conversationId ); diff --git a/app/javascript/dashboard/routes/dashboard/settings/reports/SLAReports.vue b/app/javascript/dashboard/routes/dashboard/settings/reports/SLAReports.vue new file mode 100644 index 000000000..3c1f3775f --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/reports/SLAReports.vue @@ -0,0 +1,78 @@ + + diff --git a/app/javascript/dashboard/routes/dashboard/settings/reports/components/FilterSelector.vue b/app/javascript/dashboard/routes/dashboard/settings/reports/components/FilterSelector.vue index 84bae6198..0116f54d6 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/reports/components/FilterSelector.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/reports/components/FilterSelector.vue @@ -1,6 +1,8 @@