From b316b47f74b795331d5392985b6ab9badd10350a Mon Sep 17 00:00:00 2001 From: iamsivin Date: Fri, 26 Jul 2024 01:43:44 +0530 Subject: [PATCH] fix: apply ESLint rule vue/no-bare-strings-in-template --- .eslintrc.js | 55 +++++++++++++++++++ .../widgets/AutomationActionInput.vue | 4 +- .../components/widgets/FilterInput/Index.vue | 2 +- .../EmptyState/FeaturePlaceholder.vue | 10 ++-- .../conversation/LabelSuggestion.vue | 4 +- .../conversationBulkActions/AgentSelector.vue | 6 +- .../conversationBulkActions/LabelActions.vue | 8 +-- .../conversationBulkActions/TeamActions.vue | 2 +- .../components/widgets/forms/PhoneInput.vue | 22 ++++---- .../widgets/modal/WootKeyShortcutModal.vue | 22 ++++---- .../i18n/locale/en/advancedFilters.json | 1 + .../dashboard/i18n/locale/en/automation.json | 11 ++-- .../dashboard/i18n/locale/en/bulkActions.json | 1 + .../dashboard/i18n/locale/en/contact.json | 3 + .../dashboard/i18n/locale/en/general.json | 6 +- .../dashboard/i18n/locale/en/helpCenter.json | 3 +- .../dashboard/i18n/locale/en/labelsMgmt.json | 3 +- .../dashboard/i18n/locale/en/report.json | 4 +- .../components/ContactDropdownItem.vue | 2 +- .../modules/notes/components/AddNote.vue | 4 +- .../contacts/components/TimelineCard.vue | 3 +- .../conversation/contact/ContactInfo.vue | 8 +-- .../pages/articles/DefaultPortalArticles.vue | 2 +- .../pages/articles/ListCategoryArticles.vue | 3 +- .../pages/categories/NewCategory.vue | 3 +- .../pages/categories/ShowCategory.vue | 3 +- .../helpcenter/pages/portals/ShowPortal.vue | 3 +- .../routes/dashboard/settings/inbox/Index.vue | 20 ++++--- .../settings/reports/LiveReports.vue | 2 +- .../reports/components/SLA/SLAReportItem.vue | 10 ++-- .../components/ui/label/LabelDropdown.vue | 10 ++-- .../components/playground/Header.vue | 8 +-- .../widget/components/ArticleSearch.vue | 8 +-- .../widget/components/ChatInputWrap.vue | 2 +- .../widget/components/FooterReplyTo.vue | 2 +- .../widget/components/Form/PhoneInput.vue | 24 ++++---- .../widget/components/SearchArticle.vue | 8 +-- app/javascript/widget/i18n/locale/en.json | 9 ++- 38 files changed, 192 insertions(+), 109 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 3783d8b85..9a18b1f88 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -53,6 +53,61 @@ module.exports = { ], 'vue/define-props-declaration': ['error', 'runtime'], 'vue/match-component-import-name': ['error'], + 'vue/no-bare-strings-in-template': [ + 'error', + { + allowlist: [ + '(', + ')', + ',', + '.', + '&', + '+', + '-', + '=', + '*', + '/', + '#', + '%', + '!', + '?', + ':', + '[', + ']', + '{', + '}', + '<', + '>', + '⌘', + 'πŸ“„', + 'πŸŽ‰', + 'πŸ’¬', + 'πŸ‘₯', + 'πŸ“₯', + 'πŸ”–', + '❌', + 'βœ…', + '\u00b7', + '\u2022', + '\u2010', + '\u2013', + '\u2014', + '\u2212', + '|', + ], + attributes: { + '/.+/': [ + 'title', + 'aria-label', + 'aria-placeholder', + 'aria-roledescription', + 'aria-valuetext', + ], + input: ['placeholder'], + }, + directives: ['v-text'], + }, + ], 'vue/max-attributes-per-line': [ 'error', { diff --git a/app/javascript/dashboard/components/widgets/AutomationActionInput.vue b/app/javascript/dashboard/components/widgets/AutomationActionInput.vue index 030cd9af9..cbd5c13b1 100644 --- a/app/javascript/dashboard/components/widgets/AutomationActionInput.vue +++ b/app/javascript/dashboard/components/widgets/AutomationActionInput.vue @@ -153,14 +153,14 @@ export default { v-model="action_params" type="email" class="answer--text-input" - placeholder="Enter email" + :placeholder="$t('AUTOMATION.ACTION.EMAIL_INPUT_PLACEHOLDER')" /> -
+
⌘ {{ keyShortcut.key }}
{{ keyShortcut.description }} diff --git a/app/javascript/dashboard/components/widgets/conversation/conversation/LabelSuggestion.vue b/app/javascript/dashboard/components/widgets/conversation/conversation/LabelSuggestion.vue index ad2319ad0..889051674 100644 --- a/app/javascript/dashboard/components/widgets/conversation/conversation/LabelSuggestion.vue +++ b/app/javascript/dashboard/components/widgets/conversation/conversation/LabelSuggestion.vue @@ -148,7 +148,9 @@ export default { >
-
Suggested labels
+
+ {{ $t('LABEL_MGMT.SUGGESTIONS.SUGGESTED_LABELS') }} +
-
+
{{ $t('BULK_ACTION.AGENT_SELECT_LABEL') }}
  • diff --git a/app/javascript/dashboard/components/widgets/conversation/conversationBulkActions/LabelActions.vue b/app/javascript/dashboard/components/widgets/conversation/conversationBulkActions/LabelActions.vue index 5093ffc2f..16caec1c0 100644 --- a/app/javascript/dashboard/components/widgets/conversation/conversationBulkActions/LabelActions.vue +++ b/app/javascript/dashboard/components/widgets/conversation/conversationBulkActions/LabelActions.vue @@ -37,7 +37,7 @@ export default {
  • -
    +
    {{ $t('BULK_ACTION.LABELS.ASSIGN_LABELS') }}
    @@ -79,7 +79,7 @@ export default { class="label-checkbox" /> {{ label.title }} diff --git a/app/javascript/dashboard/components/widgets/conversation/conversationBulkActions/TeamActions.vue b/app/javascript/dashboard/components/widgets/conversation/conversationBulkActions/TeamActions.vue index b67440172..345bf1395 100644 --- a/app/javascript/dashboard/components/widgets/conversation/conversationBulkActions/TeamActions.vue +++ b/app/javascript/dashboard/components/widgets/conversation/conversationBulkActions/TeamActions.vue @@ -58,7 +58,7 @@ export default { ref="search" v-model="query" type="search" - placeholder="Search" + :placeholder="$t('BULK_ACTION.SEARCH_INPUT_PLACEHOLDER')" class="agent--search_input" />
    diff --git a/app/javascript/dashboard/components/widgets/forms/PhoneInput.vue b/app/javascript/dashboard/components/widgets/forms/PhoneInput.vue index 7a2453bca..e08c52e1b 100644 --- a/app/javascript/dashboard/components/widgets/forms/PhoneInput.vue +++ b/app/javascript/dashboard/components/widgets/forms/PhoneInput.vue @@ -167,9 +167,9 @@ export default {