From e164950718df7f9d8c239f8f688f9f72e7dbd528 Mon Sep 17 00:00:00 2001 From: Lera24 Date: Fri, 8 Mar 2024 15:06:28 +0200 Subject: [PATCH 1/3] feature: add messaging tab[WTEL-3529] --- package-lock.json | 246 ++++++++++++++---- package.json | 5 +- src/app/locale/en/en.js | 15 ++ src/app/locale/ru/ru.js | 15 ++ src/app/locale/ua/ua.js | 15 ++ .../opened-contact-communications.vue | 10 + .../modules/messaging/api/MessagingAPI.js | 54 ++++ .../messaging/assets/messaging-dummy-dark.svg | 121 +++++++++ .../assets/messaging-dummy-light.svg | 121 +++++++++ .../__tests__/the-messaging.spec.js | 24 ++ .../messaging/components/the-messaging.vue | 90 +++++++ .../modules/filters/store/filters.js | 26 ++ .../messaging/store/_internals/headers.js | 23 ++ .../modules/messaging/store/messaging.js | 27 ++ src/modules/contacts/store/contacts.js | 3 +- 15 files changed, 738 insertions(+), 57 deletions(-) create mode 100644 src/modules/contacts/modules/messaging/api/MessagingAPI.js create mode 100644 src/modules/contacts/modules/messaging/assets/messaging-dummy-dark.svg create mode 100644 src/modules/contacts/modules/messaging/assets/messaging-dummy-light.svg create mode 100644 src/modules/contacts/modules/messaging/components/__tests__/the-messaging.spec.js create mode 100644 src/modules/contacts/modules/messaging/components/the-messaging.vue create mode 100644 src/modules/contacts/modules/messaging/modules/filters/store/filters.js create mode 100644 src/modules/contacts/modules/messaging/store/_internals/headers.js create mode 100644 src/modules/contacts/modules/messaging/store/messaging.js diff --git a/package-lock.json b/package-lock.json index 3b3b1587..629e9230 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@vue/compat": "^3.3.9", "@vuelidate/core": "^2.0.0", "@vuelidate/validators": "^2.0.2", - "@webitel/ui-sdk": "^24.4.5", + "@webitel/ui-sdk": "^24.4.6", "axios": "^1.6.5", "core-js": "^3.8.3", "deep-equal": "^2.2.1", @@ -20,7 +20,7 @@ "vue-i18n": "^9.2.2", "vue-router": "^4.0.3", "vuex": "^4.1.0", - "webitel-sdk": "^23.9.5" + "webitel-sdk": "^24.2.3" }, "devDependencies": { "@babel/core": "^7.12.16", @@ -36,6 +36,7 @@ "husky": "^8.0.3", "node-polyfill-webpack-plugin": "^2.0.1", "sass": "^1.32.7", + "tslib": "^2.6.2", "vite": "^5.0.11", "vite-plugin-node-polyfills": "^0.19.0", "vite-plugin-svg-sprite": "^0.5.1", @@ -1431,6 +1432,14 @@ "@babel/types": "^7.20.7" } }, + "node_modules/@types/debug": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "dependencies": { + "@types/ms": "*" + } + }, "node_modules/@types/eslint": { "version": "8.40.1", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.40.1.tgz", @@ -1459,6 +1468,11 @@ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, + "node_modules/@types/events": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.3.tgz", + "integrity": "sha512-trOc4AAUThEz9hapPtSd7wf5tiQKvTtu5b371UxXdTuqzIh0ArcRspRP0i0Viu+LXstIQ1z96t1nsPxT9ol01g==" + }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", @@ -1478,6 +1492,11 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "node_modules/@types/ms": { + "version": "0.7.34", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", + "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" + }, "node_modules/@types/node": { "version": "20.3.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.0.tgz", @@ -1491,9 +1510,9 @@ "integrity": "sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==" }, "node_modules/@types/webrtc": { - "version": "0.0.26", - "resolved": "https://registry.npmjs.org/@types/webrtc/-/webrtc-0.0.26.tgz", - "integrity": "sha512-hTDoPKPYbgcogZA9eqhihPO+HnUs5BNPfnoOyc9bzcuq56eYV28zwJ+3tortPN0uXgmDvNs3f1JaT4oTbtWxqg==" + "version": "0.0.42", + "resolved": "https://registry.npmjs.org/@types/webrtc/-/webrtc-0.0.42.tgz", + "integrity": "sha512-YyrG3yzw/JvZs0q3f9SY+AiJr0FJw1qhBjvoQJEUy07udiyakAax2A87BHpB3qnaxsm2ExCvhyUvjTxdsn+qSw==" }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", @@ -2296,9 +2315,9 @@ } }, "node_modules/@webitel/ui-sdk": { - "version": "24.4.5", - "resolved": "https://registry.npmjs.org/@webitel/ui-sdk/-/ui-sdk-24.4.5.tgz", - "integrity": "sha512-vDC95mjzY9TUs7jUTMycfcgJwpYpZmdHNDB9yYg50SD746MxQBS0Yl61Dc7d0e8meAicIcy1SHtLgSn5qbfpUA==", + "version": "24.4.6", + "resolved": "https://registry.npmjs.org/@webitel/ui-sdk/-/ui-sdk-24.4.6.tgz", + "integrity": "sha512-65gHwgf1nCyp0ozWA6fH9P3fwev1Rl+8fTRoLqid0QgYB+MadS2gkSM1U49cwMjs7lT3qtyZFF5xTOlijyXE2A==", "dependencies": { "@floating-ui/vue": "^1.0.1", "@vuelidate/core": "^2.0.3", @@ -2456,6 +2475,64 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@webitel/ui-sdk/node_modules/webitel-sdk": { + "version": "23.12.28", + "resolved": "https://registry.npmjs.org/webitel-sdk/-/webitel-sdk-23.12.28.tgz", + "integrity": "sha512-ukTNoZl/J6BHLfcYVoO7BXLmS/czPJBrItJDZmMk/CcYrWx7+mXsUgqIqIV6UoDrRz6rSiskeUpeeX+xMlj4Mw==", + "dependencies": { + "@types/webrtc": "~0.0.41", + "deep-copy": "1.4.2", + "ee-ts": "1.0.1", + "json-refs": "3.0.13", + "jssip": "=3.10.1", + "query-string": "7.0.0" + }, + "peerDependencies": { + "axios": "1.6.5", + "ee-ts": "1.0.1" + } + }, + "node_modules/@webitel/ui-sdk/node_modules/webitel-sdk/node_modules/decode-uri-component": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/@webitel/ui-sdk/node_modules/webitel-sdk/node_modules/filter-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", + "integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@webitel/ui-sdk/node_modules/webitel-sdk/node_modules/query-string": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.0.0.tgz", + "integrity": "sha512-Iy7moLybliR5ZgrK/1R3vjrXq03S13Vz4Rbm5Jg3EFq1LUmQppto0qtXz4vqZ386MSRjZgnTSZ9QC+NZOSd/XA==", + "dependencies": { + "decode-uri-component": "^0.2.0", + "filter-obj": "^1.1.0", + "split-on-first": "^1.0.0", + "strict-uri-encode": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@webitel/ui-sdk/node_modules/webitel-sdk/node_modules/split-on-first": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", + "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==", + "engines": { + "node": ">=6" + } + }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -6882,13 +6959,15 @@ "dev": true }, "node_modules/jssip": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/jssip/-/jssip-3.3.6.tgz", - "integrity": "sha512-kyLxEQ7GBVlEi1PIWToAob7mH8WPtdUE51382vtjYC4ZUEa6qCXB4i9EwysX2bvpJUPbieZ1UPY8C6tLXQeBbA==", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jssip/-/jssip-3.10.1.tgz", + "integrity": "sha512-V82JW6fZF02VInHMKgTO9oEXbkZwqezGj9SNaQPh+btriC16FfSPsRBnD+i9IhU9C86JA9le6Z8AZirYnbKi2g==", "dependencies": { - "debug": "^4.1.1", - "events": "^3.0.0", - "sdp-transform": "^2.7.0" + "@types/debug": "^4.1.7", + "@types/events": "^3.0.0", + "debug": "^4.3.1", + "events": "^3.3.0", + "sdp-transform": "^2.14.1" } }, "node_modules/jszip": { @@ -8793,9 +8872,9 @@ } }, "node_modules/sdp-transform": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-2.14.1.tgz", - "integrity": "sha512-RjZyX3nVwJyCuTo5tGPx+PZWkDMCg7oOLpSlhjDdZfwUoNqG1mM8nyj31IGHyaPWXhjbP7cdK3qZ2bmkJ1GzRw==", + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-2.14.2.tgz", + "integrity": "sha512-icY6jVao7MfKCieyo1AyxFYm1baiM+fA00qW/KrNNVlkxHAd34riEKuEkUe4bBb3gJwLJZM+xT60Yj1QL8rHiA==", "bin": { "sdp-verify": "checker.js" } @@ -10085,10 +10164,10 @@ } }, "node_modules/tslib": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", - "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==", - "peer": true + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/tty-browserify": { "version": "0.0.1", @@ -10751,22 +10830,20 @@ } }, "node_modules/webitel-sdk": { - "version": "23.9.5", - "resolved": "https://registry.npmjs.org/webitel-sdk/-/webitel-sdk-23.9.5.tgz", - "integrity": "sha512-2kexMAFaWD5dBw3ssW973NL01LMh0YEk72KICjDuPuVBGEqcBffhhUAg1r59ndI6+K3ACrxmNUo9YqxmmLyWBQ==", + "version": "24.2.3", + "resolved": "https://registry.npmjs.org/webitel-sdk/-/webitel-sdk-24.2.3.tgz", + "integrity": "sha512-0T5wZS+54yZUXkm9q300d0IFoNb44nBYh7nU9iOVP+6aI0NAQnMh17B7w63hwbea0/0K484itxU+mNhYyfEDyQ==", "dependencies": { - "@types/webrtc": "0.0.26", + "@types/webrtc": "~0.0.41", "deep-copy": "1.4.2", "ee-ts": "1.0.1", "json-refs": "3.0.13", - "jssip": "=3.3.6", + "jssip": "=3.10.1", "query-string": "7.0.0" }, "peerDependencies": { - "axios": "0.27.2", - "ee-ts": "1.0.1", - "jssip": "=3.3.6", - "tslib": ">=1.10.0" + "axios": "1.6.5", + "ee-ts": "1.0.1" } }, "node_modules/webpack": { @@ -12020,6 +12097,14 @@ "@babel/types": "^7.20.7" } }, + "@types/debug": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "requires": { + "@types/ms": "*" + } + }, "@types/eslint": { "version": "8.40.1", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.40.1.tgz", @@ -12048,6 +12133,11 @@ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, + "@types/events": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.3.tgz", + "integrity": "sha512-trOc4AAUThEz9hapPtSd7wf5tiQKvTtu5b371UxXdTuqzIh0ArcRspRP0i0Viu+LXstIQ1z96t1nsPxT9ol01g==" + }, "@types/istanbul-lib-coverage": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", @@ -12067,6 +12157,11 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "@types/ms": { + "version": "0.7.34", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", + "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" + }, "@types/node": { "version": "20.3.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.0.tgz", @@ -12080,9 +12175,9 @@ "integrity": "sha512-g9gZnnXVq7gM7v3tJCWV/qw7w+KeOlSHAhgF9RytFyifW6AF61hdT2ucrYhPq9hLs5JIryeupHV3qGk95dH9ow==" }, "@types/webrtc": { - "version": "0.0.26", - "resolved": "https://registry.npmjs.org/@types/webrtc/-/webrtc-0.0.26.tgz", - "integrity": "sha512-hTDoPKPYbgcogZA9eqhihPO+HnUs5BNPfnoOyc9bzcuq56eYV28zwJ+3tortPN0uXgmDvNs3f1JaT4oTbtWxqg==" + "version": "0.0.42", + "resolved": "https://registry.npmjs.org/@types/webrtc/-/webrtc-0.0.42.tgz", + "integrity": "sha512-YyrG3yzw/JvZs0q3f9SY+AiJr0FJw1qhBjvoQJEUy07udiyakAax2A87BHpB3qnaxsm2ExCvhyUvjTxdsn+qSw==" }, "@ungap/structured-clone": { "version": "1.2.0", @@ -12685,9 +12780,9 @@ } }, "@webitel/ui-sdk": { - "version": "24.4.5", - "resolved": "https://registry.npmjs.org/@webitel/ui-sdk/-/ui-sdk-24.4.5.tgz", - "integrity": "sha512-vDC95mjzY9TUs7jUTMycfcgJwpYpZmdHNDB9yYg50SD746MxQBS0Yl61Dc7d0e8meAicIcy1SHtLgSn5qbfpUA==", + "version": "24.4.6", + "resolved": "https://registry.npmjs.org/@webitel/ui-sdk/-/ui-sdk-24.4.6.tgz", + "integrity": "sha512-65gHwgf1nCyp0ozWA6fH9P3fwev1Rl+8fTRoLqid0QgYB+MadS2gkSM1U49cwMjs7lT3qtyZFF5xTOlijyXE2A==", "requires": { "@floating-ui/vue": "^1.0.1", "@vuelidate/core": "^2.0.3", @@ -12771,6 +12866,47 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-3.0.0.tgz", "integrity": "sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA==" + }, + "webitel-sdk": { + "version": "23.12.28", + "resolved": "https://registry.npmjs.org/webitel-sdk/-/webitel-sdk-23.12.28.tgz", + "integrity": "sha512-ukTNoZl/J6BHLfcYVoO7BXLmS/czPJBrItJDZmMk/CcYrWx7+mXsUgqIqIV6UoDrRz6rSiskeUpeeX+xMlj4Mw==", + "requires": { + "@types/webrtc": "~0.0.41", + "deep-copy": "1.4.2", + "ee-ts": "1.0.1", + "json-refs": "3.0.13", + "jssip": "=3.10.1", + "query-string": "7.0.0" + }, + "dependencies": { + "decode-uri-component": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==" + }, + "filter-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz", + "integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==" + }, + "query-string": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-7.0.0.tgz", + "integrity": "sha512-Iy7moLybliR5ZgrK/1R3vjrXq03S13Vz4Rbm5Jg3EFq1LUmQppto0qtXz4vqZ386MSRjZgnTSZ9QC+NZOSd/XA==", + "requires": { + "decode-uri-component": "^0.2.0", + "filter-obj": "^1.1.0", + "split-on-first": "^1.0.0", + "strict-uri-encode": "^2.0.0" + } + }, + "split-on-first": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz", + "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==" + } + } } } }, @@ -16147,13 +16283,15 @@ "dev": true }, "jssip": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/jssip/-/jssip-3.3.6.tgz", - "integrity": "sha512-kyLxEQ7GBVlEi1PIWToAob7mH8WPtdUE51382vtjYC4ZUEa6qCXB4i9EwysX2bvpJUPbieZ1UPY8C6tLXQeBbA==", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jssip/-/jssip-3.10.1.tgz", + "integrity": "sha512-V82JW6fZF02VInHMKgTO9oEXbkZwqezGj9SNaQPh+btriC16FfSPsRBnD+i9IhU9C86JA9le6Z8AZirYnbKi2g==", "requires": { - "debug": "^4.1.1", - "events": "^3.0.0", - "sdp-transform": "^2.7.0" + "@types/debug": "^4.1.7", + "@types/events": "^3.0.0", + "debug": "^4.3.1", + "events": "^3.3.0", + "sdp-transform": "^2.14.1" } }, "jszip": { @@ -17633,9 +17771,9 @@ } }, "sdp-transform": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-2.14.1.tgz", - "integrity": "sha512-RjZyX3nVwJyCuTo5tGPx+PZWkDMCg7oOLpSlhjDdZfwUoNqG1mM8nyj31IGHyaPWXhjbP7cdK3qZ2bmkJ1GzRw==" + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/sdp-transform/-/sdp-transform-2.14.2.tgz", + "integrity": "sha512-icY6jVao7MfKCieyo1AyxFYm1baiM+fA00qW/KrNNVlkxHAd34riEKuEkUe4bBb3gJwLJZM+xT60Yj1QL8rHiA==" }, "semver": { "version": "6.3.0", @@ -18645,10 +18783,10 @@ } }, "tslib": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", - "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==", - "peer": true + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "tty-browserify": { "version": "0.0.1", @@ -19093,15 +19231,15 @@ "peer": true }, "webitel-sdk": { - "version": "23.9.5", - "resolved": "https://registry.npmjs.org/webitel-sdk/-/webitel-sdk-23.9.5.tgz", - "integrity": "sha512-2kexMAFaWD5dBw3ssW973NL01LMh0YEk72KICjDuPuVBGEqcBffhhUAg1r59ndI6+K3ACrxmNUo9YqxmmLyWBQ==", + "version": "24.2.3", + "resolved": "https://registry.npmjs.org/webitel-sdk/-/webitel-sdk-24.2.3.tgz", + "integrity": "sha512-0T5wZS+54yZUXkm9q300d0IFoNb44nBYh7nU9iOVP+6aI0NAQnMh17B7w63hwbea0/0K484itxU+mNhYyfEDyQ==", "requires": { - "@types/webrtc": "0.0.26", + "@types/webrtc": "~0.0.41", "deep-copy": "1.4.2", "ee-ts": "1.0.1", "json-refs": "3.0.13", - "jssip": "=3.3.6", + "jssip": "=3.10.1", "query-string": "7.0.0" } }, diff --git a/package.json b/package.json index b8db7132..7c0e840e 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "@vue/compat": "^3.3.9", "@vuelidate/core": "^2.0.0", "@vuelidate/validators": "^2.0.2", - "@webitel/ui-sdk": "^24.4.5", + "@webitel/ui-sdk": "^24.4.6", "axios": "^1.6.5", "core-js": "^3.8.3", "deep-equal": "^2.2.1", @@ -22,7 +22,7 @@ "vue-i18n": "^9.2.2", "vue-router": "^4.0.3", "vuex": "^4.1.0", - "webitel-sdk": "^23.9.5" + "webitel-sdk": "^24.2.3" }, "devDependencies": { "@babel/core": "^7.12.16", @@ -38,6 +38,7 @@ "husky": "^8.0.3", "node-polyfill-webpack-plugin": "^2.0.1", "sass": "^1.32.7", + "tslib": "^2.6.2", "vite": "^5.0.11", "vite-plugin-node-polyfills": "^0.19.0", "vite-plugin-svg-sprite": "^0.5.1", diff --git a/src/app/locale/en/en.js b/src/app/locale/en/en.js index 4a85e1f6..e597fcfd 100644 --- a/src/app/locale/en/en.js +++ b/src/app/locale/en/en.js @@ -1,3 +1,5 @@ +import ChatGatewayProvider + from '@webitel/ui-sdk/src/enums/ChatGatewayProvider/ChatGatewayProvider.enum'; import AccessMode from '../../../modules/contacts/modules/permissions/enums/AccessMode.enum'; @@ -25,6 +27,19 @@ export default { editTitle: 'Edit the phone number', dummy: 'There are no phone numbers yet', }, + messaging: { + gateway: 'Gateway', + provider: 'Provider ', + dummy: 'There is no messaging options yet', + messengers: { + [ChatGatewayProvider.TELEGRAM_BOT]: 'Telegram Bot', + [ChatGatewayProvider.TELEGRAM_APP]: 'Telegram App', + [ChatGatewayProvider.MESSENGER]: 'Meta', + [ChatGatewayProvider.VIBER]: 'Viber', + [ChatGatewayProvider.WEBCHAT]: 'Web chat', + [ChatGatewayProvider.INFOBIP]: 'Infobip', + }, + }, }, attributes: 'Attribute | Attributes', }, diff --git a/src/app/locale/ru/ru.js b/src/app/locale/ru/ru.js index 653875b3..4fd04498 100644 --- a/src/app/locale/ru/ru.js +++ b/src/app/locale/ru/ru.js @@ -1,3 +1,5 @@ +import ChatGatewayProvider + from '@webitel/ui-sdk/src/enums/ChatGatewayProvider/ChatGatewayProvider.enum'; import AccessMode from '../../../modules/contacts/modules/permissions/enums/AccessMode.enum'; @@ -25,6 +27,19 @@ export default { editTitle: 'Редактировать номер телефона', dummy: 'Телефонные номера еще не добавлены', }, + messaging: { + gateway: 'Шлюз', + provider: 'Провайдер', + dummy: 'Пока еще не было текстовых диалогов', + messengers: { + [ChatGatewayProvider.TELEGRAM_BOT]: 'Telegram Бот', + [ChatGatewayProvider.TELEGRAM_APP]: 'Telegram Приложение', + [ChatGatewayProvider.MESSENGER]: 'Meta', + [ChatGatewayProvider.VIBER]: 'Viber', + [ChatGatewayProvider.WEBCHAT]: 'Web chat', + [ChatGatewayProvider.INFOBIP]: 'Infobip', + }, + }, }, attributes: 'Атрибут | Атрибуты', }, diff --git a/src/app/locale/ua/ua.js b/src/app/locale/ua/ua.js index 010cbb27..a3208d24 100644 --- a/src/app/locale/ua/ua.js +++ b/src/app/locale/ua/ua.js @@ -1,3 +1,5 @@ +import ChatGatewayProvider + from '@webitel/ui-sdk/src/enums/ChatGatewayProvider/ChatGatewayProvider.enum'; import AccessMode from '../../../modules/contacts/modules/permissions/enums/AccessMode.enum'; @@ -25,6 +27,19 @@ export default { editTitle: 'Редагувати номер телефону', dummy: 'Телефонні номери ще не додано', }, + messaging: { + gateway: 'Шлюз', + provider: 'Провайдер', + dummy: 'Поки ще було текстових діалогів', + messengers: { + [ChatGatewayProvider.TELEGRAM_BOT]: 'Telegram Бот', + [ChatGatewayProvider.TELEGRAM_APP]: 'Telegram Застосунок', + [ChatGatewayProvider.MESSENGER]: 'Meta', + [ChatGatewayProvider.VIBER]: 'Viber', + [ChatGatewayProvider.WEBCHAT]: 'Web chat', + [ChatGatewayProvider.INFOBIP]: 'Infobip', + }, + }, }, attributes: 'Атрибут | Атрибути', }, diff --git a/src/modules/contacts/components/opened-contact-communications.vue b/src/modules/contacts/components/opened-contact-communications.vue index 14089800..545ac017 100644 --- a/src/modules/contacts/components/opened-contact-communications.vue +++ b/src/modules/contacts/components/opened-contact-communications.vue @@ -28,6 +28,7 @@ import { useI18n } from 'vue-i18n'; import { useStore } from 'vuex'; import TheEmails from '../modules/emails/components/the-emails.vue'; import ThePhones from '../modules/phones/components/the-phones.vue'; +import TheMessaging from '../modules/messaging/components/the-messaging.vue'; const access = inject('access'); @@ -40,6 +41,7 @@ const props = defineProps({ const emailsNamespace = `${props.namespace}/emails`; const phonesNamespace = `${props.namespace}/phones`; +const messagingNamespace = `${props.namespace}/messaging`; const store = useStore(); const { t } = useI18n(); @@ -53,6 +55,14 @@ const tabs = computed(() => [ icon: 'call', channel: 'number', // must be same as comm popup channel }, + { + value: 'messaging', + label: t('vocabulary.messaging'), + component: TheMessaging, + namespace: messagingNamespace, + icon: 'chat', + channel: 'messaging', // must be same as comm popup channel + }, { value: 'emails', label: t('vocabulary.emails', 2), diff --git a/src/modules/contacts/modules/messaging/api/MessagingAPI.js b/src/modules/contacts/modules/messaging/api/MessagingAPI.js new file mode 100644 index 00000000..b0894785 --- /dev/null +++ b/src/modules/contacts/modules/messaging/api/MessagingAPI.js @@ -0,0 +1,54 @@ +import { getDefaultGetParams } from '@webitel/ui-sdk/src/api/defaults'; +import applyTransform, { + merge, notify, + sanitize, snakeToCamel, starToSearch +} from '@webitel/ui-sdk/src/api/transformers'; +import { IMClientsApiFactory } from 'webitel-sdk'; +import getDefaultGetListResponse + from '../../../../../app/api/defaults/getDefaultGetListResponse'; +import configuration from '../../../../../app/api/openAPIConfig'; +import instance from '../../../../../app/api/instance'; + +const service = new IMClientsApiFactory(configuration, '', instance); + +const getList = async (params) => { + const { + parentId, + page, + size, + q, + sort, + fields, + id, + } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch('q'), + ]); + try { + const response = await service.listIMClients( + parentId, + page, + size, + q, + sort, + fields, + id, + ); + const { data, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(data, []), + next, + }; + } catch (err) { + throw applyTransform(err, [ + notify, + ]); + } +}; + +export default { + getList, +}; diff --git a/src/modules/contacts/modules/messaging/assets/messaging-dummy-dark.svg b/src/modules/contacts/modules/messaging/assets/messaging-dummy-dark.svg new file mode 100644 index 00000000..3d693637 --- /dev/null +++ b/src/modules/contacts/modules/messaging/assets/messaging-dummy-dark.svg @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/modules/contacts/modules/messaging/assets/messaging-dummy-light.svg b/src/modules/contacts/modules/messaging/assets/messaging-dummy-light.svg new file mode 100644 index 00000000..c3d85fff --- /dev/null +++ b/src/modules/contacts/modules/messaging/assets/messaging-dummy-light.svg @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/modules/contacts/modules/messaging/components/__tests__/the-messaging.spec.js b/src/modules/contacts/modules/messaging/components/__tests__/the-messaging.spec.js new file mode 100644 index 00000000..e0acd65f --- /dev/null +++ b/src/modules/contacts/modules/messaging/components/__tests__/the-messaging.spec.js @@ -0,0 +1,24 @@ +import { shallowMount } from '@vue/test-utils'; +import store from '../../../../../../app/store'; +import router from '../../../../../../app/router'; +import TheMessaging from '../the-messaging.vue'; + +describe('TheEmails', () => { + it('renders a component', () => { + const wrapper = shallowMount(TheMessaging, { + props: { + namespace: 'contacts/card/messaging', + }, + global: { + plugins: [store, router], + provide: { + access: { + hasRbacEditAccess: true, + hasRbacDeleteAccess: true, + }, + }, + }, + }); + expect(wrapper.isVisible()).toBe(true); + }); +}); diff --git a/src/modules/contacts/modules/messaging/components/the-messaging.vue b/src/modules/contacts/modules/messaging/components/the-messaging.vue new file mode 100644 index 00000000..91f8f5e5 --- /dev/null +++ b/src/modules/contacts/modules/messaging/components/the-messaging.vue @@ -0,0 +1,90 @@ + + + + + diff --git a/src/modules/contacts/modules/messaging/modules/filters/store/filters.js b/src/modules/contacts/modules/messaging/modules/filters/store/filters.js new file mode 100644 index 00000000..dbb28618 --- /dev/null +++ b/src/modules/contacts/modules/messaging/modules/filters/store/filters.js @@ -0,0 +1,26 @@ +import BaseFilterSchema + from '@webitel/ui-sdk/src/modules/Filters/classes/BaseFilterSchema'; +import FiltersStoreModule + from '@webitel/ui-sdk/src/modules/Filters/store/FiltersStoreModule'; +import router from '../../../../../../../app/router'; + +const state = { + page: new BaseFilterSchema({ + value: 1, + defaultValue: 1, + }), + size: new BaseFilterSchema({ + value: 1000, + defaultValue: 1000, + }), + sort: new BaseFilterSchema(), +}; + +const getters = { + ROUTER: () => router, + TABLE_NAMESPACE: () => 'contacts/card/messaging/table', +}; + +const filters = new FiltersStoreModule().getModule({ state, getters }); + +export default filters; diff --git a/src/modules/contacts/modules/messaging/store/_internals/headers.js b/src/modules/contacts/modules/messaging/store/_internals/headers.js new file mode 100644 index 00000000..3df2f32d --- /dev/null +++ b/src/modules/contacts/modules/messaging/store/_internals/headers.js @@ -0,0 +1,23 @@ +import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; + +export default [ + { + value: 'id', + show: true, + width: '30px', + }, + { + value: 'protocol', + locale: 'contacts.communications.messaging.provider', + show: true, + field: 'protocol', + sort: SortSymbols.NONE, + }, + { + value: 'app', + locale: 'contacts.communications.messaging.gateway', + show: true, + field: 'app', + sort: SortSymbols.NONE, + }, +]; diff --git a/src/modules/contacts/modules/messaging/store/messaging.js b/src/modules/contacts/modules/messaging/store/messaging.js new file mode 100644 index 00000000..6546d6af --- /dev/null +++ b/src/modules/contacts/modules/messaging/store/messaging.js @@ -0,0 +1,27 @@ +import TableStoreModule + from '@webitel/ui-sdk/src/modules/TableStoreModule/store/TableStoreModule'; +import ApiStoreModule + from '@webitel/ui-sdk/src/store/BaseStoreModules/ApiStoreModule'; +import BaseStoreModule + from '@webitel/ui-sdk/src/store/BaseStoreModules/BaseStoreModule'; +import MessagingAPI from '../api/MessagingAPI'; +import headers from './_internals/headers'; +import filters from '../modules/filters/store/filters'; + +const getters = { + PARENT_ID: (state, getters, rootState) => rootState.contacts.card.itemId, +}; + +const api = new ApiStoreModule() +.generateAPIActions(MessagingAPI) +.getModule(); + +const table = new TableStoreModule({ headers }) +.setChildModules({ api, filters }) +.getModule({getters}); + +const messaging = new BaseStoreModule() +.setChildModules({ table }) +.getModule(); + +export default messaging; diff --git a/src/modules/contacts/store/contacts.js b/src/modules/contacts/store/contacts.js index 22082aa0..2a084708 100644 --- a/src/modules/contacts/store/contacts.js +++ b/src/modules/contacts/store/contacts.js @@ -11,6 +11,7 @@ import headers from './_internals/headers'; import filters from '../modules/filters/store/filters'; import emails from '../modules/emails/store/emails'; import phones from '../modules/phones/store/phones'; +import messaging from '../modules/messaging/store/messaging'; import permissions from '../modules/permissions/store/permissions'; import variables from '../modules/variables/store/variables'; @@ -39,7 +40,7 @@ const table = new TableStoreModule({ headers }) .getModule({ getters: tableGetters }); const card = new CardStoreModule() - .setChildModules({ api, emails, phones, variables, permissions }) + .setChildModules({ api, emails, phones, messaging, variables, permissions }) .getModule({ state: cardState }); const contacts = new BaseStoreModule() From 24683c28f8183ff7f83d01de5a86bcda33d64e9b Mon Sep 17 00:00:00 2001 From: Lera24 Date: Mon, 11 Mar 2024 14:08:15 +0200 Subject: [PATCH 2/3] fix:icon header in messaging[WTEL-3529] --- .../contacts/modules/messaging/components/the-messaging.vue | 2 +- .../contacts/modules/messaging/store/_internals/headers.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/contacts/modules/messaging/components/the-messaging.vue b/src/modules/contacts/modules/messaging/components/the-messaging.vue index 91f8f5e5..f1bad0fc 100644 --- a/src/modules/contacts/modules/messaging/components/the-messaging.vue +++ b/src/modules/contacts/modules/messaging/components/the-messaging.vue @@ -20,7 +20,7 @@ sortable @sort="sort" > -