feat: update button copy

This commit is contained in:
Shivam Mishra
2023-07-10 15:04:09 +05:30
parent 2da45340a4
commit 675796b5c5
2 changed files with 16 additions and 7 deletions
@@ -35,12 +35,7 @@
size="tiny"
@click="addAllLabels"
>
<template v-if="selectedLabels.length === 0">
Add all labels
</template>
<template v-else>
Add selected labels
</template>
{{ addButtonText }}
</woot-button>
</div>
<div class="sender--info has-tooltip" data-original-title="null">
@@ -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)
@@ -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",