feat: add labels

This commit is contained in:
Muhsin Keloth
2024-03-29 13:59:16 +05:30
parent 89cac2dec7
commit cf1a8c4b17
6 changed files with 25 additions and 7 deletions
@@ -45,6 +45,11 @@ export default {
type: Number,
required: true,
},
conversationLabels: {
type: String,
required: false,
default: '',
},
},
data() {
return {
@@ -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
);
@@ -8,7 +8,6 @@
:sla-reports="slaReports"
:current-page="Number(slaMeta.currentPage)"
:total-count="Number(slaMeta.count)"
:page-size="3"
@page-change="onPageChange"
/>
</div>
@@ -9,6 +9,10 @@ defineProps({
type: Number,
required: true,
},
conversation: {
type: Object,
required: true,
},
});
</script>
@@ -24,8 +28,11 @@ defineProps({
<div
class="flex items-center col-span-6 px-0 py-2 text-sm tracking-[0.5] text-slate-700 dark:text-slate-100 rtl:text-right"
>
#{{ conversationId }} with John Doe
<card-labels :conversation-id="148" />
#{{ conversationId }} with {{ conversation.contact.name }}
<card-labels
:conversation-id="conversationId"
:conversation-labels="conversation.labels"
/>
</div>
<div
class="flex items-center col-span-2 px-0 py-2 text-sm tracking-[0.5] text-slate-700 dark:text-slate-100 rtl:text-right"
@@ -30,7 +30,8 @@
v-for="sla in slaReports"
:key="sla.id"
:sla-name="sla.sla_policy.name"
:conversation-id="sla.conversation.id"
:conversation="sla.conversation"
:conversation-id="sla.conversation_id"
/>
</div>
<table-footer