From 6c6cca7e9c64d49c9dd1058bbe8a7c4cdca10352 Mon Sep 17 00:00:00 2001 From: Lera24 Date: Tue, 19 Nov 2024 15:09:47 +0200 Subject: [PATCH] feature: add locale and default img in useTableEmpty[WTEL-5284](https://webitel.atlassian.net/browse/WTEL-5284) --- package.json | 2 +- src/locale/en/en.js | 6 ++++++ src/locale/ru/ru.js | 6 ++++++ src/locale/ua/ua.js | 6 ++++++ .../_internals/assets/empty-filters-dark.svg | 19 +++++++++++++++++++ .../_internals/assets/empty-filters-light.svg | 19 +++++++++++++++++++ .../composables/useTableEmpty.js | 10 ++++++---- 7 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 src/modules/TableComponentModule/_internals/assets/empty-filters-dark.svg create mode 100644 src/modules/TableComponentModule/_internals/assets/empty-filters-light.svg diff --git a/package.json b/package.json index e083ffc8..afd579e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@webitel/ui-sdk", - "version": "24.10.85", + "version": "24.10.86", "private": false, "scripts": { "dev": "vite", diff --git a/src/locale/en/en.js b/src/locale/en/en.js index 3fe1cc14..bb57eb63 100644 --- a/src/locale/en/en.js +++ b/src/locale/en/en.js @@ -393,6 +393,12 @@ export default { dummy: { text: 'There are no records yet', }, + empty: { + text: { + empty: 'No results were found', + filters: 'No results for the filters', + }, + }, agentStatusSelect: { pauseCausePopup: { title: 'Select a pause cause', diff --git a/src/locale/ru/ru.js b/src/locale/ru/ru.js index 01bcef21..d16f02d3 100644 --- a/src/locale/ru/ru.js +++ b/src/locale/ru/ru.js @@ -391,6 +391,12 @@ export default { dummy: { text: 'Записи в разделе еще не созданы', }, + empty: { + text: { + empty: 'Поиск не дал результата', + filters: 'Нет результатов по фильтрам', + }, + }, agentStatusSelect: { pauseCausePopup: { title: 'Выберите причину паузы', diff --git a/src/locale/ua/ua.js b/src/locale/ua/ua.js index d8772e2f..0782b838 100644 --- a/src/locale/ua/ua.js +++ b/src/locale/ua/ua.js @@ -391,6 +391,12 @@ export default { dummy: { text: 'Записи у розділі ще не створені', }, + empty: { + text: { + empty: 'Пошук не дав результату', + filters: 'Немає результатів за фільтрами', + }, + }, agentStatusSelect: { pauseCausePopup: { title: 'Виберіть причину паузи', diff --git a/src/modules/TableComponentModule/_internals/assets/empty-filters-dark.svg b/src/modules/TableComponentModule/_internals/assets/empty-filters-dark.svg new file mode 100644 index 00000000..2f333721 --- /dev/null +++ b/src/modules/TableComponentModule/_internals/assets/empty-filters-dark.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/modules/TableComponentModule/_internals/assets/empty-filters-light.svg b/src/modules/TableComponentModule/_internals/assets/empty-filters-light.svg new file mode 100644 index 00000000..1c50b990 --- /dev/null +++ b/src/modules/TableComponentModule/_internals/assets/empty-filters-light.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/modules/TableComponentModule/composables/useTableEmpty.js b/src/modules/TableComponentModule/composables/useTableEmpty.js index f6a6817f..7f089658 100644 --- a/src/modules/TableComponentModule/composables/useTableEmpty.js +++ b/src/modules/TableComponentModule/composables/useTableEmpty.js @@ -5,6 +5,8 @@ import { useStore } from 'vuex'; import { isEmpty } from '../../../scripts/index.js'; import EmptyTableDark from '../_internals/assets/empty-table-dark.svg'; import EmptyTableLight from '../_internals/assets/empty-table-light.svg'; +import EmptyFiltersDark from '../_internals/assets/empty-filters-dark.svg'; +import EmptyFiltersLight from '../_internals/assets/empty-filters-light.svg'; export const useTableEmpty = ({ dataList, filters, error, isLoading }, overrides = {}) => { const store = useStore(); @@ -14,8 +16,8 @@ export const useTableEmpty = ({ dataList, filters, error, isLoading }, overrides const defaults = computed(() => ({ image: { filters: { - dark: EmptyTableDark, - light: EmptyTableLight, + dark: EmptyFiltersDark, + light: EmptyFiltersLight, }, error: { dark: EmptyTableDark, @@ -37,9 +39,9 @@ export const useTableEmpty = ({ dataList, filters, error, isLoading }, overrides empty: t(''), }, text: { - filters: t('web'), + filters: t('webitelUI.empty.text.filters'), error: t(''), - empty: t(''), + empty: t('webitelUI.empty.text.empty'), }, primaryActionText: { filters: t(''),