From cf1a8c4b17386b107ce2500d7a2a0901207feaa7 Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Fri, 29 Mar 2024 13:59:16 +0530 Subject: [PATCH] feat: add labels --- .../conversationCardComponents/CardLabels.vue | 5 +++++ .../dashboard/mixins/conversation/labelMixin.js | 4 ++++ .../routes/dashboard/settings/reports/SLAReports.vue | 1 - .../settings/reports/components/SLA/SLAReportItem.vue | 11 +++++++++-- .../settings/reports/components/SLA/SLATable.vue | 3 ++- .../api/v1/accounts/applied_slas/index.json.jbuilder | 8 +++++--- 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/conversation/conversationCardComponents/CardLabels.vue b/app/javascript/dashboard/components/widgets/conversation/conversationCardComponents/CardLabels.vue index a2e72caed..9ddcfc469 100644 --- a/app/javascript/dashboard/components/widgets/conversation/conversationCardComponents/CardLabels.vue +++ b/app/javascript/dashboard/components/widgets/conversation/conversationCardComponents/CardLabels.vue @@ -45,6 +45,11 @@ export default { type: Number, required: true, }, + conversationLabels: { + type: String, + required: false, + default: '', + }, }, data() { return { diff --git a/app/javascript/dashboard/mixins/conversation/labelMixin.js b/app/javascript/dashboard/mixins/conversation/labelMixin.js index 622bd3519..a749e5f63 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 index d64000986..727974c34 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/reports/SLAReports.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/reports/SLAReports.vue @@ -8,7 +8,6 @@ :sla-reports="slaReports" :current-page="Number(slaMeta.currentPage)" :total-count="Number(slaMeta.count)" - :page-size="3" @page-change="onPageChange" /> diff --git a/app/javascript/dashboard/routes/dashboard/settings/reports/components/SLA/SLAReportItem.vue b/app/javascript/dashboard/routes/dashboard/settings/reports/components/SLA/SLAReportItem.vue index 4bb9ef5bf..d1ea4fc6d 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/reports/components/SLA/SLAReportItem.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/reports/components/SLA/SLAReportItem.vue @@ -9,6 +9,10 @@ defineProps({ type: Number, required: true, }, + conversation: { + type: Object, + required: true, + }, }); @@ -24,8 +28,11 @@ defineProps({
- #{{ conversationId }} with John Doe - + #{{ conversationId }} with {{ conversation.contact.name }} +