From da0c0da0a8f719629f7ff7af8a302785f8e3c0be Mon Sep 17 00:00:00 2001 From: dlohvinov Date: Mon, 13 Jan 2025 20:22:27 +0200 Subject: [PATCH] feat: added `filters` and `columns` actions to `wt-icon-action.vue` [WTEL-5881](https://webitel.atlassian.net/browse/WTEL-5881) --- .../examples/example-icon-action.vue | 6 +-- package-lock.json | 44 +++++++++--------- package.json | 8 ++-- src/components/wt-icon-action/IActionData.js | 46 ------------------- src/components/wt-icon-action/iconMappings.js | 14 ++++++ .../wt-icon-action/wt-icon-action.vue | 12 +++-- src/locale/en/en.js | 22 +++++++-- src/locale/ru/ru.js | 22 +++++++-- src/locale/ua/ua.js | 22 +++++++-- 9 files changed, 102 insertions(+), 94 deletions(-) delete mode 100644 src/components/wt-icon-action/IActionData.js create mode 100644 src/components/wt-icon-action/iconMappings.js diff --git a/docs/pages/webitel-ui/components/wt-icon-action/examples/example-icon-action.vue b/docs/pages/webitel-ui/components/wt-icon-action/examples/example-icon-action.vue index c379a30f9..0b0cfebfa 100644 --- a/docs/pages/webitel-ui/components/wt-icon-action/examples/example-icon-action.vue +++ b/docs/pages/webitel-ui/components/wt-icon-action/examples/example-icon-action.vue @@ -1,5 +1,5 @@ - + diff --git a/package-lock.json b/package-lock.json index 7571b27f7..dabc7ee8e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@webitel/ui-sdk", - "version": "24.12.44", + "version": "24.12.49", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@webitel/ui-sdk", - "version": "24.12.44", + "version": "24.12.49", "dependencies": { "@floating-ui/vue": "^1.1.5", "@morev/vue-transitions": "^3.0.5", @@ -33,7 +33,7 @@ "plyr": "3.7.8", "query-string": "^9.1.1", "sortablejs": "^1.15.3", - "vue-i18n": "^9.14.1", + "vue-i18n": "^11.0.1", "vue-multiselect": "^3.1.0", "vue-observe-visibility": "^2.0.0-alpha.1", "vue-router": "^4.4.5", @@ -81,8 +81,8 @@ "vuex": "^4.1.0" }, "engines": { - "node": "v22.12.0", - "npm": "10.9.0" + "node": "v22", + "npm": "10" }, "optionalDependencies": { "@rollup/rollup-linux-x64-gnu": "4.9.5" @@ -1614,13 +1614,13 @@ "license": "MIT" }, "node_modules/@intlify/core-base": { - "version": "9.14.1", - "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-9.14.1.tgz", - "integrity": "sha512-rG5/hlNW6Qfve41go37szEf0mVLcfhYuOu83JcY0jZKasnwsrcZYYWDzebCcuO5I/6Sy1JFWo9p+nvkQS1Dy+w==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@intlify/core-base/-/core-base-11.0.1.tgz", + "integrity": "sha512-NAmhw1l/llM0HZRpagR/ChJTNymW4ll6/4EDSJML5c8L5Hl/+k6UyF8EIgE6DeHpfheQujkSRngauViHqq6jJQ==", "license": "MIT", "dependencies": { - "@intlify/message-compiler": "9.14.1", - "@intlify/shared": "9.14.1" + "@intlify/message-compiler": "11.0.1", + "@intlify/shared": "11.0.1" }, "engines": { "node": ">= 16" @@ -1630,12 +1630,12 @@ } }, "node_modules/@intlify/message-compiler": { - "version": "9.14.1", - "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-9.14.1.tgz", - "integrity": "sha512-MY8hwukJBnXvGAncVKlHsqKDQ5ZcQx4peqEmI8wBUTXn4pezrtTGYXNoz81cLyEEHB+L/zlKWVBSh5TiX4gYoQ==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@intlify/message-compiler/-/message-compiler-11.0.1.tgz", + "integrity": "sha512-5RFH8x+Mn3mbjcHXnb6KCXGiczBdiQkWkv99iiA0JpKrNuTAQeW59Pjq/uObMB0eR0shnKYGTkIJxum+DbL3sw==", "license": "MIT", "dependencies": { - "@intlify/shared": "9.14.1", + "@intlify/shared": "11.0.1", "source-map-js": "^1.0.2" }, "engines": { @@ -1646,9 +1646,9 @@ } }, "node_modules/@intlify/shared": { - "version": "9.14.1", - "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-9.14.1.tgz", - "integrity": "sha512-XjHu6PEQup9MnP1x0W9y0nXXfq9jFftAYSfV11hryjtH4XqXP8HrzMvXI+ZVifF+jZLszaTzIhvukllplxTQTg==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/@intlify/shared/-/shared-11.0.1.tgz", + "integrity": "sha512-lH164+aDDptHZ3dBDbIhRa1dOPQUp+83iugpc+1upTOWCnwyC1PVis6rSWNMMJ8VQxvtHQB9JMib48K55y0PvQ==", "license": "MIT", "engines": { "node": ">= 16" @@ -14181,13 +14181,13 @@ } }, "node_modules/vue-i18n": { - "version": "9.14.1", - "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-9.14.1.tgz", - "integrity": "sha512-xjxV0LYc1xQ8TbAVfIyZiOSS8qoU1R0YwV7V5I8I6Fd64+zvsTsdPgtylPsie3Vdt9wekeYhr+smKDeaK6RBuA==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-11.0.1.tgz", + "integrity": "sha512-pWAT8CusK8q9/EpN7V3oxwHwxWm6+Kp2PeTZmRGvdZTkUzMQDpbbmHp0TwQ8xw04XKm23cr6B4GL72y3W8Yekg==", "license": "MIT", "dependencies": { - "@intlify/core-base": "9.14.1", - "@intlify/shared": "9.14.1", + "@intlify/core-base": "11.0.1", + "@intlify/shared": "11.0.1", "@vue/devtools-api": "^6.5.0" }, "engines": { diff --git a/package.json b/package.json index 86dfb54b2..40e0b6ee1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@webitel/ui-sdk", - "version": "24.12.48", + "version": "24.12.50", "private": false, "scripts": { "dev": "vite", @@ -129,7 +129,7 @@ "plyr": "3.7.8", "query-string": "^9.1.1", "sortablejs": "^1.15.3", - "vue-i18n": "^9.14.1", + "vue-i18n": "^11.0.1", "vue-multiselect": "^3.1.0", "vue-observe-visibility": "^2.0.0-alpha.1", "vue-router": "^4.4.5", @@ -180,7 +180,7 @@ "@rollup/rollup-linux-x64-gnu": "4.9.5" }, "engines": { - "npm": "10.9.0", - "node": "v22.12.0" + "npm": "10", + "node": "v22" } } diff --git a/src/components/wt-icon-action/IActionData.js b/src/components/wt-icon-action/IActionData.js deleted file mode 100644 index 1d9fe256b..000000000 --- a/src/components/wt-icon-action/IActionData.js +++ /dev/null @@ -1,46 +0,0 @@ -import IconAction from '../../enums/IconAction/IconAction.enum.js'; - -const IActionData = Object.freeze({ - [IconAction.ADD]: { - value: IconAction.ADD, - icon: 'plus', - hint: 'webitelUI.iconAction.addActionHint', - }, - [IconAction.DELETE]: { - value: IconAction.DELETE, - icon: 'bucket', - hint: 'webitelUI.iconAction.deleteActionHint', - }, - [IconAction.DOWNLOAD]: { - value: IconAction.DOWNLOAD, - icon: 'download', - hint: 'webitelUI.iconAction.downloadActionHint', - }, - [IconAction.EDIT]: { - value: IconAction.EDIT, - icon: 'edit', - hint: 'webitelUI.iconAction.editActionHint', - }, - [IconAction.HISTORY]: { - value: IconAction.HISTORY, - icon: 'history', - hint: 'webitelUI.iconAction.historyActionHint', - }, - [IconAction.REFRESH]: { - value: IconAction.REFRESH, - icon: 'refresh', - hint: 'reusable.refresh', - }, - [IconAction.EXPAND]: { - value: IconAction.EXPAND, - icon: 'expand', - hint: 'reusable.expand', - }, - [IconAction.COLLAPSE]: { - value: IconAction.COLLAPSE, - icon: 'collapse', - hint: 'reusable.collapse', - }, -}); - -export { IActionData }; diff --git a/src/components/wt-icon-action/iconMappings.js b/src/components/wt-icon-action/iconMappings.js new file mode 100644 index 000000000..dbbf86d7f --- /dev/null +++ b/src/components/wt-icon-action/iconMappings.js @@ -0,0 +1,14 @@ +import { IconAction } from '../../enums/index.js'; + +export const WtIconActionIconMappings = Object.freeze({ + [IconAction.ADD]: 'plus', + [IconAction.DELETE]: 'bucket', + [IconAction.DOWNLOAD]: 'download', + [IconAction.EDIT]: 'edit', + [IconAction.HISTORY]: 'history', + [IconAction.REFRESH]: 'refresh', + [IconAction.EXPAND]: 'expand', + [IconAction.COLLAPSE]: 'collapse', + [IconAction.FILTERS]: 'filter', + [IconAction.COLUMNS]: 'column-select', +}); diff --git a/src/components/wt-icon-action/wt-icon-action.vue b/src/components/wt-icon-action/wt-icon-action.vue index ccf9ebd91..ad6de8b49 100644 --- a/src/components/wt-icon-action/wt-icon-action.vue +++ b/src/components/wt-icon-action/wt-icon-action.vue @@ -14,8 +14,9 @@ diff --git a/src/locale/en/en.js b/src/locale/en/en.js index 55fffb4a1..85a4a2d32 100644 --- a/src/locale/en/en.js +++ b/src/locale/en/en.js @@ -5,7 +5,9 @@ import { ChannelType, EngineRoutingSchemaType, } from 'webitel-sdk'; + import ChatGatewayProvider from '../../enums/ChatGatewayProvider/ChatGatewayProvider.enum.js'; +import { IconAction } from '../../enums/index.js'; import QueueType from '../../enums/QueueType/QueueType.enum.js'; import AdminSections from '../../enums/WebitelApplications/AdminSections.enum.js'; import AuditorSections from '../../enums/WebitelApplications/AuditorSections.enum.js'; @@ -18,6 +20,9 @@ import { snakeToCamel } from '../../scripts/caseConverters.js'; export default { // describes reusable buttons, actions, default titles, and other ui elements reusable: { + download: 'Download', + history: 'History', + filter: ({ plural }) => plural(['Filter', 'Filters']), total: 'Total', ok: 'Ok', save: 'Save', @@ -349,11 +354,18 @@ export default { breakOut: 'Break Out', }, iconAction: { - deleteActionHint: 'Delete', - editActionHint: 'Edit', - addActionHint: 'Add', - historyActionHint: 'History', - downloadActionHint: 'Download', + hints: { + [IconAction.DELETE]: ({ linked }) => linked('reusable.delete'), + [IconAction.EDIT]: ({ linked }) => linked('reusable.edit'), + [IconAction.ADD]: ({ linked }) => linked('reusable.add'), + [IconAction.HISTORY]: ({ linked }) => linked('reusable.history'), + [IconAction.DOWNLOAD]: ({ linked }) => linked('reusable.download'), + [IconAction.FILTERS]: ({ linked }) => linked('reusable.filter'), + [IconAction.COLUMNS]: 'Select columns', + [IconAction.REFRESH]: ({ linked }) => linked('reusable.refresh'), + [IconAction.EXPAND]: ({ linked }) => linked('reusable.expand'), + [IconAction.COLLAPSE]: ({ linked }) => linked('reusable.collapse'), + }, }, errorPages: { goBack: 'Go back', diff --git a/src/locale/ru/ru.js b/src/locale/ru/ru.js index 0e8b71e07..ec48a954c 100644 --- a/src/locale/ru/ru.js +++ b/src/locale/ru/ru.js @@ -5,7 +5,9 @@ import { ChannelType, EngineRoutingSchemaType, } from 'webitel-sdk'; + import ChatGatewayProvider from '../../enums/ChatGatewayProvider/ChatGatewayProvider.enum.js'; +import { IconAction } from '../../enums/index.js'; import QueueType from '../../enums/QueueType/QueueType.enum.js'; import AdminSections from '../../enums/WebitelApplications/AdminSections.enum.js'; import AuditorSections from '../../enums/WebitelApplications/AuditorSections.enum.js'; @@ -18,6 +20,9 @@ import { snakeToCamel } from '../../scripts/caseConverters.js'; export default { // describes reusable buttons, actions, default titles, and other ui elements reusable: { + download: 'Скачать', + history: 'История', + filter: 'Фильтр | Фильтры', total: 'Всего', ok: 'Ок', save: 'Сохранить', @@ -347,11 +352,18 @@ export default { breakOut: 'Принудительный перерыв', }, iconAction: { - deleteActionHint: 'Удалить', - editActionHint: 'Редактировать', - addActionHint: 'Добавить', - historyActionHint: 'История', - downloadActionHint: 'Скачать', + hints: { + [IconAction.DELETE]: ({ linked }) => linked('reusable.delete'), + [IconAction.EDIT]: ({ linked }) => linked('reusable.edit'), + [IconAction.ADD]: ({ linked }) => linked('reusable.add'), + [IconAction.HISTORY]: ({ linked }) => linked('reusable.history'), + [IconAction.DOWNLOAD]: ({ linked }) => linked('reusable.download'), + [IconAction.FILTERS]: ({ linked }) => linked('reusable.filter', 2), + [IconAction.COLUMNS]: 'Добавить колонки', + [IconAction.REFRESH]: ({ linked }) => linked('reusable.refresh'), + [IconAction.EXPAND]: ({ linked }) => linked('reusable.expand'), + [IconAction.COLLAPSE]: ({ linked }) => linked('reusable.collapse'), + }, }, errorPages: { goBack: 'Вернуться назад', diff --git a/src/locale/ua/ua.js b/src/locale/ua/ua.js index d75b6083e..01b1542de 100644 --- a/src/locale/ua/ua.js +++ b/src/locale/ua/ua.js @@ -5,7 +5,9 @@ import { ChannelType, EngineRoutingSchemaType, } from 'webitel-sdk'; + import ChatGatewayProvider from '../../enums/ChatGatewayProvider/ChatGatewayProvider.enum.js'; +import { IconAction } from '../../enums/index.js'; import QueueType from '../../enums/QueueType/QueueType.enum.js'; import AdminSections from '../../enums/WebitelApplications/AdminSections.enum.js'; import AuditorSections from '../../enums/WebitelApplications/AuditorSections.enum.js'; @@ -18,6 +20,9 @@ import { snakeToCamel } from '../../scripts/caseConverters.js'; export default { // describes reusable buttons, actions, default titles, and other ui elements reusable: { + download: 'Завантажити', + history: 'Історія', + filter: 'Фільтр | Фільтри', total: 'Всього', ok: 'Ок', save: 'Зберегти', @@ -347,11 +352,18 @@ export default { breakOut: 'Примусова перерва', }, iconAction: { - deleteActionHint: 'Видалити', - editActionHint: 'Редагувати', - addActionHint: 'Додати', - historyActionHint: 'Історія', - downloadActionHint: 'Скачати', + hints: { + [IconAction.DELETE]: ({ linked }) => linked('reusable.delete'), + [IconAction.EDIT]: ({ linked }) => linked('reusable.edit'), + [IconAction.ADD]: ({ linked }) => linked('reusable.add'), + [IconAction.HISTORY]: ({ linked }) => linked('reusable.history'), + [IconAction.DOWNLOAD]: ({ linked }) => linked('reusable.download'), + [IconAction.FILTERS]: ({ linked }) => linked('reusable.filter', 2), + [IconAction.COLUMNS]: 'Додати колонки', + [IconAction.REFRESH]: ({ linked }) => linked('reusable.refresh'), + [IconAction.EXPAND]: ({ linked }) => linked('reusable.expand'), + [IconAction.COLLAPSE]: ({ linked }) => linked('reusable.collapse'), + }, }, errorPages: { goBack: 'Повернутись назад',