diff --git a/src/app/locale/en/en.js b/src/app/locale/en/en.js index fb6ff493e..a74b3b17d 100644 --- a/src/app/locale/en/en.js +++ b/src/app/locale/en/en.js @@ -319,6 +319,8 @@ export default { 'Camera access is denied. Cannot perform action.', [LicencePermissionError.id.replaceAll('.', '_')]: 'You can not work in Workspace because your license has expired.', + store_sql_user_get_default_device_app_error: + "Device is missing. You can't work with calls.", }, endpoint: { noLicense: diff --git a/src/app/locale/es/es.js b/src/app/locale/es/es.js index 32f4d2780..17593b4a4 100644 --- a/src/app/locale/es/es.js +++ b/src/app/locale/es/es.js @@ -318,6 +318,8 @@ export default { 'El acceso a la cámara está denegado. No se puede realizar la acción.', [LicencePermissionError.id.replaceAll('.', '_')]: 'No puede trabajar en el Espacio de trabajo porque su licencia ha expirado.', + store_sql_user_get_default_device_app_error: + 'No tiene ningún dispositivo. No puede trabajar con llamadas.', }, endpoint: { noLicense: diff --git a/src/app/locale/kz/kz.js b/src/app/locale/kz/kz.js index 6bdb2f38b..98ac62ef5 100644 --- a/src/app/locale/kz/kz.js +++ b/src/app/locale/kz/kz.js @@ -314,6 +314,8 @@ export default { 'Камераны қосу мүмкін емес. Әрекетті орындау мүмкін емес.', [LicencePermissionError.id.replaceAll('.', '_')]: 'Workspace жұмыс істеу мүмкін емес. Лицензияның мерзімі аяқталды.', + store_sql_user_get_default_device_app_error: + 'Сізде құрылғы жоқ. Қоңыраулармен жұмыс істей алмайсыз.', }, endpoint: { noLicense: diff --git a/src/app/locale/pl/pl.js b/src/app/locale/pl/pl.js index 46c76ec11..45125e0ed 100644 --- a/src/app/locale/pl/pl.js +++ b/src/app/locale/pl/pl.js @@ -317,6 +317,8 @@ export default { 'Odmowa dostępu do kamery. Nie można wykonać akcji.', [LicencePermissionError.id.replaceAll('.', '_')]: 'Nie możesz pracować w Workspace, ponieważ Twoja licencja wygasła.', + store_sql_user_get_default_device_app_error: + 'Nie masz urządzenia. Nie możesz pracować z połączeniami.', }, endpoint: { noLicense: diff --git a/src/app/locale/ro/ro.js b/src/app/locale/ro/ro.js index c5807e5a0..5b494e740 100644 --- a/src/app/locale/ro/ro.js +++ b/src/app/locale/ro/ro.js @@ -317,6 +317,8 @@ export default { 'Accesul la cameră este refuzat. Nu se poate efectua acțiunea.', [LicencePermissionError.id.replaceAll('.', '_')]: 'Nu puteți lucra în Spațiul de lucru deoarece licența dvs. a expirat.', + store_sql_user_get_default_device_app_error: + 'Nu aveți niciun dispozitiv. Nu puteți lucra cu apeluri.', }, endpoint: { noLicense: diff --git a/src/app/locale/ru/ru.js b/src/app/locale/ru/ru.js index 3588acbd2..1f7ce4178 100644 --- a/src/app/locale/ru/ru.js +++ b/src/app/locale/ru/ru.js @@ -320,6 +320,8 @@ export default { 'Нет доступа к камере. Невозможно выполнить действие.', [LicencePermissionError.id.replaceAll('.', '_')]: 'Невозможно работать в Workspace. Истёк срок действия лицензии.', + store_sql_user_get_default_device_app_error: + 'У вас нет устройства. Вы не можете работать со звонками.', }, endpoint: { noLicense: diff --git a/src/app/locale/uk/uk.js b/src/app/locale/uk/uk.js index 082b8530d..0041ddb55 100644 --- a/src/app/locale/uk/uk.js +++ b/src/app/locale/uk/uk.js @@ -321,6 +321,8 @@ export default { 'Немає доступу до камери. Неможливо виконати дію.', [LicencePermissionError.id.replaceAll('.', '_')]: 'Неможливо працювати у Workspace. Закінчився термін ліцензії.', + store_sql_user_get_default_device_app_error: + 'У вас немає пристрою. Ви не можете працювати з дзвінками.', }, endpoint: { noLicense: 'Неможливо працювати у Workspace. Закінчився термін ліцензії.', diff --git a/src/app/locale/uz/uz.js b/src/app/locale/uz/uz.js index 170541441..019f57313 100644 --- a/src/app/locale/uz/uz.js +++ b/src/app/locale/uz/uz.js @@ -315,6 +315,8 @@ export default { 'Kameraga ruxsat yoʻq. Amalni bajarib boʻlmaydi.', [LicencePermissionError.id.replaceAll('.', '_')]: 'Workspace ishlamaydi. Litsenziya muddati tugagan.', + store_sql_user_get_default_device_app_error: + 'Sizda qurilma yoʻq. Qoʻngʻiroqlar bilan ishlay olmaysiz.', }, endpoint: { noLicense: 'Workspace ishlamaydi. Litsenziya muddati tugagan.', diff --git a/src/app/locale/vi/vi.js b/src/app/locale/vi/vi.js index a62d85b14..9c001cddd 100644 --- a/src/app/locale/vi/vi.js +++ b/src/app/locale/vi/vi.js @@ -315,6 +315,8 @@ export default { 'Từ chối truy cập camera. Không thể thực hiện hành động.', [LicencePermissionError.id.replaceAll('.', '_')]: 'Bạn không thể làm việc trong Workspace vì giấy phép đã hết hạn.', + store_sql_user_get_default_device_app_error: + 'Bạn không có thiết bị. Bạn không thể làm việc với cuộc gọi.', }, endpoint: { noLicense: diff --git a/src/features/modules/agent-status/agent-status.js b/src/features/modules/agent-status/agent-status.js index 22116482a..fae43dfc9 100644 --- a/src/features/modules/agent-status/agent-status.js +++ b/src/features/modules/agent-status/agent-status.js @@ -11,6 +11,7 @@ const state = { user: { status: {}, }, + isAgentRemoved: false, }; const getters = { @@ -19,6 +20,7 @@ const getters = { getters.IS_AGENT && state.agent.status !== AgentStatus.Offline, IS_AGENT_ONLINE: (state, getters) => getters.IS_AGENT && state.agent.status === AgentStatus.Online, + AGENT_REMOVED: (state) => state.isAgentRemoved, }; const actions = { @@ -34,7 +36,15 @@ const actions = { const { channels, onDemand, onlineSkill } = { onlineSkill: activityType, }; - agent.online(channels, onDemand, onlineSkill); + try { + await agent.online(channels, onDemand, onlineSkill); + } catch (error) { + if (error?.id === 'app.agent.login.app_err') { + context.commit('SET_AGENT_REMOVED', true); + } else { + throw error; + } + } }, SET_AGENT_PAUSE_STATUS: async (context, note = '') => { @@ -73,6 +83,10 @@ const mutations = { SET_USER_INSTANCE: (state, user) => { state.user = user; }, + + SET_AGENT_REMOVED: (state, value) => { + state.isAgentRemoved = value; + }, }; export default { diff --git a/src/features/modules/global-handlers/store/global-handlers.js b/src/features/modules/global-handlers/store/global-handlers.js index a2dd24fc4..aa01f3208 100644 --- a/src/features/modules/global-handlers/store/global-handlers.js +++ b/src/features/modules/global-handlers/store/global-handlers.js @@ -1,4 +1,6 @@ +import { eventBus } from '@webitel/ui-sdk/scripts'; import { watch } from 'vue'; +import i18n from '../../../../app/locale/i18n'; import { WebSocketConnectionState } from '../../../../ui/enums/WebSocketConnectionState.enum.ts'; const state = { @@ -14,6 +16,7 @@ const actions = { context.dispatch('SUBSCRIBE_TO_PHONE_REGISTRATION'); context.dispatch('SUBSCRIBE_TO_CLIENT_DISCONNECT'); context.dispatch('SUBSCRIBE_TO_CLIENT_CLOSED'); + context.dispatch('SUBSCRIBE_TO_PHONE_UNREGISTERED_NOTIFICATION'); }, RESET_GLOBAL_HANDLERS: (context) => { context.dispatch('CLOSE_DISCONNECT_POPUP'); @@ -106,6 +109,21 @@ const actions = { root: true, }); }, + SUBSCRIBE_TO_PHONE_UNREGISTERED_NOTIFICATION: (context) => { + watch( + () => context.state.isPhoneReg, + (value, prev) => { + if (prev === true && value === false) { + eventBus.$emit('notification', { + type: 'error', + text: i18n.global.t( + 'error.websocket.store_sql_user_get_default_device_app_error', + ), + }); + } + }, + ); + }, }; const mutations = { diff --git a/src/ui/modules/app-header/components/agent-status-select.vue b/src/ui/modules/app-header/components/agent-status-select.vue index e2035fea0..74d6e2ba3 100644 --- a/src/ui/modules/app-header/components/agent-status-select.vue +++ b/src/ui/modules/app-header/components/agent-status-select.vue @@ -6,46 +6,48 @@ :agent-id="agent.agentId" :status="agent.status" :status-duration="statusDuration" - @changed-call-center-mode="$emit('changed-call-center-mode', $event)" + :disabled="isControlsDisabled" + @changed-call-center-mode="emit('changed-call-center-mode', $event)" > - - -