From 675796b5c55263178920907e1507adab25073289 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Thu, 6 Jul 2023 14:36:30 +0530 Subject: [PATCH] feat: update button copy --- .../conversation/LabelSuggestion.vue | 18 ++++++++++++------ .../dashboard/i18n/locale/en/labelsMgmt.json | 5 ++++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/conversation/conversation/LabelSuggestion.vue b/app/javascript/dashboard/components/widgets/conversation/conversation/LabelSuggestion.vue index 933f4e3f0..7c6ec54d8 100644 --- a/app/javascript/dashboard/components/widgets/conversation/conversation/LabelSuggestion.vue +++ b/app/javascript/dashboard/components/widgets/conversation/conversation/LabelSuggestion.vue @@ -35,12 +35,7 @@ size="tiny" @click="addAllLabels" > - - + {{ addButtonText }}
@@ -125,6 +120,17 @@ export default { return this.$t('LABEL_MGMT.SUGGESTIONS.TOOLTIP.SINGLE_SUGGESTION'); }, + addButtonText() { + if (this.selectedLabels.length === 1) { + return this.$t('LABEL_MGMT.SUGGESTIONS.ADD_SELECTED_LABEL'); + } + + if (this.selectedLabels.length > 1) { + return this.$t('LABEL_MGMT.SUGGESTIONS.ADD_SELECTED_LABELS'); + } + + return this.$t('LABEL_MGMT.SUGGESTIONS.ADD_ALL_LABELS'); + }, preparedLabels() { return this.allLabels.filter(label => this.suggestedLabels.includes(label.title) diff --git a/app/javascript/dashboard/i18n/locale/en/labelsMgmt.json b/app/javascript/dashboard/i18n/locale/en/labelsMgmt.json index d4274e5b8..e36bf2776 100644 --- a/app/javascript/dashboard/i18n/locale/en/labelsMgmt.json +++ b/app/javascript/dashboard/i18n/locale/en/labelsMgmt.json @@ -40,7 +40,10 @@ "MULTIPLE_SUGGESTION": "Select this label", "DESELECT": "Deselect label" }, - "POWERED_BY": "Chatwoot AI" + "POWERED_BY": "Chatwoot AI", + "ADD_SELECTED_LABELS": "Add selected labels", + "ADD_SELECTED_LABEL": "Add selected label", + "ADD_ALL_LABELS": "Add all labels" }, "ADD": { "TITLE": "Add label",