From de7d5383282299eeff92996f518ba32d5112b21f Mon Sep 17 00:00:00 2001 From: liza-pohranichna Date: Thu, 23 May 2024 21:13:27 +0300 Subject: [PATCH 01/96] fix: changed validation rules for flow select in chat gateways wabchat tab [WTEL-4327] --- .../chat-gateways/components/opened-chat-gateway.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/modules/routing/modules/chat-gateways/components/opened-chat-gateway.vue b/src/modules/routing/modules/chat-gateways/components/opened-chat-gateway.vue index e94333bc6..cf201774b 100644 --- a/src/modules/routing/modules/chat-gateways/components/opened-chat-gateway.vue +++ b/src/modules/routing/modules/chat-gateways/components/opened-chat-gateway.vue @@ -49,7 +49,7 @@ diff --git a/src/modules/contact-center/modules/teams/modules/agents/components/opened-team-agent-popup.vue b/src/modules/contact-center/modules/teams/modules/agents/components/opened-team-agent-popup.vue index 432c2479c..3a90a1faf 100644 --- a/src/modules/contact-center/modules/teams/modules/agents/components/opened-team-agent-popup.vue +++ b/src/modules/contact-center/modules/teams/modules/agents/components/opened-team-agent-popup.vue @@ -5,7 +5,7 @@ @close="close" > diff --git a/src/app/composables/useCheckingUnsavedChanges.js b/src/app/composables/useCheckingUnsavedChanges.js index a04f93934..0847240f3 100644 --- a/src/app/composables/useCheckingUnsavedChanges.js +++ b/src/app/composables/useCheckingUnsavedChanges.js @@ -1,35 +1,35 @@ -import { ref, computed } from 'vue'; -import { useStore } from 'vuex'; -import getNamespacedState - from '@webitel/ui-sdk/src/store/helpers/getNamespacedState'; +import getNamespacedState from "@webitel/ui-sdk/src/store/helpers/getNamespacedState"; +import { computed, ref } from "vue"; +import { useStore } from "vuex"; export const useCheckingUnsavedChanges = (itemInstance) => { - const isConfirmationUnsavedChangesPopup = ref(false); + const isConfirmationUnsavedChangesPopup = ref(false); - function showConfirmationPopup(e) { - if (itemInstance.value._dirty) { - e.preventDefault(); - e.returnValue = ''; - } - } + function showConfirmationPopup(e) { + if (itemInstance.value._dirty) { + e.preventDefault(); + e.returnValue = ""; + } + } - function addCheckingUnsavedChanges() { - window.addEventListener('beforeunload', showConfirmationPopup); - } + function addCheckingUnsavedChanges() { + window.addEventListener("beforeunload", showConfirmationPopup); + } - function removeCheckingUnsavedChanges() { - window.removeEventListener('beforeunload', showConfirmationPopup); - } + function removeCheckingUnsavedChanges() { + window.removeEventListener("beforeunload", showConfirmationPopup); + } - function toggleIsConfirmationUnsavedChangesPopup() { - isConfirmationUnsavedChangesPopup.value = !isConfirmationUnsavedChangesPopup.value; - } + function toggleIsConfirmationUnsavedChangesPopup() { + isConfirmationUnsavedChangesPopup.value = + !isConfirmationUnsavedChangesPopup.value; + } - return { - isConfirmationUnsavedChangesPopup, + return { + isConfirmationUnsavedChangesPopup, - addCheckingUnsavedChanges, - removeCheckingUnsavedChanges, - toggleIsConfirmationUnsavedChangesPopup, - } -} + addCheckingUnsavedChanges, + removeCheckingUnsavedChanges, + toggleIsConfirmationUnsavedChangesPopup, + }; +}; diff --git a/src/app/composables/useDummy.js b/src/app/composables/useDummy.js index 3001e4479..e7a5c3216 100644 --- a/src/app/composables/useDummy.js +++ b/src/app/composables/useDummy.js @@ -1,52 +1,64 @@ -import IsEmpty from '@webitel/ui-sdk/src/scripts/isEmpty'; -import getNamespacedState - from '@webitel/ui-sdk/src/store/helpers/getNamespacedState'; -import { computed, ref, watch } from 'vue'; -import { useRoute } from 'vue-router'; -import { useStore } from 'vuex'; -import defaultDummyPicAfterSearchLight - from '../assets/dummy/adm-dummy-after-search-light.svg'; -import defaultDummyPicAfterSearchDark - from '../assets/dummy/adm-dummy-after-search-dark.svg'; +import IsEmpty from "@webitel/ui-sdk/src/scripts/isEmpty"; +import getNamespacedState from "@webitel/ui-sdk/src/store/helpers/getNamespacedState"; +import { computed, ref, watch } from "vue"; +import { useRoute } from "vue-router"; +import { useStore } from "vuex"; +import defaultDummyPicAfterSearchDark from "../assets/dummy/adm-dummy-after-search-dark.svg"; +import defaultDummyPicAfterSearchLight from "../assets/dummy/adm-dummy-after-search-light.svg"; export function useDummy({ - namespace, - showAction, - hiddenText, - dummyPic, - dummyText, - dummyPicAfterSearch, - dummyTextAfterSearch = 'objects.emptyResultSearch', - }) { - const store = useStore(); - const route = useRoute(); + namespace, + showAction, + hiddenText, + dummyPic, + dummyText, + dummyPicAfterSearch, + dummyTextAfterSearch = "objects.emptyResultSearch", +}) { + const store = useStore(); + const route = useRoute(); - const dummy = ref(''); + const dummy = ref(""); - const dataList = computed(() => getNamespacedState(store.state, namespace).dataList); - const search = computed(() => getNamespacedState(store.state, namespace).search); + const dataList = computed( + () => getNamespacedState(store.state, namespace).dataList, + ); + const search = computed( + () => getNamespacedState(store.state, namespace).search, + ); - const darkMode = computed(() => store.getters['appearance/DARK_MODE']); - const dummyImgAfterSearch = computed(() => { - if(dummyPicAfterSearch) return dummyPicAfterSearch; - return darkMode.value ? defaultDummyPicAfterSearchDark : defaultDummyPicAfterSearchLight; - }) + const darkMode = computed(() => store.getters["appearance/DARK_MODE"]); + const dummyImgAfterSearch = computed(() => { + if (dummyPicAfterSearch) return dummyPicAfterSearch; + return darkMode.value + ? defaultDummyPicAfterSearchDark + : defaultDummyPicAfterSearchLight; + }); - watch(() => dataList, () => { - if (!dataList.value.length) { - if (IsEmpty(route?.query) ? search.value : Object.values(route.query) - .some((query) => query.length)) { - return dummy.value = { - src: dummyImgAfterSearch, - text: dummyTextAfterSearch, - }; - } else return dummy.value = { - src: dummyPic, - text: dummyText, - showAction, - hiddenText, - }; - } else return dummy.value = ''; - }, { deep: true }); - return { dummy }; + watch( + () => dataList, + () => { + if (!dataList.value.length) { + if ( + IsEmpty(route?.query) + ? search.value + : Object.values(route.query).some((query) => query.length) + ) { + return (dummy.value = { + src: dummyImgAfterSearch, + text: dummyTextAfterSearch, + }); + } + return (dummy.value = { + src: dummyPic, + text: dummyText, + showAction, + hiddenText, + }); + } + return (dummy.value = ""); + }, + { deep: true }, + ); + return { dummy }; } diff --git a/src/app/locale/en/en.js b/src/app/locale/en/en.js index 07e03d681..0bd943054 100644 --- a/src/app/locale/en/en.js +++ b/src/app/locale/en/en.js @@ -1,1181 +1,1215 @@ /* eslint-disable quote-props */ -import { EngineCommunicationChannels, LoggerAction } from 'webitel-sdk'; +import { EngineCommunicationChannels, LoggerAction } from "webitel-sdk"; export default { - auth: { - register: 'Register', - login: 'Login', - registerReset: 'Reset password', - detailsSubtitle: 'Enter your details below', - resetPasswordLink: 'Forgot password?', - user: 'Username', - password: 'Password', - confirmPassword: 'Repeat password', - key: 'License key', - registerSubmit: 'Register', - resetSubmit: 'Reset', - loginSubmit: 'Log in', - carousel: { - title1: 'Cloud vs. On-Site', - text1: 'Security policy does not allow to store data and use cloud services? With Webitel, you can build a contact center on your site!', + auth: { + register: "Register", + login: "Login", + registerReset: "Reset password", + detailsSubtitle: "Enter your details below", + resetPasswordLink: "Forgot password?", + user: "Username", + password: "Password", + confirmPassword: "Repeat password", + key: "License key", + registerSubmit: "Register", + resetSubmit: "Reset", + loginSubmit: "Log in", + carousel: { + title1: "Cloud vs. On-Site", + text1: + "Security policy does not allow to store data and use cloud services? With Webitel, you can build a contact center on your site!", - title2: 'Multichannel VS Omni-Channel', - text2: 'Be always and everywhere in touch with your customers! IVR-menu of any complexity, outbound, inbound interaction campaigns or message on social networks - now it\'s easier than ever!', + title2: "Multichannel VS Omni-Channel", + text2: + "Be always and everywhere in touch with your customers! IVR-menu of any complexity, outbound, inbound interaction campaigns or message on social networks - now it's easier than ever!", - title3: 'Fault-tolerant infrastructure', - text3: 'No more unplanned downtime. Fast scaling and fault-tolerant architecture allows you to simultaneously serve more than 1000 customer calls per minute from different communication channels.', + title3: "Fault-tolerant infrastructure", + text3: + "No more unplanned downtime. Fast scaling and fault-tolerant architecture allows you to simultaneously serve more than 1000 customer calls per minute from different communication channels.", - title4: 'Design', - text4: 'The new minimalistic interface with the most user-friendly admin panel that allows you to have quick access to all the necessary functions. Less clicks - more features.', + title4: "Design", + text4: + "The new minimalistic interface with the most user-friendly admin panel that allows you to have quick access to all the necessary functions. Less clicks - more features.", - title5: 'New agent group work module', - text5: 'The most efficient call distribution. An agent can have several skills at once for participating in different campaigns. The client is served only by professionals.', + title5: "New agent group work module", + text5: + "The most efficient call distribution. An agent can have several skills at once for participating in different campaigns. The client is served only by professionals.", - title6: 'Setting Permissions', - text6: 'New permissions management module - new opportunities for control. Users can make changes only to sections, as well as to actions.', - }, - }, + title6: "Setting Permissions", + text6: + "New permissions management module - new opportunities for control. Users can make changes only to sections, as well as to actions.", + }, + }, - header: { - logout: 'Logout', - docs: 'Docs', - }, + header: { + logout: "Logout", + docs: "Docs", + }, - appNavigator: { - title: 'Webitel applications', - admin: 'Admin', - agent: 'Agent Workspace', - supervisor: 'Supervisor Workspace', - audit: 'Audit', - history: 'Call History', - grafana: 'Grafana', - }, + appNavigator: { + title: "Webitel applications", + admin: "Admin", + agent: "Agent Workspace", + supervisor: "Supervisor Workspace", + audit: "Audit", + history: "Call History", + grafana: "Grafana", + }, - settings: { - settings: 'Setting | Settings', - changePassword: 'Change password', - language: 'Language', - webPhone: 'WebPhone', - useWebPhone: 'Use WebPhone', - useStun: 'Use STUN', - }, + settings: { + settings: "Setting | Settings", + changePassword: "Change password", + language: "Language", + webPhone: "WebPhone", + useWebPhone: "Use WebPhone", + useStun: "Use STUN", + }, - validation: { - email: 'Should look email-like', - required: 'This field is required', - sameAs: 'Incorrect password', - gatewayHostValidator: 'Should look like IPv4 or FQDN', - ipValidator: 'Should look like IPv4', - macValidator: 'Should look like MAC', - minValue: 'Value should be at least', - maxValue: 'Value should be not much', - numeric: 'Should be numeric', - requiredArrayValue: 'Array should not be empty', - isPositiveValue: 'Value should be positive number', - cron: 'Invalid cron expression', - }, + validation: { + email: "Should look email-like", + required: "This field is required", + sameAs: "Incorrect password", + gatewayHostValidator: "Should look like IPv4 or FQDN", + ipValidator: "Should look like IPv4", + macValidator: "Should look like MAC", + minValue: "Value should be at least", + maxValue: "Value should be not much", + numeric: "Should be numeric", + requiredArrayValue: "Array should not be empty", + isPositiveValue: "Value should be positive number", + cron: "Invalid cron expression", + }, - nav: { - directory: { - directory: 'Directory', - }, - routing: { - routing: 'Routing', - }, - lookups: { - lookups: 'Lookups', - }, - ccenter: { - ccenter: 'Contact center', - }, - integrations: { - integrations: 'Integrations', - }, - permissions: { - permissions: 'Permissions', - }, - system: { - system: 'System', - }, - }, + nav: { + directory: { + directory: "Directory", + }, + routing: { + routing: "Routing", + }, + lookups: { + lookups: "Lookups", + }, + ccenter: { + ccenter: "Contact center", + }, + integrations: { + integrations: "Integrations", + }, + permissions: { + permissions: "Permissions", + }, + system: { + system: "System", + }, + }, - home: { - dashboard: 'Dashboard', - welcomeText: '', - news: 'News', - }, + home: { + dashboard: "Dashboard", + welcomeText: "", + news: "News", + }, - objects: { - all: 'All {entity}', - administration: 'Administration', - general: 'General', - new: 'New', - add: 'Add', - create: 'Create', - read: 'Read', - edit: 'Edit', - delete: 'Delete', - save: 'Save', - saved: 'Saved', - saveAs: 'Save as', - close: 'Close', - next: 'Next', - back: 'Back', - change: 'Change', - name: 'Name', - title: 'Title', - description: 'Description', - user: 'User', - users: 'Users', - action: 'Action', - allow: 'Allow', - password: 'Password', - history: 'History', - copy: 'Copy', - copied: 'Copied to clipboard!', - createdAt: 'Created', - createdBy: 'Created by', - importCSV: 'Import CSV', - online: 'Online', - offline: 'Offline', - on: 'On', - off: 'Off', - ok: 'Ok', - enabled: 'Enabled', - status: 'Status', - from: 'From', - to: 'To', - importJSON: 'Import JSON', - addNew: 'Add new', - provider: 'Provider', - default: 'Default', - service: 'Service', - tts: 'Text-to-Speech', - stt: 'Speech-to-Text', - key: 'Key', - ID: 'ID', - email: 'Email address', - updatedAt: 'Modified', - emptyWorkspace: 'There are no records yet', - emptyResultSearch: 'Your search yielded no results', + objects: { + all: "All {entity}", + administration: "Administration", + general: "General", + new: "New", + add: "Add", + create: "Create", + read: "Read", + edit: "Edit", + delete: "Delete", + save: "Save", + saved: "Saved", + saveAs: "Save as", + close: "Close", + next: "Next", + back: "Back", + change: "Change", + name: "Name", + title: "Title", + description: "Description", + user: "User", + users: "Users", + action: "Action", + allow: "Allow", + password: "Password", + history: "History", + copy: "Copy", + copied: "Copied to clipboard!", + createdAt: "Created", + createdBy: "Created by", + importCSV: "Import CSV", + online: "Online", + offline: "Offline", + on: "On", + off: "Off", + ok: "Ok", + enabled: "Enabled", + status: "Status", + from: "From", + to: "To", + importJSON: "Import JSON", + addNew: "Add new", + provider: "Provider", + default: "Default", + service: "Service", + tts: "Text-to-Speech", + stt: "Speech-to-Text", + key: "Key", + ID: "ID", + email: "Email address", + updatedAt: "Modified", + emptyWorkspace: "There are no records yet", + emptyResultSearch: "Your search yielded no results", - deleteConfirmation: { - title: 'Confirm deletion', - askingAlert: 'Are you sure you want to delete {count} item? | Are you sure you want to delete {count} items?', - undoneActionAlert: 'This action cannot be undone.', - deleteAll: 'ALL', - }, - CSV: { - skipHeaders: 'Skip headers', - charSet: 'Char set', - separator: 'Separator', - CSVColumn: 'CSV column', - fieldName: 'Field name', - clearMember: 'Clear member', - }, - generalInfo: 'General info', - objectHeader: {}, - directory: { - directory: 'Directory', - passwordInfo: 'Enter value only if you want to edit it (or create a new one). The empty field will leave the value unchanged', - users: { - users: 'User | Users', - allUsers: 'All users', - searchPlaceholder: 'Name, login, extensions, status', - login: 'Login', - extensions: 'Extensions', - state: 'State', - DnD: 'DnD', - status: 'Status', - roles: 'Roles', - tokens: 'Tokens', - usage: 'Usage', - roleAdmin: 'Admin', - license: 'License', - devices: 'Devices', - defaultDevice: 'Default device (from list of selected devices)', - deviceNotFound: 'Didn\'t find the device?', - createNewDevice: 'Add new', - variables: 'Variables', - varKey: 'Key', - varVal: 'Value', - token: 'Token | Tokens', - tokenPopupHeader: 'Your token key has been created successfully!', - tokenPopupText: 'Download your key file now or copy it. If you do not download the key file now, you will not be able to retrieve your token key again. To help protect your security, store your token key securely and do not share it.', - tokenPopupCopy: 'Copy to clipboard', - tokenPopupSave: 'Save as TXT', - userIp: 'User IP', - userId: 'User ID', - download: 'Download', - regenerate: 'Regenerate', - askingAlert: 'Are you sure you want to regenerate the code? The user won’t be able to log in', - }, - license: { - customers: 'Customers', - license: 'License | Licenses', - licenseId: 'ID', - allCustomers: 'All customers', - allLicenses: 'All licenses', - serial: 'Serial', - product: 'Product', - validFrom: 'Valid from', - validTill: 'Valid till', - used: 'Used', - limit: 'Limit', - status: 'Status', - competitive: 'Competitive', - searchPlaceholder: 'Serial, product', - domain: 'Domain', - daysToExpire: { - '0': 'Expired', - '30': '30 or less', - '90': '90 or less', - days: ' days', - }, - importLicense: 'Import license', - licenseKey: 'License key', - }, - devices: { - devices: 'Device | Devices', - newDevice: 'New device', - newDeviceDescription: 'New device description', - allDevices: 'All devices', - searchPlaceholder: 'Name, user, auth ID & desk ID', - authId: 'Auth ID', - presence: 'Presence', - hotdesk: 'Hot desking', - hotdeskDevice: 'Hot desking device', - hotdeskDeviceSettings: 'Hot desking device settings', - hotdeskIncorrectInput: 'Incorrect Host Name', - hotdeskInputHint: 'To make it easier to identify this device, you should cover it with friendly hot-desk aliases. Valid name must contain following characters: A-Z, a-z, 0-9, -, _', - deviceSettings: 'Device settings', - hostName: 'Host Name', - phoneInfo: 'Phone info', - phone: 'Phone', - vendor: 'Vendor', - model: 'Model', - ipv4: 'IPv4', - mac: 'MAC', - deviceHistory: 'Device history', - loggedIn: 'Logged In', - loggedOut: 'Logged Out', - state: { - nonreg: 'Not registered', - reged: 'Registered', - ringing: 'Ringing', - dialing: 'Dialing', - dialog: 'Dialog', - onhold: 'On hold', - }, - passwordSetFromAccount: 'If you won\'t set password, it would be the same as account', - }, - }, - permissions: { - permissions: 'Permissions', - permissionsRole: 'Role | Roles', - allRoles: 'All roles', - searchPlaceholder: 'role ..', - roles: { - permissions: { - permissions: 'Role permission | Role permissions', - add: 'Add', - delete: 'Delete', - read: 'Select', - write: 'Update', - eavesdropCall: 'Eavesdrop call', - playbackRecordFile: 'Playback record file', - exportDataGrid: 'Export data grid', - viewCdrPhoneNumbers: 'View CDR phone numbers', - manageUserRoles: 'Manage user roles', - manageUserLicense: 'Manage user license', - changeUserPassword: 'Change user password', - systemSetting: 'Manage system configurations', - addDescription: 'Grants permission to create any objects', - deleteDescription: 'Grants permission to remove any objects', - readDescription: 'Grants permission to select any objects', - writeDescription: 'Grants permission to modify any objects', - eavesdropCallDescription: 'Grants permission to eavesdrop on an active conversation', - playbackRecordFileDescription: 'Grants permission to playback call-record files', - exportDataGridDescription: 'Grants permission to export data grid to a file', - viewCdrPhoneNumbersDescription: 'View CDR phone numbers', - manageUserRolesDescription: 'Grants permission to manage a set of user roles', - manageUserLicenseDescription: 'Grants permission to manage a set of user license', - changeUserPasswordDescription: 'Grants permission to change the users password', - systemSettingDescription: 'Grants permission to access and manage the Configuration section', - schemeVariables: 'Manage global variables', - schemeVariablesDescription: 'Grants permission to access and manage the Global variables section', - }, - addPermission: 'Add role permission', - usage: 'Usage', - applicationsAccess: { - applicationsAccess: 'Application access | Applications access', - access: 'Access', - }, - }, - object: { - object: 'Objects', - allObjects: 'All objects', - ObAC: 'Managed by operations', - RbAC: 'Managed by records', - operations: 'Operations', - searchPlaceholder: 'object ..', - newPermissionRole: 'New grantee', - rbacDefault: 'Default Record based Access', - grantor: 'Grantor', - grantee: 'Grantee', - create: 'Create', - delete: 'Delete', - accessMode: { - '1': 'Forbidden', - '2': 'Allow', - '3': 'Allow with delegation', - }, - }, - }, - lookups: { - lookups: 'Lookups', - skills: { - skills: 'Skill | Skills', - capacity: 'Capacity', - minCapacity: 'Min capacity', - minCapacityLessOrEqualToMaxCapacityValidator: 'Should be less or equal to Max capacity', - maxCapacity: 'Max capacity', - maxCapacityMoreOrEqualToMinCapacityValidator: 'Should be more or equal to Min capacity', - lvl: 'Level', - agentSkills: 'Agent skill | Agent skills', - allSkills: 'All skills', - state: 'State', - stateForAll: 'State for all', - changeSkillTo: 'Change skill to', - changeAgentsSkill: 'Change agent`s skill', - totalAgents: 'Total agents', - activeSkillAgents: 'Active skill agents', - assignSkillToAgents: 'Assign skill to agents', - assignAgent: 'Assign agent', - selectCapacityAndState: 'Select capacity and state', - }, - buckets: { - buckets: 'Bucket | Buckets', - allBuckets: 'All buckets', - addBucket: 'Add bucket', - }, - blacklist: { - blacklist: 'List | Lists', - allBlacklists: 'All lists', - number: 'Number | Numbers', - newNumber: 'New number', - numbersCount: 'Numbers', - expireAt: 'Expire', - temporary: 'Temporary', - }, - media: { - mediaFiles: 'Media file | Media files', - allMediaFiles: 'All media files', - createdAt: 'Created', - format: 'Format', - size: 'Size', - textToSpeech: 'Text to speech', - popupSettings: 'Settings', - lang: 'Language', - voice: 'Voice', - token: 'Token', - key: 'Key', - dragPlaceholder: 'Drag and drop files', - dragPlaceholderHere: 'here.', - tts: { - hint: 'Create an audio file', - textType: { - textType: 'Text type', - ssml: 'SSML', - }, - }, - }, - regions: { - regions: 'Location | Locations', - allRegions: 'All locations', - }, - timezone: { - timezone: 'Timezone | Timezones', - }, - calendars: { - calendars: 'Calendar | Calendars', - allCalendars: 'All calendars', - searchPlaceholder: 'Name, description...', - timezone: 'Timezone', - start: 'Start', - end: 'End', - workWeek: 'Working week', - holidays: 'Holiday | Holidays', - date: 'Date', - repeat: 'Repeat', - fulltime: 'Temporary', - everyYear: 'Repeat every year', - newHoliday: 'New holiday', - mon: 'Monday', - tue: 'Tuesday', - wed: 'Wednesday', - thu: 'Thursday', - fri: 'Friday', - sat: 'Saturday', - sun: 'Sunday', - workingTime: 'Working time', - workStart: 'Working time start', - workStop: 'Working time end', - }, - communications: { - communications: 'Communication type | Communication types', - allCommunications: 'All communication types', - addCommunication: 'Add communication', - code: 'Code', - channels: { - [EngineCommunicationChannels.Phone]: 'Phone', - [EngineCommunicationChannels.Email]: 'Email', - [EngineCommunicationChannels.Messaging]: 'Messaging', - }, - }, - pauseCause: { - pauseCause: 'Agent statuses', - allPauseCause: 'All agent pause causes', - limit: 'Limit (min)', - min: 'min', - allowAdmin: 'Admin can change this status', - allowSupervisor: 'Supervisor can change this status', - allowAgent: 'Agent can change this status', - }, - }, - routing: { - routing: 'Routing', - ip: 'IP', - protocol: 'Protocol', - port: 'Port', - configuration: 'Configuration', - schema: 'Flow schema', - json: 'JSON', + deleteConfirmation: { + title: "Confirm deletion", + askingAlert: + "Are you sure you want to delete {count} item? | Are you sure you want to delete {count} items?", + undoneActionAlert: "This action cannot be undone.", + deleteAll: "ALL", + }, + CSV: { + skipHeaders: "Skip headers", + charSet: "Char set", + separator: "Separator", + CSVColumn: "CSV column", + fieldName: "Field name", + clearMember: "Clear member", + }, + generalInfo: "General info", + objectHeader: {}, + directory: { + directory: "Directory", + passwordInfo: + "Enter value only if you want to edit it (or create a new one). The empty field will leave the value unchanged", + users: { + users: "User | Users", + allUsers: "All users", + searchPlaceholder: "Name, login, extensions, status", + login: "Login", + extensions: "Extensions", + state: "State", + DnD: "DnD", + status: "Status", + roles: "Roles", + tokens: "Tokens", + usage: "Usage", + roleAdmin: "Admin", + license: "License", + devices: "Devices", + defaultDevice: "Default device (from list of selected devices)", + deviceNotFound: "Didn't find the device?", + createNewDevice: "Add new", + variables: "Variables", + varKey: "Key", + varVal: "Value", + token: "Token | Tokens", + tokenPopupHeader: "Your token key has been created successfully!", + tokenPopupText: + "Download your key file now or copy it. If you do not download the key file now, you will not be able to retrieve your token key again. To help protect your security, store your token key securely and do not share it.", + tokenPopupCopy: "Copy to clipboard", + tokenPopupSave: "Save as TXT", + userIp: "User IP", + userId: "User ID", + download: "Download", + regenerate: "Regenerate", + askingAlert: + "Are you sure you want to regenerate the code? The user won’t be able to log in", + }, + license: { + customers: "Customers", + license: "License | Licenses", + licenseId: "ID", + allCustomers: "All customers", + allLicenses: "All licenses", + serial: "Serial", + product: "Product", + validFrom: "Valid from", + validTill: "Valid till", + used: "Used", + limit: "Limit", + status: "Status", + competitive: "Competitive", + searchPlaceholder: "Serial, product", + domain: "Domain", + daysToExpire: { + 0: "Expired", + 30: "30 or less", + 90: "90 or less", + days: " days", + }, + importLicense: "Import license", + licenseKey: "License key", + }, + devices: { + devices: "Device | Devices", + newDevice: "New device", + newDeviceDescription: "New device description", + allDevices: "All devices", + searchPlaceholder: "Name, user, auth ID & desk ID", + authId: "Auth ID", + presence: "Presence", + hotdesk: "Hot desking", + hotdeskDevice: "Hot desking device", + hotdeskDeviceSettings: "Hot desking device settings", + hotdeskIncorrectInput: "Incorrect Host Name", + hotdeskInputHint: + "To make it easier to identify this device, you should cover it with friendly hot-desk aliases. Valid name must contain following characters: A-Z, a-z, 0-9, -, _", + deviceSettings: "Device settings", + hostName: "Host Name", + phoneInfo: "Phone info", + phone: "Phone", + vendor: "Vendor", + model: "Model", + ipv4: "IPv4", + mac: "MAC", + deviceHistory: "Device history", + loggedIn: "Logged In", + loggedOut: "Logged Out", + state: { + nonreg: "Not registered", + reged: "Registered", + ringing: "Ringing", + dialing: "Dialing", + dialog: "Dialog", + onhold: "On hold", + }, + passwordSetFromAccount: + "If you won't set password, it would be the same as account", + }, + }, + permissions: { + permissions: "Permissions", + permissionsRole: "Role | Roles", + allRoles: "All roles", + searchPlaceholder: "role ..", + roles: { + permissions: { + permissions: "Role permission | Role permissions", + add: "Add", + delete: "Delete", + read: "Select", + write: "Update", + eavesdropCall: "Eavesdrop call", + playbackRecordFile: "Playback record file", + exportDataGrid: "Export data grid", + viewCdrPhoneNumbers: "View CDR phone numbers", + manageUserRoles: "Manage user roles", + manageUserLicense: "Manage user license", + changeUserPassword: "Change user password", + systemSetting: "Manage system configurations", + addDescription: "Grants permission to create any objects", + deleteDescription: "Grants permission to remove any objects", + readDescription: "Grants permission to select any objects", + writeDescription: "Grants permission to modify any objects", + eavesdropCallDescription: + "Grants permission to eavesdrop on an active conversation", + playbackRecordFileDescription: + "Grants permission to playback call-record files", + exportDataGridDescription: + "Grants permission to export data grid to a file", + viewCdrPhoneNumbersDescription: "View CDR phone numbers", + manageUserRolesDescription: + "Grants permission to manage a set of user roles", + manageUserLicenseDescription: + "Grants permission to manage a set of user license", + changeUserPasswordDescription: + "Grants permission to change the users password", + systemSettingDescription: + "Grants permission to access and manage the Configuration section", + schemeVariables: "Manage global variables", + schemeVariablesDescription: + "Grants permission to access and manage the Global variables section", + }, + addPermission: "Add role permission", + usage: "Usage", + applicationsAccess: { + applicationsAccess: "Application access | Applications access", + access: "Access", + }, + }, + object: { + object: "Objects", + allObjects: "All objects", + ObAC: "Managed by operations", + RbAC: "Managed by records", + operations: "Operations", + searchPlaceholder: "object ..", + newPermissionRole: "New grantee", + rbacDefault: "Default Record based Access", + grantor: "Grantor", + grantee: "Grantee", + create: "Create", + delete: "Delete", + accessMode: { + 1: "Forbidden", + 2: "Allow", + 3: "Allow with delegation", + }, + }, + }, + lookups: { + lookups: "Lookups", + skills: { + skills: "Skill | Skills", + capacity: "Capacity", + minCapacity: "Min capacity", + minCapacityLessOrEqualToMaxCapacityValidator: + "Should be less or equal to Max capacity", + maxCapacity: "Max capacity", + maxCapacityMoreOrEqualToMinCapacityValidator: + "Should be more or equal to Min capacity", + lvl: "Level", + agentSkills: "Agent skill | Agent skills", + allSkills: "All skills", + state: "State", + stateForAll: "State for all", + changeSkillTo: "Change skill to", + changeAgentsSkill: "Change agent`s skill", + totalAgents: "Total agents", + activeSkillAgents: "Active skill agents", + assignSkillToAgents: "Assign skill to agents", + assignAgent: "Assign agent", + selectCapacityAndState: "Select capacity and state", + }, + buckets: { + buckets: "Bucket | Buckets", + allBuckets: "All buckets", + addBucket: "Add bucket", + }, + blacklist: { + blacklist: "List | Lists", + allBlacklists: "All lists", + number: "Number | Numbers", + newNumber: "New number", + numbersCount: "Numbers", + expireAt: "Expire", + temporary: "Temporary", + }, + media: { + mediaFiles: "Media file | Media files", + allMediaFiles: "All media files", + createdAt: "Created", + format: "Format", + size: "Size", + textToSpeech: "Text to speech", + popupSettings: "Settings", + lang: "Language", + voice: "Voice", + token: "Token", + key: "Key", + dragPlaceholder: "Drag and drop files", + dragPlaceholderHere: "here.", + tts: { + hint: "Create an audio file", + textType: { + textType: "Text type", + ssml: "SSML", + }, + }, + }, + regions: { + regions: "Location | Locations", + allRegions: "All locations", + }, + timezone: { + timezone: "Timezone | Timezones", + }, + calendars: { + calendars: "Calendar | Calendars", + allCalendars: "All calendars", + searchPlaceholder: "Name, description...", + timezone: "Timezone", + start: "Start", + end: "End", + workWeek: "Working week", + holidays: "Holiday | Holidays", + date: "Date", + repeat: "Repeat", + fulltime: "Temporary", + everyYear: "Repeat every year", + newHoliday: "New holiday", + mon: "Monday", + tue: "Tuesday", + wed: "Wednesday", + thu: "Thursday", + fri: "Friday", + sat: "Saturday", + sun: "Sunday", + workingTime: "Working time", + workStart: "Working time start", + workStop: "Working time end", + }, + communications: { + communications: "Communication type | Communication types", + allCommunications: "All communication types", + addCommunication: "Add communication", + code: "Code", + channels: { + [EngineCommunicationChannels.Phone]: "Phone", + [EngineCommunicationChannels.Email]: "Email", + [EngineCommunicationChannels.Messaging]: "Messaging", + }, + }, + pauseCause: { + pauseCause: "Agent statuses", + allPauseCause: "All agent pause causes", + limit: "Limit (min)", + min: "min", + allowAdmin: "Admin can change this status", + allowSupervisor: "Supervisor can change this status", + allowAgent: "Agent can change this status", + }, + }, + routing: { + routing: "Routing", + ip: "IP", + protocol: "Protocol", + port: "Port", + configuration: "Configuration", + schema: "Flow schema", + json: "JSON", - flow: { - flow: 'Flow schema | Flow schemas', - allFlowSchemas: 'All flow schemas', - createFlowSelectionPopup: 'Create new flow', - createNew: 'Create new?', - editor: 'Editor', - diagram: { - diagram: 'Diagram', - description: 'Create new flow using Webitel Flow Diagram tool', - }, - code: { - code: 'Code', - description: 'Create new flow using JSON-schema in code editor', - }, - askingAlert: 'Do you want to save the changes you made to "{name}" ?', - }, + flow: { + flow: "Flow schema | Flow schemas", + allFlowSchemas: "All flow schemas", + createFlowSelectionPopup: "Create new flow", + createNew: "Create new?", + editor: "Editor", + diagram: { + diagram: "Diagram", + description: "Create new flow using Webitel Flow Diagram tool", + }, + code: { + code: "Code", + description: "Create new flow using JSON-schema in code editor", + }, + askingAlert: 'Do you want to save the changes you made to "{name}" ?', + }, - dialplan: { - dialplan: 'Dialplans', - dialplanRules: 'Dialplan rules', - pattern: 'Destination number', - dialplanRule: 'Dialplan rule', - position: 'Position', - }, + dialplan: { + dialplan: "Dialplans", + dialplanRules: "Dialplan rules", + pattern: "Destination number", + dialplanRule: "Dialplan rule", + position: "Position", + }, - chatplan: { - chatplan: 'Chatplan | Chatplans', - allChatplans: 'All chatplans', - }, + chatplan: { + chatplan: "Chatplan | Chatplans", + allChatplans: "All chatplans", + }, - gateways: { - gateways: 'Gateway | Gateways', - allGateways: 'All gateways', - trunkingGateway: 'Trunking gateway', - registerGateway: 'Register gateway', - stateSuccess: 'Success', - stateFailed: 'Failed', - stateProgress: 'In progress', - stateNonreg: 'Not registered', - proxy: 'Proxy', - searchPlaceholder: 'gateway search...', - host: 'Host', - trunkingACLTitle: 'Access Control', - trunkingACL: 'Trunking access control list', - hostnameTrunking: 'Server/Gateway Hostname or IP', - hostnameRegister: 'Registrar/Server/Gateway Hostname or IP', - expire: 'Expire', - authID: 'Username', - account: 'Account', - outboundProxy: 'Outbound Proxy Hostname or IP', - newGateway: 'New gateway', - newGatewayDescription: 'New gateway description', - SIPregistrations: 'SIP Registration', - SIPregistrationsDescription: 'SIP registration description', - SIPtrunking: 'SIP Trunking', - SIPtrunkingDescription: 'SIP trunking description', + gateways: { + gateways: "Gateway | Gateways", + allGateways: "All gateways", + trunkingGateway: "Trunking gateway", + registerGateway: "Register gateway", + stateSuccess: "Success", + stateFailed: "Failed", + stateProgress: "In progress", + stateNonreg: "Not registered", + proxy: "Proxy", + searchPlaceholder: "gateway search...", + host: "Host", + trunkingACLTitle: "Access Control", + trunkingACL: "Trunking access control list", + hostnameTrunking: "Server/Gateway Hostname or IP", + hostnameRegister: "Registrar/Server/Gateway Hostname or IP", + expire: "Expire", + authID: "Username", + account: "Account", + outboundProxy: "Outbound Proxy Hostname or IP", + newGateway: "New gateway", + newGatewayDescription: "New gateway description", + SIPregistrations: "SIP Registration", + SIPregistrationsDescription: "SIP registration description", + SIPtrunking: "SIP Trunking", + SIPtrunkingDescription: "SIP trunking description", + }, + chatGateways: { + templates: { + templates: "Templates", + title: "Workspace member's name", + close: "Chat complete message", + join: "Agent joining message", + left: "Agent disconnection message", + }, + chatGateways: "Chat gateway | Chat gateways", + allChatGateways: "All chat gateways", + telegramBot: { + telegramBot: "Telegram Bot", + }, + telegramApp: { + telegramApp: "Telegram App", + signedAs: "You're signed as", + joinTelegram: "Sign in to Telegram", + metadata: { + apiId: "API id", + apiHash: "API hash", + }, + }, + infobip: { + infobip: "Infobip", + }, + messenger: { + meta: "Meta", + addOrRemovePages: "Add or remove pages", + accounts: "Accounts", + metadata: { + clientId: "App ID", + clientSecret: "App Secret", + }, + facebook: { + pages: "Facebook pages", + subscription: "Webhook subscription", + }, + instagram: { + instagram: "Instagram", + comments: "Track comments", + mentions: "Track mentions", + }, + whatsapp: { + whatsapp: "Whatsapp", + token: "Token", + status: "Status", + number: "Phone number", + review: "Review", + }, + }, + viber: { + viber: "Viber", + style: { + style: "Style", + btnBackColor: "Button background color", + btnFontColor: "Button font color", + }, + }, + webchat: { + webchat: "Web chat", + copyCode: "Copy code for site", + copyCodeHint: + "You must regenerate and reinsert Widget code to website each time after Widget settings modification", + metadata: { + mediaMaxSize: "Max media size (Mb)", + }, + view: { + view: "View", + borderRadius: "Button Shape", + language: "Language", + position: "Position", + btnColor: "Button Color", + logoUrl: "Logo URL", + logoHint: "Supported logo format is 'JPEG' or 'PNG', 24x24px", + rounded: "Rounded", + square: "Square", + right: "Right", + left: "Left", + static: "Static", + }, + recaptcha: { + recaptcha: "reCAPTCHA", + sitekey: "Site key", + secret: "Secret key", + threshold: "Threshold", + showFlag: "Show reCAPTCHA badge", + }, + chat: { + chat: "Chat", + openTimeout: "Open Timeout", + openTimeoutSec: "Open Timeout Sec", + }, + appointment: { + appointment: "Appointment", + days: "Days", + availableAgents: "Available agents", + showEmailField: "Show email field", + showMessageField: "Show message field", + resultPageText: "Result page text", + headingText: "Heading text", + subheadingText: "Subheading text", + showDefaultHeading: + "Show default heading and subheading on result page", + }, + alternativeChannels: { + alternativeChannels: "Alternative Channels", + title: "Messaging channels", + email: "Email", + whatsapp: "WhatsApp", + telegram: "Telegram", + messenger: "Messenger", + }, + call: { + title: "Online call", + url: "WebSocket Endpoint", + }, + }, + customChat: { + customChat: "Custom Chat", + customChatGateway: "Custom Chat Gateway", + appSecretHint: "Altering this field will interrupt the integration", + metadata: { + appSecret: "App Secret", + callback: "Callback", + }, + }, + uri: "URI", + newChatGateway: "New chat gateway", + metadata: { + apiKey: "Api Key", + number: "Number", + baseUrl: "Base URL", + sendApi: "Send API", + allowOrigin: "Allow Origin", + readTimeout: "Read Timeout (sec)", + writeTimeout: "Write Timeout (sec)", + handshakeTimeout: "Handshake Timeout (sec)", + messageSize: "Message Size max (bytes)", + botName: "Bot Name", + eventTypes: "Event Types", + telegramToken: "Telegram BOT API Token", + messengerApiUrl: "Messenger API URL", + }, + }, - }, - chatGateways: { - templates: { - templates: 'Templates', - title: 'Workspace member\'s name', - close: 'Chat complete message', - join: 'Agent joining message', - left: 'Agent disconnection message', - }, - chatGateways: 'Chat gateway | Chat gateways', - allChatGateways: 'All chat gateways', - telegramBot: { - telegramBot: 'Telegram Bot', - }, - telegramApp: { - telegramApp: 'Telegram App', - signedAs: 'You\'re signed as', - joinTelegram: 'Sign in to Telegram', - metadata: { - apiId: 'API id', - apiHash: 'API hash', - }, - }, - infobip: { - infobip: 'Infobip', - }, - messenger: { - meta: 'Meta', - addOrRemovePages: 'Add or remove pages', - accounts: 'Accounts', - metadata: { - clientId: 'App ID', - clientSecret: 'App Secret', - }, - facebook: { - pages: 'Facebook pages', - subscription: 'Webhook subscription', - }, - instagram: { - instagram: 'Instagram', - comments: 'Track comments', - mentions: 'Track mentions', - }, - whatsapp: { - whatsapp: 'Whatsapp', - token: 'Token', - status: 'Status', - number: 'Phone number', - review: 'Review', - }, - }, - viber: { - viber: 'Viber', - style: { - style: 'Style', - btnBackColor: 'Button background color', - btnFontColor: 'Button font color', - }, - }, - webchat: { - webchat: 'Web chat', - copyCode: 'Copy code for site', - copyCodeHint: 'You must regenerate and reinsert Widget code to website each time after Widget settings modification', - metadata: { - mediaMaxSize: 'Max media size (Mb)', - }, - view: { - view: 'View', - borderRadius: 'Button Shape', - language: 'Language', - position: 'Position', - btnColor: 'Button Color', - logoUrl: 'Logo URL', - logoHint: 'Supported logo format is \'JPEG\' or \'PNG\', 24x24px', - rounded: 'Rounded', - square: 'Square', - right: 'Right', - left: 'Left', - static: 'Static', - }, - recaptcha: { - recaptcha: 'reCAPTCHA', - sitekey: 'Site key', - secret: 'Secret key', - threshold: 'Threshold', - showFlag: 'Show reCAPTCHA badge', - }, - chat: { - chat: 'Chat', - openTimeout: 'Open Timeout', - openTimeoutSec: 'Open Timeout Sec', - }, - appointment: { - appointment: 'Appointment', - days: 'Days', - availableAgents: 'Available agents', - showEmailField: 'Show email field', - showMessageField: 'Show message field', - resultPageText: 'Result page text', - headingText: 'Heading text', - subheadingText: 'Subheading text', - showDefaultHeading: 'Show default heading and subheading on result page', - }, - alternativeChannels: { - alternativeChannels: 'Alternative Channels', - title: 'Messaging channels', - email: 'Email', - whatsapp: 'WhatsApp', - telegram: 'Telegram', - messenger: 'Messenger', - }, - call: { - title: 'Online call', - url: 'WebSocket Endpoint', - }, - }, - customChat: { - customChat: 'Custom Chat', - customChatGateway: 'Custom Chat Gateway', - appSecretHint: 'Altering this field will interrupt the integration', - metadata: { - appSecret: 'App Secret', - callback: 'Callback', - }, - }, - uri: 'URI', - newChatGateway: 'New chat gateway', - metadata: { - apiKey: 'Api Key', - number: 'Number', - baseUrl: 'Base URL', - sendApi: 'Send API', - allowOrigin: 'Allow Origin', - readTimeout: 'Read Timeout (sec)', - writeTimeout: 'Write Timeout (sec)', - handshakeTimeout: 'Handshake Timeout (sec)', - messageSize: 'Message Size max (bytes)', - botName: 'Bot Name', - eventTypes: 'Event Types', - telegramToken: 'Telegram BOT API Token', - messengerApiUrl: 'Messenger API URL', - }, - }, + callflow: { + callflow: "Callflow", + }, + }, - callflow: { - callflow: 'Callflow', - }, - }, + ccenter: { + ccenter: "Contact center", - ccenter: { - ccenter: 'Contact center', + agents: { + agents: "Agent | Agents", + supervisors: "Supervisor | Supervisors", + admins: "Admin | Admins", + subordinates: "Subordinate agent | Subordinate agents", + allAgents: "All agents", + progressiveCount: "Progressive call count", + chatCount: "Chat count", + taskCount: "Task count", + state: "Status", + isSupervisor: "Supervisor", + stateTime: "Status time", + addSkill: "Add skill", + statusHistory: "State history", + historyState: "State", + payload: "Cause", + addSubordinate: "Add subordinate agent", + historyChannel: "Channel", + historyFrom: "From", + historyTo: "To", + historyDuration: "Duration", + emptyPopup: "Please check the filters query", + status: { + online: "Online", + offline: "Offline", + pause: "Pause", + breakOut: "Break Out", + }, + }, - agents: { - agents: 'Agent | Agents', - supervisors: 'Supervisor | Supervisors', - admins: 'Admin | Admins', - subordinates: 'Subordinate agent | Subordinate agents', - allAgents: 'All agents', - progressiveCount: 'Progressive call count', - chatCount: 'Chat count', - taskCount: 'Task count', - state: 'Status', - isSupervisor: 'Supervisor', - stateTime: 'Status time', - addSkill: 'Add skill', - statusHistory: 'State history', - historyState: 'State', - payload: 'Cause', - addSubordinate: 'Add subordinate agent', - historyChannel: 'Channel', - historyFrom: 'From', - historyTo: 'To', - historyDuration: 'Duration', - emptyPopup: 'Please check the filters query', - status: { - online: 'Online', - offline: 'Offline', - pause: 'Pause', - breakOut: 'Break Out', - }, - }, + auditors: { + auditors: "Auditor | Auditors", + }, - auditors: { - auditors: 'Auditor | Auditors', - }, + teams: { + teams: "Team | Teams", + allTeams: "All teams", + strategy: "Strategy", + parameters: "Parameters", + maxNoAnswer: "Max count of missed activities", + callTimeout: "Call accept timeout", + inviteChatTimeout: "Chat accept timeout", + wrapUpTime: "Wrap up time", + noAnswerDelayTime: "Delay time after missed activity", + taskAcceptTimeout: "Task accept timeout", + strategies: { + random: "Random", + fewestCalls: "Agent with fewest calls", + leastTalkTime: "Agent with least talk time", + topDown: "Top down", + roundRobin: "Round robin", + roundRobinBucket: "Round robin bucket", + longestIdleAgent: "Agent with longest idle time", + skillCapacity: "By skill level", + }, + hooks: { + eventTypes: { + agentStatus: "Agent status changed", + }, + }, + flows: { + addFlowSchema: "Add flow schema", + editFlowSchema: "Edit flow schema", + }, + }, - teams: { - teams: 'Team | Teams', - allTeams: 'All teams', - strategy: 'Strategy', - parameters: 'Parameters', - maxNoAnswer: 'Max count of missed activities', - callTimeout: 'Call accept timeout', - inviteChatTimeout: 'Chat accept timeout', - wrapUpTime: 'Wrap up time', - noAnswerDelayTime: 'Delay time after missed activity', - taskAcceptTimeout: 'Task accept timeout', - strategies: { - random: 'Random', - fewestCalls: 'Agent with fewest calls', - leastTalkTime: 'Agent with least talk time', - topDown: 'Top down', - roundRobin: 'Round robin', - roundRobinBucket: 'Round robin bucket', - longestIdleAgent: 'Agent with longest idle time', - skillCapacity: 'By skill level', - }, - hooks: { - eventTypes: { - agentStatus: 'Agent status changed', - } - }, - flows: { - addFlowSchema: 'Add flow schema', - editFlowSchema: 'Edit flow schema', - }, - }, + members: { + members: "Member | Members", + allMembers: "All members", + addMember: "Add member", + destination: "Destination", + display: "Display number", + dtmf: "DTMF", + priority: "Priority", + attempts: "Attempts", + emptyWorkspace: "No members were found", + resetMembers: { + resetMembers: "Reset members", + description: + "Are you sure you want to reset attempts of unsuccessful members?", + reset: "Reset", + successResetCount: "Successfully reset {count} members", + }, + endCause: { + abandoned: "Abandoned", + timeout: "Timeout", + cancel: "Cancel", + success: "Success", + failed: "Failed", + missed: "Missed", + expired: "Expired", + }, + }, - members: { - members: 'Member | Members', - allMembers: 'All members', - addMember: 'Add member', - destination: 'Destination', - display: 'Display number', - dtmf: 'DTMF', - priority: 'Priority', - attempts: 'Attempts', - emptyWorkspace: 'No members were found', - resetMembers: { - resetMembers: 'Reset members', - description: 'Are you sure you want to reset attempts of unsuccessful members?', - reset: 'Reset', - successResetCount: 'Successfully reset {count} members', - }, - endCause: { - abandoned: 'Abandoned', - timeout: 'Timeout', - cancel: 'Cancel', - success: 'Success', - failed: 'Failed', - missed: 'Missed', - expired: 'Expired', - }, - }, + queues: { + queues: "Queue | Queues", + allQueues: "All queues", + type: "Type", + state: "State", + active: "Active", + notActive: "Not active", + activeCalls: "Active calls", + waiting: "Waiting", + ringtone: "Ringtone", + priority: "Priority", + teams: "Team | Teams", + tags: "Tags", + newQueue: "New queue", + blacklist: "Stop list", + newQueueDescription: "New queue descriotion", + outboundIVRQueue: "Outbound IVR queue", + outboundIVR: "Outbound IVR", + outboundIVRQueueDescription: + "An Outbound IVR allows an organization to automatically engage customers through multiple channels such as automated voice calls, SMS messages, email or social media posts using personalized notifications.", + inboundQueue: "Inbound queue", + inboundQueueDescription: + "An Inbound queue is that it's where callers are placed on hold, in a queue, while they wait to speak with a live agent.", + offlineQueue: "Offline queue", + offlineQueueDescription: + "An Offline queue gives callers the option to stop waiting on hold, input their phone number and receive a callback as soon as it's their turn.", + previewDialer: "Preview dialer", + previewDialerDescription: + "Preview the contact before auto dialing them.", + progressiveDialer: "Progressive dialer", + progressiveDialerDescription: + "Progressive dialing minimizes wasted time between calls by automatically dialing a number from a call list as soon as an agent becomes available.", + predictiveDialer: "Predictive dialer", + predictiveDialerDescription: + "A predictive dialer calls multiple numbers at one time. As soon as a customer answers, an agent is connected to them.", + chatInboundQueue: "Chat inbound queue", + chatInboundQueueDescription: + "The same as inbound queue, but with chats", + inboundJobQueue: "Inbound task queue", + inboundJobQueueDescription: "Inbound task queue", + outboundJobQueue: "Outbound task queue", + outboundJobQueueDescription: "Outbound task queue", + strategy: "Strategy", + timezone: "Timezone", + callLimit: "Call limit", + variables: "Variables", + members: "Member | Members", + params: "Parameters", + discardAbandonedAfter: "Discard abandoned after", + maxIdleAgent: "Agent response timeout", + maxIdleClient: "Customer response timeout", + maxIdleDialog: "Maximum response timeout", + timeoutWithNoAgents: "Timeout with no agents", + timeBaseScore: "Time base score", + endless: "Endless", + stickyAgent: "Sticky", + stickyAgentSec: "Sticky agent (sec)", + autoAnswerTone: "Auto answer warning tone", + varKey: "Key", + varVal: "Value", + endCause: "End cause", + offeringAt: "Offering at", + destination: "Destination | Destinations", + expire: "Expire", + originateTimeout: "Originate timeout", + maxAgentLine: "Max agent lines", + maxAgentLose: "Max agent lose calls", + minAttempts: "Min predict attempts", + maxAbandonedRate: "Max abandoned %", + loadFactor: "Load factor", + abandonRateAdjustment: "Abandon rate adjustment", + playbackSilence: "Playback silence", + targetAbandonedRate: "Target abandoned rate %", + maxWaitTime: "Max wait time", + maxWaitingSize: "Max wait count", + waitBetweenRetries: "Wait between retries", + waitBetweenRetriesDesc: "Sort members retries by descending", + strictCircuit: "Strict circuit", + retryAbandoned: "Retry abandoned", + playbackFile: "Playback file", + timeout: "Timeout", + maxNumberOfRetry: "Max number of retry", + minDuration: "Minimum succeed call duration", + maxAttempts: "Max attempts", + minOnlineAgents: + "Access to pause when there are more online agents than:", + waitForResultStatus: "Wait for result status", + bucketPriority: "Priority", + amd: "AMD", + enabled: "Use AMD", + ai: "Artificial intelligence", + positiveLabels: "Positive labels", + aiPlayback: "Playback file", + allowNotSure: "Transfer NOTSURE to an agent", + silenceNotSure: "Transfer silence to an agent", + allowGreetingAgent: "Allow greeting agent", + preSchema: "Pre-executive schema", + afterSchema: "After-executive schema", + maxCalls: "Max tasks", + maxCallsHint: "If value is 0, dialer won't call", + recordings: "Recording", + recordAll: "Start record after answer", + perNumbers: "Dialing Attempts per each phone number", + maxWordLength: "Maximum word length (ms)", + maxNumberOfWords: "Maximum number of words", + betweenWordsSilence: "Between words silence (ms)", + minWordLength: "Minimum word length (ms)", + totalAnalysisTime: "Total analysis time (ms)", + silenceThreshold: "Silence threshold (ms)", + afterGreetingSilence: "After greeting silence (ms)", + greeting: "Greeting (ms)", + initialSilence: "Initial silence (ms)", + statisticTime: "Recalculation interval", + communications: "Communication type", + manualDistribution: "Manual distribution", + lastMessageTimeout: "Timeout from the last message", + processing: { + processing: "Processing", + enabled: "Waiting for call result", + formSchema: "Dynamic processing schema", + sec: "Postprocessing time (sec)", + renewalSec: "Notify to continue after (sec)", + }, + queueStrategy: { + fifo: "FIFO (First In First Out)", + lifo: "LIFO (Last In First Out)", + strict_fifo: "Strict FIFO (First In First Out)", + }, + logs: { + logs: "Log | Logs", + destination: "Destination", + offeringAt: "Offering", + joinedAt: "Start", + leavingAt: "End", + duration: "Duration", + viewNumber: "View number", + result: "Result", + attempts: "Attempt", + resultName: { + abandoned: "Abandoned", + cancel: "Cancel", + success: "Success", + failed: "Failed", + missed: "Missed", + timeout: "Timeout", + endless: "Endless", + transferred: "Transferred", + }, + }, + hooks: { + hooks: "Hook | Hooks", + event: "Event", + eventTypes: { + joined: "Joined", + answered: "Answered", + offering: "Offering", + bridged: "Bridged", + missed: "Missed", + leaving: "Leaving", + processing: "Processing", + active: "Active", + }, + }, + }, - queues: { - queues: 'Queue | Queues', - allQueues: 'All queues', - type: 'Type', - state: 'State', - active: 'Active', - notActive: 'Not active', - activeCalls: 'Active calls', - waiting: 'Waiting', - ringtone: 'Ringtone', - priority: 'Priority', - teams: 'Team | Teams', - tags: 'Tags', - newQueue: 'New queue', - blacklist: 'Stop list', - newQueueDescription: 'New queue descriotion', - outboundIVRQueue: 'Outbound IVR queue', - outboundIVR: 'Outbound IVR', - outboundIVRQueueDescription: 'An Outbound IVR allows an organization to automatically engage customers through multiple channels such as automated voice calls, SMS messages, email or social media posts using personalized notifications.', - inboundQueue: 'Inbound queue', - inboundQueueDescription: 'An Inbound queue is that it\'s where callers are placed on hold, in a queue, while they wait to speak with a live agent.', - offlineQueue: 'Offline queue', - offlineQueueDescription: 'An Offline queue gives callers the option to stop waiting on hold, input their phone number and receive a callback as soon as it\'s their turn.', - previewDialer: 'Preview dialer', - previewDialerDescription: 'Preview the contact before auto dialing them.', - progressiveDialer: 'Progressive dialer', - progressiveDialerDescription: 'Progressive dialing minimizes wasted time between calls by automatically dialing a number from a call list as soon as an agent becomes available.', - predictiveDialer: 'Predictive dialer', - predictiveDialerDescription: 'A predictive dialer calls multiple numbers at one time. As soon as a customer answers, an agent is connected to them.', - chatInboundQueue: 'Chat inbound queue', - chatInboundQueueDescription: 'The same as inbound queue, but with chats', - inboundJobQueue: 'Inbound task queue', - inboundJobQueueDescription: 'Inbound task queue', - outboundJobQueue: 'Outbound task queue', - outboundJobQueueDescription: 'Outbound task queue', - strategy: 'Strategy', - timezone: 'Timezone', - callLimit: 'Call limit', - variables: 'Variables', - members: 'Member | Members', - params: 'Parameters', - discardAbandonedAfter: 'Discard abandoned after', - maxIdleAgent: 'Agent response timeout', - maxIdleClient: 'Customer response timeout', - maxIdleDialog: 'Maximum response timeout', - timeoutWithNoAgents: 'Timeout with no agents', - timeBaseScore: 'Time base score', - endless: 'Endless', - stickyAgent: 'Sticky', - stickyAgentSec: 'Sticky agent (sec)', - autoAnswerTone: 'Auto answer warning tone', - varKey: 'Key', - varVal: 'Value', - endCause: 'End cause', - offeringAt: 'Offering at', - destination: 'Destination | Destinations', - expire: 'Expire', - originateTimeout: 'Originate timeout', - maxAgentLine: 'Max agent lines', - maxAgentLose: 'Max agent lose calls', - minAttempts: 'Min predict attempts', - maxAbandonedRate: 'Max abandoned %', - loadFactor: 'Load factor', - abandonRateAdjustment: 'Abandon rate adjustment', - playbackSilence: 'Playback silence', - targetAbandonedRate: 'Target abandoned rate %', - maxWaitTime: 'Max wait time', - maxWaitingSize: 'Max wait count', - waitBetweenRetries: 'Wait between retries', - waitBetweenRetriesDesc: 'Sort members retries by descending', - strictCircuit: 'Strict circuit', - retryAbandoned: 'Retry abandoned', - playbackFile: 'Playback file', - timeout: 'Timeout', - maxNumberOfRetry: 'Max number of retry', - minDuration: 'Minimum succeed call duration', - maxAttempts: 'Max attempts', - minOnlineAgents: 'Access to pause when there are more online agents than:', - waitForResultStatus: 'Wait for result status', - bucketPriority: 'Priority', - amd: 'AMD', - enabled: 'Use AMD', - ai: 'Artificial intelligence', - positiveLabels: 'Positive labels', - aiPlayback: 'Playback file', - allowNotSure: 'Transfer NOTSURE to an agent', - silenceNotSure: 'Transfer silence to an agent', - allowGreetingAgent: 'Allow greeting agent', - preSchema: 'Pre-executive schema', - afterSchema: 'After-executive schema', - maxCalls: 'Max tasks', - maxCallsHint: 'If value is 0, dialer won\'t call', - recordings: 'Recording', - recordAll: 'Start record after answer', - perNumbers: 'Dialing Attempts per each phone number', - maxWordLength: 'Maximum word length (ms)', - maxNumberOfWords: 'Maximum number of words', - betweenWordsSilence: 'Between words silence (ms)', - minWordLength: 'Minimum word length (ms)', - totalAnalysisTime: 'Total analysis time (ms)', - silenceThreshold: 'Silence threshold (ms)', - afterGreetingSilence: 'After greeting silence (ms)', - greeting: 'Greeting (ms)', - initialSilence: 'Initial silence (ms)', - statisticTime: 'Recalculation interval', - communications: 'Communication type', - manualDistribution: 'Manual distribution', - lastMessageTimeout: 'Timeout from the last message', - processing: { - processing: 'Processing', - enabled: 'Waiting for call result', - formSchema: 'Dynamic processing schema', - sec: 'Postprocessing time (sec)', - renewalSec: 'Notify to continue after (sec)', - }, - queueStrategy: { - fifo: 'FIFO (First In First Out)', - lifo: 'LIFO (Last In First Out)', - strict_fifo: 'Strict FIFO (First In First Out)', - }, - logs: { - logs: 'Log | Logs', - destination: 'Destination', - offeringAt: 'Offering', - joinedAt: 'Start', - leavingAt: 'End', - duration: 'Duration', - viewNumber: 'View number', - result: 'Result', - attempts: 'Attempt', - resultName: { - abandoned: 'Abandoned', - cancel: 'Cancel', - success: 'Success', - failed: 'Failed', - missed: 'Missed', - timeout: 'Timeout', - endless: 'Endless', - transferred: 'Transferred', - }, - }, - hooks: { - hooks: 'Hook | Hooks', - event: 'Event', - eventTypes: { - joined: 'Joined', - answered: 'Answered', - offering: 'Offering', - bridged: 'Bridged', - missed: 'Missed', - leaving: 'Leaving', - processing: 'Processing', - active: 'Active', - }, - }, - }, + res: { + res: "Resource | Resources", + allRes: "All resources", + reserve: "Reserve", + searchPlaceholder: "name, gateway..", + cps: "CPS", + limit: "Limit", + cidType: "CID Type", + ignoreEarlyMedia: "Ignore Early Media", + numbers: "Number | Numbers", + displayNumbers: "Display numbers", + failure: "Failure", + maxErrors: "Maximum failure responses", + errorCodes: "Request Failure Responses", + patterns: "Destination number pattern", + priority: "Priority", + reserveResource: "Reserve resource", + failureDialDelay: "Failure dial delay", + }, - res: { - res: 'Resource | Resources', - allRes: 'All resources', - reserve: 'Reserve', - searchPlaceholder: 'name, gateway..', - cps: 'CPS', - limit: 'Limit', - cidType: 'CID Type', - ignoreEarlyMedia: 'Ignore Early Media', - numbers: 'Number | Numbers', - displayNumbers: 'Display numbers', - failure: 'Failure', - maxErrors: 'Maximum failure responses', - errorCodes: 'Request Failure Responses', - patterns: 'Destination number pattern', - priority: 'Priority', - reserveResource: 'Reserve resource', - failureDialDelay: 'Failure dial delay', - }, + resGroups: { + resGroups: "Resource group | Resource groups", + allResGroups: "All resource groups", + searchPlaceholder: "res group name..", + addResGroup: "Add resource group", + strategy: "Strategy", + timerange: "Time range", + timerangeFrom: "From", + timerangeTo: "To", + }, + }, - resGroups: { - resGroups: 'Resource group | Resource groups', - allResGroups: 'All resource groups', - searchPlaceholder: 'res group name..', - addResGroup: 'Add resource group', - strategy: 'Strategy', - timerange: 'Time range', - timerangeFrom: 'From', - timerangeTo: 'To', - }, - }, + integrations: { + integrations: "Integrations", + emptyWorkspace: "There are no profiles yet", - integrations: { - integrations: 'Integrations', - emptyWorkspace: 'There are no profiles yet', + storage: { + storage: "Storage", + allStorages: "All storages", + type: "Type", + maxSize: "Storage space (GB)", + expireDays: "Lifetime (days)", + priority: "Priority", + newStorage: "New storage", + newStorageDescription: "New Storage description", + local: "Local", + s3: "S3 Bucket", + digitalOcean: "Digital Ocean Spaces", + backblaze: "Backblaze B2", + dropbox: "Dropbox", + drive: "Google Drive", + configuration: "Configuration", + pathPattern: "Path pattern", + localFolder: "Local folder", + s3Key: "Key ID", + s3Access: "Access Key", + bucket: "Bucket", + region: "Region", + oceanKey: "Key ID", + oceanAccess: "Access Key", + backblazeAccount: "Account ID", + backblazeKey: "Application key", + backblazeBucketId: "Bucket Id", + dropboxKey: "Access Token", + driveFolder: "Folder name", + driveEmail: "Google Email", + driveKey: "Private key", + s3Endpoint: "Endpoint", + }, - storage: { - storage: 'Storage', - allStorages: 'All storages', - type: 'Type', - maxSize: 'Storage space (GB)', - expireDays: 'Lifetime (days)', - priority: 'Priority', - newStorage: 'New storage', - newStorageDescription: 'New Storage description', - local: 'Local', - s3: 'S3 Bucket', - digitalOcean: 'Digital Ocean Spaces', - backblaze: 'Backblaze B2', - dropbox: 'Dropbox', - drive: 'Google Drive', - configuration: 'Configuration', - pathPattern: 'Path pattern', - localFolder: 'Local folder', - s3Key: 'Key ID', - s3Access: 'Access Key', - bucket: 'Bucket', - region: 'Region', - oceanKey: 'Key ID', - oceanAccess: 'Access Key', - backblazeAccount: 'Account ID', - backblazeKey: 'Application key', - backblazeBucketId: 'Bucket Id', - dropboxKey: 'Access Token', - driveFolder: 'Folder name', - driveEmail: 'Google Email', - driveKey: 'Private key', - s3Endpoint: 'Endpoint', - }, + cognitiveProfiles: { + cognitiveProfiles: "Cognitive profile | Cognitive profiles", + properties: { + region: "Region", + locale: "Locale", + }, + }, + emailProfiles: { + emailProfiles: "Email profile | Email profiles", + mailbox: "Mailbox", + smtpPort: "SMTP Port", + imapPort: "IMAP Port", + smtpHost: "SMTP Host", + imapHost: "IMAP Host", + fetchInterval: "Refresh interval", + listen: "Listen", + authType: "Auth type", + authenticatedAs: "Authenticated as", + }, + singleSignOn: { + allTypes: "All types", + singleSignOn: "Single Sign-on", + clientId: "Client id", + clientSecret: "Client secret", + discoveryUrl: "Discovery url", + }, - cognitiveProfiles: { - cognitiveProfiles: 'Cognitive profile | Cognitive profiles', - properties: { - region: 'Region', - locale: 'Locale', - }, - }, - emailProfiles: { - emailProfiles: 'Email profile | Email profiles', - mailbox: 'Mailbox', - smtpPort: 'SMTP Port', - imapPort: 'IMAP Port', - smtpHost: 'SMTP Host', - imapHost: 'IMAP Host', - fetchInterval: 'Refresh interval', - listen: 'Listen', - authType: 'Auth type', - authenticatedAs: 'Authenticated as', - }, - singleSignOn: { - allTypes: 'All types', - singleSignOn: 'Single Sign-on', - clientId: 'Client id', - clientSecret: 'Client secret', - discoveryUrl: 'Discovery url', - }, + importCsv: { + importCsv: "Import CSV from file | Imports of CSV from file", + allImportsCsv: "All imports data from CSV files", + source: "Import destination", + settings: "Settings", + mappings: "Field mappings", + mappingsHint: + "In this section you should provide names of CSV file columns in inputs below in accordance with its labels", + columnHeader: "{name} column", + members: { + clearMembers: "Purge existing members", + }, + }, - importCsv: { - importCsv: 'Import CSV from file | Imports of CSV from file', - allImportsCsv: 'All imports data from CSV files', - source: 'Import destination', - settings: 'Settings', - mappings: 'Field mappings', - mappingsHint: 'In this section you should provide names of CSV file columns in inputs below in accordance with its labels', - columnHeader: '{name} column', - members: { - clearMembers: 'Purge existing members', - }, - }, + tokens: { + tokens: "Token | Tokens", + allTokens: "All tokens", + expires: "Expires on", + popupMessage: + "Download your key file now or copy it. If you do not download the key file now, you will not be able to retrieve your token key again. To help protect your security, store your token key securely and do not share it.", + tokenCreated: "Your token has been successfully created!", + }, - tokens: { - tokens: 'Token | Tokens', - allTokens: 'All tokens', - expires: 'Expires on', - popupMessage: 'Download your key file now or copy it. If you do not download the key file now, you will not be able to retrieve your token key again. To help protect your security, store your token key securely and do not share it.', - tokenCreated: 'Your token has been successfully created!', - }, + triggers: { + triggers: "Trigger | Triggers", + allTriggers: "All triggers", + type: "Type", + schema: "Schema", + newTrigger: "New trigger", + newTriggerDescription: + "Choose a template to get going or start from scratch with a blank canvas", + onEvent: "On event", + onEventDescription: "An event-based JSON Schema scheduler", + cron: "At time", + atTimeDescription: "A time-based JSON Schema scheduler", + event: "Event", + expression: "Expression", + timeout: "Timeout", + logs: { + logs: "Running history", + startedAt: "Start", + result: "Result", + resultName: { + idle: "Idle", + active: "Active", + done: "Done", + error: "Error", + }, + }, + }, + }, + system: { + system: "System", + changelogs: { + changelogs: "Change log | Change logs", + objects: "Object | Objects", + daysToStore: "Days to store", + storage: "Download to", + logs: { + logs: "Log | Logs", + actions: "Operation | Operations", + records: "Record ID | Records ID", + actionType: { + [LoggerAction.Create]: "Create", + [LoggerAction.Delete]: "Delete", + [LoggerAction.Update]: "Edit", + }, + }, + period: { + period: "Period", + options: { + daily: "Daily", + weekly: "Weekly", + fortnightly: "Fortnightly", + monthly: "Monthly", + }, + }, + }, + configuration: { + configuration: "Configuration | Configurations", + parameter: "Parameter", + }, + globalVariables: { + globalVariables: "Global variable | Global variables", + encrypted: "Encrypted", + valueInfo: "Enter value only if you want to edit", + newTitle: "New global variable", + editTitle: "Edit global variable", + }, + }, - triggers: { - triggers: 'Trigger | Triggers', - allTriggers: 'All triggers', - type: 'Type', - schema: 'Schema', - newTrigger: 'New trigger', - newTriggerDescription: 'Choose a template to get going or start from scratch with a blank canvas', - onEvent: 'On event', - onEventDescription: 'An event-based JSON Schema scheduler', - cron: 'At time', - atTimeDescription: 'A time-based JSON Schema scheduler', - event: 'Event', - expression: 'Expression', - timeout: 'Timeout', - logs: { - logs: 'Running history', - startedAt: 'Start', - result: 'Result', - resultName: { - idle: 'Idle', - active: 'Active', - done: 'Done', - error: 'Error', - }, - }, - }, - }, - system: { - system: 'System', - changelogs: { - changelogs: 'Change log | Change logs', - objects: 'Object | Objects', - daysToStore: 'Days to store', - storage: 'Download to', - logs: { - logs: 'Log | Logs', - actions: 'Operation | Operations', - records: 'Record ID | Records ID', - actionType: { - [LoggerAction.Create]: 'Create', - [LoggerAction.Delete]: 'Delete', - [LoggerAction.Update]: 'Edit', - }, - }, - period: { - period: 'Period', - options: { - daily: 'Daily', - weekly: 'Weekly', - fortnightly: 'Fortnightly', - monthly: 'Monthly', - }, - }, + pagination: { + rowsPerPage: "Rows per page", + }, + }, - }, - configuration: { - configuration: 'Configuration | Configurations', - parameter: 'Parameter', - }, - globalVariables: { - globalVariables: 'Global variable | Global variables', - encrypted: 'Encrypted', - valueInfo: 'Enter value only if you want to edit', - newTitle: 'New global variable', - editTitle: 'Edit global variable', - }, - }, + filters: { + team: "Team", + queueType: "Queue Type", + }, - pagination: { - rowsPerPage: 'Rows per page', - }, - }, + utils: { + downloadFilesBtn: { + downloadFiles: "Download files", + filesLoaded: "Files loaded", + zippingProgress: "Zipping progress", + }, + }, - filters: { - team: 'Team', - queueType: 'Queue Type', - }, + errorPages: { + goToHome: "Go to Home page", + page403: { + title: "Access denied", + text: "Sorry, you have not enough privileges to see this page.", + }, + page404: { + title: "Looks like you're lost", + text: "Sorry, we can't find the page you want.", + }, + }, - utils: { - downloadFilesBtn: { - downloadFiles: 'Download files', - filesLoaded: 'Files loaded', - zippingProgress: 'Zipping progress', - }, - }, + icon: { + docs: "Docs", + logout: "Logout", + account: "Account", + appNavigator: "App navigator", + settings: "Settings", + }, - errorPages: { - goToHome: 'Go to Home page', - page403: { - title: 'Access denied', - text: 'Sorry, you have not enough privileges to see this page.', - }, - page404: { - title: 'Looks like you\'re lost', - text: 'Sorry, we can\'t find the page you want.', - }, - }, - - icon: { - docs: 'Docs', - logout: 'Logout', - account: 'Account', - appNavigator: 'App navigator', - settings: 'Settings', - }, - - iconHints: { - upload: 'Upload', - reload: 'Refresh table', - edit: 'Edit', - delete: 'Delete', - deleteAll: 'Delete all items', - deleteSelected: 'Delete {count} selected items', - deleteFiltered: 'Delete all filtered items', - generate: 'Generate', - add: 'Add', - history: 'History', - download: 'Download', - downloadAll: 'Download all', - draggable: 'Draggable', - play: 'Play', - pause: 'Pause', - resume: 'Resume', - close: 'Close', - change: 'Change', - volume: 'Volume', - stop: 'Stop', - members: 'Members', - moveUp: 'Move up', - moveDown: 'Move down', - nextPage: 'Next page', - prevPage: 'Previous page', - expand: 'Expand', - collapse: 'Collapse', - }, - errors: { - invalidJson: 'JSON is invalid', - }, - reusable: { - time: { - t15m: '15 min', - t30m: '30 min', - t45m: '45 min', - t1h: '1 hour', - t3h: '4 hour', - t6h: '6 hour', - }, - }, + iconHints: { + upload: "Upload", + reload: "Refresh table", + edit: "Edit", + delete: "Delete", + deleteAll: "Delete all items", + deleteSelected: "Delete {count} selected items", + deleteFiltered: "Delete all filtered items", + generate: "Generate", + add: "Add", + history: "History", + download: "Download", + downloadAll: "Download all", + draggable: "Draggable", + play: "Play", + pause: "Pause", + resume: "Resume", + close: "Close", + change: "Change", + volume: "Volume", + stop: "Stop", + members: "Members", + moveUp: "Move up", + moveDown: "Move down", + nextPage: "Next page", + prevPage: "Previous page", + expand: "Expand", + collapse: "Collapse", + }, + errors: { + invalidJson: "JSON is invalid", + }, + reusable: { + time: { + t15m: "15 min", + t30m: "30 min", + t45m: "45 min", + t1h: "1 hour", + t3h: "4 hour", + t6h: "6 hour", + }, + }, }; diff --git a/src/app/locale/i18n.js b/src/app/locale/i18n.js index 3c1c6d606..552104189 100644 --- a/src/app/locale/i18n.js +++ b/src/app/locale/i18n.js @@ -1,19 +1,19 @@ -import { createI18n } from 'vue-i18n'; -import en from './en/en'; -import ru from './ru/ru'; -import ua from './ua/ua'; -import kz from './kz/kz'; +import { createI18n } from "vue-i18n"; +import en from "./en/en"; +import kz from "./kz/kz"; +import ru from "./ru/ru"; +import ua from "./ua/ua"; const messages = { - en, - ru, - ua, - kz, + en, + ru, + ua, + kz, }; export default new createI18n({ - locale: 'en', - fallbackLocale: 'en', - allowComposition: true, - messages, + locale: "en", + fallbackLocale: "en", + allowComposition: true, + messages, }); diff --git a/src/app/locale/kz/kz.js b/src/app/locale/kz/kz.js index 53aa32d2f..efa3c4f3f 100644 --- a/src/app/locale/kz/kz.js +++ b/src/app/locale/kz/kz.js @@ -1,943 +1,980 @@ -import { EngineCommunicationChannels } from 'webitel-sdk'; +import { EngineCommunicationChannels } from "webitel-sdk"; export default { - auth: { - register: 'Жасау', - login: 'Кіру', - registerReset: 'Құпиясөзді жіберу/құпиясөзді алып тастау ', - detailsSubtitle: 'Деректеріңізді енгізіңіз', - resetPasswordLink: 'Құпиясөзіңізді ұмыттыңыз ба?', - user: 'Пайдаланушының аты', - password: 'Құпиясөз', - confirmPassword: 'Құпиясөзді қайталау', - key: 'Лицензия кілті', - registerSubmit: 'Тіркелу', - resetSubmit: 'Бас тарту', - loginSubmit: 'Кіру', - carousel: { - title1: 'Бұлт және Он-сайтқа', - text1: 'Қауіпсіздік саясатыңыз деректерді сақтауға және бұлттық қызметтерді пайдалануға мүмкіндік бермейді ме? Webitel көмегімен сіз өз сайтыңызда байланыс орталығын құра аласыз!', + auth: { + register: "Жасау", + login: "Кіру", + registerReset: "Құпиясөзді жіберу/құпиясөзді алып тастау ", + detailsSubtitle: "Деректеріңізді енгізіңіз", + resetPasswordLink: "Құпиясөзіңізді ұмыттыңыз ба?", + user: "Пайдаланушының аты", + password: "Құпиясөз", + confirmPassword: "Құпиясөзді қайталау", + key: "Лицензия кілті", + registerSubmit: "Тіркелу", + resetSubmit: "Бас тарту", + loginSubmit: "Кіру", + carousel: { + title1: "Бұлт және Он-сайтқа", + text1: + "Қауіпсіздік саясатыңыз деректерді сақтауға және бұлттық қызметтерді пайдалануға мүмкіндік бермейді ме? Webitel көмегімен сіз өз сайтыңызда байланыс орталығын құра аласыз!", - title2: 'Көп арналы және ортақ арналы', - text2: 'Клиенттермен әрқашан, кез келген жерде байланыста болыңыз! Кез келген күрделі IVR мәзірі, кіріс, шығыс қарым-қатынас науқандары немесе әлеуметтік желілерге хабарламалар - енді тіпті оңай!', + title2: "Көп арналы және ортақ арналы", + text2: + "Клиенттермен әрқашан, кез келген жерде байланыста болыңыз! Кез келген күрделі IVR мәзірі, кіріс, шығыс қарым-қатынас науқандары немесе әлеуметтік желілерге хабарламалар - енді тіпті оңай!", - title3: 'Орнықты жұмыс істейтін инфрақұрылым', - text3: 'Енді ешқандай тұрып қалу болмайды және деректер жоғалмайды. Жылдам ауқымдау және орнықты жұмыс істейтін архитектура әр түрлі байланыс арналарынан минутына клиенттердің 1000-нан астам өтінішіне бір уақытта қызмет көрсетуге мүмкіндік береді.', + title3: "Орнықты жұмыс істейтін инфрақұрылым", + text3: + "Енді ешқандай тұрып қалу болмайды және деректер жоғалмайды. Жылдам ауқымдау және орнықты жұмыс істейтін архитектура әр түрлі байланыс арналарынан минутына клиенттердің 1000-нан астам өтінішіне бір уақытта қызмет көрсетуге мүмкіндік береді.", - title4: 'Дизайн', - text4: 'Барлық қажетті функцияларға жылдам қол жеткізуге мүмкіндік беретін ең ыңғайлы басқару панелі бар жаңа минималистік интерфейс. Аз клик - көп мүмкіндіктер.', + title4: "Дизайн", + text4: + "Барлық қажетті функцияларға жылдам қол жеткізуге мүмкіндік беретін ең ыңғайлы басқару панелі бар жаңа минималистік интерфейс. Аз клик - көп мүмкіндіктер.", - title5: 'Оператор топтарымен жұмыстың жаңа модулі', - text5: 'Қоңырауларды барынша тиімді тарату. Оператордың әртүрлі науқандарға қатысу үшін бірнеше дағдылары болуы мүмкін. Клиентке тек кәсіби мамандар қызмет көрсетеді.', + title5: "Оператор топтарымен жұмыстың жаңа модулі", + text5: + "Қоңырауларды барынша тиімді тарату. Оператордың әртүрлі науқандарға қатысу үшін бірнеше дағдылары болуы мүмкін. Клиентке тек кәсіби мамандар қызмет көрсетеді.", - title6: 'Қол жеткізу құқықтарын күйге келтіру', - text6: 'Құқықтарды басқарудың жаңа модулі – бақылаудың жаңа мүмкіндіктері. Сіз енгізілген өзгерістерді қадағалай отырып, тек бөлімдерге ғана емес, пайдаланушылардың әрекеттеріне де құқық бере аласыз.', - }, - }, - header: { - logout: 'Шығу', - docs: 'Анықтама', - }, - appNavigator: { - title: 'Webitel қосымшалары', - }, - settings: { - settings: 'Баптау', - changePassword: 'Құпиясөзді өзгерту', - language: 'Тіл', - webPhone: 'Web-телефон', - useWebPhone: 'Web-телефонды пайдаланушы', - useStun: 'STUN пайдаланушы', - }, - validation: { - email: 'Электрондық пошта мекенжайын енгізіңіз', - required: 'Міндетті түрде толтырылатын өріс', - sameAs: 'Құпия сөз қате', - minValue: 'мәні кем дегенде .....болуы керек', - maxValue: 'Мәні тым үлкен болмауы керек', - numeric: 'Сандар болуы керек', - requiredArrayValue: 'Өріс бос болмауы керек', - isPositiveValue: 'Мәні нөлден үлкен болуы керек', - cron: 'қате cron- өрнегі', - }, - nav: { - directory: { - directory: 'Каталог', - }, - routing: { - routing: 'Бағыттау', - }, - lookups: { - lookups: 'Анықтамалар', - }, - ccenter: { - ccenter: 'Байланыс орталығы', - }, - integrations: { - integrations: 'Интеграциялар', - }, - permissions: { - permissions: 'Рұқсат', - }, - }, - home: { - dashboard: 'Есептер', - welcomeText: 'Қош келдіңіз!', - news: 'Жаңалықтар', - }, - objects: { - all: 'Барлығы { entity }', - administration: 'Басқару ', - general: 'Жалпы', - new: 'Жаңа нысан', - add: 'Қосу', - create: 'Жасау', - read: 'Оқу', - edit: 'Редакциялау', - delete: 'Жою', - save: 'Сақтау', - saved: 'Сақталған', - saveAs: 'Жаңа ретінде сақтаңыз', - close: 'Жабу', - next: 'Әрі қарай', - back: 'Артқа', - change: 'Ауыстыру', - name: 'Аты', - description: 'Сипаттама', - user: 'Пайдаланушы', - users: 'Пайдаланушылар', - password: 'Құпиясөз', - history: 'Тарих', - copy: 'Көшіру', - copied: 'Көшірілді!', - createdAt: 'Жасалды', - createdBy: 'Кім жасады', - importCSV: 'CSV импорттау', - online: 'Онлайн', - offline: 'Оффлайн', - enabled: 'енгізілген', - status: 'Мәртебе', - from: 'бастап', - to: 'дейін', - importJSON: 'JSON импорттау', - addNew: 'қосу', - provider: 'Провайдер', - default: 'Ұйғарым бойынша', - service: 'Сервис', - key: 'Кілт', - email: 'Электрондық поштаның мекенжайы', - updatedAt: 'Өзгертілді', - emptyWorkspace: 'Бөлімде әлі жазбалар жазылмаған', - emptyResultSearch: 'Іздеу еш нәтиже бермеді', - deleteConfirmation: { - title: 'Жоюды растаңыз', - askingAlert: '{count} жазбасын жойғыңыз келетініне сенімдісіз бе? | {count} жазбасын жойғыңыз келетініне сенімдісіз бе?', - undoneActionAlert: 'Бұл әрекетті қайтару мүмкін емес.', - deleteAll: 'БАРЛЫҒЫ', - }, - CSV: { - skipHeaders: 'Тақырыптарды жию', - separator: 'Ажыратқыш', - CSVColumn: 'CSV өрісі', - fieldName: 'Өріс атауы', - clearMember: 'Абонентті тазалау', - }, - generalInfo: 'жалпы ақпарат', - directory: { - directory: 'Каталог', - users: { - users: 'Пайдаланушы | Пайдаланушылар', - allUsers: 'Барлық пайдаланушылар', - searchPlaceholder: 'Аты, пайдаланушы, телефон нөмірлері, мәртебесі', - login: 'Логин', - extensions: 'Ішкі нөмір', - state: 'Мәртебе', - status: 'Мәртебе', - roles: 'Рөлдері', - tokens: 'Токендер', - usage: 'Пайдалану', - roleAdmin: 'Әкімші', - license: 'Лицензия', - devices: 'Құрылғы', - defaultDevice: 'Ұйғарым бойынша құрылғы (таңдалған құрылғылар тізімінен)', - deviceNotFound: 'Құрылғыңызды таба алмадыңыз ба?', - createNewDevice: 'Жаңасын қосыңыз', - variables: 'Ауыспалы', - varKey: 'Кілт', - varVal: 'Мәні', - token: 'Токен | Токендер', - tokenPopupHeader: 'Сіздің токен-кілтіңіз сәтті жасалды!', - tokenPopupText: 'Файлды қазір кілтпен жүктеп алыңыз немесе оны кейінірек пайдалану үшін көшіріңіз. Егер файл кілтін қазір жүктемесеңіз,токен-кілтіңізді қайтадан ала алмайсыз. Сіздің қауіпсіздігіңіз үшін токен-кілтіңізді ешкімге бермеңіз.', - tokenPopupCopy: 'Көшіру', - tokenPopupSave: 'TXT форматында сақтаңыз', - }, - license: { - customers: 'Пайдаланушылар', - license: 'Лицензия | Лицензиялар', - allCustomers: 'Барлық пайдаланушылар', - allLicenses: 'Барлық лицензиялар', - serial: 'Серия', - product: 'Өнім', - validFrom: 'Бастап жарамды', - validTill: 'дейін жарамды', - used: 'Пайдаланылған', - limit: 'Лимит ', - status: 'Мәртебе', - competitive: 'Бәсекелес', - searchPlaceholder: 'Серия, өнім', - domain: 'Домен', - daysToExpire: { - '0': 'Жарамдылық мерзімінің өтуі', - '30': '30 немесе одан аз', - '90': '90 немесе одан аз', - days: 'күндер', - }, - importLicense: 'Лицензияны жүктеп алу', - licenseKey: 'Лицензия кілті', - }, - devices: { - devices: 'Құрылғы | Құрылғылар', - allDevices: 'Барлық құрылғылар', - newDevice: 'Жаңа құрылғы', - newDeviceDescription: 'Жаңа құрылғының сипаттамасы', - hotdeskDeviceSettings: 'Құрылғының ауысымдық қолданылуын баптау', - searchPlaceholder: 'Атауы, пайдаланушы, идентификатор & компьютер идентификаторы', - authId: 'Идентификатор', - presence: 'Ағымдағы мәртебесі', - hotdesk: 'Hot desking', - hotdeskDevice: 'Hot desking құрылғы', - hotdeskIncorrectInput: 'Хост атауы қате', - hotdeskInputHint: 'Хост атауы үшін дұрыс таңбаларды пайдаланыңыз. Рұқсат етілген таңбалар: A-Z, a-z, 0-9, -, _', - deviceSettings: 'Құрылғының баптаулары', - hostName: 'Хост атауы', - phoneInfo: 'Телефон туралы ақпарат', - phone: 'Телефон ', - vendor: 'Өндіруші', - model: 'Моделі', - deviceHistory: 'Пайдалдану тарихы', - loggedIn: 'Жүйеде', - loggedOut: 'Жүйеден шықты', - state: { - nonreg: 'Тіркелмеген', - reged: 'Тіркелген', - ringing: 'Қоңырау шалу', - dialing: 'Теру', - dialog: 'Әңгімелесуде', - onhold: 'Күтуде', - }, - passwordSetFromAccount: 'Құпиясөзді орнатпасаңыз, ол аккаунтыңызбен бірдей болады', - }, - }, - permissions: { - permissions: 'Рұқсат', - permissionsRole: 'Рөл | Рөлдер', - allRoles: 'Барлық рөлдер', - searchPlaceholder: 'Рөл ', - roles: { - permissions: { - permissions: 'Рөлге қосылу құқығы | Рөлдерге қосылу құқығы', - add: 'Құру ', - delete: 'Жою', - read: 'Таңдау', - write: 'Түзету', - eavesdropCall: 'Белсенді қоңырауды тыңдау', - playbackRecordFile: 'Қоңырау жазбаларын ойнату', - exportDataGrid: 'Деректерді экспорттау', - viewCdrPhoneNumbers: 'Шифрланбаған телефон нөмірлерін қарау', - manageUserRoles: 'Пайдаланушы рөлдерін басқару', - manageUserLicense: 'Пайдаланушы лицензиясын басқару', - changeUserPassword: 'Пайдаланушың құпиясөзін өзгерту', - addDescription: 'Нысандарды жасауға рұқсат береді', - deleteDescription: 'Нысандарды жоюға рұқсат береді', - readDescription: 'Нысандарды таңдауға рұқсат береді', - writeDescription: 'Нысандарды өзгертуге рұқсат береді', - eavesdropCallDescription: 'Белсенді әңгімені тыңдауға рұқсат береді', - playbackRecordFileDescription: 'Сөйлесу жазбалары бар файлдарды ойнатуға рұқсат береді', - exportDataGridDescription: 'Деректерді экспорттауға рұқсат береді', - viewCdrPhoneNumbersDescription: 'Шифрланбаған телефон нөмірлерін көрсетуге рұқсат береді', - manageUserRolesDescription: 'Пайдаланушы рөлдерінің жиынын басқаруға рұқсат береді', - manageUserLicenseDescription: 'Пайдаланушы лицензияларының жинағын басқаруға рұқсат береді', - changeUserPasswordDescription: 'Пайдаланушының құпиясөзін өзгертуге рұқсат береді', - }, - addPermission: 'Рөлге кіру құқығын қосыңыз', - usage: 'Пайдалану ', - applicationsAccess: { - applicationsAccess: 'Қосымша | Қосымшалар', - access: 'Қол жеткізу', - }, - }, - object: { - object: 'Бөлімдер', - allObjects: 'Барлық бөлімдер', - ObAC: 'Әрекеттерді басқару', - RbAC: 'Жазбаларды басқару', - operations: 'Әрекеттер', - searchPlaceholder: '... бөлім', - newPermissionRole: 'Жаңа құқық иесі', - rbacDefault: 'Ұйғарым бойынша жазбаларға кіру құқығы', - grantor: 'құқық беруші', - grantee: 'Алушы', - create: 'Жасау', - delete: 'Жою', - accessMode: { - '1': 'Тыйым салынады', - '2': 'Рұқсат', - '3': 'Басқару ', - }, - }, - }, - lookups: { - lookups: 'Анықтамалықтар', - skills: { - skills: 'Дағды | Дағдылар', - capacity: 'Әлеует', - minCapacity: 'Ең төменгі әлеует', - minCapacityLessOrEqualToMaxCapacityValidator: 'Ең жоғарғы әлеуеттен төмен немесе тең болуы керек', - maxCapacity: 'Ең жоғарғы әлеует', - maxCapacityMoreOrEqualToMinCapacityValidator: 'Ең төменгі әлеуеттен үлкен немесе тең болуы керек', - lvl: 'Деңгей', - agentSkills: 'Оператор дағдылары | Операторлардың дағдылары', - allSkills: 'Барлық дағдылар', - state: 'Жағдай', - stateForAll: 'Барлығына арналған жағдай ', - changeSkillTo: 'дағдыны.... ауыстыру', - changeAgentsSkill: 'Операторлар үшін дағдыны ауыстыру', - totalAgents: 'Барлық операторлар', - activeSkillAgents: 'Белсенді дағдымен ', - assignSkillToAgents: 'Операторларға дағдыны тағайындау', - assignAgent: 'Операторды тағайындау', - selectCapacityAndState: 'Әлеует пен жағдайды таңдаңыз', - }, - buckets: { - buckets: 'Себет | Себеттер', - allBuckets: 'Барлық себеттер', - addBucket: 'Себетті қосу', - }, - blacklist: { - blacklist: 'Тізім | Тізімдер', - allBlacklists: 'Барлық тізімдер', - number: 'Нөмір | Нөмірлер', - newNumber: 'Жаңа нөмір', - numbersCount: 'Нөмірлер', - expireAt: 'Жарамдылық мерзімі', - temporary: 'Уақытша', - }, - media: { - mediaFiles: 'Медиафайл| Медиафайлдар', - allMediaFiles: 'Барлық медиафайлдар', - createdAt: 'Жасалды', - format: 'Формат', - size: 'Көлемі', - textToSpeech: 'Сөйлеу синтезі', - popupSettings: 'Баптау ', - lang: 'Тіл', - voice: 'Дауыс', - token: 'Токен', - key: 'Кілт', - dragPlaceholder: 'Файлдарды жүктеп салу', - dragPlaceholderHere: 'Мұнда.', - tts: { - hint: 'Аудиофайл жасау', - textType: { - textType: 'Мәтін типі', - }, - }, - }, - regions: { - regions: 'Алаң | Алаңдар', - allRegions: 'Барлық алаң', - }, - timezone: { - timezone: 'Уақыт белдеуі | Уақыт белдеуі', - }, - calendars: { - calendars: 'Күнтізбе | Күнтізбелер', - allCalendars: 'Барлық күнтізбелер', - searchPlaceholder: 'Атауы, сипаттамасы...', - timezone: 'Уақыт белдеуі', - start: 'Басы', - end: 'Соңы', - workWeek: 'Жұмыс аптасы', - holidays: 'Демалыс күні | Демалыс күндері', - date: 'Күні', - repeat: 'Қайталау', - fulltime: 'Уақытша', - everyYear: 'Жыл сайын қайталау', - newHoliday: 'Жаңа демалыс күні', - mon: 'Дүйсенб', - tue: 'Сейсенбі', - wed: 'Сәрсенбі', - thu: 'Бейсенбі', - fri: 'Жұма', - sat: 'Сенбі', - sun: 'Жексенбі', - }, - communications: { - communications: 'Байланыс түрі| Байланыс түрлері', - allCommunications: 'Байланыстың барлық түрлері', - addCommunication: 'Байланысты қосу', - code: 'Код', - channels: { - [EngineCommunicationChannels.Phone]: 'Телефон', - [EngineCommunicationChannels.Email]: 'Электрондық пошта', - [EngineCommunicationChannels.Messaging]: 'Хабарламалар', - }, - }, - pauseCause: { - pauseCause: 'Оператордың мәртебесі', - allPauseCause: 'Оператордың үзілісінің барлық себептері', - limit: 'Лимит (мин)', - min: 'Минут', - allowAdmin: 'Әкімші бұл мәртебені өзгерте алады', - allowSupervisor: 'Супервизор бұл мәртебені өзгерте алады', - allowAgent: 'Оператор бұл мәртебені өзгерте алады', - }, - }, - routing: { - routing: 'Бағыттау', - protocol: 'Протокол ', - port: 'Порт', - configuration: 'Конфигурация', - schema: 'Қоңырау схемасы', - flow: { - flow: 'Схема| Схемалар', - allFlowSchemas: 'Барлық схемалар', - createFlowSelectionPopup: 'Жаңа схема құру', - createNew: 'Жаңа схема құрасыз ба?', - editor: 'Редактор', - diagram: { - diagram: 'Диаграмма', - description: 'Webitel Flow Diagram көмегімен жаңа схема құру', - }, - code: { - code: 'Код', - description: 'Код редакторында JSON схемасын пайдаланып жаңа схема құру', - }, - }, - dialplan: { - dialplan: 'Шығыс бағыттау', - dialplanRules: 'Шығыс бағыттау қағидалары ', - pattern: 'Белгіленген нөмірі', - dialplanRule: 'Шығыс бағыттау қағидалары ', - position: 'Позиция', - }, - chatplan: { - chatplan: 'Мәтіндік хабарламаны бағыттау қағидасы | Мәтіндік хабарламаны бағыттау қағидасы', - allChatplans: 'Мәтіндік хабарламаны бағыттаудың барлық қағидасы', - }, - gateways: { - gateways: 'Шлюз | Шлюздер', - allGateways: 'Барлық шлюздер', - trunkingGateway: 'Көп арналы шлюз', - registerGateway: 'Шлюзді тіркеу', - stateSuccess: 'Сәтті', - stateFailed: 'Сәтсіз', - stateProgress: 'Орындалуда', - stateNonreg: 'Тіркелмеген', - proxy: 'Прокси', - searchPlaceholder: 'шлюзді іздеу...', - host: 'Хост', - trunkingACLTitle: 'Қосылуды басқару', - trunkingACL: 'Көп арналы косылу тізімі', - hostnameTrunking: 'Сервер/Шлюздің хосты немесе IP', - hostnameRegister: 'Тіркеуші/Сервер/Шлюз Хост немесе IP', - expire: 'Жарамдылық мерзімі', - authID: 'Пайдаланушының аты', - account: 'Аккаунт', - outboundProxy: 'Шығыс SIP прокси мекенжайы', - newGateway: 'Жаңа шлюз', - newGatewayDescription: 'Жаңа шлюздің сипаттамасы', - SIPregistrations: 'SIP тіркеу', - SIPregistrationsDescription: 'SIP тіркеуінің сипаттамасы', - SIPtrunking: 'SIP-транктер', - SIPtrunkingDescription: 'SIP транктерінің сипаттамасы', - }, - chatGateways: { - templates: { - templates: 'Үлгілер', - title: 'Workspaceтегі абоненттің жасырын аты ', - close: 'Чатты аяқтау хабары', - join: 'Оператордың қосылу хабарламасы', - left: 'Операторды ажырату хабарламасы', - }, - chatGateways: 'Мәтіндік шлюз | Мәтіндік шлюздер', - allChatGateways: 'Барлық мәтіндік шлюздер', - telegramBot: { - telegramBot: 'Telegram Бот', - }, - telegramApp: { - telegramApp: 'Telegram қосымшасы', - signedAs: 'Сіз ... авторландыңыз', - metadata: { - apiId: 'API идентификатор', - apiHash: 'API хэш', - }, - }, - infobip: {}, - messenger: { - addOrRemovePages: 'Парақшаларды қосу немесе жою', - accounts: 'Аккаунттар', - metadata: {}, - facebook: { - pages: 'Facebook парақшалары', - subscription: 'Webhook жазылымдары', - }, - instagram: { - comments: 'Пікірлерді қадағалау', - mentions: 'Ескертуді қадағалау', - }, - whatsapp: { - token: 'Токен', - status: 'Мәртебе', - number: 'Телефон нөмірі', - review: 'Қарастыру', - }, - }, - viber: { - style: { - style: 'Стиль', - btnBackColor: 'Батырма фонының түсі', - btnFontColor: 'Батырма мәтінінің түсі', - }, - }, - webchat: { - copyCode: 'Кодты көшіру', - copyCodeHint: 'Баптауды әр өзгерткеннен кейін сайтқа Виджет кодын қайта жасау және енгізу қажет', - metadata: { - mediaMaxSize: 'Ең жоғарғы файл көлемі (МБ)', - }, - view: { - borderRadius: 'Батырма түрі', - language: 'Тіл', - view: 'Түрі', - position: 'Орналастыру', - btnColor: 'Батырманың түсі', - logoUrl: 'Логотип URL', - logoHint: 'Қолданылатын логотип пішімі - \'JPEG\' немесе \'PNG\', 24x24px', - rounded: 'Дөңгелек', - square: 'квадрат ', - right: 'Оң жақта', - left: 'Сол жақта', - static: 'Статикалық', - }, - chat: { - chat: 'Чат', - openTimeout: 'Ашылу кідірісін қосыңыз', - openTimeoutSec: 'Ашылудың кешігу уақыты', - }, - appointment: { - appointment: 'Қоңырау шалуға тапсырыс беру', - days: 'Күндер саны', - availableAgents: 'Бос агенттер', - showEmailField: 'Поштаны енгізу өрісін көрсету', - showMessageField: 'Хабарлама енгізу өрісін көрсету', - resultPageText: 'Нәтиже бетіндегі мәтін', - headingText: 'Тақырып', - subheadingText: 'Тақырыпша', - showDefaultHeading: 'Нәтиже бетінде стандартты тақырып пен тақырыпшаны көрсетіңіз', - }, - alternativeChannels: { - alternativeChannels: 'Балама арналар', - email: 'Электрондық пошта', - }, - }, - newChatGateway: 'Жаңа мәтіндік шлюз', - metadata: {}, - }, - callflow: { - callflow: 'Қоңырау конструкторы', - }, - }, - ccenter: { - ccenter: 'Байланыс орталығы', - agents: { - agents: 'Оператор | Операторлар', - supervisors: 'Супервизор | Супервизорлар', - admins: 'Әкімші | Әкімшілер', - subordinates: 'Бағынышты оператор | Бағынышты операторлар', - allAgents: 'Барлық операторлар', - state: 'Мәртебе', - progressiveCount: 'Бір уақыттағы қоңыраулар саны', - chatCount: 'Бір уақыттағы чаттар саны', - isSupervisor: 'Супервизор', - stateTime: 'Ұзақтығы', - addSkill: 'Дағды қосу', - addSubordinate: 'Бағынышты операторды қосу', - statusHistory: 'Жағдайдың тарихы', - historyState: 'Жағдай', - historyChannel: 'Арна', - historyFrom: 'бастап', - historyTo: 'Дейін', - historyDuration: 'Ұзақтығы', - payload: 'Себеп', - emptyPopup: 'Өтінемін, іріктеме баптауларын тексеріңіз', - status: { - online: 'Онлайн', - offline: 'Оффлайн', - pause: 'Үзіліс', - breakOut: 'Мәжбүрлі үзіліс', - }, - }, - auditors: { - auditors: 'Аудитор | Аудиторлар', - }, - teams: { - teams: 'Команда| Командалар', - allTeams: 'Барлық командалар', - strategy: 'Стратегия', - timing: 'Қоңырау шалу параметрлері', - maxNoAnswer: 'Жауапсыз қоңыраулардың ең аз саны', - callTimeout: 'Қоңыраудың ұзақтығы', - inviteChatTimeout: 'Чатты қабылдау уақыты', - wrapUpTime: 'Қоңыраулар арасындағы үзілістің ұзақтығы', - noAnswerDelayTime: 'Оператордың жауабы болмаған кезде күту уақыты', - taskAcceptTimeout: 'Тапсырысты қабылдау уақыты', - strategies: { - random: 'Кездейсоқ', - fewestCalls: 'Ең аз қоңырау қабылдайтын агент', - leastTalkTime: 'Сөйлесу уақыты ең қысқа агент', - topDown: 'Жоғарыдан төмен', - roundRobin: 'ретімен ', - roundRobinBucket: 'Себет ретімен', - longestIdleAgent: 'Ең көп тоқтап қалу уақыты бар агент', - skillCapacity: 'Дағды деңгейі бойынша', - }, - }, - members: { - members: 'Абонент| Абоненттер', - allMembers: 'Барлық абоненттер', - addMember: 'Абонентті қосу', - destination: 'Тағайындау', - display: 'Нөмірді көрсету', - priority: 'Басымдық', - attempts: 'Әрекет', - emptyWorkspace: 'Абоненттер табылмады', - resetMembers: { - resetMembers: 'Абоненттерді қайта іске қосыңыз', - description: 'Сіз шынымен абоненттердің сәтсіз әрекеттері бойынша қайта қоңырау шалғыңыз келе ме? ', - reset: 'Қайтадан қосу', - successResetCount: '{count} абонент сәтті қайта іске қосылды', - }, - endCause: { - abandoned: 'Жоғалған', - timeout: 'Тайм-аут', - cancel: 'Бас тартылған', - success: 'Сәтті', - failed: 'Сәтсіз', - missed: 'Қабылданбаған', - expired: 'Мерзімі өткен', - }, - }, - queues: { - queues: 'Кезек | Кезектер', - allQueues: 'Барлық кезектер', - type: 'Тип', - state: 'Жағдай', - active: 'Белсенді', - notActive: 'Белсенді емес', - activeCalls: 'Белсенді қоңыраулар', - waiting: 'Күту', - ringtone: 'Әуен', - priority: 'Басымдық', - teams: 'Команда| Командалар', - tags: 'Тегтер', - blacklist: 'Тоқтату ', - newQueue: 'Жаңа кезек', - newQueueDescription: 'Кезек түрлері', - outboundIVRQueue: 'Шығыс IVR кезегі', - outboundIVR: 'Шығыс IVR', - outboundIVRQueueDescription: 'Шығыс IVR ұйымға жеке хабарландыруларды қолдана отырып, автоматты дыбыстық қоңыраулар, SMS хабарламалар, электрондық пошта немесе әлеуметтік желілердегі хабарламалар сияқты бірнеше арна арқылы клиенттерді автоматты түрде тартуға мүмкіндік береді.', - inboundQueue: 'Кіріс кезегі', - inboundQueueDescription: 'Кіріс кезегі: Қоңырау шалушылар оператормен сөйлесу үшін кезекте күтеді.', - offlineQueue: 'Оффлайн кезек', - offlineQueueDescription: 'Автономды кезек қоңырау шалушыларға күтуді тоқтатуға, телефон нөмірін енгізуге және кері қоңырау шалуға мүмкіндік береді.', - previewDialer: 'Қоңырауды алдын ала қарау', - previewDialerDescription: 'Қоңырау бастамашысы - оператор. Нөмірді автоматты түрде теру алдында байланысты алдын ала қарау. ', - progressiveDialer: 'Прогрессивті қоңырау шалу', - progressiveDialerDescription: 'Операторды резервтеу арқылы шығыс науқан.', - predictiveDialer: 'Болжамды қоңырау', - predictiveDialerDescription: 'Қоңырауды күту уақытын барынша азайту үшін операторды алдын ала резервтеусіз шығыс науқаны.', - chatInboundQueue: 'Кіріс чат кезегі', - chatInboundQueueDescription: 'Кіріс кезегі сияқты, бірақ чаттармен', - inboundJobQueue: 'Кіріс жұмыс кезегі', - inboundJobQueueDescription: 'Кіріс жұмыс кезегі', - outboundJobQueue: 'Шығыс жұмыс кезегі', - outboundJobQueueDescription: 'Шығыс жұмыс кезегі', - strategy: 'Стратегия', - timezone: 'Уақыт белдеуі', - callLimit: 'Бір уақыттағы қоңыраулардың ең көп саны', - variables: 'Ауыспалы', - members: 'Абонент |Абоненттер', - params: 'Қоңырау шалу параметрлері', - discardAbandonedAfter: 'Абонент толық өшкенге дейінгі секундтар саны', - maxIdleAgent: 'Оператордың жауабы күтілуде', - maxIdleClient: 'Оператордың жауабы күтілуде', - maxIdleDialog: 'Хабарламаны максималды күту уақыты', - timeoutWithNoAgents: 'Агенттер болмаған кезде күту уақыты', - timeBaseScore: 'Қоңырау рейтингі', - endless: 'Қоңырауды тоқтатпау', - stickyAgent: 'Жабысқақтық', - stickyAgentSec: 'Жабысқақты күту уақыты (сек)', - autoAnswerTone: 'Автоматты жауап беру туралы ескерту сигналы', - varKey: 'Кілт', - varVal: 'Мағынасы', - endCause: 'Тоқтату себебі', - offeringAt: 'Қайта қоңырау шалу', - destination: 'Тағайындау', - expire: 'аяқталады', - originateTimeout: 'Күту уақыты', - maxAgentLine: 'Операторға бір мезгілде соғылған қоңыраулар саны', - maxAgentLose: 'Желілер терілгенге дейін тоқтату үшін қабылданбаған қоңыраулардың ең көп саны', - minAttempts: 'Болжамды түзімге ауысу әрекеттерінің саны', - maxAbandonedRate: 'Қабылданбаған қоңыраулардың рұқсат етілген %', - loadFactor: 'Жүктеме коэффициенті', - abandonRateAdjustment: 'Қабылданбаған қоңырауларды түзету', - playbackSilence: 'Аудио файлды ойнату алдында дыбысты өшіру (мс.)', - targetAbandonedRate: 'Қабылданбаған қоңыраулардың қалаулы %', - maxWaitTime: 'Ең ұзақ күту уақыты', - maxWaitingSize: 'Күту уақытының ұзақтығы', - waitBetweenRetries: 'Әрекеттер арасындағы уақыт', - waitBetweenRetriesDesc: 'Жаңа әрекеттерді кему реті бойынша іріктеу', - retryAbandoned: 'Жоғалған абоненттерді қалпына келтіру', - playbackFile: 'Файлды ойнату', - timeout: 'Қоңыраулар арасындағы үзіліс уақыты', - maxNumberOfRetry: 'Қоңырау шалу әрекеттерінің ең көп саны', - minDuration: 'Ең аз сәтті қоңыраудың ұзақтығы', - maxAttempts: 'Әрекеттердің ең көп саны', - waitForResultStatus: 'Қоңырау нәтижесін күтуде', - bucketPriority: 'Басымдық', - enabled: 'Автоматты анықтауды қосыңыз', - ai: 'Жасанды интеллект', - positiveLabels: 'Оң тегтер', - aiPlayback: 'Файлды ойнату', - allowNotSure: 'Белгісіз', - silenceNotSure: 'Тыныштық', - allowGreetingAgent: 'Амандасуға рұқсат ', - preSchema: 'Алдын ала теру схемасы', - afterSchema: 'Теруден кейінгі схема', - maxCalls: 'Тапсырмалар шегі', - maxCallsHint: 'Мәні 0 -ге тең болса, дайлер қоңырау шалмайды', - recordings: 'Жазба', - recordAll: 'Жазуды жауап бергеннен кейін бастау', - perNumbers: 'Әрбір нөмір үшін бастама', - maxWordLength: 'Сөйлемнің максималды ұзақтығы (мс)', - maxNumberOfWords: 'Сәлемдесудегі сөздердің ең аз саны', - betweenWordsSilence: 'Сөздер арасындағы үнсіздіктің ұзақтығы (мс)', - minWordLength: 'Дауыстағы үздіксіз дыбыстың ең аз ұзақтығы (мс)', - totalAnalysisTime: 'Таныудың ең көп уақыты (мс)', - silenceThreshold: 'Сөздер арасындағы үнсіздіктің максималды ұзақтығы (мс)', - afterGreetingSilence: 'Сәлемдесуден кейінгі үнсіздік ұзақтығы (мс)', - greeting: 'Максималды сәлем ұзақтығы (мс)', - initialSilence: 'Сәлемдесу алдындағы үнсіздіктің максималды ұзақтығы (мс)', - statisticTime: 'Қайта есептеу аралығы', - communications: 'Байланыс түрі', - processing: { - processing: 'Өңдеу', - enabled: 'Тапсырма нәтижесін күту', - formSchema: 'Динамикалық өңдеу схемасы', - sec: 'Өңдеу уақыты (сек)', - renewalSec: '(сек) кейін ұзартуды ұсыну', - }, - queueStrategy: { - fifo: 'FIFO (Бірінші кірді Бірінші шықты)', - lifo: 'LIFO (Соңғысы кірді Бірінші шықты)', - strict_fifo: 'StrictFIFO (Бірінші кірді Бірінші шықты)', - }, - logs: { - logs: 'Лог | Логтар', - destination: 'Тағайындау', - offeringAt: 'Тарату', - joinedAt: 'Басы', - leavingAt: 'Соңы', - duration: 'Ұзақтығы', - viewNumber: 'Нөмір', - result: 'Нәтиже', - attempts: 'Әрекет', - resultName: {}, - }, - hooks: { - hooks: 'Хук | Хуктар', - event: 'Оқиға', - eventTypes: { - joined: 'Абонент кезекке тұрды', - answered: 'Оператор қабылдады', - offering: 'Операторға бөліп беру', - bridged: 'Абонентті оператормен қосу', - missed: 'Оператор жіберіп алды', - leaving: 'Абонент кезектен шықты', - processing: 'Кейінгі өңдеу', - active: 'Белсенді әрекет', - }, - }, - }, - res: { - res: 'Ресурс | Ресурстар', - allRes: 'Барлық ресурстар', - reserve: 'Резервтік ', - searchPlaceholder: 'атауы, шлюз...', - limit: 'Лимит ', - numbers: 'Нөмір | Нөмірлер', - displayNumbers: 'Көрсетілетін нөмір', - failure: 'Іркіліс', - maxErrors: 'Қателердің максималды саны', - errorCodes: 'Қателер кодтары', - patterns: 'Шығыс нөмір шаблоны', - priority: 'Басымдық', - reserveResource: 'Резервтік ресурс', - failureDialDelay: 'Қате теру кезіндегі кідіріс', - }, - resGroups: { - resGroups: 'Ресурстар тобы | Ресурстар топтары ', - allResGroups: 'Барлық ресурстар топтары', - searchPlaceholder: 'ресурс топтарының атауы..', - addResGroup: 'Ресурстар тобын қосу', - strategy: 'Стратегия', - timerange: 'Аралық', - timerangeFrom: 'Бастап', - timerangeTo: 'Дейін', - }, - }, - integrations: { - integrations: 'Интеграция', - emptyWorkspace: 'Бөлімдегі профильдер әлі жасалмаған', - storage: { - storage: 'Сақтау орны', - allStorages: 'Барлық сақтау орындары', - type: 'Тип', - maxSize: 'Сақтау орнының көлемі (GB)', - expireDays: 'Сақтау мерзімі', - priority: 'Басымдық', - newStorage: 'Жаңа сақтау орны', - newStorageDescription: 'Жаңа сақтау орнының сипаттамасы', - configuration: 'Конфигурация', - pathPattern: 'Жүру шаблоны', - bucket: 'Себет', - region: 'Алаң', - }, - cognitiveProfiles: { - cognitiveProfiles: 'Дыбыстық профиль | Дыбыстық профильдер', - properties: { - region: ' Аймақ', - locale: 'Тіл', - }, - }, - emailProfiles: { - emailProfiles: 'Email профилі | Email профильдері', - mailbox: 'Пошта жәшігі', - fetchInterval: 'Жаңарту аралығы', - }, - importCsv: { - importCsv: 'CSV файлынан деректерді импорттау | CSV файлдарынан деректерді импорттау', - allImportsCsv: 'CSV файлдарынан импортталған барлық деректер ', - source: 'Импорттауды тағайындау', - settings: 'Баптау', - mappings: 'Өрістер маппингі', - mappingsHint: 'Бұл бөлімде CSV файлының бағандарының атауларын төменгі өрістерде олардың тақырыптарына сәйкес көрсету қажет', - columnHeader: 'Баған', - members: { - clearMembers: 'Абоненттерді жою', - }, - }, - tokens: { - tokens: 'Токен | Токендер ', - allTokens: 'Барлық токендер ', - expires: 'Мерзімі аяқталады', - popupMessage: 'Кілт файлын жүктеп алыңыз немесе оны көшіріп алыңыз. Кілт файлын қазір жүктеп алмасаңыз, оны қайтадан шығарып ала алмайсыз. Қауіпсіздікті арттыру үшін кілтті қауіпсіз жерде сақтаңыз және оны ешкімге бермеңіз', - tokenCreated: 'Сіздің токеніңіз сәтті жасалды', - }, - triggers: { - triggers: 'Триггер | Триггерлер', - allTriggers: 'Барлық триггерлер', - type: 'Тип', - schema: 'Схема', - newTrigger: 'Жаңа триггер', - expression: 'Мән', - timeout: 'кідіру', - logs: { - logs: 'Басталу тарихы', - startedAt: 'Басы', - result: 'Нәтиже', - resultName: { - idle: 'Белсенді емес', - active: 'Белсенді', - done: 'Аяқталған', - error: 'Қате', - }, - }, - }, - }, - pagination: { - rowsPerPage: 'Бір беттегі жолдар саны', - }, - }, - filters: { - team: 'Команда', - queueType: 'Кезек түрі', - }, - utils: { - downloadFilesBtn: { - downloadFiles: 'Файлдарды жүктеп алу', - filesLoaded: 'жүктелген файлдар', - zippingProgress: 'Мұрағаттау прогресі', - }, - }, - errorPages: { - goToHome: 'Басына оралу', - page403: { - title: 'Кіру мүмкіндігі жоқ', - text: 'Кешіріңіз, сіздің бұл бетті қарауға құқығыңыз жоқ', - }, - page404: { - title: 'Сіз адасып кеткен сияқтысыз', - text: 'Кешіріңіз, біз сіз іздеген мәліметті таба алмаймыз', - }, - }, - icon: { - docs: 'Құжаттама', - logout: 'Шығу', - account: 'Аккаунт', - appNavigator: 'Қосымшалар навигаторы', - settings: 'Баптау', - }, - iconHints: { - upload: 'Жүктеу', - reload: 'Жаңарту', - edit: 'Өңдеу', - delete: 'Жою', - deleteAll: 'Барлық нысандарды жою', - deleteSelected: '{count} таңдалған нысандарды жою ', - deleteFiltered: 'Барлық іріктелген нысандарды жою', - generate: 'Жасау', - add: 'Қосу', - history: 'Тарих', - download: 'Жүктеу', - downloadAll: 'Бәрін жүктеу', - draggable: 'Жылжытып апару', - play: 'Ойнау', - pause: 'Үзіліс', - resume: 'Қайтадан жалғастыру', - close: 'Жабу', - volume: 'Дыбыс деңгейі', - stop: 'Тоқтату', - members: 'Абоненттер', - moveUp: 'Жоғарыға жылжыту', - moveDown: 'Төменге жылжыту', - nextPage: 'Келесі бет', - prevPage: 'Алдыңғы бет', - expand: 'Ашу', - collapse: 'Жабу', - }, - errors: { - invalidJson: 'Жарамсыз JSON', - }, - reusable: { - time: { - t15m: '15 мин', - t30m: '30 мин', - t45m: '45 мин', - t1h: '1 сағат', - t3h: '4 сағат', - t6h: '6 сағат', - }, - }, + title6: "Қол жеткізу құқықтарын күйге келтіру", + text6: + "Құқықтарды басқарудың жаңа модулі – бақылаудың жаңа мүмкіндіктері. Сіз енгізілген өзгерістерді қадағалай отырып, тек бөлімдерге ғана емес, пайдаланушылардың әрекеттеріне де құқық бере аласыз.", + }, + }, + header: { + logout: "Шығу", + docs: "Анықтама", + }, + appNavigator: { + title: "Webitel қосымшалары", + }, + settings: { + settings: "Баптау", + changePassword: "Құпиясөзді өзгерту", + language: "Тіл", + webPhone: "Web-телефон", + useWebPhone: "Web-телефонды пайдаланушы", + useStun: "STUN пайдаланушы", + }, + validation: { + email: "Электрондық пошта мекенжайын енгізіңіз", + required: "Міндетті түрде толтырылатын өріс", + sameAs: "Құпия сөз қате", + minValue: "мәні кем дегенде .....болуы керек", + maxValue: "Мәні тым үлкен болмауы керек", + numeric: "Сандар болуы керек", + requiredArrayValue: "Өріс бос болмауы керек", + isPositiveValue: "Мәні нөлден үлкен болуы керек", + cron: "қате cron- өрнегі", + }, + nav: { + directory: { + directory: "Каталог", + }, + routing: { + routing: "Бағыттау", + }, + lookups: { + lookups: "Анықтамалар", + }, + ccenter: { + ccenter: "Байланыс орталығы", + }, + integrations: { + integrations: "Интеграциялар", + }, + permissions: { + permissions: "Рұқсат", + }, + }, + home: { + dashboard: "Есептер", + welcomeText: "Қош келдіңіз!", + news: "Жаңалықтар", + }, + objects: { + all: "Барлығы { entity }", + administration: "Басқару ", + general: "Жалпы", + new: "Жаңа нысан", + add: "Қосу", + create: "Жасау", + read: "Оқу", + edit: "Редакциялау", + delete: "Жою", + save: "Сақтау", + saved: "Сақталған", + saveAs: "Жаңа ретінде сақтаңыз", + close: "Жабу", + next: "Әрі қарай", + back: "Артқа", + change: "Ауыстыру", + name: "Аты", + description: "Сипаттама", + user: "Пайдаланушы", + users: "Пайдаланушылар", + password: "Құпиясөз", + history: "Тарих", + copy: "Көшіру", + copied: "Көшірілді!", + createdAt: "Жасалды", + createdBy: "Кім жасады", + importCSV: "CSV импорттау", + online: "Онлайн", + offline: "Оффлайн", + enabled: "енгізілген", + status: "Мәртебе", + from: "бастап", + to: "дейін", + importJSON: "JSON импорттау", + addNew: "қосу", + provider: "Провайдер", + default: "Ұйғарым бойынша", + service: "Сервис", + key: "Кілт", + email: "Электрондық поштаның мекенжайы", + updatedAt: "Өзгертілді", + emptyWorkspace: "Бөлімде әлі жазбалар жазылмаған", + emptyResultSearch: "Іздеу еш нәтиже бермеді", + deleteConfirmation: { + title: "Жоюды растаңыз", + askingAlert: + "{count} жазбасын жойғыңыз келетініне сенімдісіз бе? | {count} жазбасын жойғыңыз келетініне сенімдісіз бе?", + undoneActionAlert: "Бұл әрекетті қайтару мүмкін емес.", + deleteAll: "БАРЛЫҒЫ", + }, + CSV: { + skipHeaders: "Тақырыптарды жию", + separator: "Ажыратқыш", + CSVColumn: "CSV өрісі", + fieldName: "Өріс атауы", + clearMember: "Абонентті тазалау", + }, + generalInfo: "жалпы ақпарат", + directory: { + directory: "Каталог", + users: { + users: "Пайдаланушы | Пайдаланушылар", + allUsers: "Барлық пайдаланушылар", + searchPlaceholder: "Аты, пайдаланушы, телефон нөмірлері, мәртебесі", + login: "Логин", + extensions: "Ішкі нөмір", + state: "Мәртебе", + status: "Мәртебе", + roles: "Рөлдері", + tokens: "Токендер", + usage: "Пайдалану", + roleAdmin: "Әкімші", + license: "Лицензия", + devices: "Құрылғы", + defaultDevice: + "Ұйғарым бойынша құрылғы (таңдалған құрылғылар тізімінен)", + deviceNotFound: "Құрылғыңызды таба алмадыңыз ба?", + createNewDevice: "Жаңасын қосыңыз", + variables: "Ауыспалы", + varKey: "Кілт", + varVal: "Мәні", + token: "Токен | Токендер", + tokenPopupHeader: "Сіздің токен-кілтіңіз сәтті жасалды!", + tokenPopupText: + "Файлды қазір кілтпен жүктеп алыңыз немесе оны кейінірек пайдалану үшін көшіріңіз. Егер файл кілтін қазір жүктемесеңіз,токен-кілтіңізді қайтадан ала алмайсыз. Сіздің қауіпсіздігіңіз үшін токен-кілтіңізді ешкімге бермеңіз.", + tokenPopupCopy: "Көшіру", + tokenPopupSave: "TXT форматында сақтаңыз", + }, + license: { + customers: "Пайдаланушылар", + license: "Лицензия | Лицензиялар", + allCustomers: "Барлық пайдаланушылар", + allLicenses: "Барлық лицензиялар", + serial: "Серия", + product: "Өнім", + validFrom: "Бастап жарамды", + validTill: "дейін жарамды", + used: "Пайдаланылған", + limit: "Лимит ", + status: "Мәртебе", + competitive: "Бәсекелес", + searchPlaceholder: "Серия, өнім", + domain: "Домен", + daysToExpire: { + 0: "Жарамдылық мерзімінің өтуі", + 30: "30 немесе одан аз", + 90: "90 немесе одан аз", + days: "күндер", + }, + importLicense: "Лицензияны жүктеп алу", + licenseKey: "Лицензия кілті", + }, + devices: { + devices: "Құрылғы | Құрылғылар", + allDevices: "Барлық құрылғылар", + newDevice: "Жаңа құрылғы", + newDeviceDescription: "Жаңа құрылғының сипаттамасы", + hotdeskDeviceSettings: "Құрылғының ауысымдық қолданылуын баптау", + searchPlaceholder: + "Атауы, пайдаланушы, идентификатор & компьютер идентификаторы", + authId: "Идентификатор", + presence: "Ағымдағы мәртебесі", + hotdesk: "Hot desking", + hotdeskDevice: "Hot desking құрылғы", + hotdeskIncorrectInput: "Хост атауы қате", + hotdeskInputHint: + "Хост атауы үшін дұрыс таңбаларды пайдаланыңыз. Рұқсат етілген таңбалар: A-Z, a-z, 0-9, -, _", + deviceSettings: "Құрылғының баптаулары", + hostName: "Хост атауы", + phoneInfo: "Телефон туралы ақпарат", + phone: "Телефон ", + vendor: "Өндіруші", + model: "Моделі", + deviceHistory: "Пайдалдану тарихы", + loggedIn: "Жүйеде", + loggedOut: "Жүйеден шықты", + state: { + nonreg: "Тіркелмеген", + reged: "Тіркелген", + ringing: "Қоңырау шалу", + dialing: "Теру", + dialog: "Әңгімелесуде", + onhold: "Күтуде", + }, + passwordSetFromAccount: + "Құпиясөзді орнатпасаңыз, ол аккаунтыңызбен бірдей болады", + }, + }, + permissions: { + permissions: "Рұқсат", + permissionsRole: "Рөл | Рөлдер", + allRoles: "Барлық рөлдер", + searchPlaceholder: "Рөл ", + roles: { + permissions: { + permissions: "Рөлге қосылу құқығы | Рөлдерге қосылу құқығы", + add: "Құру ", + delete: "Жою", + read: "Таңдау", + write: "Түзету", + eavesdropCall: "Белсенді қоңырауды тыңдау", + playbackRecordFile: "Қоңырау жазбаларын ойнату", + exportDataGrid: "Деректерді экспорттау", + viewCdrPhoneNumbers: "Шифрланбаған телефон нөмірлерін қарау", + manageUserRoles: "Пайдаланушы рөлдерін басқару", + manageUserLicense: "Пайдаланушы лицензиясын басқару", + changeUserPassword: "Пайдаланушың құпиясөзін өзгерту", + addDescription: "Нысандарды жасауға рұқсат береді", + deleteDescription: "Нысандарды жоюға рұқсат береді", + readDescription: "Нысандарды таңдауға рұқсат береді", + writeDescription: "Нысандарды өзгертуге рұқсат береді", + eavesdropCallDescription: "Белсенді әңгімені тыңдауға рұқсат береді", + playbackRecordFileDescription: + "Сөйлесу жазбалары бар файлдарды ойнатуға рұқсат береді", + exportDataGridDescription: "Деректерді экспорттауға рұқсат береді", + viewCdrPhoneNumbersDescription: + "Шифрланбаған телефон нөмірлерін көрсетуге рұқсат береді", + manageUserRolesDescription: + "Пайдаланушы рөлдерінің жиынын басқаруға рұқсат береді", + manageUserLicenseDescription: + "Пайдаланушы лицензияларының жинағын басқаруға рұқсат береді", + changeUserPasswordDescription: + "Пайдаланушының құпиясөзін өзгертуге рұқсат береді", + }, + addPermission: "Рөлге кіру құқығын қосыңыз", + usage: "Пайдалану ", + applicationsAccess: { + applicationsAccess: "Қосымша | Қосымшалар", + access: "Қол жеткізу", + }, + }, + object: { + object: "Бөлімдер", + allObjects: "Барлық бөлімдер", + ObAC: "Әрекеттерді басқару", + RbAC: "Жазбаларды басқару", + operations: "Әрекеттер", + searchPlaceholder: "... бөлім", + newPermissionRole: "Жаңа құқық иесі", + rbacDefault: "Ұйғарым бойынша жазбаларға кіру құқығы", + grantor: "құқық беруші", + grantee: "Алушы", + create: "Жасау", + delete: "Жою", + accessMode: { + 1: "Тыйым салынады", + 2: "Рұқсат", + 3: "Басқару ", + }, + }, + }, + lookups: { + lookups: "Анықтамалықтар", + skills: { + skills: "Дағды | Дағдылар", + capacity: "Әлеует", + minCapacity: "Ең төменгі әлеует", + minCapacityLessOrEqualToMaxCapacityValidator: + "Ең жоғарғы әлеуеттен төмен немесе тең болуы керек", + maxCapacity: "Ең жоғарғы әлеует", + maxCapacityMoreOrEqualToMinCapacityValidator: + "Ең төменгі әлеуеттен үлкен немесе тең болуы керек", + lvl: "Деңгей", + agentSkills: "Оператор дағдылары | Операторлардың дағдылары", + allSkills: "Барлық дағдылар", + state: "Жағдай", + stateForAll: "Барлығына арналған жағдай ", + changeSkillTo: "дағдыны.... ауыстыру", + changeAgentsSkill: "Операторлар үшін дағдыны ауыстыру", + totalAgents: "Барлық операторлар", + activeSkillAgents: "Белсенді дағдымен ", + assignSkillToAgents: "Операторларға дағдыны тағайындау", + assignAgent: "Операторды тағайындау", + selectCapacityAndState: "Әлеует пен жағдайды таңдаңыз", + }, + buckets: { + buckets: "Себет | Себеттер", + allBuckets: "Барлық себеттер", + addBucket: "Себетті қосу", + }, + blacklist: { + blacklist: "Тізім | Тізімдер", + allBlacklists: "Барлық тізімдер", + number: "Нөмір | Нөмірлер", + newNumber: "Жаңа нөмір", + numbersCount: "Нөмірлер", + expireAt: "Жарамдылық мерзімі", + temporary: "Уақытша", + }, + media: { + mediaFiles: "Медиафайл| Медиафайлдар", + allMediaFiles: "Барлық медиафайлдар", + createdAt: "Жасалды", + format: "Формат", + size: "Көлемі", + textToSpeech: "Сөйлеу синтезі", + popupSettings: "Баптау ", + lang: "Тіл", + voice: "Дауыс", + token: "Токен", + key: "Кілт", + dragPlaceholder: "Файлдарды жүктеп салу", + dragPlaceholderHere: "Мұнда.", + tts: { + hint: "Аудиофайл жасау", + textType: { + textType: "Мәтін типі", + }, + }, + }, + regions: { + regions: "Алаң | Алаңдар", + allRegions: "Барлық алаң", + }, + timezone: { + timezone: "Уақыт белдеуі | Уақыт белдеуі", + }, + calendars: { + calendars: "Күнтізбе | Күнтізбелер", + allCalendars: "Барлық күнтізбелер", + searchPlaceholder: "Атауы, сипаттамасы...", + timezone: "Уақыт белдеуі", + start: "Басы", + end: "Соңы", + workWeek: "Жұмыс аптасы", + holidays: "Демалыс күні | Демалыс күндері", + date: "Күні", + repeat: "Қайталау", + fulltime: "Уақытша", + everyYear: "Жыл сайын қайталау", + newHoliday: "Жаңа демалыс күні", + mon: "Дүйсенб", + tue: "Сейсенбі", + wed: "Сәрсенбі", + thu: "Бейсенбі", + fri: "Жұма", + sat: "Сенбі", + sun: "Жексенбі", + }, + communications: { + communications: "Байланыс түрі| Байланыс түрлері", + allCommunications: "Байланыстың барлық түрлері", + addCommunication: "Байланысты қосу", + code: "Код", + channels: { + [EngineCommunicationChannels.Phone]: "Телефон", + [EngineCommunicationChannels.Email]: "Электрондық пошта", + [EngineCommunicationChannels.Messaging]: "Хабарламалар", + }, + }, + pauseCause: { + pauseCause: "Оператордың мәртебесі", + allPauseCause: "Оператордың үзілісінің барлық себептері", + limit: "Лимит (мин)", + min: "Минут", + allowAdmin: "Әкімші бұл мәртебені өзгерте алады", + allowSupervisor: "Супервизор бұл мәртебені өзгерте алады", + allowAgent: "Оператор бұл мәртебені өзгерте алады", + }, + }, + routing: { + routing: "Бағыттау", + protocol: "Протокол ", + port: "Порт", + configuration: "Конфигурация", + schema: "Қоңырау схемасы", + flow: { + flow: "Схема| Схемалар", + allFlowSchemas: "Барлық схемалар", + createFlowSelectionPopup: "Жаңа схема құру", + createNew: "Жаңа схема құрасыз ба?", + editor: "Редактор", + diagram: { + diagram: "Диаграмма", + description: "Webitel Flow Diagram көмегімен жаңа схема құру", + }, + code: { + code: "Код", + description: + "Код редакторында JSON схемасын пайдаланып жаңа схема құру", + }, + }, + dialplan: { + dialplan: "Шығыс бағыттау", + dialplanRules: "Шығыс бағыттау қағидалары ", + pattern: "Белгіленген нөмірі", + dialplanRule: "Шығыс бағыттау қағидалары ", + position: "Позиция", + }, + chatplan: { + chatplan: + "Мәтіндік хабарламаны бағыттау қағидасы | Мәтіндік хабарламаны бағыттау қағидасы", + allChatplans: "Мәтіндік хабарламаны бағыттаудың барлық қағидасы", + }, + gateways: { + gateways: "Шлюз | Шлюздер", + allGateways: "Барлық шлюздер", + trunkingGateway: "Көп арналы шлюз", + registerGateway: "Шлюзді тіркеу", + stateSuccess: "Сәтті", + stateFailed: "Сәтсіз", + stateProgress: "Орындалуда", + stateNonreg: "Тіркелмеген", + proxy: "Прокси", + searchPlaceholder: "шлюзді іздеу...", + host: "Хост", + trunkingACLTitle: "Қосылуды басқару", + trunkingACL: "Көп арналы косылу тізімі", + hostnameTrunking: "Сервер/Шлюздің хосты немесе IP", + hostnameRegister: "Тіркеуші/Сервер/Шлюз Хост немесе IP", + expire: "Жарамдылық мерзімі", + authID: "Пайдаланушының аты", + account: "Аккаунт", + outboundProxy: "Шығыс SIP прокси мекенжайы", + newGateway: "Жаңа шлюз", + newGatewayDescription: "Жаңа шлюздің сипаттамасы", + SIPregistrations: "SIP тіркеу", + SIPregistrationsDescription: "SIP тіркеуінің сипаттамасы", + SIPtrunking: "SIP-транктер", + SIPtrunkingDescription: "SIP транктерінің сипаттамасы", + }, + chatGateways: { + templates: { + templates: "Үлгілер", + title: "Workspaceтегі абоненттің жасырын аты ", + close: "Чатты аяқтау хабары", + join: "Оператордың қосылу хабарламасы", + left: "Операторды ажырату хабарламасы", + }, + chatGateways: "Мәтіндік шлюз | Мәтіндік шлюздер", + allChatGateways: "Барлық мәтіндік шлюздер", + telegramBot: { + telegramBot: "Telegram Бот", + }, + telegramApp: { + telegramApp: "Telegram қосымшасы", + signedAs: "Сіз ... авторландыңыз", + metadata: { + apiId: "API идентификатор", + apiHash: "API хэш", + }, + }, + infobip: {}, + messenger: { + addOrRemovePages: "Парақшаларды қосу немесе жою", + accounts: "Аккаунттар", + metadata: {}, + facebook: { + pages: "Facebook парақшалары", + subscription: "Webhook жазылымдары", + }, + instagram: { + comments: "Пікірлерді қадағалау", + mentions: "Ескертуді қадағалау", + }, + whatsapp: { + token: "Токен", + status: "Мәртебе", + number: "Телефон нөмірі", + review: "Қарастыру", + }, + }, + viber: { + style: { + style: "Стиль", + btnBackColor: "Батырма фонының түсі", + btnFontColor: "Батырма мәтінінің түсі", + }, + }, + webchat: { + copyCode: "Кодты көшіру", + copyCodeHint: + "Баптауды әр өзгерткеннен кейін сайтқа Виджет кодын қайта жасау және енгізу қажет", + metadata: { + mediaMaxSize: "Ең жоғарғы файл көлемі (МБ)", + }, + view: { + borderRadius: "Батырма түрі", + language: "Тіл", + view: "Түрі", + position: "Орналастыру", + btnColor: "Батырманың түсі", + logoUrl: "Логотип URL", + logoHint: + "Қолданылатын логотип пішімі - 'JPEG' немесе 'PNG', 24x24px", + rounded: "Дөңгелек", + square: "квадрат ", + right: "Оң жақта", + left: "Сол жақта", + static: "Статикалық", + }, + chat: { + chat: "Чат", + openTimeout: "Ашылу кідірісін қосыңыз", + openTimeoutSec: "Ашылудың кешігу уақыты", + }, + appointment: { + appointment: "Қоңырау шалуға тапсырыс беру", + days: "Күндер саны", + availableAgents: "Бос агенттер", + showEmailField: "Поштаны енгізу өрісін көрсету", + showMessageField: "Хабарлама енгізу өрісін көрсету", + resultPageText: "Нәтиже бетіндегі мәтін", + headingText: "Тақырып", + subheadingText: "Тақырыпша", + showDefaultHeading: + "Нәтиже бетінде стандартты тақырып пен тақырыпшаны көрсетіңіз", + }, + alternativeChannels: { + alternativeChannels: "Балама арналар", + email: "Электрондық пошта", + }, + }, + newChatGateway: "Жаңа мәтіндік шлюз", + metadata: {}, + }, + callflow: { + callflow: "Қоңырау конструкторы", + }, + }, + ccenter: { + ccenter: "Байланыс орталығы", + agents: { + agents: "Оператор | Операторлар", + supervisors: "Супервизор | Супервизорлар", + admins: "Әкімші | Әкімшілер", + subordinates: "Бағынышты оператор | Бағынышты операторлар", + allAgents: "Барлық операторлар", + state: "Мәртебе", + progressiveCount: "Бір уақыттағы қоңыраулар саны", + chatCount: "Бір уақыттағы чаттар саны", + isSupervisor: "Супервизор", + stateTime: "Ұзақтығы", + addSkill: "Дағды қосу", + addSubordinate: "Бағынышты операторды қосу", + statusHistory: "Жағдайдың тарихы", + historyState: "Жағдай", + historyChannel: "Арна", + historyFrom: "бастап", + historyTo: "Дейін", + historyDuration: "Ұзақтығы", + payload: "Себеп", + emptyPopup: "Өтінемін, іріктеме баптауларын тексеріңіз", + status: { + online: "Онлайн", + offline: "Оффлайн", + pause: "Үзіліс", + breakOut: "Мәжбүрлі үзіліс", + }, + }, + auditors: { + auditors: "Аудитор | Аудиторлар", + }, + teams: { + teams: "Команда| Командалар", + allTeams: "Барлық командалар", + strategy: "Стратегия", + timing: "Қоңырау шалу параметрлері", + maxNoAnswer: "Жауапсыз қоңыраулардың ең аз саны", + callTimeout: "Қоңыраудың ұзақтығы", + inviteChatTimeout: "Чатты қабылдау уақыты", + wrapUpTime: "Қоңыраулар арасындағы үзілістің ұзақтығы", + noAnswerDelayTime: "Оператордың жауабы болмаған кезде күту уақыты", + taskAcceptTimeout: "Тапсырысты қабылдау уақыты", + strategies: { + random: "Кездейсоқ", + fewestCalls: "Ең аз қоңырау қабылдайтын агент", + leastTalkTime: "Сөйлесу уақыты ең қысқа агент", + topDown: "Жоғарыдан төмен", + roundRobin: "ретімен ", + roundRobinBucket: "Себет ретімен", + longestIdleAgent: "Ең көп тоқтап қалу уақыты бар агент", + skillCapacity: "Дағды деңгейі бойынша", + }, + }, + members: { + members: "Абонент| Абоненттер", + allMembers: "Барлық абоненттер", + addMember: "Абонентті қосу", + destination: "Тағайындау", + display: "Нөмірді көрсету", + priority: "Басымдық", + attempts: "Әрекет", + emptyWorkspace: "Абоненттер табылмады", + resetMembers: { + resetMembers: "Абоненттерді қайта іске қосыңыз", + description: + "Сіз шынымен абоненттердің сәтсіз әрекеттері бойынша қайта қоңырау шалғыңыз келе ме? ", + reset: "Қайтадан қосу", + successResetCount: "{count} абонент сәтті қайта іске қосылды", + }, + endCause: { + abandoned: "Жоғалған", + timeout: "Тайм-аут", + cancel: "Бас тартылған", + success: "Сәтті", + failed: "Сәтсіз", + missed: "Қабылданбаған", + expired: "Мерзімі өткен", + }, + }, + queues: { + queues: "Кезек | Кезектер", + allQueues: "Барлық кезектер", + type: "Тип", + state: "Жағдай", + active: "Белсенді", + notActive: "Белсенді емес", + activeCalls: "Белсенді қоңыраулар", + waiting: "Күту", + ringtone: "Әуен", + priority: "Басымдық", + teams: "Команда| Командалар", + tags: "Тегтер", + blacklist: "Тоқтату ", + newQueue: "Жаңа кезек", + newQueueDescription: "Кезек түрлері", + outboundIVRQueue: "Шығыс IVR кезегі", + outboundIVR: "Шығыс IVR", + outboundIVRQueueDescription: + "Шығыс IVR ұйымға жеке хабарландыруларды қолдана отырып, автоматты дыбыстық қоңыраулар, SMS хабарламалар, электрондық пошта немесе әлеуметтік желілердегі хабарламалар сияқты бірнеше арна арқылы клиенттерді автоматты түрде тартуға мүмкіндік береді.", + inboundQueue: "Кіріс кезегі", + inboundQueueDescription: + "Кіріс кезегі: Қоңырау шалушылар оператормен сөйлесу үшін кезекте күтеді.", + offlineQueue: "Оффлайн кезек", + offlineQueueDescription: + "Автономды кезек қоңырау шалушыларға күтуді тоқтатуға, телефон нөмірін енгізуге және кері қоңырау шалуға мүмкіндік береді.", + previewDialer: "Қоңырауды алдын ала қарау", + previewDialerDescription: + "Қоңырау бастамашысы - оператор. Нөмірді автоматты түрде теру алдында байланысты алдын ала қарау. ", + progressiveDialer: "Прогрессивті қоңырау шалу", + progressiveDialerDescription: + "Операторды резервтеу арқылы шығыс науқан.", + predictiveDialer: "Болжамды қоңырау", + predictiveDialerDescription: + "Қоңырауды күту уақытын барынша азайту үшін операторды алдын ала резервтеусіз шығыс науқаны.", + chatInboundQueue: "Кіріс чат кезегі", + chatInboundQueueDescription: "Кіріс кезегі сияқты, бірақ чаттармен", + inboundJobQueue: "Кіріс жұмыс кезегі", + inboundJobQueueDescription: "Кіріс жұмыс кезегі", + outboundJobQueue: "Шығыс жұмыс кезегі", + outboundJobQueueDescription: "Шығыс жұмыс кезегі", + strategy: "Стратегия", + timezone: "Уақыт белдеуі", + callLimit: "Бір уақыттағы қоңыраулардың ең көп саны", + variables: "Ауыспалы", + members: "Абонент |Абоненттер", + params: "Қоңырау шалу параметрлері", + discardAbandonedAfter: "Абонент толық өшкенге дейінгі секундтар саны", + maxIdleAgent: "Оператордың жауабы күтілуде", + maxIdleClient: "Оператордың жауабы күтілуде", + maxIdleDialog: "Хабарламаны максималды күту уақыты", + timeoutWithNoAgents: "Агенттер болмаған кезде күту уақыты", + timeBaseScore: "Қоңырау рейтингі", + endless: "Қоңырауды тоқтатпау", + stickyAgent: "Жабысқақтық", + stickyAgentSec: "Жабысқақты күту уақыты (сек)", + autoAnswerTone: "Автоматты жауап беру туралы ескерту сигналы", + varKey: "Кілт", + varVal: "Мағынасы", + endCause: "Тоқтату себебі", + offeringAt: "Қайта қоңырау шалу", + destination: "Тағайындау", + expire: "аяқталады", + originateTimeout: "Күту уақыты", + maxAgentLine: "Операторға бір мезгілде соғылған қоңыраулар саны", + maxAgentLose: + "Желілер терілгенге дейін тоқтату үшін қабылданбаған қоңыраулардың ең көп саны", + minAttempts: "Болжамды түзімге ауысу әрекеттерінің саны", + maxAbandonedRate: "Қабылданбаған қоңыраулардың рұқсат етілген %", + loadFactor: "Жүктеме коэффициенті", + abandonRateAdjustment: "Қабылданбаған қоңырауларды түзету", + playbackSilence: "Аудио файлды ойнату алдында дыбысты өшіру (мс.)", + targetAbandonedRate: "Қабылданбаған қоңыраулардың қалаулы %", + maxWaitTime: "Ең ұзақ күту уақыты", + maxWaitingSize: "Күту уақытының ұзақтығы", + waitBetweenRetries: "Әрекеттер арасындағы уақыт", + waitBetweenRetriesDesc: "Жаңа әрекеттерді кему реті бойынша іріктеу", + retryAbandoned: "Жоғалған абоненттерді қалпына келтіру", + playbackFile: "Файлды ойнату", + timeout: "Қоңыраулар арасындағы үзіліс уақыты", + maxNumberOfRetry: "Қоңырау шалу әрекеттерінің ең көп саны", + minDuration: "Ең аз сәтті қоңыраудың ұзақтығы", + maxAttempts: "Әрекеттердің ең көп саны", + waitForResultStatus: "Қоңырау нәтижесін күтуде", + bucketPriority: "Басымдық", + enabled: "Автоматты анықтауды қосыңыз", + ai: "Жасанды интеллект", + positiveLabels: "Оң тегтер", + aiPlayback: "Файлды ойнату", + allowNotSure: "Белгісіз", + silenceNotSure: "Тыныштық", + allowGreetingAgent: "Амандасуға рұқсат ", + preSchema: "Алдын ала теру схемасы", + afterSchema: "Теруден кейінгі схема", + maxCalls: "Тапсырмалар шегі", + maxCallsHint: "Мәні 0 -ге тең болса, дайлер қоңырау шалмайды", + recordings: "Жазба", + recordAll: "Жазуды жауап бергеннен кейін бастау", + perNumbers: "Әрбір нөмір үшін бастама", + maxWordLength: "Сөйлемнің максималды ұзақтығы (мс)", + maxNumberOfWords: "Сәлемдесудегі сөздердің ең аз саны", + betweenWordsSilence: "Сөздер арасындағы үнсіздіктің ұзақтығы (мс)", + minWordLength: "Дауыстағы үздіксіз дыбыстың ең аз ұзақтығы (мс)", + totalAnalysisTime: "Таныудың ең көп уақыты (мс)", + silenceThreshold: + "Сөздер арасындағы үнсіздіктің максималды ұзақтығы (мс)", + afterGreetingSilence: "Сәлемдесуден кейінгі үнсіздік ұзақтығы (мс)", + greeting: "Максималды сәлем ұзақтығы (мс)", + initialSilence: + "Сәлемдесу алдындағы үнсіздіктің максималды ұзақтығы (мс)", + statisticTime: "Қайта есептеу аралығы", + communications: "Байланыс түрі", + processing: { + processing: "Өңдеу", + enabled: "Тапсырма нәтижесін күту", + formSchema: "Динамикалық өңдеу схемасы", + sec: "Өңдеу уақыты (сек)", + renewalSec: "(сек) кейін ұзартуды ұсыну", + }, + queueStrategy: { + fifo: "FIFO (Бірінші кірді Бірінші шықты)", + lifo: "LIFO (Соңғысы кірді Бірінші шықты)", + strict_fifo: "StrictFIFO (Бірінші кірді Бірінші шықты)", + }, + logs: { + logs: "Лог | Логтар", + destination: "Тағайындау", + offeringAt: "Тарату", + joinedAt: "Басы", + leavingAt: "Соңы", + duration: "Ұзақтығы", + viewNumber: "Нөмір", + result: "Нәтиже", + attempts: "Әрекет", + resultName: {}, + }, + hooks: { + hooks: "Хук | Хуктар", + event: "Оқиға", + eventTypes: { + joined: "Абонент кезекке тұрды", + answered: "Оператор қабылдады", + offering: "Операторға бөліп беру", + bridged: "Абонентті оператормен қосу", + missed: "Оператор жіберіп алды", + leaving: "Абонент кезектен шықты", + processing: "Кейінгі өңдеу", + active: "Белсенді әрекет", + }, + }, + }, + res: { + res: "Ресурс | Ресурстар", + allRes: "Барлық ресурстар", + reserve: "Резервтік ", + searchPlaceholder: "атауы, шлюз...", + limit: "Лимит ", + numbers: "Нөмір | Нөмірлер", + displayNumbers: "Көрсетілетін нөмір", + failure: "Іркіліс", + maxErrors: "Қателердің максималды саны", + errorCodes: "Қателер кодтары", + patterns: "Шығыс нөмір шаблоны", + priority: "Басымдық", + reserveResource: "Резервтік ресурс", + failureDialDelay: "Қате теру кезіндегі кідіріс", + }, + resGroups: { + resGroups: "Ресурстар тобы | Ресурстар топтары ", + allResGroups: "Барлық ресурстар топтары", + searchPlaceholder: "ресурс топтарының атауы..", + addResGroup: "Ресурстар тобын қосу", + strategy: "Стратегия", + timerange: "Аралық", + timerangeFrom: "Бастап", + timerangeTo: "Дейін", + }, + }, + integrations: { + integrations: "Интеграция", + emptyWorkspace: "Бөлімдегі профильдер әлі жасалмаған", + storage: { + storage: "Сақтау орны", + allStorages: "Барлық сақтау орындары", + type: "Тип", + maxSize: "Сақтау орнының көлемі (GB)", + expireDays: "Сақтау мерзімі", + priority: "Басымдық", + newStorage: "Жаңа сақтау орны", + newStorageDescription: "Жаңа сақтау орнының сипаттамасы", + configuration: "Конфигурация", + pathPattern: "Жүру шаблоны", + bucket: "Себет", + region: "Алаң", + }, + cognitiveProfiles: { + cognitiveProfiles: "Дыбыстық профиль | Дыбыстық профильдер", + properties: { + region: " Аймақ", + locale: "Тіл", + }, + }, + emailProfiles: { + emailProfiles: "Email профилі | Email профильдері", + mailbox: "Пошта жәшігі", + fetchInterval: "Жаңарту аралығы", + }, + importCsv: { + importCsv: + "CSV файлынан деректерді импорттау | CSV файлдарынан деректерді импорттау", + allImportsCsv: "CSV файлдарынан импортталған барлық деректер ", + source: "Импорттауды тағайындау", + settings: "Баптау", + mappings: "Өрістер маппингі", + mappingsHint: + "Бұл бөлімде CSV файлының бағандарының атауларын төменгі өрістерде олардың тақырыптарына сәйкес көрсету қажет", + columnHeader: "Баған", + members: { + clearMembers: "Абоненттерді жою", + }, + }, + tokens: { + tokens: "Токен | Токендер ", + allTokens: "Барлық токендер ", + expires: "Мерзімі аяқталады", + popupMessage: + "Кілт файлын жүктеп алыңыз немесе оны көшіріп алыңыз. Кілт файлын қазір жүктеп алмасаңыз, оны қайтадан шығарып ала алмайсыз. Қауіпсіздікті арттыру үшін кілтті қауіпсіз жерде сақтаңыз және оны ешкімге бермеңіз", + tokenCreated: "Сіздің токеніңіз сәтті жасалды", + }, + triggers: { + triggers: "Триггер | Триггерлер", + allTriggers: "Барлық триггерлер", + type: "Тип", + schema: "Схема", + newTrigger: "Жаңа триггер", + expression: "Мән", + timeout: "кідіру", + logs: { + logs: "Басталу тарихы", + startedAt: "Басы", + result: "Нәтиже", + resultName: { + idle: "Белсенді емес", + active: "Белсенді", + done: "Аяқталған", + error: "Қате", + }, + }, + }, + }, + pagination: { + rowsPerPage: "Бір беттегі жолдар саны", + }, + }, + filters: { + team: "Команда", + queueType: "Кезек түрі", + }, + utils: { + downloadFilesBtn: { + downloadFiles: "Файлдарды жүктеп алу", + filesLoaded: "жүктелген файлдар", + zippingProgress: "Мұрағаттау прогресі", + }, + }, + errorPages: { + goToHome: "Басына оралу", + page403: { + title: "Кіру мүмкіндігі жоқ", + text: "Кешіріңіз, сіздің бұл бетті қарауға құқығыңыз жоқ", + }, + page404: { + title: "Сіз адасып кеткен сияқтысыз", + text: "Кешіріңіз, біз сіз іздеген мәліметті таба алмаймыз", + }, + }, + icon: { + docs: "Құжаттама", + logout: "Шығу", + account: "Аккаунт", + appNavigator: "Қосымшалар навигаторы", + settings: "Баптау", + }, + iconHints: { + upload: "Жүктеу", + reload: "Жаңарту", + edit: "Өңдеу", + delete: "Жою", + deleteAll: "Барлық нысандарды жою", + deleteSelected: "{count} таңдалған нысандарды жою ", + deleteFiltered: "Барлық іріктелген нысандарды жою", + generate: "Жасау", + add: "Қосу", + history: "Тарих", + download: "Жүктеу", + downloadAll: "Бәрін жүктеу", + draggable: "Жылжытып апару", + play: "Ойнау", + pause: "Үзіліс", + resume: "Қайтадан жалғастыру", + close: "Жабу", + volume: "Дыбыс деңгейі", + stop: "Тоқтату", + members: "Абоненттер", + moveUp: "Жоғарыға жылжыту", + moveDown: "Төменге жылжыту", + nextPage: "Келесі бет", + prevPage: "Алдыңғы бет", + expand: "Ашу", + collapse: "Жабу", + }, + errors: { + invalidJson: "Жарамсыз JSON", + }, + reusable: { + time: { + t15m: "15 мин", + t30m: "30 мин", + t45m: "45 мин", + t1h: "1 сағат", + t3h: "4 сағат", + t6h: "6 сағат", + }, + }, }; diff --git a/src/app/locale/ru/ru.js b/src/app/locale/ru/ru.js index beaf0e6b2..6698d275b 100644 --- a/src/app/locale/ru/ru.js +++ b/src/app/locale/ru/ru.js @@ -1,1178 +1,1223 @@ /* eslint-disable quote-props */ -import { EngineCommunicationChannels, LoggerAction } from 'webitel-sdk'; +import { EngineCommunicationChannels, LoggerAction } from "webitel-sdk"; export default { - auth: { - register: 'Создать', - login: 'Вход', - registerReset: 'Скинуть пароль', - detailsSubtitle: 'Введите свои данные', - resetPasswordLink: 'Забыли пароль?', - user: 'Имя пользователя', - password: 'Пароль', - confirmPassword: 'Повторить пароль', - key: 'Лицензионный ключ', - registerSubmit: 'Зарегистрироваться', - resetSubmit: 'Скинуть', - loginSubmit: 'Войти', - carousel: { - title1: 'Облако и в Он-сайт', - text1: 'Политика безопасности не позволяет хранить данные и использовать облачные сервисы? С Webitel вы можете построить контакт-центр на своей площадке!', + auth: { + register: "Создать", + login: "Вход", + registerReset: "Скинуть пароль", + detailsSubtitle: "Введите свои данные", + resetPasswordLink: "Забыли пароль?", + user: "Имя пользователя", + password: "Пароль", + confirmPassword: "Повторить пароль", + key: "Лицензионный ключ", + registerSubmit: "Зарегистрироваться", + resetSubmit: "Скинуть", + loginSubmit: "Войти", + carousel: { + title1: "Облако и в Он-сайт", + text1: + "Политика безопасности не позволяет хранить данные и использовать облачные сервисы? С Webitel вы можете построить контакт-центр на своей площадке!", - title2: 'Мультиканальность и Омниканальность', - text2: 'Будьте всегда и везде на связи со своими клиентами! IVR-меню любой сложности, входящие, исходящие кампании взаимодействия или сообщение в социальные сети - теперь просто как никогда!', + title2: "Мультиканальность и Омниканальность", + text2: + "Будьте всегда и везде на связи со своими клиентами! IVR-меню любой сложности, входящие, исходящие кампании взаимодействия или сообщение в социальные сети - теперь просто как никогда!", - title3: 'Отказоустойчивая инфраструктура', - text3: 'Больше никаких простоев и потерь данных. Быстрое масштабирование и отказоустойчивая архитектура позволяет обслуживать одновременно более 1000 обращений клиентов в минуту с разных каналов коммуникаций.', + title3: "Отказоустойчивая инфраструктура", + text3: + "Больше никаких простоев и потерь данных. Быстрое масштабирование и отказоустойчивая архитектура позволяет обслуживать одновременно более 1000 обращений клиентов в минуту с разных каналов коммуникаций.", - title4: 'Дизайн', - text4: 'Новый минималистичный интерфейс с максимально удобной для пользователя админ-панелью, позволяющей иметь оперативный доступ ко всем необходимым функциям. Меньше кликов - больше возможностей.', + title4: "Дизайн", + text4: + "Новый минималистичный интерфейс с максимально удобной для пользователя админ-панелью, позволяющей иметь оперативный доступ ко всем необходимым функциям. Меньше кликов - больше возможностей.", - title5: 'Новый модуль работы с операторскими группами', - text5: 'Максимально эффективное распределение звонков. Оператор может обладать сразу несколькими навыками для участия в разных кампаниях. Клиента обслуживают только профессионалы своего дела.', + title5: "Новый модуль работы с операторскими группами", + text5: + "Максимально эффективное распределение звонков. Оператор может обладать сразу несколькими навыками для участия в разных кампаниях. Клиента обслуживают только профессионалы своего дела.", - title6: 'Настройка прав доступа', - text6: 'Новый модуль управления правами - новые возможности для контроля. Вы можете назначать права не только на разделы, но и на действия пользователей, при этом отслеживая вносимые изменения. ', - }, - }, + title6: "Настройка прав доступа", + text6: + "Новый модуль управления правами - новые возможности для контроля. Вы можете назначать права не только на разделы, но и на действия пользователей, при этом отслеживая вносимые изменения. ", + }, + }, - header: { - logout: 'Выйти', - docs: 'Справка', - }, + header: { + logout: "Выйти", + docs: "Справка", + }, - appNavigator: { - title: 'Приложения Webitel', - admin: 'Admin', - agent: 'Agent Workspace', - supervisor: 'Supervisor Workspace', - audit: 'Audit', - history: 'Call History', - grafana: 'Grafana', - }, + appNavigator: { + title: "Приложения Webitel", + admin: "Admin", + agent: "Agent Workspace", + supervisor: "Supervisor Workspace", + audit: "Audit", + history: "Call History", + grafana: "Grafana", + }, - settings: { - settings: 'Настройка | Настройки', - changePassword: 'Изменить пароль', - language: 'Язык', - webPhone: 'Web-телефон', - useWebPhone: 'Использовать Web-телефон', - useStun: 'Использовать STUN', - }, + settings: { + settings: "Настройка | Настройки", + changePassword: "Изменить пароль", + language: "Язык", + webPhone: "Web-телефон", + useWebPhone: "Использовать Web-телефон", + useStun: "Использовать STUN", + }, - validation: { - email: 'Введите адрес электронной почты', - required: 'Обязательное поле для заполнения', - sameAs: 'Неверный пароль', - gatewayHostValidator: 'Should look like IPv4 or FQDN', - ipValidator: 'Should look like IPv4', - macValidator: 'Should look like MAC', - minValue: 'Значение должно быть не менее', - maxValue: 'Значение должно быть не слишком большим', - numeric: 'Должны быть цифры', - requiredArrayValue: 'Поле не должно быть пустым', - isPositiveValue: 'Значение должно быть больше нуля', - cron: 'Некорректное cron-выражение', - }, + validation: { + email: "Введите адрес электронной почты", + required: "Обязательное поле для заполнения", + sameAs: "Неверный пароль", + gatewayHostValidator: "Should look like IPv4 or FQDN", + ipValidator: "Should look like IPv4", + macValidator: "Should look like MAC", + minValue: "Значение должно быть не менее", + maxValue: "Значение должно быть не слишком большим", + numeric: "Должны быть цифры", + requiredArrayValue: "Поле не должно быть пустым", + isPositiveValue: "Значение должно быть больше нуля", + cron: "Некорректное cron-выражение", + }, - nav: { - directory: { - directory: 'Каталог', - }, - routing: { - routing: 'Маршрутизация', - }, - lookups: { - lookups: 'Справочники', - }, - ccenter: { - ccenter: 'Контакт-центр', - }, - integrations: { - integrations: 'Интеграции', - }, - permissions: { - permissions: 'Разрешения', - }, - system: { - system: 'Система', - }, - }, + nav: { + directory: { + directory: "Каталог", + }, + routing: { + routing: "Маршрутизация", + }, + lookups: { + lookups: "Справочники", + }, + ccenter: { + ccenter: "Контакт-центр", + }, + integrations: { + integrations: "Интеграции", + }, + permissions: { + permissions: "Разрешения", + }, + system: { + system: "Система", + }, + }, - home: { - dashboard: 'Отчеты', - welcomeText: 'Приветствуем!', - news: 'Новости', - }, + home: { + dashboard: "Отчеты", + welcomeText: "Приветствуем!", + news: "Новости", + }, - objects: { - all: 'Все {entity}', - administration: 'Управление', - general: 'Общее', - new: 'Новый объект', - add: 'Добавить', - create: 'Создать', - read: 'Читать', - edit: 'Редактировать', - delete: 'Удалить', - save: 'Сохранить', - saved: 'Сохранено', - saveAs: 'Сохранить как нового', - close: 'Закрыть', - next: 'Далее', - back: 'Назад', - change: 'Заменить', - name: 'Имя', - title: 'Название', - description: 'Описание', - user: 'Пользователь', - users: 'Пользователи', - action: 'Action', - allow: 'Allow', - password: 'Пароль', - history: 'История', - copy: 'Копировать', - copied: 'Скопировано!', - createdAt: 'Создано', - createdBy: 'Кем создан', - importCSV: 'Импортировать CSV', - online: 'Онлайн', - offline: 'Оффлайн', - on: 'On', - off: 'Off', - ok: 'Ok', - enabled: 'Включено', - status: 'Статус', - from: 'От', - to: 'До', - importJSON: 'Импортировать JSON', - addNew: 'Добавить', - provider: 'Провайдер', - default: 'По умолчанию', - service: 'Сервис', - tts: 'Text-to-Speech', - stt: 'Speech-to-Text', - key: 'Ключ', - ID: 'ID', - email: 'Адрес электронной почты', - updatedAt: 'Изменено', - emptyWorkspace: 'Записи в разделе еще не созданы', - emptyResultSearch: 'Поиск не дал результатов', + objects: { + all: "Все {entity}", + administration: "Управление", + general: "Общее", + new: "Новый объект", + add: "Добавить", + create: "Создать", + read: "Читать", + edit: "Редактировать", + delete: "Удалить", + save: "Сохранить", + saved: "Сохранено", + saveAs: "Сохранить как нового", + close: "Закрыть", + next: "Далее", + back: "Назад", + change: "Заменить", + name: "Имя", + title: "Название", + description: "Описание", + user: "Пользователь", + users: "Пользователи", + action: "Action", + allow: "Allow", + password: "Пароль", + history: "История", + copy: "Копировать", + copied: "Скопировано!", + createdAt: "Создано", + createdBy: "Кем создан", + importCSV: "Импортировать CSV", + online: "Онлайн", + offline: "Оффлайн", + on: "On", + off: "Off", + ok: "Ok", + enabled: "Включено", + status: "Статус", + from: "От", + to: "До", + importJSON: "Импортировать JSON", + addNew: "Добавить", + provider: "Провайдер", + default: "По умолчанию", + service: "Сервис", + tts: "Text-to-Speech", + stt: "Speech-to-Text", + key: "Ключ", + ID: "ID", + email: "Адрес электронной почты", + updatedAt: "Изменено", + emptyWorkspace: "Записи в разделе еще не созданы", + emptyResultSearch: "Поиск не дал результатов", - deleteConfirmation: { - title: 'Подтвердите удаление', - askingAlert: 'Вы уверенны, что хотите удалить {count} запись? | Вы уверенны, что хотите удалить {count} записей?', - undoneActionAlert: 'Это действие не может быть отменено.', - deleteAll: 'ВСЕ', - }, - CSV: { - skipHeaders: 'Свернуть заголовки', - charSet: 'Char set', - separator: 'Разделитель', - CSVColumn: 'CSV поле', - fieldName: 'Название поля', - clearMember: 'Очистить абонента', - }, - generalInfo: 'Общая информация', - objectHeader: {}, - directory: { - directory: 'Каталог', - passwordInfo: 'Введите значение только если хотите его перезаписать (или задать новое). Пустое поле оставит значение тем же.', - users: { - users: 'Пользователь | Пользователи', - allUsers: 'Все пользователи', - searchPlaceholder: 'Имя, пользователь, номера телефона, статус', - login: 'Логин', - extensions: 'Внутренний номер', - state: 'Статус', - DnD: 'DnD', - status: 'Статус', - roles: 'Роли', - tokens: 'Токены', - usage: 'Использование', - roleAdmin: 'Администратор', - license: 'Лицензия', - devices: 'Устройство', - defaultDevice: 'Устройство по умолчанию (из списка выбраных устройств)', - deviceNotFound: 'Не смогли найти свое устройство?', - createNewDevice: 'Добавить новое', - variables: 'Переменные', - varKey: 'Ключ', - varVal: 'Значение', - token: 'Токен | Токены', - tokenPopupHeader: 'Ваш токен-ключ был успешно создан!', - tokenPopupText: 'Загрузите файл с ключом сейчас или скопируйте его для дальнейшего использования. Если вы не загрузите файл ключа сейчас, вы не сможете получить свой токен-ключ снова. Для вашей безопасности никому не передавайте свой токен-ключ.', - tokenPopupCopy: 'Копировать', - tokenPopupSave: 'Сохранить в формате TXT', - userIp: 'IP пользователя', - userId: 'ID пользователя', - download: 'Скачать', - regenerate: 'Перегенерировать', - askingAlert: 'Вы уверены, что хотите перегенерировать QR-код? Пользователь потеряет возможность войти в систему', - }, - license: { - customers: 'Пользователи', - license: 'Лицензия | Лицензии', - licenseId: 'ID', - allCustomers: 'Все пользователи', - allLicenses: 'Все лицензии', - serial: 'Серия', - product: 'Продукт', - validFrom: 'Действительно с', - validTill: 'Действительно до', - used: 'Использовано', - limit: 'Лимит', - status: 'Статус', - competitive: 'Конкурентная', - searchPlaceholder: 'Серия, продукт', - domain: 'Домен', - daysToExpire: { - '0': 'Истечение срока действия', - '30': '30 или меньше', - '90': '90 или меньше', - days: ' дней', - }, - importLicense: 'Загрузить лицензию', - licenseKey: 'Лицензионный ключ', - }, - devices: { - devices: 'Устройство | Устройства', - allDevices: 'Все устройства', - newDevice: 'Новое устройство', - newDeviceDescription: 'Описание нового устройства', - hotdeskDeviceSettings: 'Настройка посменного использования устройства', - searchPlaceholder: 'Название, пользователь, идентификатор & идентификатор компьютера', - authId: 'Идентификатор', - presence: 'Актуальный статус', - hotdesk: 'Hot desking', - hotdeskDevice: 'Hot desking устройство', - hotdeskIncorrectInput: 'Неправильное имя хоста', - hotdeskInputHint: 'Для имени хоста используйте правильные символы. Разрешены символы: A-Z, a-z, 0-9, -, _', - deviceSettings: 'Настройки устройства', - hostName: 'Имя хоста', - phoneInfo: 'Информация о телефоне', - phone: 'Телефон', - vendor: 'Производитель', - model: 'Модель', - ipv4: 'IPv4', - mac: 'MAC', - deviceHistory: 'История пользования', - loggedIn: 'В системе', - loggedOut: 'Вышел из системы', - state: { - nonreg: 'Не зарегистрировано', - reged: 'Зарегистрировано', - ringing: 'Звонит', - dialing: 'Набирает', - dialog: 'В разговоре', - onhold: 'На удержании', - }, - passwordSetFromAccount: 'Если вы не установите пароль, он будет таким же, как аккаунт', - }, - }, - permissions: { - permissions: 'Разрешения', - permissionsRole: 'Роль | Роли', - allRoles: 'Все роли', - searchPlaceholder: 'роль ..', - roles: { - permissions: { - permissions: 'Право доступа роли | Права доступа ролей', - add: 'Создавать', - delete: 'Удалять', - read: 'Выбирать', - write: 'Редактировать', - eavesdropCall: 'Прослушивать активный звонок', - playbackRecordFile: 'Воспроизводить записи разговоров', - exportDataGrid: 'Экспортировать данные', - viewCdrPhoneNumbers: 'Просмотр незашифрованных номеров телефонов', - manageUserRoles: 'Управление ролями пользователей', - manageUserLicense: 'Управление лицензиями пользователей', - changeUserPassword: 'Изменять пароли пользователей', - systemSetting: 'Управление системными конфигурациями', - addDescription: 'Предоставляет разрешение на создание объектов', - deleteDescription: 'Предоставляет разрешение на удаление объектов', - readDescription: 'Предоставляет разрешение на выбор объектов', - writeDescription: 'Предоставляет разрешение на изменение объектов', - eavesdropCallDescription: 'Предоставляет разрешение на прослушивание активного разговора', - playbackRecordFileDescription: 'Предоставляет разрешение на воспроизведение файлов с записями разговоров', - exportDataGridDescription: 'Предоставляет разрешение на экспорт данных', - viewCdrPhoneNumbersDescription: 'Предоставляет разрешение на отображение незашифрованных телефонных номеров', - manageUserRolesDescription: 'Предоставляет разрешение на управление набором ролей пользователей', - manageUserLicenseDescription: 'Предоставляет разрешение на управление набором пользовательских лицензий', - changeUserPasswordDescription: 'Предоставляет разрешение на изменение пароля пользователя', - systemSettingDescription: 'Предоставляет разрешение на управление разделом Конфигурация', - schemeVariables: 'Управление глобальными переменными', - schemeVariablesDescription: 'Предоставляет разрешение на управление разделом Глобальные переменные', - }, - addPermission: 'Добавить право доступа для роли', - usage: 'Использование', - applicationsAccess: { - applicationsAccess: 'Приложение | Приложения', - access: 'Доступ', - }, - }, - object: { - object: 'Разделы', - allObjects: 'Все разделы', - ObAC: 'Управление действиями', - RbAC: 'Управление записями', - operations: 'Действия', - searchPlaceholder: 'раздел ..', - newPermissionRole: 'Новый владелец прав', - rbacDefault: 'Права доступа по записям по умолчанию', - grantor: 'Праводатель', - grantee: 'Получатель', - create: 'Создавать', - delete: 'Удалять', - accessMode: { - '1': 'Запрещено', - '2': 'Разрешено', - '3': 'Управление', - }, - }, - }, - lookups: { - lookups: 'Справочники', - skills: { - skills: 'Навык | Навыки', - capacity: 'Потенциал', - minCapacity: 'Минимальный потенциал', - minCapacityLessOrEqualToMaxCapacityValidator: 'Должно быть меньше или равно Максимальному потенциалу', - maxCapacity: 'Максимальный потенциал', - maxCapacityMoreOrEqualToMinCapacityValidator: 'Должно быть больше или равно Минимальному потенциалу', - lvl: 'Уровень', - agentSkills: 'Навыки оператора | Навыки операторов', - allSkills: 'Все навыки', - state: 'Состояние', - stateForAll: 'Состояние для всех', - changeSkillTo: 'Заменить навык на', - changeAgentsSkill: 'Заменить навык операторам', - totalAgents: 'Всего операторов', - activeSkillAgents: 'С активным навыком', - assignSkillToAgents: 'Назначить навык операторам', - assignAgent: 'Назначить оператора', - selectCapacityAndState: 'Выбрать потенциал и состояние', - }, - buckets: { - buckets: 'Корзина | Корзины', - allBuckets: 'Все корзины', - addBucket: 'Добавить корзину', - }, - blacklist: { - blacklist: 'Список | Списки', - allBlacklists: 'Все списки', - number: 'Номер | Номера', - newNumber: 'Новый номер', - numbersCount: 'Номера', - expireAt: 'Срок действия', - temporary: 'Временный', - }, - media: { - mediaFiles: 'Медиафайл| Медиафайлы', - allMediaFiles: 'Все медиафайлы', - createdAt: 'Создано', - format: 'Формат', - size: 'Размер', - textToSpeech: 'Синтез речи', - popupSettings: 'Настройки', - lang: 'Язык', - voice: 'Голос', - token: 'Токен', - key: 'Ключ', - dragPlaceholder: 'Загрузка файлов', - dragPlaceholderHere: 'здесь.', - tts: { - hint: 'Создать аудиофайл', - textType: { - textType: 'Тип текста', - ssml: 'SSML', - }, - }, - }, - regions: { - regions: 'Площадка | Площадки', - allRegions: 'Все площадки', - }, - timezone: { - timezone: 'Часовая зона | Часовые зоны', - }, - calendars: { - calendars: 'Календарь | Календари', - allCalendars: 'Все календари', - searchPlaceholder: 'Название, описание...', - timezone: 'Часовой пояс', - start: 'Начало', - end: 'Конец', - workWeek: 'Рабочая неделя', - holidays: 'Выходной | Выходные', - date: 'Дата', - repeat: 'Повторить', - fulltime: 'Временный', - everyYear: 'Повторять каждый год', - newHoliday: 'Новый выходной', - mon: 'Понедельник', - tue: 'Вторник', - wed: 'Среда', - thu: 'Четверг', - fri: 'Пятница', - sat: 'Суббота', - sun: 'Воскресение', - workingTime: 'Рабочее время', - workStart: 'Начало рабочего времени', - workStop: 'Конец рабочего времени', - }, - communications: { - communications: 'Тип связи| Типы связи', - allCommunications: 'Все типы связи', - addCommunication: 'Добавить связь', - code: 'Код', - channels: { - [EngineCommunicationChannels.Phone]: 'Телефон', - [EngineCommunicationChannels.Email]: 'Электронная почта', - [EngineCommunicationChannels.Messaging]: 'Сообщения', - }, - }, - pauseCause: { - pauseCause: 'Статусы оператора', - allPauseCause: 'Все причины паузы оператора', - limit: 'Лимит (мин)', - min: 'Минут', - allowAdmin: 'Администратор может изменять этот статус', - allowSupervisor: 'Супервизор может изменять этот статус', - allowAgent: 'Оператор может изменять этот статус', - }, - }, - routing: { - routing: 'Маршрутизация', - ip: 'IP', - protocol: 'Протокол', - port: 'Порт', - configuration: 'Конфигурация', - schema: 'Схема звонка', - json: 'JSON', + deleteConfirmation: { + title: "Подтвердите удаление", + askingAlert: + "Вы уверенны, что хотите удалить {count} запись? | Вы уверенны, что хотите удалить {count} записей?", + undoneActionAlert: "Это действие не может быть отменено.", + deleteAll: "ВСЕ", + }, + CSV: { + skipHeaders: "Свернуть заголовки", + charSet: "Char set", + separator: "Разделитель", + CSVColumn: "CSV поле", + fieldName: "Название поля", + clearMember: "Очистить абонента", + }, + generalInfo: "Общая информация", + objectHeader: {}, + directory: { + directory: "Каталог", + passwordInfo: + "Введите значение только если хотите его перезаписать (или задать новое). Пустое поле оставит значение тем же.", + users: { + users: "Пользователь | Пользователи", + allUsers: "Все пользователи", + searchPlaceholder: "Имя, пользователь, номера телефона, статус", + login: "Логин", + extensions: "Внутренний номер", + state: "Статус", + DnD: "DnD", + status: "Статус", + roles: "Роли", + tokens: "Токены", + usage: "Использование", + roleAdmin: "Администратор", + license: "Лицензия", + devices: "Устройство", + defaultDevice: "Устройство по умолчанию (из списка выбраных устройств)", + deviceNotFound: "Не смогли найти свое устройство?", + createNewDevice: "Добавить новое", + variables: "Переменные", + varKey: "Ключ", + varVal: "Значение", + token: "Токен | Токены", + tokenPopupHeader: "Ваш токен-ключ был успешно создан!", + tokenPopupText: + "Загрузите файл с ключом сейчас или скопируйте его для дальнейшего использования. Если вы не загрузите файл ключа сейчас, вы не сможете получить свой токен-ключ снова. Для вашей безопасности никому не передавайте свой токен-ключ.", + tokenPopupCopy: "Копировать", + tokenPopupSave: "Сохранить в формате TXT", + userIp: "IP пользователя", + userId: "ID пользователя", + download: "Скачать", + regenerate: "Перегенерировать", + askingAlert: + "Вы уверены, что хотите перегенерировать QR-код? Пользователь потеряет возможность войти в систему", + }, + license: { + customers: "Пользователи", + license: "Лицензия | Лицензии", + licenseId: "ID", + allCustomers: "Все пользователи", + allLicenses: "Все лицензии", + serial: "Серия", + product: "Продукт", + validFrom: "Действительно с", + validTill: "Действительно до", + used: "Использовано", + limit: "Лимит", + status: "Статус", + competitive: "Конкурентная", + searchPlaceholder: "Серия, продукт", + domain: "Домен", + daysToExpire: { + 0: "Истечение срока действия", + 30: "30 или меньше", + 90: "90 или меньше", + days: " дней", + }, + importLicense: "Загрузить лицензию", + licenseKey: "Лицензионный ключ", + }, + devices: { + devices: "Устройство | Устройства", + allDevices: "Все устройства", + newDevice: "Новое устройство", + newDeviceDescription: "Описание нового устройства", + hotdeskDeviceSettings: "Настройка посменного использования устройства", + searchPlaceholder: + "Название, пользователь, идентификатор & идентификатор компьютера", + authId: "Идентификатор", + presence: "Актуальный статус", + hotdesk: "Hot desking", + hotdeskDevice: "Hot desking устройство", + hotdeskIncorrectInput: "Неправильное имя хоста", + hotdeskInputHint: + "Для имени хоста используйте правильные символы. Разрешены символы: A-Z, a-z, 0-9, -, _", + deviceSettings: "Настройки устройства", + hostName: "Имя хоста", + phoneInfo: "Информация о телефоне", + phone: "Телефон", + vendor: "Производитель", + model: "Модель", + ipv4: "IPv4", + mac: "MAC", + deviceHistory: "История пользования", + loggedIn: "В системе", + loggedOut: "Вышел из системы", + state: { + nonreg: "Не зарегистрировано", + reged: "Зарегистрировано", + ringing: "Звонит", + dialing: "Набирает", + dialog: "В разговоре", + onhold: "На удержании", + }, + passwordSetFromAccount: + "Если вы не установите пароль, он будет таким же, как аккаунт", + }, + }, + permissions: { + permissions: "Разрешения", + permissionsRole: "Роль | Роли", + allRoles: "Все роли", + searchPlaceholder: "роль ..", + roles: { + permissions: { + permissions: "Право доступа роли | Права доступа ролей", + add: "Создавать", + delete: "Удалять", + read: "Выбирать", + write: "Редактировать", + eavesdropCall: "Прослушивать активный звонок", + playbackRecordFile: "Воспроизводить записи разговоров", + exportDataGrid: "Экспортировать данные", + viewCdrPhoneNumbers: "Просмотр незашифрованных номеров телефонов", + manageUserRoles: "Управление ролями пользователей", + manageUserLicense: "Управление лицензиями пользователей", + changeUserPassword: "Изменять пароли пользователей", + systemSetting: "Управление системными конфигурациями", + addDescription: "Предоставляет разрешение на создание объектов", + deleteDescription: "Предоставляет разрешение на удаление объектов", + readDescription: "Предоставляет разрешение на выбор объектов", + writeDescription: "Предоставляет разрешение на изменение объектов", + eavesdropCallDescription: + "Предоставляет разрешение на прослушивание активного разговора", + playbackRecordFileDescription: + "Предоставляет разрешение на воспроизведение файлов с записями разговоров", + exportDataGridDescription: + "Предоставляет разрешение на экспорт данных", + viewCdrPhoneNumbersDescription: + "Предоставляет разрешение на отображение незашифрованных телефонных номеров", + manageUserRolesDescription: + "Предоставляет разрешение на управление набором ролей пользователей", + manageUserLicenseDescription: + "Предоставляет разрешение на управление набором пользовательских лицензий", + changeUserPasswordDescription: + "Предоставляет разрешение на изменение пароля пользователя", + systemSettingDescription: + "Предоставляет разрешение на управление разделом Конфигурация", + schemeVariables: "Управление глобальными переменными", + schemeVariablesDescription: + "Предоставляет разрешение на управление разделом Глобальные переменные", + }, + addPermission: "Добавить право доступа для роли", + usage: "Использование", + applicationsAccess: { + applicationsAccess: "Приложение | Приложения", + access: "Доступ", + }, + }, + object: { + object: "Разделы", + allObjects: "Все разделы", + ObAC: "Управление действиями", + RbAC: "Управление записями", + operations: "Действия", + searchPlaceholder: "раздел ..", + newPermissionRole: "Новый владелец прав", + rbacDefault: "Права доступа по записям по умолчанию", + grantor: "Праводатель", + grantee: "Получатель", + create: "Создавать", + delete: "Удалять", + accessMode: { + 1: "Запрещено", + 2: "Разрешено", + 3: "Управление", + }, + }, + }, + lookups: { + lookups: "Справочники", + skills: { + skills: "Навык | Навыки", + capacity: "Потенциал", + minCapacity: "Минимальный потенциал", + minCapacityLessOrEqualToMaxCapacityValidator: + "Должно быть меньше или равно Максимальному потенциалу", + maxCapacity: "Максимальный потенциал", + maxCapacityMoreOrEqualToMinCapacityValidator: + "Должно быть больше или равно Минимальному потенциалу", + lvl: "Уровень", + agentSkills: "Навыки оператора | Навыки операторов", + allSkills: "Все навыки", + state: "Состояние", + stateForAll: "Состояние для всех", + changeSkillTo: "Заменить навык на", + changeAgentsSkill: "Заменить навык операторам", + totalAgents: "Всего операторов", + activeSkillAgents: "С активным навыком", + assignSkillToAgents: "Назначить навык операторам", + assignAgent: "Назначить оператора", + selectCapacityAndState: "Выбрать потенциал и состояние", + }, + buckets: { + buckets: "Корзина | Корзины", + allBuckets: "Все корзины", + addBucket: "Добавить корзину", + }, + blacklist: { + blacklist: "Список | Списки", + allBlacklists: "Все списки", + number: "Номер | Номера", + newNumber: "Новый номер", + numbersCount: "Номера", + expireAt: "Срок действия", + temporary: "Временный", + }, + media: { + mediaFiles: "Медиафайл| Медиафайлы", + allMediaFiles: "Все медиафайлы", + createdAt: "Создано", + format: "Формат", + size: "Размер", + textToSpeech: "Синтез речи", + popupSettings: "Настройки", + lang: "Язык", + voice: "Голос", + token: "Токен", + key: "Ключ", + dragPlaceholder: "Загрузка файлов", + dragPlaceholderHere: "здесь.", + tts: { + hint: "Создать аудиофайл", + textType: { + textType: "Тип текста", + ssml: "SSML", + }, + }, + }, + regions: { + regions: "Площадка | Площадки", + allRegions: "Все площадки", + }, + timezone: { + timezone: "Часовая зона | Часовые зоны", + }, + calendars: { + calendars: "Календарь | Календари", + allCalendars: "Все календари", + searchPlaceholder: "Название, описание...", + timezone: "Часовой пояс", + start: "Начало", + end: "Конец", + workWeek: "Рабочая неделя", + holidays: "Выходной | Выходные", + date: "Дата", + repeat: "Повторить", + fulltime: "Временный", + everyYear: "Повторять каждый год", + newHoliday: "Новый выходной", + mon: "Понедельник", + tue: "Вторник", + wed: "Среда", + thu: "Четверг", + fri: "Пятница", + sat: "Суббота", + sun: "Воскресение", + workingTime: "Рабочее время", + workStart: "Начало рабочего времени", + workStop: "Конец рабочего времени", + }, + communications: { + communications: "Тип связи| Типы связи", + allCommunications: "Все типы связи", + addCommunication: "Добавить связь", + code: "Код", + channels: { + [EngineCommunicationChannels.Phone]: "Телефон", + [EngineCommunicationChannels.Email]: "Электронная почта", + [EngineCommunicationChannels.Messaging]: "Сообщения", + }, + }, + pauseCause: { + pauseCause: "Статусы оператора", + allPauseCause: "Все причины паузы оператора", + limit: "Лимит (мин)", + min: "Минут", + allowAdmin: "Администратор может изменять этот статус", + allowSupervisor: "Супервизор может изменять этот статус", + allowAgent: "Оператор может изменять этот статус", + }, + }, + routing: { + routing: "Маршрутизация", + ip: "IP", + protocol: "Протокол", + port: "Порт", + configuration: "Конфигурация", + schema: "Схема звонка", + json: "JSON", - flow: { - flow: 'Схема | Схемы', - allFlowSchemas: 'Все схемы', - createFlowSelectionPopup: 'Создать новую схему', - createNew: 'Создать новую схему?', - editor: 'Редактор', - diagram: { - diagram: 'Диаграмма', - description: 'Создать новую схему используя Webitel Flow Diagram', - }, - code: { - code: 'Код', - description: 'Создать новую схему используя JSON-схему в редакторе кода', - }, - askingAlert: 'Вы хотите сохранить изменения, внесенные в "{name}" ?', - }, + flow: { + flow: "Схема | Схемы", + allFlowSchemas: "Все схемы", + createFlowSelectionPopup: "Создать новую схему", + createNew: "Создать новую схему?", + editor: "Редактор", + diagram: { + diagram: "Диаграмма", + description: "Создать новую схему используя Webitel Flow Diagram", + }, + code: { + code: "Код", + description: + "Создать новую схему используя JSON-схему в редакторе кода", + }, + askingAlert: 'Вы хотите сохранить изменения, внесенные в "{name}" ?', + }, - dialplan: { - dialplan: 'Исходящая маршрутизация', - dialplanRules: 'Правила исходящей маршрутизации', - pattern: 'Номер назначения', - dialplanRule: 'Правило исходящей маршрутизации', - position: 'Позиция', - }, + dialplan: { + dialplan: "Исходящая маршрутизация", + dialplanRules: "Правила исходящей маршрутизации", + pattern: "Номер назначения", + dialplanRule: "Правило исходящей маршрутизации", + position: "Позиция", + }, - chatplan: { - chatplan: 'Правило маршрутизации текстовых сообщений | Правила маршрутизации текстовых сообщений', - allChatplans: 'Все правила маршрутизации текстовых сообщений', - }, + chatplan: { + chatplan: + "Правило маршрутизации текстовых сообщений | Правила маршрутизации текстовых сообщений", + allChatplans: "Все правила маршрутизации текстовых сообщений", + }, - gateways: { - gateways: 'Шлюз | Шлюзы', - allGateways: 'Все шлюзы', - trunkingGateway: 'Многоканальный шлюз', - registerGateway: 'Зарегистрировать шлюз', - stateSuccess: 'Успешно', - stateFailed: 'Неудачно', - stateProgress: 'В процессе', - stateNonreg: 'Не зарегистрирован', - proxy: 'Прокси', - searchPlaceholder: 'поиск шлюза...', - host: 'Хост', - trunkingACLTitle: 'Контроль доступа', - trunkingACL: 'Многоканальный список доступа', - hostnameTrunking: 'Сервер/Хост шлюза или IP', - hostnameRegister: 'Регистратор/Сервер/Хост шлюза или IP', - expire: 'Срок действия', - authID: 'Имя пользователя', - account: 'Аккаунт', - outboundProxy: 'Адрес исходящего SIP-прокси', - newGateway: 'Новый шлюз', - newGatewayDescription: 'Описание нового шлюза', - SIPregistrations: 'SIP-регистрация', - SIPregistrationsDescription: 'Описание SIP-регистрации', - SIPtrunking: 'SIP-транки', - SIPtrunkingDescription: 'Описание SIP-транков', - }, + gateways: { + gateways: "Шлюз | Шлюзы", + allGateways: "Все шлюзы", + trunkingGateway: "Многоканальный шлюз", + registerGateway: "Зарегистрировать шлюз", + stateSuccess: "Успешно", + stateFailed: "Неудачно", + stateProgress: "В процессе", + stateNonreg: "Не зарегистрирован", + proxy: "Прокси", + searchPlaceholder: "поиск шлюза...", + host: "Хост", + trunkingACLTitle: "Контроль доступа", + trunkingACL: "Многоканальный список доступа", + hostnameTrunking: "Сервер/Хост шлюза или IP", + hostnameRegister: "Регистратор/Сервер/Хост шлюза или IP", + expire: "Срок действия", + authID: "Имя пользователя", + account: "Аккаунт", + outboundProxy: "Адрес исходящего SIP-прокси", + newGateway: "Новый шлюз", + newGatewayDescription: "Описание нового шлюза", + SIPregistrations: "SIP-регистрация", + SIPregistrationsDescription: "Описание SIP-регистрации", + SIPtrunking: "SIP-транки", + SIPtrunkingDescription: "Описание SIP-транков", + }, - chatGateways: { - templates: { - templates: 'Шаблоны', - title: 'Анонимное имя абонента в Workspace', - close: 'Сообщение завершения чата', - join: 'Сообщение присоединения оператора', - left: 'Сообщение отключения оператора', - }, - chatGateways: 'Текстовый шлюз | Текстовые шлюзы', - allChatGateways: 'Все текстовые шлюзы', - telegramBot: { - telegramBot: 'Telegram Бот', - }, - telegramApp: { - telegramApp: 'Telegram Приложение', - signedAs: 'Вы авторизированы как', - joinTelegram: 'Sign in to Telegram', - metadata: { - apiId: 'API идентификатор', - apiHash: 'API хэш', - }, - }, - infobip: { - infobip: 'Infobip', - }, - messenger: { - meta: 'Meta', - addOrRemovePages: 'Добавить или удалить страницы', - accounts: 'Аккаунты', - metadata: { - clientId: 'App ID', - clientSecret: 'App Secret', - }, - facebook: { - pages: 'Facebook страницы', - subscription: 'Webhook подписки', - }, - instagram: { - instagram: 'Instagram', - comments: 'Отслеживать комментарии', - mentions: 'Отслеживать упоминания', - }, - whatsapp: { - whatsapp: 'Whatsapp', - token: 'Токен', - status: 'Статус', - number: 'Номер телефона', - review: 'Рассмотрение', - }, - }, - viber: { - viber: 'Viber', - style: { - style: 'Стиль', - btnBackColor: 'Цвет фона кнопки', - btnFontColor: 'Цвет текста кнопки', - }, - }, - webchat: { - webchat: 'Web chat', - copyCode: 'Скопировать код', - copyCodeHint: 'Необходимо перегенерировать и вставить код Виджета на сайт после каждой модификации настроек', - metadata: { - mediaMaxSize: 'Максимальный размер файла (Мб)', - }, - view: { - borderRadius: 'Вид кнопки', - language: 'Язык', - view: 'Вид', - position: 'Размещение', - btnColor: 'Цвет кнопки', - logoUrl: 'URL логотипа', - logoHint: 'Поддерживаемый формат логотипа - \'JPEG\' or \'PNG\', 24x24px', - rounded: 'Круглая', - square: 'Квадратная', - right: 'Справа', - left: 'Слева', - static: 'Статическая', - }, - recaptcha: { - recaptcha: 'reCAPTCHA', - sitekey: 'Site key', - secret: 'Secret key', - threshold: 'Порог', - showFlag: 'Показывать значок reCAPTCHA', - }, - chat: { - chat: 'Чат', - openTimeout: 'Включить задержку открытия', - openTimeoutSec: 'Время задержки открытия', - }, - appointment: { - appointment: 'Заказ звонка', - days: 'Количество дней', - availableAgents: 'Свободные агенты', - showEmailField: 'Показать поле ввода почты', - showMessageField: 'Показать поле ввода сообщения', - resultPageText: 'Текст та странице результата', - headingText: 'Заголовок', - subheadingText: 'Подзаголовок', - showDefaultHeading: 'Показать стандартный заголовок и подзаголовок на странице результата', - }, - call: { - title: 'Онлайн-звонок', - url: 'WebSocket Endpoint', - }, - alternativeChannels: { - alternativeChannels: 'Альтернативные каналы', - title: 'Текстовые каналы', - email: 'Электронная почта', - whatsapp: 'WhatsApp', - telegram: 'Telegram', - messenger: 'Messenger', - }, - }, - customChat: { - customChat: 'Custom Chat', - customChatGateway: 'Custom Chat Gateway', - appSecretHint: 'Изменение этого поля прервет интеграцию', - metadata: { - appSecret: 'App Secret', - callback: 'Callback', - }, - }, - uri: 'URI', - newChatGateway: 'Новый текстовый шлюз', - metadata: { - apiKey: 'Api Key', - number: 'Number', - baseUrl: 'Base URL', - sendApi: 'Send API', - allowOrigin: 'Allow Origin', - readTimeout: 'Read Timeout (sec)', - writeTimeout: 'Write Timeout (sec)', - handshakeTimeout: 'Handshake Timeout (sec)', - messageSize: 'Message Size max (bytes)', - botName: 'Bot Name', - eventTypes: 'Event Types', - telegramToken: 'Telegram BOT API Token', - messengerApiUrl: 'Messenger API URL', - }, - }, + chatGateways: { + templates: { + templates: "Шаблоны", + title: "Анонимное имя абонента в Workspace", + close: "Сообщение завершения чата", + join: "Сообщение присоединения оператора", + left: "Сообщение отключения оператора", + }, + chatGateways: "Текстовый шлюз | Текстовые шлюзы", + allChatGateways: "Все текстовые шлюзы", + telegramBot: { + telegramBot: "Telegram Бот", + }, + telegramApp: { + telegramApp: "Telegram Приложение", + signedAs: "Вы авторизированы как", + joinTelegram: "Sign in to Telegram", + metadata: { + apiId: "API идентификатор", + apiHash: "API хэш", + }, + }, + infobip: { + infobip: "Infobip", + }, + messenger: { + meta: "Meta", + addOrRemovePages: "Добавить или удалить страницы", + accounts: "Аккаунты", + metadata: { + clientId: "App ID", + clientSecret: "App Secret", + }, + facebook: { + pages: "Facebook страницы", + subscription: "Webhook подписки", + }, + instagram: { + instagram: "Instagram", + comments: "Отслеживать комментарии", + mentions: "Отслеживать упоминания", + }, + whatsapp: { + whatsapp: "Whatsapp", + token: "Токен", + status: "Статус", + number: "Номер телефона", + review: "Рассмотрение", + }, + }, + viber: { + viber: "Viber", + style: { + style: "Стиль", + btnBackColor: "Цвет фона кнопки", + btnFontColor: "Цвет текста кнопки", + }, + }, + webchat: { + webchat: "Web chat", + copyCode: "Скопировать код", + copyCodeHint: + "Необходимо перегенерировать и вставить код Виджета на сайт после каждой модификации настроек", + metadata: { + mediaMaxSize: "Максимальный размер файла (Мб)", + }, + view: { + borderRadius: "Вид кнопки", + language: "Язык", + view: "Вид", + position: "Размещение", + btnColor: "Цвет кнопки", + logoUrl: "URL логотипа", + logoHint: + "Поддерживаемый формат логотипа - 'JPEG' or 'PNG', 24x24px", + rounded: "Круглая", + square: "Квадратная", + right: "Справа", + left: "Слева", + static: "Статическая", + }, + recaptcha: { + recaptcha: "reCAPTCHA", + sitekey: "Site key", + secret: "Secret key", + threshold: "Порог", + showFlag: "Показывать значок reCAPTCHA", + }, + chat: { + chat: "Чат", + openTimeout: "Включить задержку открытия", + openTimeoutSec: "Время задержки открытия", + }, + appointment: { + appointment: "Заказ звонка", + days: "Количество дней", + availableAgents: "Свободные агенты", + showEmailField: "Показать поле ввода почты", + showMessageField: "Показать поле ввода сообщения", + resultPageText: "Текст та странице результата", + headingText: "Заголовок", + subheadingText: "Подзаголовок", + showDefaultHeading: + "Показать стандартный заголовок и подзаголовок на странице результата", + }, + call: { + title: "Онлайн-звонок", + url: "WebSocket Endpoint", + }, + alternativeChannels: { + alternativeChannels: "Альтернативные каналы", + title: "Текстовые каналы", + email: "Электронная почта", + whatsapp: "WhatsApp", + telegram: "Telegram", + messenger: "Messenger", + }, + }, + customChat: { + customChat: "Custom Chat", + customChatGateway: "Custom Chat Gateway", + appSecretHint: "Изменение этого поля прервет интеграцию", + metadata: { + appSecret: "App Secret", + callback: "Callback", + }, + }, + uri: "URI", + newChatGateway: "Новый текстовый шлюз", + metadata: { + apiKey: "Api Key", + number: "Number", + baseUrl: "Base URL", + sendApi: "Send API", + allowOrigin: "Allow Origin", + readTimeout: "Read Timeout (sec)", + writeTimeout: "Write Timeout (sec)", + handshakeTimeout: "Handshake Timeout (sec)", + messageSize: "Message Size max (bytes)", + botName: "Bot Name", + eventTypes: "Event Types", + telegramToken: "Telegram BOT API Token", + messengerApiUrl: "Messenger API URL", + }, + }, - callflow: { - callflow: 'Конструктор звонка', - }, - }, - ccenter: { - ccenter: 'Контакт центр', - agents: { - agents: 'Оператор | Операторы', - supervisors: 'Супервизор | Супервизоры', - admins: 'Администратор | Администраторы', - subordinates: 'Подчинённый оператор | Подчинённые операторы', - allAgents: 'Все операторы', - state: 'Статус', - progressiveCount: 'Количество одновременных звонков', - chatCount: 'Количество одновременных чатов', - taskCount: 'Количество одновременных задач', - isSupervisor: 'Супервизор', - stateTime: 'Длительность', - addSkill: 'Добавить навык', - addSubordinate: 'Добавить подчинённого оператора', - statusHistory: 'История состояний', - historyState: 'Состояние', - historyChannel: 'Канал', - historyFrom: 'С', - historyTo: 'До', - historyDuration: 'Длительность', - payload: 'Причина', - emptyPopup: 'Пожалуйста, проверьте настройки фильтров', - status: { - online: 'Онлайн', - offline: 'Оффлайн', - pause: 'Пауза', - breakOut: 'Принудительный перерыв', - }, - }, + callflow: { + callflow: "Конструктор звонка", + }, + }, + ccenter: { + ccenter: "Контакт центр", + agents: { + agents: "Оператор | Операторы", + supervisors: "Супервизор | Супервизоры", + admins: "Администратор | Администраторы", + subordinates: "Подчинённый оператор | Подчинённые операторы", + allAgents: "Все операторы", + state: "Статус", + progressiveCount: "Количество одновременных звонков", + chatCount: "Количество одновременных чатов", + taskCount: "Количество одновременных задач", + isSupervisor: "Супервизор", + stateTime: "Длительность", + addSkill: "Добавить навык", + addSubordinate: "Добавить подчинённого оператора", + statusHistory: "История состояний", + historyState: "Состояние", + historyChannel: "Канал", + historyFrom: "С", + historyTo: "До", + historyDuration: "Длительность", + payload: "Причина", + emptyPopup: "Пожалуйста, проверьте настройки фильтров", + status: { + online: "Онлайн", + offline: "Оффлайн", + pause: "Пауза", + breakOut: "Принудительный перерыв", + }, + }, - auditors: { - auditors: 'Аудитор | Аудиторы', - }, + auditors: { + auditors: "Аудитор | Аудиторы", + }, - teams: { - teams: 'Команда| Команды', - allTeams: 'Все команды', - strategy: 'Стратегия', - parameters: 'Параметры', - maxNoAnswer: 'Максимальное количество пропущенных активностей', - callTimeout: 'Время на принятие звонка', - inviteChatTimeout: 'Время на принятие чата', - wrapUpTime: 'Длительность паузы между звонками', - noAnswerDelayTime: 'Время задержки после пропущенной активности', - taskAcceptTimeout: 'Время на принятие задачи', - strategies: { - random: 'Случайно', - fewestCalls: 'Агент с наименьшим количеством звонков', - leastTalkTime: 'Агент с наименьшим временем разговора', - topDown: 'Сверху вниз', - roundRobin: 'По порядку', - roundRobinBucket: 'По порядку корзины', - longestIdleAgent: 'Агент с наибольшим временем простоя', - skillCapacity: 'По уровню навыка', - }, - hooks: { - eventTypes: { - agentStatus: 'Изменение статуса оператора', - } - }, - flows: { - addFlowSchema: 'Добавить схему', - editFlowSchema: 'Редактировать схему', - }, - }, + teams: { + teams: "Команда| Команды", + allTeams: "Все команды", + strategy: "Стратегия", + parameters: "Параметры", + maxNoAnswer: "Максимальное количество пропущенных активностей", + callTimeout: "Время на принятие звонка", + inviteChatTimeout: "Время на принятие чата", + wrapUpTime: "Длительность паузы между звонками", + noAnswerDelayTime: "Время задержки после пропущенной активности", + taskAcceptTimeout: "Время на принятие задачи", + strategies: { + random: "Случайно", + fewestCalls: "Агент с наименьшим количеством звонков", + leastTalkTime: "Агент с наименьшим временем разговора", + topDown: "Сверху вниз", + roundRobin: "По порядку", + roundRobinBucket: "По порядку корзины", + longestIdleAgent: "Агент с наибольшим временем простоя", + skillCapacity: "По уровню навыка", + }, + hooks: { + eventTypes: { + agentStatus: "Изменение статуса оператора", + }, + }, + flows: { + addFlowSchema: "Добавить схему", + editFlowSchema: "Редактировать схему", + }, + }, - members: { - members: 'Абонент| Абоненты', - allMembers: 'Все абоненты', - addMember: 'добавить абонента', - destination: 'Назначение', - display: 'Отображение номера', - dtmf: 'DTMF', - priority: 'Приоритет', - attempts: 'Попыток', - emptyWorkspace: 'Абоненты не найдены', - resetMembers: { - resetMembers: 'Перезапустить абонентов', - description: 'Вы действительно хотите перезапустить повторный дозвон по неудачным попыткам абонентов?', - reset: 'Перезапустить', - successResetCount: 'Успешно перезапущено {count} абонентов', - }, - endCause: { - abandoned: 'Потерянный', - timeout: 'Тайм-аут', - cancel: 'Отменённый', - success: 'Успешный', - failed: 'Неудачный', - missed: 'Пропущенный', - expired: 'Истекший', - }, - }, + members: { + members: "Абонент| Абоненты", + allMembers: "Все абоненты", + addMember: "добавить абонента", + destination: "Назначение", + display: "Отображение номера", + dtmf: "DTMF", + priority: "Приоритет", + attempts: "Попыток", + emptyWorkspace: "Абоненты не найдены", + resetMembers: { + resetMembers: "Перезапустить абонентов", + description: + "Вы действительно хотите перезапустить повторный дозвон по неудачным попыткам абонентов?", + reset: "Перезапустить", + successResetCount: "Успешно перезапущено {count} абонентов", + }, + endCause: { + abandoned: "Потерянный", + timeout: "Тайм-аут", + cancel: "Отменённый", + success: "Успешный", + failed: "Неудачный", + missed: "Пропущенный", + expired: "Истекший", + }, + }, - queues: { - queues: 'Очередь | Очереди', - allQueues: 'Все очереди', - type: 'Тип', - state: 'Состояние', - active: 'Активная', - notActive: 'Не активная', - activeCalls: 'Активные звонки', - waiting: 'Ожидание', - ringtone: 'Мелодия', - priority: 'Приоритет', - teams: 'Команда| Команды', - tags: 'Теги', - blacklist: 'Стоп лист', - newQueue: 'Новая очередь', - newQueueDescription: 'Типы очередей', - outboundIVRQueue: 'Исходящая IVR-очередь', - outboundIVR: 'Исходящий IVR', - outboundIVRQueueDescription: 'Исходящий IVR позволяет организации автоматически привлекать клиентов по нескольким каналам, таким как автоматические голосовые вызовы, SMS-сообщения, электронная почта или сообщения в социальных сетях с использованием персонализированных уведомлений.', - inboundQueue: 'Входящая очередь', - inboundQueueDescription: 'Входящая очередь: звонящие находятся в режиме ожидания в очереди, чтобы поговорить с живым оператором.', - offlineQueue: 'Оффлайн очередь', - offlineQueueDescription: 'Автономная очередь дает возможность звонящим прекратить ожидание на удержании, ввести свой номер телефона и получить обратный вызов.', - previewDialer: 'Превью обзвон', - previewDialerDescription: 'Инициатором звонка выступает оператор. Предварительный просмотр контакта перед автоматическим набором номера.', - progressiveDialer: 'Прогрессивный обзвон', - progressiveDialerDescription: 'Исходящая кампания с резервированием оператора.', - predictiveDialer: 'Предиктивный обзвон', - predictiveDialerDescription: 'Исходящая кампания без предварительного резервирования оператора для максимального сокращения времени ожидания звонка.', - chatInboundQueue: 'Входящая очередь чатов', - chatInboundQueueDescription: 'То же самое, что и Входящая очередь, но с чатами', - inboundJobQueue: 'Входящая очередь заданий', - inboundJobQueueDescription: 'Входящая очередь заданий', - outboundJobQueue: 'Исходящая очередь заданий', - outboundJobQueueDescription: 'Исходящая очередь заданий', - strategy: 'Стратегия', - timezone: 'Часовая зона', - callLimit: 'Максимальное количество одновременных звонков', - variables: 'Переменные', - members: 'Абонент | Абоненты', - params: 'Параметры дозвона', - discardAbandonedAfter: 'Кол-во секунд до полного удаления абонента', - maxIdleAgent: 'Ожидание ответа оператора', - maxIdleClient: 'Ожидание ответа абонента', - maxIdleDialog: 'Максимальное время ожидания сообщения', - timeoutWithNoAgents: 'Время ожидания, когда нет агентов', - timeBaseScore: 'Рейтинг звонка', - endless: 'Не прекращать дозвон', - stickyAgent: 'Липкость', - stickyAgentSec: 'Время ожидания липкости (сек)', - autoAnswerTone: 'Сигнал предупреждения автоответа', - varKey: 'Ключ', - varVal: 'Значение', - endCause: 'Причина прекращения', - offeringAt: 'Перезвонить в', - destination: 'Назначение | Назначения', - expire: 'Истекает', - originateTimeout: 'Длительность ожидания', - maxAgentLine: 'Количество одновременных звонков на оператора', - maxAgentLose: 'Максимальное количество непринятых звонков для прекращения донабора линий', - minAttempts: 'Количество попыток для перехода в предиктивный режим', - maxAbandonedRate: 'Разрешенный % потерянных звонков', - loadFactor: 'Коэффициент нагрузки', - abandonRateAdjustment: 'Корректировка потерянных звонков', - playbackSilence: 'Тишина перед проигрыванием аудиофайла (мс.)', - targetAbandonedRate: 'Желаемый % потерянных звонков', - maxWaitTime: 'Максимальное время ожидания', - maxWaitingSize: 'Максимальное количество ожидания', - waitBetweenRetries: 'Время между попытками', - waitBetweenRetriesDesc: 'Сортировка новых попыток по спаданию', - strictCircuit: 'Strict circuit', - retryAbandoned: 'Возобновлять потерянных абонентов', - playbackFile: 'Проиграть файл', - timeout: 'Время перерыва между звонками', - maxNumberOfRetry: 'Максимальное количество попыток звонков', - minDuration: 'Минимально успешная длительность звонка', - maxAttempts: 'Максимальное количество попыток', - minOnlineAgents: 'Доступ к паузе, если количество операторов онлайн больше чем:', - waitForResultStatus: 'Ожидание результата звонка', - bucketPriority: 'Приоритет', - amd: 'AMD', - enabled: 'Включить автоопределение', - ai: 'Искусственный интеллект', - positiveLabels: 'Положительные теги', - aiPlayback: 'Проиграть файл', - allowNotSure: 'Неопределенные', - silenceNotSure: 'Тишина', - allowGreetingAgent: 'Разрешить приветствие', - preSchema: 'Схема предварительного набора', - afterSchema: 'Схема посленабора', - formSchema: '', - maxCalls: 'Лимит задач', - maxCallsHint: 'Если значение равно 0, дайлер не будет звонить', - recordings: 'Запись', - recordAll: 'Начать запись после ответа', - perNumbers: 'Инициация для каждого номера', - maxWordLength: 'Максимальная продолжительность предложения (мс)', - maxNumberOfWords: 'Максимальное кол-во слов в приветствии', - betweenWordsSilence: 'Продолжительность тишины между словами (мс)', - minWordLength: 'Минимальная продолжительность непрерывного звука голоса (мс)', - totalAnalysisTime: 'Максимальное время для распознавания (мс)', - silenceThreshold: 'Максимальная продолжительность тишины между словами (мс)', - afterGreetingSilence: 'Продолжительность тишины после приветствия (мс)', - greeting: 'Максимальная длина приветствия (мс)', - initialSilence: 'Максимальная продолжительность тишины перед приветствием (мс)', - statisticTime: 'Интервал пересчета', - communications: 'Тип связи', - manualDistribution: 'Ручное распределение', - lastMessageTimeout: 'Время ожидания от последнего сообщения', - processing: { - processing: 'Обработка', - enabled: 'Ожидание результата задачи', - formSchema: 'Схема динамической обработки', - sec: 'Время обработки (сек)', - renewalSec: 'Предложить продление после (сек)', - }, - queueStrategy: { - fifo: 'FIFO (Первый зашёл Первый вышел)', - lifo: 'LIFO (Последний зашёл Первый вышел)', - strict_fifo: 'Strict FIFO (Первый зашёл Первый вышел)', - }, - logs: { - logs: 'Лог | Логи', - destination: 'Назначение', - offeringAt: 'Распределение', - joinedAt: 'Начало', - leavingAt: 'Конец', - duration: 'Длительность', - viewNumber: 'Номер', - result: 'Результат', - attempts: 'Попытка', - resultName: { - abandoned: 'Abandoned', - cancel: 'Cancel', - success: 'Success', - failed: 'Failed', - missed: 'Missed', - timeout: 'Timeout', - endless: 'Endless', - transferred: 'Transferred', - }, - }, - hooks: { - hooks: 'Хук | Хуки', - event: 'Событие', - eventTypes: { - joined: 'Абонент вошел в очередь', - answered: 'Принят оператором', - offering: 'Распределение на оператора', - bridged: 'Соединение абонента с оператором', - missed: 'Пропущенный оператором', - leaving: 'Абонент вышел из очереди', - processing: 'Постобработка', - active: 'Активное действие', - }, - }, - }, + queues: { + queues: "Очередь | Очереди", + allQueues: "Все очереди", + type: "Тип", + state: "Состояние", + active: "Активная", + notActive: "Не активная", + activeCalls: "Активные звонки", + waiting: "Ожидание", + ringtone: "Мелодия", + priority: "Приоритет", + teams: "Команда| Команды", + tags: "Теги", + blacklist: "Стоп лист", + newQueue: "Новая очередь", + newQueueDescription: "Типы очередей", + outboundIVRQueue: "Исходящая IVR-очередь", + outboundIVR: "Исходящий IVR", + outboundIVRQueueDescription: + "Исходящий IVR позволяет организации автоматически привлекать клиентов по нескольким каналам, таким как автоматические голосовые вызовы, SMS-сообщения, электронная почта или сообщения в социальных сетях с использованием персонализированных уведомлений.", + inboundQueue: "Входящая очередь", + inboundQueueDescription: + "Входящая очередь: звонящие находятся в режиме ожидания в очереди, чтобы поговорить с живым оператором.", + offlineQueue: "Оффлайн очередь", + offlineQueueDescription: + "Автономная очередь дает возможность звонящим прекратить ожидание на удержании, ввести свой номер телефона и получить обратный вызов.", + previewDialer: "Превью обзвон", + previewDialerDescription: + "Инициатором звонка выступает оператор. Предварительный просмотр контакта перед автоматическим набором номера.", + progressiveDialer: "Прогрессивный обзвон", + progressiveDialerDescription: + "Исходящая кампания с резервированием оператора.", + predictiveDialer: "Предиктивный обзвон", + predictiveDialerDescription: + "Исходящая кампания без предварительного резервирования оператора для максимального сокращения времени ожидания звонка.", + chatInboundQueue: "Входящая очередь чатов", + chatInboundQueueDescription: + "То же самое, что и Входящая очередь, но с чатами", + inboundJobQueue: "Входящая очередь заданий", + inboundJobQueueDescription: "Входящая очередь заданий", + outboundJobQueue: "Исходящая очередь заданий", + outboundJobQueueDescription: "Исходящая очередь заданий", + strategy: "Стратегия", + timezone: "Часовая зона", + callLimit: "Максимальное количество одновременных звонков", + variables: "Переменные", + members: "Абонент | Абоненты", + params: "Параметры дозвона", + discardAbandonedAfter: "Кол-во секунд до полного удаления абонента", + maxIdleAgent: "Ожидание ответа оператора", + maxIdleClient: "Ожидание ответа абонента", + maxIdleDialog: "Максимальное время ожидания сообщения", + timeoutWithNoAgents: "Время ожидания, когда нет агентов", + timeBaseScore: "Рейтинг звонка", + endless: "Не прекращать дозвон", + stickyAgent: "Липкость", + stickyAgentSec: "Время ожидания липкости (сек)", + autoAnswerTone: "Сигнал предупреждения автоответа", + varKey: "Ключ", + varVal: "Значение", + endCause: "Причина прекращения", + offeringAt: "Перезвонить в", + destination: "Назначение | Назначения", + expire: "Истекает", + originateTimeout: "Длительность ожидания", + maxAgentLine: "Количество одновременных звонков на оператора", + maxAgentLose: + "Максимальное количество непринятых звонков для прекращения донабора линий", + minAttempts: "Количество попыток для перехода в предиктивный режим", + maxAbandonedRate: "Разрешенный % потерянных звонков", + loadFactor: "Коэффициент нагрузки", + abandonRateAdjustment: "Корректировка потерянных звонков", + playbackSilence: "Тишина перед проигрыванием аудиофайла (мс.)", + targetAbandonedRate: "Желаемый % потерянных звонков", + maxWaitTime: "Максимальное время ожидания", + maxWaitingSize: "Максимальное количество ожидания", + waitBetweenRetries: "Время между попытками", + waitBetweenRetriesDesc: "Сортировка новых попыток по спаданию", + strictCircuit: "Strict circuit", + retryAbandoned: "Возобновлять потерянных абонентов", + playbackFile: "Проиграть файл", + timeout: "Время перерыва между звонками", + maxNumberOfRetry: "Максимальное количество попыток звонков", + minDuration: "Минимально успешная длительность звонка", + maxAttempts: "Максимальное количество попыток", + minOnlineAgents: + "Доступ к паузе, если количество операторов онлайн больше чем:", + waitForResultStatus: "Ожидание результата звонка", + bucketPriority: "Приоритет", + amd: "AMD", + enabled: "Включить автоопределение", + ai: "Искусственный интеллект", + positiveLabels: "Положительные теги", + aiPlayback: "Проиграть файл", + allowNotSure: "Неопределенные", + silenceNotSure: "Тишина", + allowGreetingAgent: "Разрешить приветствие", + preSchema: "Схема предварительного набора", + afterSchema: "Схема посленабора", + formSchema: "", + maxCalls: "Лимит задач", + maxCallsHint: "Если значение равно 0, дайлер не будет звонить", + recordings: "Запись", + recordAll: "Начать запись после ответа", + perNumbers: "Инициация для каждого номера", + maxWordLength: "Максимальная продолжительность предложения (мс)", + maxNumberOfWords: "Максимальное кол-во слов в приветствии", + betweenWordsSilence: "Продолжительность тишины между словами (мс)", + minWordLength: + "Минимальная продолжительность непрерывного звука голоса (мс)", + totalAnalysisTime: "Максимальное время для распознавания (мс)", + silenceThreshold: + "Максимальная продолжительность тишины между словами (мс)", + afterGreetingSilence: "Продолжительность тишины после приветствия (мс)", + greeting: "Максимальная длина приветствия (мс)", + initialSilence: + "Максимальная продолжительность тишины перед приветствием (мс)", + statisticTime: "Интервал пересчета", + communications: "Тип связи", + manualDistribution: "Ручное распределение", + lastMessageTimeout: "Время ожидания от последнего сообщения", + processing: { + processing: "Обработка", + enabled: "Ожидание результата задачи", + formSchema: "Схема динамической обработки", + sec: "Время обработки (сек)", + renewalSec: "Предложить продление после (сек)", + }, + queueStrategy: { + fifo: "FIFO (Первый зашёл Первый вышел)", + lifo: "LIFO (Последний зашёл Первый вышел)", + strict_fifo: "Strict FIFO (Первый зашёл Первый вышел)", + }, + logs: { + logs: "Лог | Логи", + destination: "Назначение", + offeringAt: "Распределение", + joinedAt: "Начало", + leavingAt: "Конец", + duration: "Длительность", + viewNumber: "Номер", + result: "Результат", + attempts: "Попытка", + resultName: { + abandoned: "Abandoned", + cancel: "Cancel", + success: "Success", + failed: "Failed", + missed: "Missed", + timeout: "Timeout", + endless: "Endless", + transferred: "Transferred", + }, + }, + hooks: { + hooks: "Хук | Хуки", + event: "Событие", + eventTypes: { + joined: "Абонент вошел в очередь", + answered: "Принят оператором", + offering: "Распределение на оператора", + bridged: "Соединение абонента с оператором", + missed: "Пропущенный оператором", + leaving: "Абонент вышел из очереди", + processing: "Постобработка", + active: "Активное действие", + }, + }, + }, - res: { - res: 'Ресурс | Ресурсы', - allRes: 'Все ресурсы', - reserve: 'Резервный', - searchPlaceholder: 'название, шлюз..', - cps: 'CPS', - limit: 'Лимит', - cidType: 'CID Type', - ignoreEarlyMedia: 'Ignore Early Media', - numbers: 'Номер | Номера', - displayNumbers: 'Номер для отображения', - failure: 'Сбой', - maxErrors: 'Максимальное количество ошибок', - errorCodes: 'Коды ошибок', - patterns: 'Шаблон исходящего номера', - priority: 'Приоритет', - reserveResource: 'Резервный ресурс', - failureDialDelay: 'Задержка при ошибке набора', - }, + res: { + res: "Ресурс | Ресурсы", + allRes: "Все ресурсы", + reserve: "Резервный", + searchPlaceholder: "название, шлюз..", + cps: "CPS", + limit: "Лимит", + cidType: "CID Type", + ignoreEarlyMedia: "Ignore Early Media", + numbers: "Номер | Номера", + displayNumbers: "Номер для отображения", + failure: "Сбой", + maxErrors: "Максимальное количество ошибок", + errorCodes: "Коды ошибок", + patterns: "Шаблон исходящего номера", + priority: "Приоритет", + reserveResource: "Резервный ресурс", + failureDialDelay: "Задержка при ошибке набора", + }, - resGroups: { - resGroups: 'Группа ресурсов | Группы ресурсов', - allResGroups: 'Все группы ресурсов', - searchPlaceholder: 'название группы ресурсов..', - addResGroup: 'Добавить группу ресурсов', - strategy: 'Стратегия', - timerange: 'Интервал', - timerangeFrom: 'ОТ', - timerangeTo: 'До', - }, - }, - integrations: { - integrations: 'Интеграции', - emptyWorkspace: 'Профили в разделе еще не созданы', + resGroups: { + resGroups: "Группа ресурсов | Группы ресурсов", + allResGroups: "Все группы ресурсов", + searchPlaceholder: "название группы ресурсов..", + addResGroup: "Добавить группу ресурсов", + strategy: "Стратегия", + timerange: "Интервал", + timerangeFrom: "ОТ", + timerangeTo: "До", + }, + }, + integrations: { + integrations: "Интеграции", + emptyWorkspace: "Профили в разделе еще не созданы", - storage: { - storage: 'Хранилища', - allStorages: 'Все хранилища', - type: 'Тип', - maxSize: 'Объем хранилища (GB)', - expireDays: 'Срок хранения (дней)', - priority: 'Приоритет', - newStorage: 'Новое хранилище', - newStorageDescription: 'Описание нового хранилища', - local: 'Local', - s3: 'Amazon S3', - digitalOcean: 'Digital Ocean Spaces', - backblaze: 'Backblaze B2', - dropbox: 'Dropbox', - drive: 'Google Drive', - configuration: 'Конфигурация', - pathPattern: 'Шаблон пути', - localFolder: 'Local folder', - s3Key: 'Key ID', - s3Access: 'Access Key', - bucket: 'Корзина', - region: 'Площадка', - oceanKey: 'Key ID', - oceanAccess: 'Access Key', - backblazeAccount: 'Account ID', - backblazeKey: 'Application key', - backblazeBucketId: 'Bucket Id', - dropboxKey: 'Access Token', - driveFolder: 'Folder name', - driveEmail: 'Google Email', - driveKey: 'Private key', - s3Endpoint: 'Endpoint', - }, + storage: { + storage: "Хранилища", + allStorages: "Все хранилища", + type: "Тип", + maxSize: "Объем хранилища (GB)", + expireDays: "Срок хранения (дней)", + priority: "Приоритет", + newStorage: "Новое хранилище", + newStorageDescription: "Описание нового хранилища", + local: "Local", + s3: "Amazon S3", + digitalOcean: "Digital Ocean Spaces", + backblaze: "Backblaze B2", + dropbox: "Dropbox", + drive: "Google Drive", + configuration: "Конфигурация", + pathPattern: "Шаблон пути", + localFolder: "Local folder", + s3Key: "Key ID", + s3Access: "Access Key", + bucket: "Корзина", + region: "Площадка", + oceanKey: "Key ID", + oceanAccess: "Access Key", + backblazeAccount: "Account ID", + backblazeKey: "Application key", + backblazeBucketId: "Bucket Id", + dropboxKey: "Access Token", + driveFolder: "Folder name", + driveEmail: "Google Email", + driveKey: "Private key", + s3Endpoint: "Endpoint", + }, - cognitiveProfiles: { - cognitiveProfiles: 'Голосовой профиль | Голосовые профили', - properties: { - region: 'Регион', - locale: 'Язык', - }, - }, - emailProfiles: { - emailProfiles: 'Email профиль | Email профили', - mailbox: 'Почтовый ящик', - smtpPort: 'SMTP Порт', - imapPort: 'IMAP Порт', - smtpHost: 'SMTP Хост', - imapHost: 'IMAP Хост', - fetchInterval: 'Интервал обновления', - listen: 'Прослушивать ', - authType: 'Тип аутентификации', - authenticatedAs: 'Аутентифицировано как', - }, + cognitiveProfiles: { + cognitiveProfiles: "Голосовой профиль | Голосовые профили", + properties: { + region: "Регион", + locale: "Язык", + }, + }, + emailProfiles: { + emailProfiles: "Email профиль | Email профили", + mailbox: "Почтовый ящик", + smtpPort: "SMTP Порт", + imapPort: "IMAP Порт", + smtpHost: "SMTP Хост", + imapHost: "IMAP Хост", + fetchInterval: "Интервал обновления", + listen: "Прослушивать ", + authType: "Тип аутентификации", + authenticatedAs: "Аутентифицировано как", + }, - singleSignOn: { - allTypes: 'Все типы', - // TODO: add locale - singleSignOn: 'Single Sign-on', - clientId: 'Client id', - clientSecret: 'Client secret', - discoveryUrl: 'Discovery url', - }, + singleSignOn: { + allTypes: "Все типы", + // TODO: add locale + singleSignOn: "Single Sign-on", + clientId: "Client id", + clientSecret: "Client secret", + discoveryUrl: "Discovery url", + }, - importCsv: { - importCsv: 'Импорт данных из CSV файла | Импорт данных из CSV файлов', - allImportsCsv: 'Все импорты данных из CSV файлов', - source: 'Назначение импорта', - settings: 'Настройки', - mappings: 'Маппинги полей', - mappingsHint: 'В этой секции необходимо указать названия колонок CSV файла в полях ниже в соответствии с их заголовками', - columnHeader: 'Колонка {name}', - members: { - clearMembers: 'Удалить существующих абонентов', - }, - }, + importCsv: { + importCsv: "Импорт данных из CSV файла | Импорт данных из CSV файлов", + allImportsCsv: "Все импорты данных из CSV файлов", + source: "Назначение импорта", + settings: "Настройки", + mappings: "Маппинги полей", + mappingsHint: + "В этой секции необходимо указать названия колонок CSV файла в полях ниже в соответствии с их заголовками", + columnHeader: "Колонка {name}", + members: { + clearMembers: "Удалить существующих абонентов", + }, + }, - tokens: { - tokens: 'Токен | Токены', - allTokens: 'Все токены', - expires: 'Истекает', - popupMessage: 'Загрузите файл ключа или скопируйте его. Если вы не загрузите файл ключа сейчас, вы не сможете извлечь его еще раз. Чтобы повысить безопасность, храните ключ в надежном месте и не делитесь им.', - tokenCreated: 'Ваш токен успешно создан!', - }, + tokens: { + tokens: "Токен | Токены", + allTokens: "Все токены", + expires: "Истекает", + popupMessage: + "Загрузите файл ключа или скопируйте его. Если вы не загрузите файл ключа сейчас, вы не сможете извлечь его еще раз. Чтобы повысить безопасность, храните ключ в надежном месте и не делитесь им.", + tokenCreated: "Ваш токен успешно создан!", + }, - triggers: { - triggers: 'Триггер | Триггеры', - allTriggers: 'Все триггеры', - type: 'Тип', - schema: 'Схема', - newTrigger: 'Новый триггер', - newTriggerDescription: 'Choose a template to get going or start from scratch with a blank canvas', - onEvent: 'On event', - onEventDescription: 'An event-based JSON Schema scheduler', - cron: 'At time', - atTimeDescription: 'A time-based JSON Schema scheduler', - event: 'Event', - expression: 'Выражение', - timeout: 'Задержка', - logs: { - logs: 'История запуска', - startedAt: 'Начало', - result: 'Результат', - resultName: { - idle: 'Неактивний', - active: 'Активний', - done: 'Завершенный', - error: 'Ошибка', - }, - }, - }, - }, - system: { - system: 'Система', - changelogs: { - changelogs: 'Журнал изменений | Журналы изменений', - objects: 'Объект | Объекты', - daysToStore: 'Дней хранения', - storage: 'Выгрузить в', - logs: { - logs: 'Лог | Логи', - actions: 'Действие | Действия', - records: 'ID записи | ID записей', - actionType: { - [LoggerAction.Create]: 'Создание', - [LoggerAction.Delete]: 'Удаление', - [LoggerAction.Update]: 'Редактирование', - }, - }, - period: { - period: 'Период', - options: { - daily: 'Ежедневно', - weekly: 'Еженедельно', - fortnightly: 'Каждые две недели', - monthly: 'Ежемесячно', - }, - }, - }, - configuration: { - configuration: 'Конфигурация | Конфигурации', - parameter: 'Параметр', - }, - globalVariables: { - globalVariables: 'Глобальная переменная | Глобальные переменные', - encrypted: 'Зашифровано', - valueInfo: 'Введите значение, если хотите перезаписать его', - newTitle: 'Новая глобальная переменная', - editTitle: 'Редактировать глобальную переменную', - }, - }, - pagination: { - rowsPerPage: 'Количество строк на странице', - }, - }, + triggers: { + triggers: "Триггер | Триггеры", + allTriggers: "Все триггеры", + type: "Тип", + schema: "Схема", + newTrigger: "Новый триггер", + newTriggerDescription: + "Choose a template to get going or start from scratch with a blank canvas", + onEvent: "On event", + onEventDescription: "An event-based JSON Schema scheduler", + cron: "At time", + atTimeDescription: "A time-based JSON Schema scheduler", + event: "Event", + expression: "Выражение", + timeout: "Задержка", + logs: { + logs: "История запуска", + startedAt: "Начало", + result: "Результат", + resultName: { + idle: "Неактивний", + active: "Активний", + done: "Завершенный", + error: "Ошибка", + }, + }, + }, + }, + system: { + system: "Система", + changelogs: { + changelogs: "Журнал изменений | Журналы изменений", + objects: "Объект | Объекты", + daysToStore: "Дней хранения", + storage: "Выгрузить в", + logs: { + logs: "Лог | Логи", + actions: "Действие | Действия", + records: "ID записи | ID записей", + actionType: { + [LoggerAction.Create]: "Создание", + [LoggerAction.Delete]: "Удаление", + [LoggerAction.Update]: "Редактирование", + }, + }, + period: { + period: "Период", + options: { + daily: "Ежедневно", + weekly: "Еженедельно", + fortnightly: "Каждые две недели", + monthly: "Ежемесячно", + }, + }, + }, + configuration: { + configuration: "Конфигурация | Конфигурации", + parameter: "Параметр", + }, + globalVariables: { + globalVariables: "Глобальная переменная | Глобальные переменные", + encrypted: "Зашифровано", + valueInfo: "Введите значение, если хотите перезаписать его", + newTitle: "Новая глобальная переменная", + editTitle: "Редактировать глобальную переменную", + }, + }, + pagination: { + rowsPerPage: "Количество строк на странице", + }, + }, - filters: { - queueType: 'Тип очереди', - team: 'Команда', - }, + filters: { + queueType: "Тип очереди", + team: "Команда", + }, - utils: { - downloadFilesBtn: { - downloadFiles: 'Скачать файлы', - filesLoaded: 'Файлов скачано', - zippingProgress: 'Прогресс архивации', - }, - }, + utils: { + downloadFilesBtn: { + downloadFiles: "Скачать файлы", + filesLoaded: "Файлов скачано", + zippingProgress: "Прогресс архивации", + }, + }, - errorPages: { - goToHome: 'Вернуться Домой', - page403: { - title: 'Нет доступа', - text: 'Извините, у вас недостаточно прав доступа для просмотра этой страницы.', - }, - page404: { - title: 'Похоже, вы потерялись', - text: 'Извините, мы не можем найти то, что вы ищете', - }, - }, + errorPages: { + goToHome: "Вернуться Домой", + page403: { + title: "Нет доступа", + text: "Извините, у вас недостаточно прав доступа для просмотра этой страницы.", + }, + page404: { + title: "Похоже, вы потерялись", + text: "Извините, мы не можем найти то, что вы ищете", + }, + }, - icon: { - docs: 'Документация', - logout: 'Выйти', - account: 'Аккаунт', - appNavigator: 'Навигатор приложений', - settings: 'Настройки', - }, + icon: { + docs: "Документация", + logout: "Выйти", + account: "Аккаунт", + appNavigator: "Навигатор приложений", + settings: "Настройки", + }, - iconHints: { - upload: 'Загрузить', - reload: 'Обновить', - edit: 'Редактировать', - delete: 'Удалить', - deleteAll: 'Удалить все объекты', - deleteSelected: 'Удалить {count} выбранных объектов', - deleteFiltered: 'Удалить все отфильтрованные объекты', - generate: 'Создать', - add: 'Добавить', - history: 'История', - download: 'Скачать', - downloadAll: 'Скачать все', - draggable: 'Перетащить', - play: 'Играть', - pause: 'Пауза', - resume: 'Возобновить', - close: 'Закрыть', - volume: 'Громкость', - stop: 'Остановить', - members: 'Абоненты', - moveUp: 'Передвинуть вверх', - moveDown: 'Передвинуть вниз', - nextPage: 'Следующая страница', - prevPage: 'Предыдущая страница', - expand: 'Развернуть', - collapse: 'Свернуть', - }, - errors: { - invalidJson: 'Некорректный JSON', - }, - reusable: { - time: { - t15m: '15 мин', - t30m: '30 мин', - t45m: '45 мин', - t1h: '1 ч', - t3h: '4 ч', - t6h: '6 ч', - }, - }, + iconHints: { + upload: "Загрузить", + reload: "Обновить", + edit: "Редактировать", + delete: "Удалить", + deleteAll: "Удалить все объекты", + deleteSelected: "Удалить {count} выбранных объектов", + deleteFiltered: "Удалить все отфильтрованные объекты", + generate: "Создать", + add: "Добавить", + history: "История", + download: "Скачать", + downloadAll: "Скачать все", + draggable: "Перетащить", + play: "Играть", + pause: "Пауза", + resume: "Возобновить", + close: "Закрыть", + volume: "Громкость", + stop: "Остановить", + members: "Абоненты", + moveUp: "Передвинуть вверх", + moveDown: "Передвинуть вниз", + nextPage: "Следующая страница", + prevPage: "Предыдущая страница", + expand: "Развернуть", + collapse: "Свернуть", + }, + errors: { + invalidJson: "Некорректный JSON", + }, + reusable: { + time: { + t15m: "15 мин", + t30m: "30 мин", + t45m: "45 мин", + t1h: "1 ч", + t3h: "4 ч", + t6h: "6 ч", + }, + }, }; diff --git a/src/app/locale/ua/ua.js b/src/app/locale/ua/ua.js index 157c0a054..e64175487 100644 --- a/src/app/locale/ua/ua.js +++ b/src/app/locale/ua/ua.js @@ -1,1177 +1,1218 @@ /* eslint-disable quote-props */ -import { EngineCommunicationChannels, LoggerAction } from 'webitel-sdk'; +import { EngineCommunicationChannels, LoggerAction } from "webitel-sdk"; export default { - auth: { - register: 'Створити', - login: 'Вхід', - registerReset: 'Скинути пароль', - detailsSubtitle: 'Введіть свої дані', - resetPasswordLink: 'Забули пароль?', - user: 'Ім\'я користувача', - password: 'Пароль', - confirmPassword: 'Підтвердіть пароль', - key: 'Ліцензійний ключ', - registerSubmit: 'Зареєструватися', - resetSubmit: 'Скинути', - loginSubmit: 'Ввійти', - carousel: { - title1: 'Cloud vs On-Site', - text1: 'Політика безпеки не дозволяє зберігати дані і використовувати хмарні сервіси? З Webitel Ви можете створити контакт-центр на своїй площадці!', + auth: { + register: "Створити", + login: "Вхід", + registerReset: "Скинути пароль", + detailsSubtitle: "Введіть свої дані", + resetPasswordLink: "Забули пароль?", + user: "Ім'я користувача", + password: "Пароль", + confirmPassword: "Підтвердіть пароль", + key: "Ліцензійний ключ", + registerSubmit: "Зареєструватися", + resetSubmit: "Скинути", + loginSubmit: "Ввійти", + carousel: { + title1: "Cloud vs On-Site", + text1: + "Політика безпеки не дозволяє зберігати дані і використовувати хмарні сервіси? З Webitel Ви можете створити контакт-центр на своїй площадці!", - title2: 'Мультиканальність vs Омніканальність', - text2: 'Будьте завжди і всюди на зв\'язку зі своїми клієнтами! IVR-меню будь-якої складності, вхідні, вихідні кампанії взаємодії чи повідомлення в соцмережі - зараз просто, як ніколи!', + title2: "Мультиканальність vs Омніканальність", + text2: + "Будьте завжди і всюди на зв'язку зі своїми клієнтами! IVR-меню будь-якої складності, вхідні, вихідні кампанії взаємодії чи повідомлення в соцмережі - зараз просто, як ніколи!", - title3: 'Відмовостійка інфраструктура', - text3: 'Більше ніяких простоїв та втрат даних. Швидке масштабування та відмовостійка архітектура дозволяє одночасно обслуговувати більше 1000 звернень клієнтів за хвиилину з різних каналів комунікацій.', + title3: "Відмовостійка інфраструктура", + text3: + "Більше ніяких простоїв та втрат даних. Швидке масштабування та відмовостійка архітектура дозволяє одночасно обслуговувати більше 1000 звернень клієнтів за хвиилину з різних каналів комунікацій.", - title4: 'Дизайн', - text4: 'Новий мінімалістичний інтерфейс з максимально зручною для користувача адмін-панеллю, що дозволяє мати оператичний доступ до всіх необхідних функцій. Менше кліків - більше можливостей.', + title4: "Дизайн", + text4: + "Новий мінімалістичний інтерфейс з максимально зручною для користувача адмін-панеллю, що дозволяє мати оператичний доступ до всіх необхідних функцій. Менше кліків - більше можливостей.", - title5: 'Новий модуль роботи з операторськими групами', - text5: 'Максимально ефективне розподілення дзвінків. Оператор може мати одразу декілька навичок для участі у різних кампаніях. Клієнта обслуговують лише професіонали своєї справи.', + title5: "Новий модуль роботи з операторськими групами", + text5: + "Максимально ефективне розподілення дзвінків. Оператор може мати одразу декілька навичок для участі у різних кампаніях. Клієнта обслуговують лише професіонали своєї справи.", - title6: 'Налаштування прав доступу', - text6: 'Новий модуль управління правами - нові можливості для контролю. Ви можете надавати права не тільки на розділи, але і на дії користувачів, відслідковуючи при цьому зміни. ', - }, - }, + title6: "Налаштування прав доступу", + text6: + "Новий модуль управління правами - нові можливості для контролю. Ви можете надавати права не тільки на розділи, але і на дії користувачів, відслідковуючи при цьому зміни. ", + }, + }, - header: { - logout: 'Вийти', - docs: 'Довідка', - }, + header: { + logout: "Вийти", + docs: "Довідка", + }, - appNavigator: { - title: 'Додатки Webitel', - admin: 'Адміністрування', - agent: 'Робоче місце оператора', - supervisor: 'Робоче місце супервізора', - audit: 'Аудит', - history: 'Історія дзвінків', - grafana: 'Grafana', - }, + appNavigator: { + title: "Додатки Webitel", + admin: "Адміністрування", + agent: "Робоче місце оператора", + supervisor: "Робоче місце супервізора", + audit: "Аудит", + history: "Історія дзвінків", + grafana: "Grafana", + }, - settings: { - settings: 'Налаштування | Налаштування', - changePassword: 'Змінити пароль', - language: 'Мова', - webPhone: 'Web-телефон', - useWebPhone: 'Використовувати Web-телефон', - useStun: 'Використовувати STUN', - }, + settings: { + settings: "Налаштування | Налаштування", + changePassword: "Змінити пароль", + language: "Мова", + webPhone: "Web-телефон", + useWebPhone: "Використовувати Web-телефон", + useStun: "Використовувати STUN", + }, - validation: { - email: 'Введіть адресу електронної пошти', - required: 'Поле обов\'язкове для заповнення', - sameAs: 'Невірний пароль', - gatewayHostValidator: 'Має виглядати як IPv4 або FQDN', - ipValidator: 'Має виглядати як IPv4', - macValidator: 'Має виглядати як MAC', - minValue: 'Значення має бути не менше', - maxValue: 'Значення має бути не надто велкиим', - numeric: 'Мають бути цифри', - requiredArrayValue: 'Поле не може бути пустим', - isPositiveValue: 'Значення має бути додатнім числом', - cron: 'Некорректний cron-вираз', - }, + validation: { + email: "Введіть адресу електронної пошти", + required: "Поле обов'язкове для заповнення", + sameAs: "Невірний пароль", + gatewayHostValidator: "Має виглядати як IPv4 або FQDN", + ipValidator: "Має виглядати як IPv4", + macValidator: "Має виглядати як MAC", + minValue: "Значення має бути не менше", + maxValue: "Значення має бути не надто велкиим", + numeric: "Мають бути цифри", + requiredArrayValue: "Поле не може бути пустим", + isPositiveValue: "Значення має бути додатнім числом", + cron: "Некорректний cron-вираз", + }, - nav: { - directory: { - directory: 'Каталог', - }, - routing: { - routing: 'Маршрутизація', - }, - lookups: { - lookups: 'Довідники', - }, - ccenter: { - ccenter: 'Контакт-центр', - }, - integrations: { - integrations: 'Інтеграції', - }, - permissions: { - permissions: 'Дозволи', - }, - system: { - system: 'Система', - }, - }, + nav: { + directory: { + directory: "Каталог", + }, + routing: { + routing: "Маршрутизація", + }, + lookups: { + lookups: "Довідники", + }, + ccenter: { + ccenter: "Контакт-центр", + }, + integrations: { + integrations: "Інтеграції", + }, + permissions: { + permissions: "Дозволи", + }, + system: { + system: "Система", + }, + }, - home: { - dashboard: 'Звіти', - welcomeText: 'Вітання!', - news: 'Новини', - }, + home: { + dashboard: "Звіти", + welcomeText: "Вітання!", + news: "Новини", + }, - objects: { - all: 'Всі {entity}', - administration: 'Управління', - general: 'Загальне', - new: 'Новий', - add: 'Додати', - create: 'Створити', - read: 'Читати', - edit: 'Редагувати', - delete: 'Видалити', - save: 'Зберегти', - saved: 'Збережено', - saveAs: 'Зберігти як нового', - close: 'Закрити', - next: 'Далі', - back: 'Назад', - change: 'Замінити', - name: 'Ім\'я', - title: 'Назва', - description: 'Опис', - user: 'Користувач', - users: 'Користувачі', - action: 'Дія', - allow: 'Дозволити', - password: 'Пароль', - history: 'Історія', - copy: 'Копіювати', - copied: 'Скопійовано!', - createdAt: 'Створено', - createdBy: 'Ким створено', - importCSV: 'Імпортувати CSV', - online: 'Онлайн', - offline: 'Офлайн', - on: 'On', - off: 'Off', - ok: 'Ok', - enabled: 'Ввімкнено', - status: 'Статус', - from: 'Від', - to: 'До', - importJSON: 'Імпортувати JSON', - addNew: 'Додати', - provider: 'Провайдер', - default: 'За замовчуванням', - service: 'Сервіс', - tts: 'Text-to-Speech', - stt: 'Speech-to-Text', - key: 'Ключ', - ID: 'ID', - email: 'Адреса електронної пошти', - updatedAt: 'Змінено', - emptyWorkspace: 'Записи у розділі ще не створені', - emptyResultSearch: 'Пошук не дав результатів', + objects: { + all: "Всі {entity}", + administration: "Управління", + general: "Загальне", + new: "Новий", + add: "Додати", + create: "Створити", + read: "Читати", + edit: "Редагувати", + delete: "Видалити", + save: "Зберегти", + saved: "Збережено", + saveAs: "Зберігти як нового", + close: "Закрити", + next: "Далі", + back: "Назад", + change: "Замінити", + name: "Ім'я", + title: "Назва", + description: "Опис", + user: "Користувач", + users: "Користувачі", + action: "Дія", + allow: "Дозволити", + password: "Пароль", + history: "Історія", + copy: "Копіювати", + copied: "Скопійовано!", + createdAt: "Створено", + createdBy: "Ким створено", + importCSV: "Імпортувати CSV", + online: "Онлайн", + offline: "Офлайн", + on: "On", + off: "Off", + ok: "Ok", + enabled: "Ввімкнено", + status: "Статус", + from: "Від", + to: "До", + importJSON: "Імпортувати JSON", + addNew: "Додати", + provider: "Провайдер", + default: "За замовчуванням", + service: "Сервіс", + tts: "Text-to-Speech", + stt: "Speech-to-Text", + key: "Ключ", + ID: "ID", + email: "Адреса електронної пошти", + updatedAt: "Змінено", + emptyWorkspace: "Записи у розділі ще не створені", + emptyResultSearch: "Пошук не дав результатів", - deleteConfirmation: { - title: 'Підтвердіть видалення', - askingAlert: 'Ви впевнені, що хочете видалити {count} запис? | Ви впевнені, що хочете видалити {count} записів?', - undoneActionAlert: 'Дана дія не може бути скасована.', - deleteAll: 'ВСІ', - }, - CSV: { - skipHeaders: 'Згорнути заголовки', - charSet: 'Char set', - separator: 'Розділювач', - CSVColumn: 'CSV поле', - fieldName: 'Назва поля', - clearMember: 'Очистити абонента', - }, - generalInfo: 'Загальна інформація', - objectHeader: {}, - directory: { - directory: 'Каталог', - passwordInfo: 'Введіть значення лише якщо хочете його перезаписати (або задати нове). Порожнє значення залишить пароль незмінним', - users: { - users: 'Користувач | Користувачі', - allUsers: 'Всі користувачі', - searchPlaceholder: 'Ім\'я, користувач, номери телефону, статус', - login: 'Логін', - extensions: 'Внутрішній номер', - state: 'Стан', - DnD: 'DnD', - status: 'Статус', - roles: 'Ролі', - tokens: 'Токени', - usage: 'Використання', - roleAdmin: 'Адміністратор', - license: 'Ліцензія', - devices: 'Пристрій', - defaultDevice: 'Пристрій за замовчуванням (зі списку вибраних пристроїв)', - deviceNotFound: 'Не знайшли свій пристрій?', - createNewDevice: 'Додати новий', - variables: 'Змінні', - varKey: 'Ключ', - varVal: 'Значення', - token: 'Токен | Токени', - tokenPopupHeader: 'Ваш токен-ключ був успішно створений', - tokenPopupText: 'Завантажте файл з ключем зараз або скопіюйте його для подальшого використання. Якщо Ви не завантажите файл ключа зараз, то не зможете отримати свій токен-ключ знову. Для Вашої безпеки нікому не передвайте свій токен-ключ.', - tokenPopupCopy: 'Копіювати', - tokenPopupSave: 'Зберегти у форматі TXT', - userIp: 'IP користувача', - userId: 'ID користувача', - download: 'Завантажити', - regenerate: 'Перегенерувати', - askingAlert: 'Ви впевнені, що хочете перегенерувати QR-код? Користувач втратить можливість зайти в систему', - }, - license: { - customers: 'Користувачі', - license: 'Ліцензія | Ліцензії', - licenseId: 'ID', - allCustomers: 'Всі користувачі', - allLicenses: 'Всі ліцензії', - serial: 'Серія', - product: 'Продукт', - validFrom: 'Дійсно з', - validTill: 'Дійсно до', - used: 'Використано', - limit: 'Ліміт', - status: 'Статус', - competitive: 'Конкурентна', - searchPlaceholder: 'Серія, продукт', - domain: 'Домен', - daysToExpire: { - '0': 'Час дії вичерпано', - '30': '30 або менше', - '90': '90 або менше', - days: ' днів', - }, - importLicense: 'Завантажити ліцензію', - licenseKey: 'Ліцензійний ключ', - }, - devices: { - devices: 'Пристрій | Пристрої', - allDevices: 'Всі пристрої', - newDevice: 'Новий пристрій', - newDeviceDescription: 'Опис нового пристрою', - hotdeskDeviceSettings: 'Налаштування позмінного використання пристрою', - searchPlaceholder: 'Назва, користувач, ідентифікатор, ідентифікатор комп\'ютера', - authId: 'Ідентифікатор', - presence: 'Актуальний статус', - hotdesk: 'Hot desking', - hotdeskDevice: 'Hot desking пристрій', - hotdeskIncorrectInput: 'Неправильне ім\'я хоста', - hotdeskInputHint: 'Для імені хоста використовуйте лише правильні символи. Дозволені символи: A-Z, a-z, 0-9, -, _', - deviceSettings: 'Налаштування пристрою', - hostName: 'Ім\'я хоста', - phoneInfo: 'Інформація про телефон', - phone: 'Телефон', - vendor: 'Виробник', - model: 'Модель', - ipv4: 'IPv4', - mac: 'MAC', - deviceHistory: 'Історія користування', - loggedIn: 'В системі', - loggedOut: 'Вийшов із системи', - state: { - nonreg: 'Не зареєстровано', - reged: 'Зареєстровано', - ringing: 'Дзвонить', - dialing: 'Викликає', - dialog: 'В розмові', - onhold: 'На утриманні', - }, - passwordSetFromAccount: 'Якщо Ви не встановите пароль, він буде таким же, як і акаунт', - }, - }, - permissions: { - permissions: 'Дозволи', - permissionsRole: 'Роль | Ролі', - allRoles: 'Всі ролі', - searchPlaceholder: 'роль ..', - roles: { - permissions: { - permissions: 'Дозвіл ролі | Дозволи ролей', - add: 'Створювати', - delete: 'Видаляти', - read: 'Вибирати', - write: 'Редагувати', - eavesdropCall: 'Прослуховувати активний дзвінок', - playbackRecordFile: 'Відтворювати записи розмов', - exportDataGrid: 'Експортувати дані', - viewCdrPhoneNumbers: 'Перегляд незашифрованих номерів телефонів', - manageUserRoles: 'Управління ролями користувачів', - manageUserLicense: 'Управління ліцензіями користувачів', - changeUserPassword: 'Змінювати паролі користувачів', - systemSetting: 'Управління системними конфігураціями', - addDescription: 'Надає дозвіл на створення об’єктів', - deleteDescription: 'Надає дозвіл на видалення об’єктів', - readDescription: 'Надає дозвіл на вибір об’єктів', - writeDescription: 'Надає дозвіл змінювати об’єкти', - eavesdropCallDescription: 'Надає дозвіл прослуховувати активну розмову', - playbackRecordFileDescription: 'Надає дозвіл на відтворення файлів записів дзвінків', - exportDataGridDescription: 'Надає дозвіл на експорт даних', - viewCdrPhoneNumbersDescription: 'Надає дозвіл на відображення незашифрованих телефонних номерів', - manageUserRolesDescription: 'Надає дозвіл на керування набором ролей користувачів', - manageUserLicenseDescription: 'Надає дозвіл на керування набором ліцензій користувача', - changeUserPasswordDescription: 'Надає дозвіл на зміну пароля користувача', - systemSettingDescription: 'Надає дозвіл на керування розділом Конфігурація', - schemeVariables: 'Управління глобальними змінними', - schemeVariablesDescription: 'Надає дозвіл на керування розділом Глобальні змінні', - }, - addPermission: 'Надати дозвіл', - usage: 'Використання', - applicationsAccess: { - applicationsAccess: 'Застосунок | Застосунки', - access: 'Доступ', - }, - }, - object: { - object: 'Розділи', - allObjects: 'Всі розділи', - ObAC: 'Управління діями', - RbAC: 'Управління записами', - operations: 'Дії', - searchPlaceholder: 'розділ ..', - newPermissionRole: 'Новий власник прав', - rbacDefault: 'Права доступу на записи за замовчуванням', - grantor: 'Праводатель', - grantee: 'Отримувач', - create: 'Створювати', - delete: 'Видаляти', - accessMode: { - '1': 'Заборонено', - '2': 'Дозволено', - '3': 'Управління', - }, - }, - }, - lookups: { - lookups: 'Довідники', - skills: { - skills: 'Навичка | Навички', - capacity: 'Потенціал', - minCapacity: 'Мінімальний потенціал', - maxCapacity: 'Максимальний потенціал', - lvl: 'Рівень', - agentSkills: 'Навички оператора | Навички операторів', - allSkills: 'Всі навички', - state: 'Стан', - stateForAll: 'Стан для всіх', - changeSkillTo: 'Замінити навичку на', - changeAgentsSkill: 'Замінити навичку операторам', - totalAgents: 'Всього операторів', - activeSkillAgents: 'З активною навичкою', - assignSkillToAgents: 'Назначити навичку операторам', - assignAgent: 'Призначити оператора', - selectCapacityAndState: 'Вибрати потенціал і стан', - minCapacityLessOrEqualToMaxCapacityValidator: 'Має бути менше або рівне Максимальному потенціалу', - maxCapacityMoreOrEqualToMinCapacityValidator: 'Має бути більше або рівне Мінімальному потенціалу', - }, - buckets: { - buckets: 'Кошик | Кошики', - allBuckets: 'Всі кошики', - addBucket: 'Додати кошик', - }, - blacklist: { - blacklist: 'Список | Списки', - allBlacklists: 'Всі списки', - number: 'Номер | Номери', - newNumber: 'Новий номер', - numbersCount: 'Номери', - expireAt: 'Термін дії', - temporary: 'Тимчасовий', - }, - media: { - mediaFiles: 'Медіафайл| Медіафайли', - allMediaFiles: 'Всі медіафайли', - createdAt: 'Створено', - format: 'Формат', - size: 'Розмір', - textToSpeech: 'Синтез мовлення', - popupSettings: 'Налаштування', - lang: 'Мова', - voice: 'Голос', - token: 'Токен', - key: 'Ключ', - dragPlaceholder: 'Завантаження файлів', - dragPlaceholderHere: 'тут.', - tts: { - hint: 'Створити аудіофайл', - textType: { - textType: 'Тип тексту', - ssml: 'SSML', - }, - }, - }, - regions: { - regions: 'Розташування | Розташування', - allRegions: 'Всі розташування', - }, - timezone: { - timezone: 'Часова зона | Часові зони', - }, - calendars: { - calendars: 'Календар | Календарі', - allCalendars: 'Всі календарі', - searchPlaceholder: 'Назва, опис...', - timezone: 'Часовий пояс', - start: 'Початок', - end: 'Кінець', - workWeek: 'Робочий тиждень', - holidays: 'Вихідний | Вихідні', - date: 'Дата', - repeat: 'Повторювати', - fulltime: 'Тимчасовий', - everyYear: 'Повторювати щороку', - newHoliday: 'Новий вихідний', - mon: 'Понеділок', - tue: 'Вівторок', - wed: 'Середа', - thu: 'Четвер', - fri: 'П\'ятниця', - sat: 'Субота', - sun: 'Неділя', - workingTime: 'Робочий час', - workStart: 'Початок робочого часу', - workStop: 'Кінець робочого часу', - }, - communications: { - communications: 'Тип зв\'язку | Типи зв\'язку', - allCommunications: 'Всі типи зв\'язку', - addCommunication: 'Додати тип зв\'язку', - code: 'Код', - channels: { - [EngineCommunicationChannels.Phone]: 'Телефон', - [EngineCommunicationChannels.Email]: 'Електронна пошта', - [EngineCommunicationChannels.Messaging]: 'Повідомлення', - }, - }, - pauseCause: { - pauseCause: 'Статуси оператора', - allPauseCause: 'Всі причини паузи оператора', - limit: 'Ліміт (хв)', - min: 'хвилин', - allowAdmin: 'Адміністратор може змінювати статус', - allowSupervisor: 'Супервізор може змінювати статус', - allowAgent: 'Оператор може змінювати статус', - }, - }, - routing: { - routing: 'Маршрутизація', - ip: 'IP', - protocol: 'Протокол', - port: 'Порт', - configuration: 'Конфігурація', - schema: 'Схема дзвінка', - json: 'JSON', + deleteConfirmation: { + title: "Підтвердіть видалення", + askingAlert: + "Ви впевнені, що хочете видалити {count} запис? | Ви впевнені, що хочете видалити {count} записів?", + undoneActionAlert: "Дана дія не може бути скасована.", + deleteAll: "ВСІ", + }, + CSV: { + skipHeaders: "Згорнути заголовки", + charSet: "Char set", + separator: "Розділювач", + CSVColumn: "CSV поле", + fieldName: "Назва поля", + clearMember: "Очистити абонента", + }, + generalInfo: "Загальна інформація", + objectHeader: {}, + directory: { + directory: "Каталог", + passwordInfo: + "Введіть значення лише якщо хочете його перезаписати (або задати нове). Порожнє значення залишить пароль незмінним", + users: { + users: "Користувач | Користувачі", + allUsers: "Всі користувачі", + searchPlaceholder: "Ім'я, користувач, номери телефону, статус", + login: "Логін", + extensions: "Внутрішній номер", + state: "Стан", + DnD: "DnD", + status: "Статус", + roles: "Ролі", + tokens: "Токени", + usage: "Використання", + roleAdmin: "Адміністратор", + license: "Ліцензія", + devices: "Пристрій", + defaultDevice: + "Пристрій за замовчуванням (зі списку вибраних пристроїв)", + deviceNotFound: "Не знайшли свій пристрій?", + createNewDevice: "Додати новий", + variables: "Змінні", + varKey: "Ключ", + varVal: "Значення", + token: "Токен | Токени", + tokenPopupHeader: "Ваш токен-ключ був успішно створений", + tokenPopupText: + "Завантажте файл з ключем зараз або скопіюйте його для подальшого використання. Якщо Ви не завантажите файл ключа зараз, то не зможете отримати свій токен-ключ знову. Для Вашої безпеки нікому не передвайте свій токен-ключ.", + tokenPopupCopy: "Копіювати", + tokenPopupSave: "Зберегти у форматі TXT", + userIp: "IP користувача", + userId: "ID користувача", + download: "Завантажити", + regenerate: "Перегенерувати", + askingAlert: + "Ви впевнені, що хочете перегенерувати QR-код? Користувач втратить можливість зайти в систему", + }, + license: { + customers: "Користувачі", + license: "Ліцензія | Ліцензії", + licenseId: "ID", + allCustomers: "Всі користувачі", + allLicenses: "Всі ліцензії", + serial: "Серія", + product: "Продукт", + validFrom: "Дійсно з", + validTill: "Дійсно до", + used: "Використано", + limit: "Ліміт", + status: "Статус", + competitive: "Конкурентна", + searchPlaceholder: "Серія, продукт", + domain: "Домен", + daysToExpire: { + 0: "Час дії вичерпано", + 30: "30 або менше", + 90: "90 або менше", + days: " днів", + }, + importLicense: "Завантажити ліцензію", + licenseKey: "Ліцензійний ключ", + }, + devices: { + devices: "Пристрій | Пристрої", + allDevices: "Всі пристрої", + newDevice: "Новий пристрій", + newDeviceDescription: "Опис нового пристрою", + hotdeskDeviceSettings: "Налаштування позмінного використання пристрою", + searchPlaceholder: + "Назва, користувач, ідентифікатор, ідентифікатор комп'ютера", + authId: "Ідентифікатор", + presence: "Актуальний статус", + hotdesk: "Hot desking", + hotdeskDevice: "Hot desking пристрій", + hotdeskIncorrectInput: "Неправильне ім'я хоста", + hotdeskInputHint: + "Для імені хоста використовуйте лише правильні символи. Дозволені символи: A-Z, a-z, 0-9, -, _", + deviceSettings: "Налаштування пристрою", + hostName: "Ім'я хоста", + phoneInfo: "Інформація про телефон", + phone: "Телефон", + vendor: "Виробник", + model: "Модель", + ipv4: "IPv4", + mac: "MAC", + deviceHistory: "Історія користування", + loggedIn: "В системі", + loggedOut: "Вийшов із системи", + state: { + nonreg: "Не зареєстровано", + reged: "Зареєстровано", + ringing: "Дзвонить", + dialing: "Викликає", + dialog: "В розмові", + onhold: "На утриманні", + }, + passwordSetFromAccount: + "Якщо Ви не встановите пароль, він буде таким же, як і акаунт", + }, + }, + permissions: { + permissions: "Дозволи", + permissionsRole: "Роль | Ролі", + allRoles: "Всі ролі", + searchPlaceholder: "роль ..", + roles: { + permissions: { + permissions: "Дозвіл ролі | Дозволи ролей", + add: "Створювати", + delete: "Видаляти", + read: "Вибирати", + write: "Редагувати", + eavesdropCall: "Прослуховувати активний дзвінок", + playbackRecordFile: "Відтворювати записи розмов", + exportDataGrid: "Експортувати дані", + viewCdrPhoneNumbers: "Перегляд незашифрованих номерів телефонів", + manageUserRoles: "Управління ролями користувачів", + manageUserLicense: "Управління ліцензіями користувачів", + changeUserPassword: "Змінювати паролі користувачів", + systemSetting: "Управління системними конфігураціями", + addDescription: "Надає дозвіл на створення об’єктів", + deleteDescription: "Надає дозвіл на видалення об’єктів", + readDescription: "Надає дозвіл на вибір об’єктів", + writeDescription: "Надає дозвіл змінювати об’єкти", + eavesdropCallDescription: + "Надає дозвіл прослуховувати активну розмову", + playbackRecordFileDescription: + "Надає дозвіл на відтворення файлів записів дзвінків", + exportDataGridDescription: "Надає дозвіл на експорт даних", + viewCdrPhoneNumbersDescription: + "Надає дозвіл на відображення незашифрованих телефонних номерів", + manageUserRolesDescription: + "Надає дозвіл на керування набором ролей користувачів", + manageUserLicenseDescription: + "Надає дозвіл на керування набором ліцензій користувача", + changeUserPasswordDescription: + "Надає дозвіл на зміну пароля користувача", + systemSettingDescription: + "Надає дозвіл на керування розділом Конфігурація", + schemeVariables: "Управління глобальними змінними", + schemeVariablesDescription: + "Надає дозвіл на керування розділом Глобальні змінні", + }, + addPermission: "Надати дозвіл", + usage: "Використання", + applicationsAccess: { + applicationsAccess: "Застосунок | Застосунки", + access: "Доступ", + }, + }, + object: { + object: "Розділи", + allObjects: "Всі розділи", + ObAC: "Управління діями", + RbAC: "Управління записами", + operations: "Дії", + searchPlaceholder: "розділ ..", + newPermissionRole: "Новий власник прав", + rbacDefault: "Права доступу на записи за замовчуванням", + grantor: "Праводатель", + grantee: "Отримувач", + create: "Створювати", + delete: "Видаляти", + accessMode: { + 1: "Заборонено", + 2: "Дозволено", + 3: "Управління", + }, + }, + }, + lookups: { + lookups: "Довідники", + skills: { + skills: "Навичка | Навички", + capacity: "Потенціал", + minCapacity: "Мінімальний потенціал", + maxCapacity: "Максимальний потенціал", + lvl: "Рівень", + agentSkills: "Навички оператора | Навички операторів", + allSkills: "Всі навички", + state: "Стан", + stateForAll: "Стан для всіх", + changeSkillTo: "Замінити навичку на", + changeAgentsSkill: "Замінити навичку операторам", + totalAgents: "Всього операторів", + activeSkillAgents: "З активною навичкою", + assignSkillToAgents: "Назначити навичку операторам", + assignAgent: "Призначити оператора", + selectCapacityAndState: "Вибрати потенціал і стан", + minCapacityLessOrEqualToMaxCapacityValidator: + "Має бути менше або рівне Максимальному потенціалу", + maxCapacityMoreOrEqualToMinCapacityValidator: + "Має бути більше або рівне Мінімальному потенціалу", + }, + buckets: { + buckets: "Кошик | Кошики", + allBuckets: "Всі кошики", + addBucket: "Додати кошик", + }, + blacklist: { + blacklist: "Список | Списки", + allBlacklists: "Всі списки", + number: "Номер | Номери", + newNumber: "Новий номер", + numbersCount: "Номери", + expireAt: "Термін дії", + temporary: "Тимчасовий", + }, + media: { + mediaFiles: "Медіафайл| Медіафайли", + allMediaFiles: "Всі медіафайли", + createdAt: "Створено", + format: "Формат", + size: "Розмір", + textToSpeech: "Синтез мовлення", + popupSettings: "Налаштування", + lang: "Мова", + voice: "Голос", + token: "Токен", + key: "Ключ", + dragPlaceholder: "Завантаження файлів", + dragPlaceholderHere: "тут.", + tts: { + hint: "Створити аудіофайл", + textType: { + textType: "Тип тексту", + ssml: "SSML", + }, + }, + }, + regions: { + regions: "Розташування | Розташування", + allRegions: "Всі розташування", + }, + timezone: { + timezone: "Часова зона | Часові зони", + }, + calendars: { + calendars: "Календар | Календарі", + allCalendars: "Всі календарі", + searchPlaceholder: "Назва, опис...", + timezone: "Часовий пояс", + start: "Початок", + end: "Кінець", + workWeek: "Робочий тиждень", + holidays: "Вихідний | Вихідні", + date: "Дата", + repeat: "Повторювати", + fulltime: "Тимчасовий", + everyYear: "Повторювати щороку", + newHoliday: "Новий вихідний", + mon: "Понеділок", + tue: "Вівторок", + wed: "Середа", + thu: "Четвер", + fri: "П'ятниця", + sat: "Субота", + sun: "Неділя", + workingTime: "Робочий час", + workStart: "Початок робочого часу", + workStop: "Кінець робочого часу", + }, + communications: { + communications: "Тип зв'язку | Типи зв'язку", + allCommunications: "Всі типи зв'язку", + addCommunication: "Додати тип зв'язку", + code: "Код", + channels: { + [EngineCommunicationChannels.Phone]: "Телефон", + [EngineCommunicationChannels.Email]: "Електронна пошта", + [EngineCommunicationChannels.Messaging]: "Повідомлення", + }, + }, + pauseCause: { + pauseCause: "Статуси оператора", + allPauseCause: "Всі причини паузи оператора", + limit: "Ліміт (хв)", + min: "хвилин", + allowAdmin: "Адміністратор може змінювати статус", + allowSupervisor: "Супервізор може змінювати статус", + allowAgent: "Оператор може змінювати статус", + }, + }, + routing: { + routing: "Маршрутизація", + ip: "IP", + protocol: "Протокол", + port: "Порт", + configuration: "Конфігурація", + schema: "Схема дзвінка", + json: "JSON", - flow: { - flow: 'Схема | Схеми', - allFlowSchemas: 'Всі схеми', - createFlowSelectionPopup: 'Створити нову схему', - createNew: 'Створити нову схему?', - editor: 'Редактор', - diagram: { - diagram: 'Діаграма', - description: 'Створити нову схему використовуючи Webitel Flow Diagram', - }, - code: { - code: 'Код', - description: 'Створити нову схему використовуючи JSON-схему у редакторі коду', - }, - askingAlert: 'Бажаєте зберегти внесені вами зміни в "{name}" ?', - }, + flow: { + flow: "Схема | Схеми", + allFlowSchemas: "Всі схеми", + createFlowSelectionPopup: "Створити нову схему", + createNew: "Створити нову схему?", + editor: "Редактор", + diagram: { + diagram: "Діаграма", + description: + "Створити нову схему використовуючи Webitel Flow Diagram", + }, + code: { + code: "Код", + description: + "Створити нову схему використовуючи JSON-схему у редакторі коду", + }, + askingAlert: 'Бажаєте зберегти внесені вами зміни в "{name}" ?', + }, - dialplan: { - dialplan: 'Правила вихідного набору', - dialplanRules: 'Правила вихідного набору', - pattern: 'Номер призначення', - dialplanRule: 'Правило вихідного набору', - position: 'Позиція', - }, + dialplan: { + dialplan: "Правила вихідного набору", + dialplanRules: "Правила вихідного набору", + pattern: "Номер призначення", + dialplanRule: "Правило вихідного набору", + position: "Позиція", + }, - chatplan: { - chatplan: 'Правило маршрутизації текстових повідомлень | Правила маршрутизації текстових повідомлень', - allChatplans: 'Всі правила маршрутизації текстових повідомлень', - }, + chatplan: { + chatplan: + "Правило маршрутизації текстових повідомлень | Правила маршрутизації текстових повідомлень", + allChatplans: "Всі правила маршрутизації текстових повідомлень", + }, - gateways: { - gateways: 'Шлюз | Шлюзи', - allGateways: 'Всі шлюзи', - trunkingGateway: 'Багатоканальний шлюз', - registerGateway: 'Зареєструвати шлюз', - stateSuccess: 'Успішно', - stateFailed: 'Неуспішно', - stateProgress: 'В процесі', - stateNonreg: 'Не зареєстрований', - proxy: 'Проксі', - searchPlaceholder: 'пошук шлюзу...', - host: 'Хост', - trunkingACLTitle: 'Контроль доступу', - trunkingACL: 'Багатоканальний список доступу', - hostnameTrunking: 'Сервер/Хост шлюзу чи IP', - hostnameRegister: 'Реєстратор/Сервер/Хост шлюзу чи IP', - expire: 'Термін дії', - authID: 'Ім\'я користувача', - account: 'Акаунт', - outboundProxy: 'Адреса вихідного SIP-проксі', - newGateway: 'Новий шлюз', - newGatewayDescription: 'Опис нового шлюзу', - SIPregistrations: 'SIP-реєстрація', - SIPregistrationsDescription: 'Опис SIP-реєстрації', - SIPtrunking: 'SIP-транки', - SIPtrunkingDescription: 'Опис SIP-транків', - }, + gateways: { + gateways: "Шлюз | Шлюзи", + allGateways: "Всі шлюзи", + trunkingGateway: "Багатоканальний шлюз", + registerGateway: "Зареєструвати шлюз", + stateSuccess: "Успішно", + stateFailed: "Неуспішно", + stateProgress: "В процесі", + stateNonreg: "Не зареєстрований", + proxy: "Проксі", + searchPlaceholder: "пошук шлюзу...", + host: "Хост", + trunkingACLTitle: "Контроль доступу", + trunkingACL: "Багатоканальний список доступу", + hostnameTrunking: "Сервер/Хост шлюзу чи IP", + hostnameRegister: "Реєстратор/Сервер/Хост шлюзу чи IP", + expire: "Термін дії", + authID: "Ім'я користувача", + account: "Акаунт", + outboundProxy: "Адреса вихідного SIP-проксі", + newGateway: "Новий шлюз", + newGatewayDescription: "Опис нового шлюзу", + SIPregistrations: "SIP-реєстрація", + SIPregistrationsDescription: "Опис SIP-реєстрації", + SIPtrunking: "SIP-транки", + SIPtrunkingDescription: "Опис SIP-транків", + }, - chatGateways: { - templates: { - templates: 'Шаблони', - title: 'Анонімне ім\'я абонента у Workspace', - close: 'Повідомлення завершення чату', - join: 'Повідомлення приєднання оператора', - left: 'Повідомлення від\'єднання оператора', - }, - chatGateways: 'Текстовий шлюз | Текстові шлюзи', - allChatGateways: 'Всі текстові шлюзи', - telegramBot: { - telegramBot: 'Telegram Бот', - }, - telegramApp: { - telegramApp: 'Telegram Застосунок', - signedAs: 'Ви авторизовані як', - joinTelegram: 'Sign in to Telegram', - metadata: { - apiId: 'API ідентифікатор', - apiHash: 'API хеш', - }, - }, - infobip: { - infobip: 'Infobip', - }, - messenger: { - meta: 'Meta', - addOrRemovePages: 'Додати або видалити сторінки', - accounts: 'Аккаунти', - metadata: { - clientId: 'App ID', - clientSecret: 'App Secret', - }, - facebook: { - pages: 'Facebook сторінки', - subscription: 'Webhook підписки', - }, - instagram: { - instagram: 'Instagram', - comments: 'Відслідковувати коментарі', - mentions: 'Відслідковувати згадування', - }, - whatsapp: { - whatsapp: 'Whatsapp', - token: 'Токен', - status: 'Статус', - number: 'Номер телефону', - review: 'Розгляд', - }, - }, - viber: { - viber: 'Viber', + chatGateways: { + templates: { + templates: "Шаблони", + title: "Анонімне ім'я абонента у Workspace", + close: "Повідомлення завершення чату", + join: "Повідомлення приєднання оператора", + left: "Повідомлення від'єднання оператора", + }, + chatGateways: "Текстовий шлюз | Текстові шлюзи", + allChatGateways: "Всі текстові шлюзи", + telegramBot: { + telegramBot: "Telegram Бот", + }, + telegramApp: { + telegramApp: "Telegram Застосунок", + signedAs: "Ви авторизовані як", + joinTelegram: "Sign in to Telegram", + metadata: { + apiId: "API ідентифікатор", + apiHash: "API хеш", + }, + }, + infobip: { + infobip: "Infobip", + }, + messenger: { + meta: "Meta", + addOrRemovePages: "Додати або видалити сторінки", + accounts: "Аккаунти", + metadata: { + clientId: "App ID", + clientSecret: "App Secret", + }, + facebook: { + pages: "Facebook сторінки", + subscription: "Webhook підписки", + }, + instagram: { + instagram: "Instagram", + comments: "Відслідковувати коментарі", + mentions: "Відслідковувати згадування", + }, + whatsapp: { + whatsapp: "Whatsapp", + token: "Токен", + status: "Статус", + number: "Номер телефону", + review: "Розгляд", + }, + }, + viber: { + viber: "Viber", - style: { - style: 'Стиль', - btnBackColor: 'Колір фону кнопки', - btnFontColor: 'Колір тексту кнопки', - }, - }, - webchat: { - webchat: 'Web chat', - copyCode: 'Копіювати код', - copyCodeHint: 'Необхідно перегенерувати та вставити код Віджета на сайт після кожної модифікації налаштувань', - metadata: { - mediaMaxSize: 'Максимальний розмір файла (Мб)', - }, - view: { - borderRadius: 'Вигляд кнопки', - language: 'Мова', - view: 'Вигляд', - position: 'Розміщення', - btnColor: 'Колір кнопки', - logoUrl: 'URL логотипу', - logoHint: 'Підтримуваний формат логотипу - \'JPEG\' or \'PNG\', 24x24px', - rounded: 'Кругла', - square: 'Квадратна', - right: 'Справа', - left: 'Зліва', - static: 'Статична', - }, - recaptcha: { - recaptcha: 'reCAPTCHA', - sitekey: 'Site key', - secret: 'Secret key', - threshold: 'Поріг', - showFlag: 'Показувати значок reCAPTCHA', - }, - chat: { - chat: 'Чат', - openTimeout: 'Ввімкнути затримку відкриття', - openTimeoutSec: 'Час затримки відкриття', - }, - appointment: { - appointment: 'Замовлення дзвінка', - days: 'Кількість днів', - availableAgents: 'Вільні агенти', - showEmailField: 'Показати поле вводу пошти', - showMessageField: 'Показати поле вводу повідомлення', - resultPageText: 'Текст на сторінці результату', - headingText: 'Заголовок', - subheadingText: 'Підзаголовок', - showDefaultHeading: 'Показати стандартний заголовок та підзаголовок на сторінці результату', - }, - call: { - title: 'Онлайн-дзвінок', - url: 'WebSocket Endpoint', - }, - alternativeChannels: { - alternativeChannels: 'Альтернативні канали', - title: 'Текстові канали', - email: 'Електронна пошта', - whatsapp: 'WhatsApp', - telegram: 'Telegram', - messenger: 'Messenger', - }, - }, - customChat: { - customChat: 'Custom Chat', - customChatGateway: 'Custom Chat Gateway', - appSecretHint: 'Зміна цього поля перерве інтеграцію', - metadata: { - appSecret: 'App Secret', - callback: 'Callback', - }, - }, - uri: 'URI', - newChatGateway: 'Новий текстовий шлюз', - metadata: { - apiKey: 'Api Key', - number: 'Number', - baseUrl: 'Base URL', - sendApi: 'Send API', - allowOrigin: 'Allow Origin', - readTimeout: 'Read Timeout (sec)', - writeTimeout: 'Write Timeout (sec)', - handshakeTimeout: 'Handshake Timeout (sec)', - messageSize: 'Message Size max (bytes)', - botName: 'Bot Name', - eventTypes: 'Event Types', - telegramToken: 'Telegram BOT API Token', - messengerApiUrl: 'Messenger API URL', - }, - }, + style: { + style: "Стиль", + btnBackColor: "Колір фону кнопки", + btnFontColor: "Колір тексту кнопки", + }, + }, + webchat: { + webchat: "Web chat", + copyCode: "Копіювати код", + copyCodeHint: + "Необхідно перегенерувати та вставити код Віджета на сайт після кожної модифікації налаштувань", + metadata: { + mediaMaxSize: "Максимальний розмір файла (Мб)", + }, + view: { + borderRadius: "Вигляд кнопки", + language: "Мова", + view: "Вигляд", + position: "Розміщення", + btnColor: "Колір кнопки", + logoUrl: "URL логотипу", + logoHint: + "Підтримуваний формат логотипу - 'JPEG' or 'PNG', 24x24px", + rounded: "Кругла", + square: "Квадратна", + right: "Справа", + left: "Зліва", + static: "Статична", + }, + recaptcha: { + recaptcha: "reCAPTCHA", + sitekey: "Site key", + secret: "Secret key", + threshold: "Поріг", + showFlag: "Показувати значок reCAPTCHA", + }, + chat: { + chat: "Чат", + openTimeout: "Ввімкнути затримку відкриття", + openTimeoutSec: "Час затримки відкриття", + }, + appointment: { + appointment: "Замовлення дзвінка", + days: "Кількість днів", + availableAgents: "Вільні агенти", + showEmailField: "Показати поле вводу пошти", + showMessageField: "Показати поле вводу повідомлення", + resultPageText: "Текст на сторінці результату", + headingText: "Заголовок", + subheadingText: "Підзаголовок", + showDefaultHeading: + "Показати стандартний заголовок та підзаголовок на сторінці результату", + }, + call: { + title: "Онлайн-дзвінок", + url: "WebSocket Endpoint", + }, + alternativeChannels: { + alternativeChannels: "Альтернативні канали", + title: "Текстові канали", + email: "Електронна пошта", + whatsapp: "WhatsApp", + telegram: "Telegram", + messenger: "Messenger", + }, + }, + customChat: { + customChat: "Custom Chat", + customChatGateway: "Custom Chat Gateway", + appSecretHint: "Зміна цього поля перерве інтеграцію", + metadata: { + appSecret: "App Secret", + callback: "Callback", + }, + }, + uri: "URI", + newChatGateway: "Новий текстовий шлюз", + metadata: { + apiKey: "Api Key", + number: "Number", + baseUrl: "Base URL", + sendApi: "Send API", + allowOrigin: "Allow Origin", + readTimeout: "Read Timeout (sec)", + writeTimeout: "Write Timeout (sec)", + handshakeTimeout: "Handshake Timeout (sec)", + messageSize: "Message Size max (bytes)", + botName: "Bot Name", + eventTypes: "Event Types", + telegramToken: "Telegram BOT API Token", + messengerApiUrl: "Messenger API URL", + }, + }, - callflow: { - callflow: 'Конструктор дзвінка', - }, - }, - ccenter: { - ccenter: 'Контакт-центр', + callflow: { + callflow: "Конструктор дзвінка", + }, + }, + ccenter: { + ccenter: "Контакт-центр", - agents: { - agents: 'Оператор | Оператори', - supervisors: 'Супервізор | Супервізори', - admins: 'Адміністратор | Адміністратори', - subordinates: 'Підлеглий оператор | Підлеглі оператори', - allAgents: 'Всі оператори', - state: 'Статус', - progressiveCount: 'Кількість одночасних дзвінків', - chatCount: 'Кількість одночасних чатів', - taskCount: 'Кількість одночасних задач', - isSupervisor: 'Супервізор', - stateTime: 'Тривалість', - addSkill: 'Додати навичку', - addSubordinate: 'Додати підлеглого оператора', - statusHistory: 'Історія станів', - historyState: 'Стан', - historyChannel: 'Канал', - historyFrom: 'Від', - historyTo: 'До', - historyDuration: 'Тривалість', - payload: 'Причина', - emptyPopup: 'Будь ласка, перевірте налаштування фільтрів', - status: { - online: 'Онлайн', - offline: 'Офлайн', - pause: 'Пауза', - breakOut: 'Примусова пауза', - }, - }, + agents: { + agents: "Оператор | Оператори", + supervisors: "Супервізор | Супервізори", + admins: "Адміністратор | Адміністратори", + subordinates: "Підлеглий оператор | Підлеглі оператори", + allAgents: "Всі оператори", + state: "Статус", + progressiveCount: "Кількість одночасних дзвінків", + chatCount: "Кількість одночасних чатів", + taskCount: "Кількість одночасних задач", + isSupervisor: "Супервізор", + stateTime: "Тривалість", + addSkill: "Додати навичку", + addSubordinate: "Додати підлеглого оператора", + statusHistory: "Історія станів", + historyState: "Стан", + historyChannel: "Канал", + historyFrom: "Від", + historyTo: "До", + historyDuration: "Тривалість", + payload: "Причина", + emptyPopup: "Будь ласка, перевірте налаштування фільтрів", + status: { + online: "Онлайн", + offline: "Офлайн", + pause: "Пауза", + breakOut: "Примусова пауза", + }, + }, - auditors: { - auditors: 'Аудитор | Аудитори', - }, + auditors: { + auditors: "Аудитор | Аудитори", + }, - teams: { - teams: 'Команда | Команди', - allTeams: 'Всі команди', - strategy: 'Стратегія', - parameters: 'Параметри', - maxNoAnswer: 'Максимальна кількість пропущених активностей', - callTimeout: 'Час на прийняття дзвінка', - inviteChatTimeout: 'Час на прийняття чату', - wrapUpTime: 'Тривалість паузи між дзвінками', - noAnswerDelayTime: 'Час затримки після пропущеної активності', - taskAcceptTimeout: 'Час на прийняття завдання', - strategies: { - random: 'Випадково', - fewestCalls: 'Оператор з найменшою кількістю дзвінків', - leastTalkTime: 'Оператор з найменшим часом розмови', - topDown: 'Згори вниз', - roundRobin: 'По порядку', - roundRobinBucket: 'По порядку кошика', - longestIdleAgent: 'Оператор з найбільшим часом простою', - skillCapacity: 'По рівню навички', - }, - hooks: { - eventTypes: { - agentStatus: 'Зміна статуту оператора', - } - }, - flows: { - addFlowSchema: 'Додати схему', - editFlowSchema: 'Редагувати схему', - }, - }, + teams: { + teams: "Команда | Команди", + allTeams: "Всі команди", + strategy: "Стратегія", + parameters: "Параметри", + maxNoAnswer: "Максимальна кількість пропущених активностей", + callTimeout: "Час на прийняття дзвінка", + inviteChatTimeout: "Час на прийняття чату", + wrapUpTime: "Тривалість паузи між дзвінками", + noAnswerDelayTime: "Час затримки після пропущеної активності", + taskAcceptTimeout: "Час на прийняття завдання", + strategies: { + random: "Випадково", + fewestCalls: "Оператор з найменшою кількістю дзвінків", + leastTalkTime: "Оператор з найменшим часом розмови", + topDown: "Згори вниз", + roundRobin: "По порядку", + roundRobinBucket: "По порядку кошика", + longestIdleAgent: "Оператор з найбільшим часом простою", + skillCapacity: "По рівню навички", + }, + hooks: { + eventTypes: { + agentStatus: "Зміна статуту оператора", + }, + }, + flows: { + addFlowSchema: "Додати схему", + editFlowSchema: "Редагувати схему", + }, + }, - members: { - members: 'Абонент| Абоненти', - allMembers: 'Всі абоненти', - addMember: 'Додати абонента', - destination: 'Призначення', - display: 'Відображення номера', - dtmf: 'DTMF', - priority: 'Пріоритет', - attempts: 'Спроб', - emptyWorkspace: 'Абонентів не знайдено', - resetMembers: { - resetMembers: 'Перезапустити абонентів', - description: 'Ви впевнені, що бажаєте перезапустити усі неуспішні спроби повторно?', - reset: 'Перезапустити', - successResetCount: 'Успішно перезапущено {count} абонентів', - }, - endCause: { - abandoned: 'Втрачений', - timeout: 'Тайм-аут', - cancel: 'Скасований', - success: 'Успішний', - failed: 'Неуспішний', - missed: 'Пропущений', - expired: 'Час вийшов', - }, - }, + members: { + members: "Абонент| Абоненти", + allMembers: "Всі абоненти", + addMember: "Додати абонента", + destination: "Призначення", + display: "Відображення номера", + dtmf: "DTMF", + priority: "Пріоритет", + attempts: "Спроб", + emptyWorkspace: "Абонентів не знайдено", + resetMembers: { + resetMembers: "Перезапустити абонентів", + description: + "Ви впевнені, що бажаєте перезапустити усі неуспішні спроби повторно?", + reset: "Перезапустити", + successResetCount: "Успішно перезапущено {count} абонентів", + }, + endCause: { + abandoned: "Втрачений", + timeout: "Тайм-аут", + cancel: "Скасований", + success: "Успішний", + failed: "Неуспішний", + missed: "Пропущений", + expired: "Час вийшов", + }, + }, - queues: { - queues: 'Черга | Черги', - allQueues: 'Всі черги', - type: 'Тип', - state: 'Стан', - active: 'Активна', - notActive: 'Не активна', - activeCalls: 'Активні дзвінки', - waiting: 'Очікування', - ringtone: 'Мелодія', - priority: 'Пріоритет', - teams: 'Команда| Команди', - tags: 'Теги', - blacklist: 'Стоп лист', - newQueue: 'Нова черга', - newQueueDescription: 'Типи черг', - outboundIVRQueue: 'Вихідна IVR-черга', - outboundIVR: 'Вихідний IVR', - outboundIVRQueueDescription: 'Вихідний IVR дозволяє організації автоматично залучати клієнтів по кількох каналах, таких як автоматичні голосові виклики, SMS-повідомлення, електронна пошта або повідомлення в соцмережах з використанням персоналізованих сповіщень.', - inboundQueue: 'Вхідна черга', - inboundQueueDescription: 'Абоненти вхідної черги знаходяться в режимі очікування, щоб поспілкуватися з живим оператором.', - offlineQueue: 'Офлайн черга', - offlineQueueDescription: 'Автономна черга дає можливість абонентам завершити очікування на утриманні, ввести свій номер телефону і отримати зворотній дзвінок.', - previewDialer: 'Прев\'ю-обдзвін', - previewDialerDescription: 'Ініціатором дзвінка виступає оператор. Він попередньо переглядає контакт перед автоматичним набором номеру.', - progressiveDialer: 'Прогресивний обдзвін', - progressiveDialerDescription: 'Вихідна кампанія з резервуванням оператора.', - predictiveDialer: 'Предиктивний обдзвін', - predictiveDialerDescription: 'Вихідна кампанія без попереднього резервування оператора для максимального скорочення часу очікування дзвінка.', - chatInboundQueue: 'Вхідна черга чатів', - chatInboundQueueDescription: 'Така ж вхідна черга, але для чатів', - inboundJobQueue: 'Вхідна черга завдань', - inboundJobQueueDescription: 'Вхідна черга завдань', - outboundJobQueue: 'Вихідна черга завдань', - outboundJobQueueDescription: 'Вихідна черга завдань', - strategy: 'Стратегія', - timezone: 'Часова зона', - callLimit: 'Максимальна кількість одночасних дзвінків', - variables: 'Змінні', - members: 'Абонент | Абоненти', - params: 'Налаштування додзвону абонентів', - discardAbandonedAfter: 'Кількість секунд до повного видалення абонента', - maxIdleAgent: 'Очікування відповіді оператора', - maxIdleClient: 'Очікування відповіді абонента', - maxIdleDialog: 'Максимальний час очікування повідомлення', - timeoutWithNoAgents: 'Час очікування, коли немає операторів', - timeBaseScore: 'Рейтинг дзвінка', - endless: 'Не припиняти набір', - stickyAgent: 'Липкість', - stickyAgentSec: 'Час очікування липкості (сек)', - autoAnswerTone: 'Попереджувальний сигнал автоматичної відповіді', - varKey: 'Ключ', - varVal: 'Значення', - endCause: 'Причина припинення', - offeringAt: 'Передзвонити в', - destination: 'Призначення | Призначення', - expire: 'Закінчується', - originateTimeout: 'Час очікування', - maxAgentLine: 'Кількість одночасних дзвінків на оператора', - maxAgentLose: 'Максимальна кількість неприйнятих дзвінків для припинення донабору ліній', - minAttempts: 'Кількість спроб для переходу в предиктивний режим', - maxAbandonedRate: 'Дозволений % втрачених дзвінків', - loadFactor: 'Коефіцієнт навантаження', - abandonRateAdjustment: 'Коригування втрачених дзвінків', - playbackSilence: 'Тиша перед програванням аудіофайлу (мс.)', - targetAbandonedRate: 'Бажаний % втрачених дзвінків', - maxWaitTime: 'Максимальний час очікування', - maxWaitingSize: 'Максимальна кількість очікування', - waitBetweenRetries: 'Час між спробами', - waitBetweenRetriesDesc: 'Сортування нових спроб за спаданням', - strictCircuit: 'Strict circuit', - timeout: 'Час перерви між дзвінками', - maxNumberOfRetry: 'Максимальна кількість повторів додзвону', - minDuration: 'Мінімальна тривалість успішного дзвінка', - maxAttempts: 'Максимальна кількість спроб', - minOnlineAgents: 'Доступ до паузи, якщо кількість операторів онлайн більше ніж:', - waitForResultStatus: 'Очікування результату дзвінка', - retryAbandoned: 'Відновлювати втрачених абонентів', - playbackFile: 'Програти файл', - bucketPriority: 'Пріоритет', - amd: 'AMD', - enabled: 'Увімкнути автовизначення', - ai: 'Штучний інтелект', - positiveLabels: 'Позитивні мітки', - aiPlayback: 'Програти файл', - allowNotSure: 'Невизначені', - silenceNotSure: 'Тиша', - allowGreetingAgent: 'Дозволити привітання', - preSchema: 'Схема попереднього набору', - afterSchema: 'Схема подальшого набору', - maxCalls: 'Ліміт задач', - maxCallsHint: 'Якщо значення дорівнює 0, дайлер не буде дзвонити', - recordings: 'Запис', - recordAll: 'Почати запис після відповіді', - perNumbers: 'Ініціація на кожен номер', - maxWordLength: 'Максимальна тривалість речення (мс)', - maxNumberOfWords: 'Максимальна кількість слів в привітанні', - betweenWordsSilence: 'Тривалість тиші між словами (мс)', - minWordLength: 'Мінімальна пропозиція неперервного звуку голосу (мс)', - totalAnalysisTime: 'Максимальний час для розпізнавання (мс)', - silenceThreshold: 'Максимальний поріг тиші (мс)', - afterGreetingSilence: 'Тривалість тиші після привітання (мс)', - greeting: 'Максимальна довжина привітання (мс)', - initialSilence: 'Максимальна тривалість тиші перед привітанням (мс)', - statisticTime: 'Інтервал перерахунку', - communications: 'Тип зв\'язку', - manualDistribution: 'Ручне розподілення', - lastMessageTimeout: 'Час очікування від останнього повідомлення', - processing: { - processing: 'Обробка', - enabled: 'Очікування результату задачі', - formSchema: 'Схема динамічної обробки', - sec: 'Час обробки (сек)', - renewalSec: 'Запропонувати продовження після (сек)', - }, - queueStrategy: { - fifo: 'FIFO (Першим зайшов, першим вийшов)', - lifo: 'LIFO (Останнім зайшов, першим вийшов)', - strict_fifo: 'Strict FIFO (Першим зайшов, першим вийшов)', - }, - logs: { - logs: 'Лог | Логи', - destination: 'Призначення', - offeringAt: 'Розподілення', - joinedAt: 'Початок', - leavingAt: 'Кінець', - duration: 'Тривалість', - viewNumber: 'Номер', - result: 'Результат', - attempts: 'Спроба', - resultName: { - abandoned: 'Abandoned', - cancel: 'Cancel', - success: 'Success', - failed: 'Failed', - missed: 'Missed', - timeout: 'Timeout', - endless: 'Endless', - transferred: 'Transferred', - }, - }, - hooks: { - hooks: 'Хук | Хуки', - event: 'Подія', - eventTypes: { - joined: 'Абонент увійшов в чергу', - answered: 'Прийнятий оператором', - offering: 'Розподілення на оператора', - bridged: 'З’єднання абонента з оператором', - missed: 'Пропущений оператором', - leaving: 'Абонент вийшов із черги', - processing: 'Постобробка', - active: 'Активна дія', - }, - }, - }, + queues: { + queues: "Черга | Черги", + allQueues: "Всі черги", + type: "Тип", + state: "Стан", + active: "Активна", + notActive: "Не активна", + activeCalls: "Активні дзвінки", + waiting: "Очікування", + ringtone: "Мелодія", + priority: "Пріоритет", + teams: "Команда| Команди", + tags: "Теги", + blacklist: "Стоп лист", + newQueue: "Нова черга", + newQueueDescription: "Типи черг", + outboundIVRQueue: "Вихідна IVR-черга", + outboundIVR: "Вихідний IVR", + outboundIVRQueueDescription: + "Вихідний IVR дозволяє організації автоматично залучати клієнтів по кількох каналах, таких як автоматичні голосові виклики, SMS-повідомлення, електронна пошта або повідомлення в соцмережах з використанням персоналізованих сповіщень.", + inboundQueue: "Вхідна черга", + inboundQueueDescription: + "Абоненти вхідної черги знаходяться в режимі очікування, щоб поспілкуватися з живим оператором.", + offlineQueue: "Офлайн черга", + offlineQueueDescription: + "Автономна черга дає можливість абонентам завершити очікування на утриманні, ввести свій номер телефону і отримати зворотній дзвінок.", + previewDialer: "Прев'ю-обдзвін", + previewDialerDescription: + "Ініціатором дзвінка виступає оператор. Він попередньо переглядає контакт перед автоматичним набором номеру.", + progressiveDialer: "Прогресивний обдзвін", + progressiveDialerDescription: + "Вихідна кампанія з резервуванням оператора.", + predictiveDialer: "Предиктивний обдзвін", + predictiveDialerDescription: + "Вихідна кампанія без попереднього резервування оператора для максимального скорочення часу очікування дзвінка.", + chatInboundQueue: "Вхідна черга чатів", + chatInboundQueueDescription: "Така ж вхідна черга, але для чатів", + inboundJobQueue: "Вхідна черга завдань", + inboundJobQueueDescription: "Вхідна черга завдань", + outboundJobQueue: "Вихідна черга завдань", + outboundJobQueueDescription: "Вихідна черга завдань", + strategy: "Стратегія", + timezone: "Часова зона", + callLimit: "Максимальна кількість одночасних дзвінків", + variables: "Змінні", + members: "Абонент | Абоненти", + params: "Налаштування додзвону абонентів", + discardAbandonedAfter: "Кількість секунд до повного видалення абонента", + maxIdleAgent: "Очікування відповіді оператора", + maxIdleClient: "Очікування відповіді абонента", + maxIdleDialog: "Максимальний час очікування повідомлення", + timeoutWithNoAgents: "Час очікування, коли немає операторів", + timeBaseScore: "Рейтинг дзвінка", + endless: "Не припиняти набір", + stickyAgent: "Липкість", + stickyAgentSec: "Час очікування липкості (сек)", + autoAnswerTone: "Попереджувальний сигнал автоматичної відповіді", + varKey: "Ключ", + varVal: "Значення", + endCause: "Причина припинення", + offeringAt: "Передзвонити в", + destination: "Призначення | Призначення", + expire: "Закінчується", + originateTimeout: "Час очікування", + maxAgentLine: "Кількість одночасних дзвінків на оператора", + maxAgentLose: + "Максимальна кількість неприйнятих дзвінків для припинення донабору ліній", + minAttempts: "Кількість спроб для переходу в предиктивний режим", + maxAbandonedRate: "Дозволений % втрачених дзвінків", + loadFactor: "Коефіцієнт навантаження", + abandonRateAdjustment: "Коригування втрачених дзвінків", + playbackSilence: "Тиша перед програванням аудіофайлу (мс.)", + targetAbandonedRate: "Бажаний % втрачених дзвінків", + maxWaitTime: "Максимальний час очікування", + maxWaitingSize: "Максимальна кількість очікування", + waitBetweenRetries: "Час між спробами", + waitBetweenRetriesDesc: "Сортування нових спроб за спаданням", + strictCircuit: "Strict circuit", + timeout: "Час перерви між дзвінками", + maxNumberOfRetry: "Максимальна кількість повторів додзвону", + minDuration: "Мінімальна тривалість успішного дзвінка", + maxAttempts: "Максимальна кількість спроб", + minOnlineAgents: + "Доступ до паузи, якщо кількість операторів онлайн більше ніж:", + waitForResultStatus: "Очікування результату дзвінка", + retryAbandoned: "Відновлювати втрачених абонентів", + playbackFile: "Програти файл", + bucketPriority: "Пріоритет", + amd: "AMD", + enabled: "Увімкнути автовизначення", + ai: "Штучний інтелект", + positiveLabels: "Позитивні мітки", + aiPlayback: "Програти файл", + allowNotSure: "Невизначені", + silenceNotSure: "Тиша", + allowGreetingAgent: "Дозволити привітання", + preSchema: "Схема попереднього набору", + afterSchema: "Схема подальшого набору", + maxCalls: "Ліміт задач", + maxCallsHint: "Якщо значення дорівнює 0, дайлер не буде дзвонити", + recordings: "Запис", + recordAll: "Почати запис після відповіді", + perNumbers: "Ініціація на кожен номер", + maxWordLength: "Максимальна тривалість речення (мс)", + maxNumberOfWords: "Максимальна кількість слів в привітанні", + betweenWordsSilence: "Тривалість тиші між словами (мс)", + minWordLength: "Мінімальна пропозиція неперервного звуку голосу (мс)", + totalAnalysisTime: "Максимальний час для розпізнавання (мс)", + silenceThreshold: "Максимальний поріг тиші (мс)", + afterGreetingSilence: "Тривалість тиші після привітання (мс)", + greeting: "Максимальна довжина привітання (мс)", + initialSilence: "Максимальна тривалість тиші перед привітанням (мс)", + statisticTime: "Інтервал перерахунку", + communications: "Тип зв'язку", + manualDistribution: "Ручне розподілення", + lastMessageTimeout: "Час очікування від останнього повідомлення", + processing: { + processing: "Обробка", + enabled: "Очікування результату задачі", + formSchema: "Схема динамічної обробки", + sec: "Час обробки (сек)", + renewalSec: "Запропонувати продовження після (сек)", + }, + queueStrategy: { + fifo: "FIFO (Першим зайшов, першим вийшов)", + lifo: "LIFO (Останнім зайшов, першим вийшов)", + strict_fifo: "Strict FIFO (Першим зайшов, першим вийшов)", + }, + logs: { + logs: "Лог | Логи", + destination: "Призначення", + offeringAt: "Розподілення", + joinedAt: "Початок", + leavingAt: "Кінець", + duration: "Тривалість", + viewNumber: "Номер", + result: "Результат", + attempts: "Спроба", + resultName: { + abandoned: "Abandoned", + cancel: "Cancel", + success: "Success", + failed: "Failed", + missed: "Missed", + timeout: "Timeout", + endless: "Endless", + transferred: "Transferred", + }, + }, + hooks: { + hooks: "Хук | Хуки", + event: "Подія", + eventTypes: { + joined: "Абонент увійшов в чергу", + answered: "Прийнятий оператором", + offering: "Розподілення на оператора", + bridged: "З’єднання абонента з оператором", + missed: "Пропущений оператором", + leaving: "Абонент вийшов із черги", + processing: "Постобробка", + active: "Активна дія", + }, + }, + }, - res: { - res: 'Ресурс | Ресурси', - allRes: 'Всі ресурси', - reserve: 'Резервний', - searchPlaceholder: 'назва, шлюз..', - cps: 'CPS', - limit: 'Ліміт', - cidType: 'CID Type', - ignoreEarlyMedia: 'Ignore Early Media', - numbers: 'Номер | Номери', - displayNumbers: 'Номер для відображення', - failure: 'Збій', - maxErrors: 'Максимальна кількість помилок', - errorCodes: 'Коди помилок', - patterns: 'Шаблон вихідного номера', - priority: 'Пріоритет', - reserveResource: 'Резервний ресурс', - failureDialDelay: 'Затримка при помилці набору', - }, + res: { + res: "Ресурс | Ресурси", + allRes: "Всі ресурси", + reserve: "Резервний", + searchPlaceholder: "назва, шлюз..", + cps: "CPS", + limit: "Ліміт", + cidType: "CID Type", + ignoreEarlyMedia: "Ignore Early Media", + numbers: "Номер | Номери", + displayNumbers: "Номер для відображення", + failure: "Збій", + maxErrors: "Максимальна кількість помилок", + errorCodes: "Коди помилок", + patterns: "Шаблон вихідного номера", + priority: "Пріоритет", + reserveResource: "Резервний ресурс", + failureDialDelay: "Затримка при помилці набору", + }, - resGroups: { - resGroups: 'Група ресурсів | Групи ресурсів', - allResGroups: 'Всі групи ресурсів', - searchPlaceholder: 'назва групи ресурсів..', - addResGroup: 'Додати групу ресурсів', - strategy: 'Стратегія', - timerange: 'Інтервал', - timerangeFrom: 'Від', - timerangeTo: 'До', - }, - }, - integrations: { - integrations: 'Інтеграції', - emptyWorkspace: 'Профілі у розділі ще не створені', + resGroups: { + resGroups: "Група ресурсів | Групи ресурсів", + allResGroups: "Всі групи ресурсів", + searchPlaceholder: "назва групи ресурсів..", + addResGroup: "Додати групу ресурсів", + strategy: "Стратегія", + timerange: "Інтервал", + timerangeFrom: "Від", + timerangeTo: "До", + }, + }, + integrations: { + integrations: "Інтеграції", + emptyWorkspace: "Профілі у розділі ще не створені", - storage: { - storage: 'Сховища', - allStorages: 'Всі сховища', - type: 'Тип', - maxSize: 'Об\'єм сховища (GB)', - expireDays: 'Термін зберігання (днів)', - priority: 'Пріоритет', - newStorage: 'Нове сховище', - newStorageDescription: 'Опис нового сховища', - local: 'Local', - s3: 'Amazon S3', - digitalOcean: 'Digital Ocean Spaces', - backblaze: 'Backblaze B2', - dropbox: 'Dropbox', - drive: 'Google Drive', - configuration: 'Конфігурація', - pathPattern: 'Шаблон шляху', - localFolder: 'Local folder', - s3Key: 'Key ID', - s3Access: 'Access Key', - bucket: 'Bucket', - region: 'Розміщення', - oceanKey: 'Key ID', - oceanAccess: 'Access Key', - backblazeAccount: 'Account ID', - backblazeKey: 'Application key', - backblazeBucketId: 'Bucket Id', - dropboxKey: 'Access Token', - driveFolder: 'Folder name', - driveEmail: 'Google Email', - driveKey: 'Private key', - s3Endpoint: 'Endpoint', - }, + storage: { + storage: "Сховища", + allStorages: "Всі сховища", + type: "Тип", + maxSize: "Об'єм сховища (GB)", + expireDays: "Термін зберігання (днів)", + priority: "Пріоритет", + newStorage: "Нове сховище", + newStorageDescription: "Опис нового сховища", + local: "Local", + s3: "Amazon S3", + digitalOcean: "Digital Ocean Spaces", + backblaze: "Backblaze B2", + dropbox: "Dropbox", + drive: "Google Drive", + configuration: "Конфігурація", + pathPattern: "Шаблон шляху", + localFolder: "Local folder", + s3Key: "Key ID", + s3Access: "Access Key", + bucket: "Bucket", + region: "Розміщення", + oceanKey: "Key ID", + oceanAccess: "Access Key", + backblazeAccount: "Account ID", + backblazeKey: "Application key", + backblazeBucketId: "Bucket Id", + dropboxKey: "Access Token", + driveFolder: "Folder name", + driveEmail: "Google Email", + driveKey: "Private key", + s3Endpoint: "Endpoint", + }, - cognitiveProfiles: { - cognitiveProfiles: 'Голосовий профіль | Голосові профілі', - properties: { - region: 'Регіон', - locale: 'Мова', - }, - }, - emailProfiles: { - emailProfiles: 'Email профіль | Email профілі', - mailbox: 'Почтова скринька', - smtpPort: 'SMTP Порт', - imapPort: 'IMAP Порт', - smtpHost: 'SMTP Хост', - imapHost: 'IMAP Хост', - fetchInterval: 'Інтервал оновлення', - listen: 'Прослуховувати', - authType: 'Тип аутентифікації', - authenticatedAs: 'Аутентифіковано як', - }, - singleSignOn: { - allTypes: 'Всі типи', - // TODO: add locale - singleSignOn: 'Single Sign-on', - clientId: 'Client id', - clientSecret: 'Client secret', - discoveryUrl: 'Discovery url', - }, - importCsv: { - importCsv: 'Імпорт даних з CSV файлу | Імпорт даних з CSV файлів', - allImportsCsv: 'Всі імпорти даних з CSV файлів', - source: 'Призначення імпорту', - settings: 'Налаштування', - mappings: 'Мапінги полів', - mappingsHint: 'У цій секції необхідно вказати назви колонок CSV файлу у полях нижче у відповідності до їх заголовків', - columnHeader: 'Колонка {name}', - members: { - clearMembers: 'Видалити існуючих абонентів', - }, - }, + cognitiveProfiles: { + cognitiveProfiles: "Голосовий профіль | Голосові профілі", + properties: { + region: "Регіон", + locale: "Мова", + }, + }, + emailProfiles: { + emailProfiles: "Email профіль | Email профілі", + mailbox: "Почтова скринька", + smtpPort: "SMTP Порт", + imapPort: "IMAP Порт", + smtpHost: "SMTP Хост", + imapHost: "IMAP Хост", + fetchInterval: "Інтервал оновлення", + listen: "Прослуховувати", + authType: "Тип аутентифікації", + authenticatedAs: "Аутентифіковано як", + }, + singleSignOn: { + allTypes: "Всі типи", + // TODO: add locale + singleSignOn: "Single Sign-on", + clientId: "Client id", + clientSecret: "Client secret", + discoveryUrl: "Discovery url", + }, + importCsv: { + importCsv: "Імпорт даних з CSV файлу | Імпорт даних з CSV файлів", + allImportsCsv: "Всі імпорти даних з CSV файлів", + source: "Призначення імпорту", + settings: "Налаштування", + mappings: "Мапінги полів", + mappingsHint: + "У цій секції необхідно вказати назви колонок CSV файлу у полях нижче у відповідності до їх заголовків", + columnHeader: "Колонка {name}", + members: { + clearMembers: "Видалити існуючих абонентів", + }, + }, - tokens: { - tokens: 'Токен | Токени', - allTokens: 'Всі токени', - expires: 'Закінчується', - popupMessage: 'Завантажте файл з ключем зараз або скопіюйте його для подальшого використання. Якщо Ви не завантажите файл ключа зараз, то не зможете отримати свій токен-ключ знову. Для Вашої безпеки нікому не передвайте свій токен-ключ.', - tokenCreated: 'Ваш токен успішно створений', - }, + tokens: { + tokens: "Токен | Токени", + allTokens: "Всі токени", + expires: "Закінчується", + popupMessage: + "Завантажте файл з ключем зараз або скопіюйте його для подальшого використання. Якщо Ви не завантажите файл ключа зараз, то не зможете отримати свій токен-ключ знову. Для Вашої безпеки нікому не передвайте свій токен-ключ.", + tokenCreated: "Ваш токен успішно створений", + }, - triggers: { - triggers: 'Тригер| Тригери', - allTriggers: 'Всі тригери', - type: 'Тип', - schema: 'Схема', - newTrigger: 'Новий тригер', - newTriggerDescription: 'Оберіть шаблон або почніть з нуля', - onEvent: 'On event', - onEventDescription: 'An event-based JSON Schema scheduler', - cron: 'At time', - atTimeDescription: 'A time-based JSON Schema scheduler', - event: 'Event', - expression: 'Вираз', - timeout: 'Затримка', - logs: { - logs: 'Історія запуску', - startedAt: 'Початок', - result: 'Результат', - resultName: { - idle: 'Неактивний', - active: 'Активний', - done: 'Завершений', - error: 'Помилка', - }, - }, - }, - }, - system: { - system: 'Система', - changelogs: { - changelogs: 'Журнал змін | Журнали змін', - objects: 'Об\'єкт | Об\'єкти', - daysToStore: 'Днів зберігання', - storage: 'Вивантажити в', - logs: { - logs: 'Лог | Логи', - actions: 'Дія | Дії', - records: 'ID запису | ID записів', - actionType: { - [LoggerAction.Create]: 'Створення', - [LoggerAction.Delete]: 'Видалення', - [LoggerAction.Update]: 'Редагування', - }, - }, - period: { - period: 'Період', - options: { - daily: 'Щодня', - weekly: 'Щотижня', - fortnightly: 'Кожні два тижня', - monthly: 'Щомісяця', - }, - }, - }, - configuration: { - configuration: 'Конфігурація | Конфігурації', - parameter: 'Параметр', - }, - globalVariables: { - globalVariables: 'Глобальна змінна | Глобальні змінні', - encrypted: 'Зашифровано', - valueInfo: 'Введіть значення, якщо хочете перезаписати його', - newTitle: 'Нова глобальна змінна', - editTitle: 'Редагувати глобальну змінну', - }, - }, - pagination: { - rowsPerPage: 'Кількість записів', - }, - }, + triggers: { + triggers: "Тригер| Тригери", + allTriggers: "Всі тригери", + type: "Тип", + schema: "Схема", + newTrigger: "Новий тригер", + newTriggerDescription: "Оберіть шаблон або почніть з нуля", + onEvent: "On event", + onEventDescription: "An event-based JSON Schema scheduler", + cron: "At time", + atTimeDescription: "A time-based JSON Schema scheduler", + event: "Event", + expression: "Вираз", + timeout: "Затримка", + logs: { + logs: "Історія запуску", + startedAt: "Початок", + result: "Результат", + resultName: { + idle: "Неактивний", + active: "Активний", + done: "Завершений", + error: "Помилка", + }, + }, + }, + }, + system: { + system: "Система", + changelogs: { + changelogs: "Журнал змін | Журнали змін", + objects: "Об'єкт | Об'єкти", + daysToStore: "Днів зберігання", + storage: "Вивантажити в", + logs: { + logs: "Лог | Логи", + actions: "Дія | Дії", + records: "ID запису | ID записів", + actionType: { + [LoggerAction.Create]: "Створення", + [LoggerAction.Delete]: "Видалення", + [LoggerAction.Update]: "Редагування", + }, + }, + period: { + period: "Період", + options: { + daily: "Щодня", + weekly: "Щотижня", + fortnightly: "Кожні два тижня", + monthly: "Щомісяця", + }, + }, + }, + configuration: { + configuration: "Конфігурація | Конфігурації", + parameter: "Параметр", + }, + globalVariables: { + globalVariables: "Глобальна змінна | Глобальні змінні", + encrypted: "Зашифровано", + valueInfo: "Введіть значення, якщо хочете перезаписати його", + newTitle: "Нова глобальна змінна", + editTitle: "Редагувати глобальну змінну", + }, + }, + pagination: { + rowsPerPage: "Кількість записів", + }, + }, - filters: { - team: 'Команда', - queueType: 'Тип черги', - }, + filters: { + team: "Команда", + queueType: "Тип черги", + }, - utils: { - downloadFilesBtn: { - downloadFiles: 'Скачати файли', - filesLoaded: 'Файлів скачано', - zippingProgress: 'Прогрес архівації', - }, - }, + utils: { + downloadFilesBtn: { + downloadFiles: "Скачати файли", + filesLoaded: "Файлів скачано", + zippingProgress: "Прогрес архівації", + }, + }, - errorPages: { - goToHome: 'Повернутись додому', - page403: { - title: 'Немає доступу', - text: 'Вибачте, у Вас недостатньо прав доступу для перегляду цієї сторінки', - }, - page404: { - title: 'Здається, Ви загубились', - text: 'Вибачте, ми не можемо знайти те, що Ви шукаєте', - }, - }, + errorPages: { + goToHome: "Повернутись додому", + page403: { + title: "Немає доступу", + text: "Вибачте, у Вас недостатньо прав доступу для перегляду цієї сторінки", + }, + page404: { + title: "Здається, Ви загубились", + text: "Вибачте, ми не можемо знайти те, що Ви шукаєте", + }, + }, - icon: { - docs: 'Документація', - logout: 'Вийти', - account: 'Акаунт', - appNavigator: 'Додатки Webitel', - settings: 'Налаштування', - }, + icon: { + docs: "Документація", + logout: "Вийти", + account: "Акаунт", + appNavigator: "Додатки Webitel", + settings: "Налаштування", + }, - iconHints: { - upload: 'Завантажити', - reload: 'Оновити', - edit: 'Редагувати', - delete: 'Видалити', - deleteAll: 'Видалити всі об\'єкти', - deleteSelected: 'Видалити {count} обраних об\'єктів', - deleteFiltered: 'Видалити всі відфільтровані об\'єкти', - generate: 'Створити', - add: 'Додати', - history: 'Історія', - download: 'Скачати', - downloadAll: 'Скачати все', - draggable: 'Перетягнути', - play: 'Програти', - pause: 'Пауза', - resume: 'Продовжити', - close: 'Зкрити', - volume: 'Гучність', - stop: 'Зупинити', - members: 'Абоненти', - moveUp: 'Пересунути вгору', - moveDown: 'Пересунути вниз', - nextPage: 'Наступна сторінка', - prevPage: 'Попередня сторінка', - expand: 'Розгорнути', - collapse: 'Згорнути', - }, - errors: { - invalidJson: 'Некоректний JSON', - }, - reusable: { - time: { - t15m: '15 хв', - t30m: '30 хв', - t45m: '45 хв', - t1h: '1 год', - t3h: '4 год', - t6h: '6 год', - }, - }, + iconHints: { + upload: "Завантажити", + reload: "Оновити", + edit: "Редагувати", + delete: "Видалити", + deleteAll: "Видалити всі об'єкти", + deleteSelected: "Видалити {count} обраних об'єктів", + deleteFiltered: "Видалити всі відфільтровані об'єкти", + generate: "Створити", + add: "Додати", + history: "Історія", + download: "Скачати", + downloadAll: "Скачати все", + draggable: "Перетягнути", + play: "Програти", + pause: "Пауза", + resume: "Продовжити", + close: "Зкрити", + volume: "Гучність", + stop: "Зупинити", + members: "Абоненти", + moveUp: "Пересунути вгору", + moveDown: "Пересунути вниз", + nextPage: "Наступна сторінка", + prevPage: "Попередня сторінка", + expand: "Розгорнути", + collapse: "Згорнути", + }, + errors: { + invalidJson: "Некоректний JSON", + }, + reusable: { + time: { + t15m: "15 хв", + t30m: "30 хв", + t45m: "45 хв", + t1h: "1 год", + t3h: "4 год", + t6h: "6 год", + }, + }, }; diff --git a/src/app/mixins/baseMixins/accessControlMixin/__tests__/accessControlMixin.spec.js b/src/app/mixins/baseMixins/accessControlMixin/__tests__/accessControlMixin.spec.js index 5eb9f6161..1aa347343 100644 --- a/src/app/mixins/baseMixins/accessControlMixin/__tests__/accessControlMixin.spec.js +++ b/src/app/mixins/baseMixins/accessControlMixin/__tests__/accessControlMixin.spec.js @@ -1,15 +1,15 @@ -import { mount } from '@vue/test-utils'; -import AccessControlMixin from '../accessControlMixin'; +import { mount } from "@vue/test-utils"; +import AccessControlMixin from "../accessControlMixin"; const Component = { - render() {}, + render() {}, }; -describe('AccessControlMixin', () => { - it('renders a component', () => { - const wrapper = mount(Component, { - mixins: [AccessControlMixin], - }); - expect(wrapper.exists()).toBe(true); - }); +describe("AccessControlMixin", () => { + it("renders a component", () => { + const wrapper = mount(Component, { + mixins: [AccessControlMixin], + }); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/app/mixins/baseMixins/accessControlMixin/accessControlMixin.js b/src/app/mixins/baseMixins/accessControlMixin/accessControlMixin.js index cf8fd61a7..d3bf9274a 100644 --- a/src/app/mixins/baseMixins/accessControlMixin/accessControlMixin.js +++ b/src/app/mixins/baseMixins/accessControlMixin/accessControlMixin.js @@ -1,16 +1,24 @@ export default { - computed: { - hasReadAccess() { - return this.$store.getters['userinfo/HAS_READ_ACCESS']({ route: this.$route }); - }, - hasCreateAccess() { - return this.$store.getters['userinfo/HAS_CREATE_ACCESS']({ route: this.$route }); - }, - hasEditAccess() { - return this.$store.getters['userinfo/HAS_EDIT_ACCESS']({ route: this.$route }); - }, - hasDeleteAccess() { - return this.$store.getters['userinfo/HAS_DELETE_ACCESS']({ route: this.$route }); - }, - }, + computed: { + hasReadAccess() { + return this.$store.getters["userinfo/HAS_READ_ACCESS"]({ + route: this.$route, + }); + }, + hasCreateAccess() { + return this.$store.getters["userinfo/HAS_CREATE_ACCESS"]({ + route: this.$route, + }); + }, + hasEditAccess() { + return this.$store.getters["userinfo/HAS_EDIT_ACCESS"]({ + route: this.$route, + }); + }, + hasDeleteAccess() { + return this.$store.getters["userinfo/HAS_DELETE_ACCESS"]({ + route: this.$route, + }); + }, + }, }; diff --git a/src/app/mixins/baseMixins/baseObjectMixin/__tests__/baseObjectMixin.spec.js b/src/app/mixins/baseMixins/baseObjectMixin/__tests__/baseObjectMixin.spec.js index 4d21cf967..f30a0053a 100644 --- a/src/app/mixins/baseMixins/baseObjectMixin/__tests__/baseObjectMixin.spec.js +++ b/src/app/mixins/baseMixins/baseObjectMixin/__tests__/baseObjectMixin.spec.js @@ -1,34 +1,34 @@ -import { shallowMount } from '@vue/test-utils'; -import BaseObjectMixin from '../baseObjectMixin'; +import { shallowMount } from "@vue/test-utils"; +import BaseObjectMixin from "../baseObjectMixin"; const Component = { - render() {}, + render() {}, }; -describe('BaseObjectMixin', () => { - it('renders a component', () => { - const wrapper = shallowMount(Component, { - data: () => ({ - itemInstance: {}, - }), - mixins: [BaseObjectMixin], - methods: { - checkValidations() { - return true; - }, - }, - global: { - mocks: { - v$: { - itemInstance: { - $error: true, - $touch: vi.fn(), - }, - }, - }, - }, - }); - expect(wrapper.exists()).toBe(true); - expect(wrapper.vm.disabledSave).toBe(true); - }); +describe("BaseObjectMixin", () => { + it("renders a component", () => { + const wrapper = shallowMount(Component, { + data: () => ({ + itemInstance: {}, + }), + mixins: [BaseObjectMixin], + methods: { + checkValidations() { + return true; + }, + }, + global: { + mocks: { + v$: { + itemInstance: { + $error: true, + $touch: vi.fn(), + }, + }, + }, + }, + }); + expect(wrapper.exists()).toBe(true); + expect(wrapper.vm.disabledSave).toBe(true); + }); }); diff --git a/src/app/mixins/baseMixins/baseObjectMixin/baseObjectMixin.js b/src/app/mixins/baseMixins/baseObjectMixin/baseObjectMixin.js index 6fea2e6c3..47abe195c 100644 --- a/src/app/mixins/baseMixins/baseObjectMixin/baseObjectMixin.js +++ b/src/app/mixins/baseMixins/baseObjectMixin/baseObjectMixin.js @@ -1,7 +1,6 @@ -import { mapActions } from 'vuex'; -import openedObjectValidationMixin - from '../openedObjectValidationMixin/openedObjectValidationMixin'; -import resetOnDestroyMixin from '../resetOnDestroyMixin/resetOnDestroyMixin'; +import { mapActions } from "vuex"; +import openedObjectValidationMixin from "../openedObjectValidationMixin/openedObjectValidationMixin"; +import resetOnDestroyMixin from "../resetOnDestroyMixin/resetOnDestroyMixin"; /** * @fileOverview abstract mixin, @@ -12,61 +11,63 @@ import resetOnDestroyMixin from '../resetOnDestroyMixin/resetOnDestroyMixin'; * @extends openedObjectValidationMixin, openedObjectAccessControlMixin */ export default { - mixins: [resetOnDestroyMixin, openedObjectValidationMixin], + mixins: [resetOnDestroyMixin, openedObjectValidationMixin], - computed: { - saveText() { - // if it's a new item - // OR any fields have changed - return !this.id || this.itemInstance._dirty - ? this.$t('objects.save') : this.$t('objects.saved'); - }, + computed: { + saveText() { + // if it's a new item + // OR any fields have changed + return !this.id || this.itemInstance._dirty + ? this.$t("objects.save") + : this.$t("objects.saved"); + }, - disabledSave() { - // if there's a validation problem - // OR it's edit and any fields haven't changed - return this.checkValidations() || - (!this.itemInstance._dirty && !!this.id); - }, - }, + disabledSave() { + // if there's a validation problem + // OR it's edit and any fields haven't changed + return ( + this.checkValidations() || (!this.itemInstance._dirty && !!this.id) + ); + }, + }, - methods: { - ...mapActions({ - loadItem(dispatch, payload) { - return dispatch(`${this.namespace}/LOAD_ITEM`, payload); - }, - addItem(dispatch, payload) { - return dispatch(`${this.namespace}/ADD_ITEM`, payload); - }, - updateItem(dispatch, payload) { - return dispatch(`${this.namespace}/UPDATE_ITEM`, payload); - }, - }), + methods: { + ...mapActions({ + loadItem(dispatch, payload) { + return dispatch(`${this.namespace}/LOAD_ITEM`, payload); + }, + addItem(dispatch, payload) { + return dispatch(`${this.namespace}/ADD_ITEM`, payload); + }, + updateItem(dispatch, payload) { + return dispatch(`${this.namespace}/UPDATE_ITEM`, payload); + }, + }), - async save() { - if (!this.disabledSave) { - if (this.id) { - await this.updateItem(); - } else { - try { - await this.addItem(); - if (this.id) { - await this.redirectToEdit(); - } - } catch (err) { - throw err; - } - } - } - }, + async save() { + if (!this.disabledSave) { + if (this.id) { + await this.updateItem(); + } else { + try { + await this.addItem(); + if (this.id) { + await this.redirectToEdit(); + } + } catch (err) { + throw err; + } + } + } + }, - async redirectToEdit() { - const routeName = this.$route.name.replace('-new', '-edit'); - return this.$router.replace({ - name: routeName, - params: { id: this.id }, - hash: this.$route.hash, - }); - }, - }, + async redirectToEdit() { + const routeName = this.$route.name.replace("-new", "-edit"); + return this.$router.replace({ + name: routeName, + params: { id: this.id }, + hash: this.$route.hash, + }); + }, + }, }; diff --git a/src/app/mixins/baseMixins/baseTableMixin/baseTableMixin.js b/src/app/mixins/baseMixins/baseTableMixin/baseTableMixin.js index 2bf9b80f4..9a73f01d1 100644 --- a/src/app/mixins/baseMixins/baseTableMixin/baseTableMixin.js +++ b/src/app/mixins/baseMixins/baseTableMixin/baseTableMixin.js @@ -1,6 +1,6 @@ -import deleteMixin from './deleteMixin/tableDeleteMixin'; -import itemLinkMixin from './itemLinkMixin'; -import tableActionsHandlerMixin from './tableActionsMixin'; +import deleteMixin from "./deleteMixin/tableDeleteMixin"; +import itemLinkMixin from "./itemLinkMixin"; +import tableActionsHandlerMixin from "./tableActionsMixin"; /** * @fileOverview abstract mixin, @@ -10,43 +10,39 @@ import tableActionsHandlerMixin from './tableActionsMixin'; * @extends itemLinkMixin, tableActionsHandlerMixin */ export default { - mixins: [ - deleteMixin, - itemLinkMixin, - tableActionsHandlerMixin, - ], + mixins: [deleteMixin, itemLinkMixin, tableActionsHandlerMixin], - data: () => ({ - isLoaded: false, - }), + data: () => ({ + isLoaded: false, + }), - created() { - this.initTableView(); - }, + created() { + this.initTableView(); + }, - computed: { - selectedRows() { - return this.dataList.filter((item) => item._isSelected); - }, - // shows delete table action if some items are selected - anySelected() { - return !this.selectedRows?.length; - }, - }, + computed: { + selectedRows() { + return this.dataList.filter((item) => item._isSelected); + }, + // shows delete table action if some items are selected + anySelected() { + return !this.selectedRows?.length; + }, + }, - methods: { - initTableView() { - if (this.setParentId) this.setParentId(this.parentId); - this.loadList(); - }, - async loadList() { - this.isLoaded = false; - try { - await this.loadDataList(this.$route.query); - } catch (e) { - } finally { - this.isLoaded = true; - } - }, - }, + methods: { + initTableView() { + if (this.setParentId) this.setParentId(this.parentId); + this.loadList(); + }, + async loadList() { + this.isLoaded = false; + try { + await this.loadDataList(this.$route.query); + } catch (e) { + } finally { + this.isLoaded = true; + } + }, + }, }; diff --git a/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/tableDeleteMixin.js b/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/tableDeleteMixin.js index d74b7935d..6b6ddaadd 100644 --- a/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/tableDeleteMixin.js +++ b/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/tableDeleteMixin.js @@ -1,10 +1,10 @@ export default { - methods: { - deleteData(deleted) { - return this.dispatchDelete(deleted); - }, - dispatchDelete() { - throw new TypeError('implement dispatchDelete method first'); - }, - }, + methods: { + deleteData(deleted) { + return this.dispatchDelete(deleted); + }, + dispatchDelete() { + throw new TypeError("implement dispatchDelete method first"); + }, + }, }; diff --git a/src/app/mixins/baseMixins/baseTableMixin/itemLinkMixin.js b/src/app/mixins/baseMixins/baseTableMixin/itemLinkMixin.js index deb5801d0..9d1ad588a 100644 --- a/src/app/mixins/baseMixins/baseTableMixin/itemLinkMixin.js +++ b/src/app/mixins/baseMixins/baseTableMixin/itemLinkMixin.js @@ -1,13 +1,13 @@ -import RouteNames from '../../../router/_internals/RouteNames.enum'; +import RouteNames from "../../../router/_internals/RouteNames.enum"; export default { - data: () => ({ - RouteNames, - }), - methods: { - editLink({ id }) { - const routeName = this.routeName || this.tableObjectRouteName; - return { name: `${routeName}-edit`, params: { id } }; - }, - }, + data: () => ({ + RouteNames, + }), + methods: { + editLink({ id }) { + const routeName = this.routeName || this.tableObjectRouteName; + return { name: `${routeName}-edit`, params: { id } }; + }, + }, }; diff --git a/src/app/mixins/baseMixins/baseTableMixin/tableActionsMixin.js b/src/app/mixins/baseMixins/baseTableMixin/tableActionsMixin.js index c8190ebd2..d31be6e90 100644 --- a/src/app/mixins/baseMixins/baseTableMixin/tableActionsMixin.js +++ b/src/app/mixins/baseMixins/baseTableMixin/tableActionsMixin.js @@ -2,36 +2,36 @@ * @fileOverview wt-table-actions extension mixin with default behavior, extended by baseTableMixin */ export default { - methods: { - tableActionsHandler(eventName) { - switch (eventName) { - case 'refresh': - this.refreshList(); - break; - case 'columnSelect': - this.openColumnSelect(); - break; - case 'filterReset': - this.resetFilters(); - break; - case 'settings': - this.expandFilters(); - break; - default: - } - }, + methods: { + tableActionsHandler(eventName) { + switch (eventName) { + case "refresh": + this.refreshList(); + break; + case "columnSelect": + this.openColumnSelect(); + break; + case "filterReset": + this.resetFilters(); + break; + case "settings": + this.expandFilters(); + break; + default: + } + }, - expandFilters() { - this.isOpened = !this.isOpened; - }, - refreshList() { - this.loadList(); - }, - openColumnSelect() { - this.isFilterFieldsOpened = true; - }, - resetFilters() { - this.$router.replace({ query: null }); - }, - }, + expandFilters() { + this.isOpened = !this.isOpened; + }, + refreshList() { + this.loadList(); + }, + openColumnSelect() { + this.isFilterFieldsOpened = true; + }, + resetFilters() { + this.$router.replace({ query: null }); + }, + }, }; diff --git a/src/app/mixins/baseMixins/headlineNavMixin/headlineNavMixin.js b/src/app/mixins/baseMixins/headlineNavMixin/headlineNavMixin.js index a5749972a..f15523298 100644 --- a/src/app/mixins/baseMixins/headlineNavMixin/headlineNavMixin.js +++ b/src/app/mixins/baseMixins/headlineNavMixin/headlineNavMixin.js @@ -1,25 +1,25 @@ export default { - data: () => ({ - pathName: '', - }), - watch: { - 'itemInstance._dirty': { - handler(value) { - if (!value) this.setPathName(); - }, - }, - }, - methods: { - setPathName() { - this.pathName = this.itemInstance.name; - }, - }, - mounted() { - // itemInstance._dirty isn't init as "false", - // so that we should set up first name representation in other way - const unwatch = this.$watch('itemInstance.name', () => { - this.setPathName(); - unwatch(); - }); - }, + data: () => ({ + pathName: "", + }), + watch: { + "itemInstance._dirty": { + handler(value) { + if (!value) this.setPathName(); + }, + }, + }, + methods: { + setPathName() { + this.pathName = this.itemInstance.name; + }, + }, + mounted() { + // itemInstance._dirty isn't init as "false", + // so that we should set up first name representation in other way + const unwatch = this.$watch("itemInstance.name", () => { + this.setPathName(); + unwatch(); + }); + }, }; diff --git a/src/app/mixins/baseMixins/openedObjectValidationMixin/openedObjectValidationMixin.js b/src/app/mixins/baseMixins/openedObjectValidationMixin/openedObjectValidationMixin.js index be81b6fe9..c8306262e 100644 --- a/src/app/mixins/baseMixins/openedObjectValidationMixin/openedObjectValidationMixin.js +++ b/src/app/mixins/baseMixins/openedObjectValidationMixin/openedObjectValidationMixin.js @@ -2,19 +2,18 @@ * @fileOverview implements work with validation */ export default { - props: { - v: { - type: Object, - }, - }, + props: { + v: { + type: Object, + }, + }, - methods: { - checkValidations(validatedInstance = 'itemInstance') { - const v = this.v$ ? this.v$ : this.v; - v[validatedInstance].$touch(); - // if its still pending or an error is returned do not submit - return v[validatedInstance].$pending - || v[validatedInstance].$error; - }, - }, + methods: { + checkValidations(validatedInstance = "itemInstance") { + const v = this.v$ ? this.v$ : this.v; + v[validatedInstance].$touch(); + // if its still pending or an error is returned do not submit + return v[validatedInstance].$pending || v[validatedInstance].$error; + }, + }, }; diff --git a/src/app/mixins/baseMixins/resetOnDestroyMixin/resetOnDestroyMixin.js b/src/app/mixins/baseMixins/resetOnDestroyMixin/resetOnDestroyMixin.js index a729d190b..9bba95634 100644 --- a/src/app/mixins/baseMixins/resetOnDestroyMixin/resetOnDestroyMixin.js +++ b/src/app/mixins/baseMixins/resetOnDestroyMixin/resetOnDestroyMixin.js @@ -1,15 +1,15 @@ -import { mapActions } from 'vuex'; +import { mapActions } from "vuex"; export default { - destroyed() { - this.resetState(); - }, + destroyed() { + this.resetState(); + }, - methods: { - ...mapActions({ - resetState(dispatch, payload) { - return dispatch(`${this.namespace}/RESET_ITEM_STATE`, payload); - }, - }), - }, + methods: { + ...mapActions({ + resetState(dispatch, payload) { + return dispatch(`${this.namespace}/RESET_ITEM_STATE`, payload); + }, + }), + }, }; diff --git a/src/app/mixins/navMixin.js b/src/app/mixins/navMixin.js index 0ad784b7a..1029a81a2 100644 --- a/src/app/mixins/navMixin.js +++ b/src/app/mixins/navMixin.js @@ -1,21 +1,21 @@ -import { mapGetters } from 'vuex'; +import { mapGetters } from "vuex"; export default { - computed: { - ...mapGetters('userinfo', { - accessibleNav: 'ACCESSIBLE_NAV', - }), - nav() { - const navWithLocale = (nav) => ({ ...nav, name: this.$t(nav.locale) }); - return this.accessibleNav.map((nav) => { - if (nav.subNav) { - return { - ...navWithLocale(nav), - subNav: nav.subNav.map((nav) => navWithLocale(nav)), - }; - } - return navWithLocale(nav); - }); - }, - }, + computed: { + ...mapGetters("userinfo", { + accessibleNav: "ACCESSIBLE_NAV", + }), + nav() { + const navWithLocale = (nav) => ({ ...nav, name: this.$t(nav.locale) }); + return this.accessibleNav.map((nav) => { + if (nav.subNav) { + return { + ...navWithLocale(nav), + subNav: nav.subNav.map((nav) => navWithLocale(nav)), + }; + } + return navWithLocale(nav); + }); + }, + }, }; diff --git a/src/app/mixins/objectPagesMixins/historyPopupMixin/historyPopupMixin.js b/src/app/mixins/objectPagesMixins/historyPopupMixin/historyPopupMixin.js index db73c0883..e7ad16cdc 100644 --- a/src/app/mixins/objectPagesMixins/historyPopupMixin/historyPopupMixin.js +++ b/src/app/mixins/objectPagesMixins/historyPopupMixin/historyPopupMixin.js @@ -1,41 +1,40 @@ -import getNamespacedState - from '@webitel/ui-sdk/src/store/helpers/getNamespacedState'; -import { mapActions, mapState } from 'vuex'; -import tableComponentMixin from '../objectTableMixin/tableComponentMixin'; +import getNamespacedState from "@webitel/ui-sdk/src/store/helpers/getNamespacedState"; +import { mapActions, mapState } from "vuex"; +import tableComponentMixin from "../objectTableMixin/tableComponentMixin"; export default { - mixins: [tableComponentMixin], - destroyed() { - this.resetState(); - }, - computed: { - ...mapState({ - from(state) { - return getNamespacedState(state, this.namespace).from; - }, - to(state) { - return getNamespacedState(state, this.namespace).to; - }, - }), - }, - methods: { - ...mapActions({ - setFrom(dispatch, payload) { - return dispatch(`${this.namespace}/SET_FROM`, payload); - }, - setTo(dispatch, payload) { - return dispatch(`${this.namespace}/SET_TO`, payload); - }, - resetState(dispatch, payload) { - return dispatch(`${this.namespace}/RESET_ITEM_STATE`, payload); - }, - }), - prettifyTime(time) { - if (!time) return 'none'; - return new Date(+time).toLocaleString(); - }, - close() { - this.$emit('close'); - }, - }, + mixins: [tableComponentMixin], + destroyed() { + this.resetState(); + }, + computed: { + ...mapState({ + from(state) { + return getNamespacedState(state, this.namespace).from; + }, + to(state) { + return getNamespacedState(state, this.namespace).to; + }, + }), + }, + methods: { + ...mapActions({ + setFrom(dispatch, payload) { + return dispatch(`${this.namespace}/SET_FROM`, payload); + }, + setTo(dispatch, payload) { + return dispatch(`${this.namespace}/SET_TO`, payload); + }, + resetState(dispatch, payload) { + return dispatch(`${this.namespace}/RESET_ITEM_STATE`, payload); + }, + }), + prettifyTime(time) { + if (!time) return "none"; + return new Date(+time).toLocaleString(); + }, + close() { + this.$emit("close"); + }, + }, }; diff --git a/src/app/mixins/objectPagesMixins/objectTableMixin/_internals/objectTableAccessControlMixin.js b/src/app/mixins/objectPagesMixins/objectTableMixin/_internals/objectTableAccessControlMixin.js index a61994db4..073e050e0 100644 --- a/src/app/mixins/objectPagesMixins/objectTableMixin/_internals/objectTableAccessControlMixin.js +++ b/src/app/mixins/objectPagesMixins/objectTableMixin/_internals/objectTableAccessControlMixin.js @@ -1,11 +1,10 @@ -import accessControlMixin - from '../../../baseMixins/accessControlMixin/accessControlMixin'; +import accessControlMixin from "../../../baseMixins/accessControlMixin/accessControlMixin"; export default { - mixins: [accessControlMixin], - computed: { - hasTableActions() { - return this.hasEditAccess || this.hasDeleteAccess; - }, - }, + mixins: [accessControlMixin], + computed: { + hasTableActions() { + return this.hasEditAccess || this.hasDeleteAccess; + }, + }, }; diff --git a/src/app/mixins/objectPagesMixins/objectTableMixin/tableComponentMixin.js b/src/app/mixins/objectPagesMixins/objectTableMixin/tableComponentMixin.js index bdd7b100d..93fa764c0 100644 --- a/src/app/mixins/objectPagesMixins/objectTableMixin/tableComponentMixin.js +++ b/src/app/mixins/objectPagesMixins/objectTableMixin/tableComponentMixin.js @@ -1,9 +1,7 @@ -import getNamespacedState - from '@webitel/ui-sdk/src/store/helpers/getNamespacedState'; -import { mapActions, mapGetters, mapState } from 'vuex'; -import baseTableMixin from '../../baseMixins/baseTableMixin/baseTableMixin'; -import objectTableAccessControlMixin - from './_internals/objectTableAccessControlMixin'; +import getNamespacedState from "@webitel/ui-sdk/src/store/helpers/getNamespacedState"; +import { mapActions, mapGetters, mapState } from "vuex"; +import baseTableMixin from "../../baseMixins/baseTableMixin/baseTableMixin"; +import objectTableAccessControlMixin from "./_internals/objectTableAccessControlMixin"; /** * @fileOverview contains main tables (like the-agents.vue) common logic @@ -15,83 +13,84 @@ import objectTableAccessControlMixin * @extends baseTableMixin, objectTableAccessControlMixin */ export default { - mixins: [baseTableMixin, objectTableAccessControlMixin], - computed: { - ...mapState({ - headersValue(state) { - return getNamespacedState(state, this.namespace).headers; - }, - dataList(state) { - return getNamespacedState(state, this.namespace).dataList; - }, - page(state) { - return getNamespacedState(state, this.namespace).page; - }, - size(state) { - return getNamespacedState(state, this.namespace).size; - }, - search(state) { - return getNamespacedState(state, this.namespace).search; - }, - isNext(state) { - return getNamespacedState(state, this.namespace).isNextPage; - }, - }), - ...mapGetters('appearance', { - darkMode: 'DARK_MODE', - }), - headers() { - if (!this.headersValue) return []; - return this.headersValue.map((header) => { - let localizedText; - // set "false" if no locale prop - if (header.locale) { - localizedText = !header.locale || typeof header.locale === 'string' - ? this.$t(header.locale) - : this.$tc(...header.locale); - } - return { - ...header, - text: localizedText || header.text, - }; - }); - }, - }, - methods: { - ...mapActions({ - loadDataList(dispatch, payload) { - return dispatch(`${this.namespace}/LOAD_DATA_LIST`, payload); - }, - setSize(dispatch, payload) { - return dispatch(`${this.namespace}/SET_SIZE`, payload); - }, - setSearch(dispatch, payload) { - return dispatch(`${this.namespace}/SET_SEARCH`, payload); - }, - nextPage(dispatch, payload) { - return dispatch(`${this.namespace}/NEXT_PAGE`, payload); - }, - prevPage(dispatch, payload) { - return dispatch(`${this.namespace}/PREV_PAGE`, payload); - }, - dispatchSort(dispatch, payload) { - return dispatch(`${this.namespace}/SORT`, payload); - }, - dispatchDelete(dispatch, payload) { - return dispatch(`${this.namespace}/DELETE`, payload); - }, - patchItem(dispatch, payload) { - return dispatch(`${this.namespace}/PATCH_ITEM_PROPERTY`, payload); - }, - }), - create() { - this.$router.push({ name: `${this.routeName}-new` }); - }, - edit(item) { - this.$router.push(this.editLink(item)); - }, - sort(...params) { - this.dispatchSort({ header: params[0], nextSortOrder: params[1] }); - }, - }, + mixins: [baseTableMixin, objectTableAccessControlMixin], + computed: { + ...mapState({ + headersValue(state) { + return getNamespacedState(state, this.namespace).headers; + }, + dataList(state) { + return getNamespacedState(state, this.namespace).dataList; + }, + page(state) { + return getNamespacedState(state, this.namespace).page; + }, + size(state) { + return getNamespacedState(state, this.namespace).size; + }, + search(state) { + return getNamespacedState(state, this.namespace).search; + }, + isNext(state) { + return getNamespacedState(state, this.namespace).isNextPage; + }, + }), + ...mapGetters("appearance", { + darkMode: "DARK_MODE", + }), + headers() { + if (!this.headersValue) return []; + return this.headersValue.map((header) => { + let localizedText; + // set "false" if no locale prop + if (header.locale) { + localizedText = + !header.locale || typeof header.locale === "string" + ? this.$t(header.locale) + : this.$tc(...header.locale); + } + return { + ...header, + text: localizedText || header.text, + }; + }); + }, + }, + methods: { + ...mapActions({ + loadDataList(dispatch, payload) { + return dispatch(`${this.namespace}/LOAD_DATA_LIST`, payload); + }, + setSize(dispatch, payload) { + return dispatch(`${this.namespace}/SET_SIZE`, payload); + }, + setSearch(dispatch, payload) { + return dispatch(`${this.namespace}/SET_SEARCH`, payload); + }, + nextPage(dispatch, payload) { + return dispatch(`${this.namespace}/NEXT_PAGE`, payload); + }, + prevPage(dispatch, payload) { + return dispatch(`${this.namespace}/PREV_PAGE`, payload); + }, + dispatchSort(dispatch, payload) { + return dispatch(`${this.namespace}/SORT`, payload); + }, + dispatchDelete(dispatch, payload) { + return dispatch(`${this.namespace}/DELETE`, payload); + }, + patchItem(dispatch, payload) { + return dispatch(`${this.namespace}/PATCH_ITEM_PROPERTY`, payload); + }, + }), + create() { + this.$router.push({ name: `${this.routeName}-new` }); + }, + edit(item) { + this.$router.push(this.editLink(item)); + }, + sort(...params) { + this.dispatchSort({ header: params[0], nextSortOrder: params[1] }); + }, + }, }; diff --git a/src/app/mixins/objectPagesMixins/openedObjectMixin/_internals/openedObjectAccessControlMixin.js b/src/app/mixins/objectPagesMixins/openedObjectMixin/_internals/openedObjectAccessControlMixin.js index c0ece204e..cf8f7d171 100644 --- a/src/app/mixins/objectPagesMixins/openedObjectMixin/_internals/openedObjectAccessControlMixin.js +++ b/src/app/mixins/objectPagesMixins/openedObjectMixin/_internals/openedObjectAccessControlMixin.js @@ -1,12 +1,11 @@ -import accessControlMixin - from '../../../baseMixins/accessControlMixin/accessControlMixin'; +import accessControlMixin from "../../../baseMixins/accessControlMixin/accessControlMixin"; export default { - mixins: [accessControlMixin], - computed: { - hasSaveActionAccess() { - if (this.$route.name.includes('-edit')) return this.hasEditAccess; - return this.hasCreateAccess; - }, - }, + mixins: [accessControlMixin], + computed: { + hasSaveActionAccess() { + if (this.$route.name.includes("-edit")) return this.hasEditAccess; + return this.hasCreateAccess; + }, + }, }; diff --git a/src/app/mixins/objectPagesMixins/openedObjectMixin/nestedObjectMixin.js b/src/app/mixins/objectPagesMixins/openedObjectMixin/nestedObjectMixin.js index 1d54c45ea..66214ff3b 100644 --- a/src/app/mixins/objectPagesMixins/openedObjectMixin/nestedObjectMixin.js +++ b/src/app/mixins/objectPagesMixins/openedObjectMixin/nestedObjectMixin.js @@ -1,7 +1,6 @@ -import getNamespacedState - from '@webitel/ui-sdk/src/store/helpers/getNamespacedState'; -import { mapActions, mapState } from 'vuex'; -import baseObjectMixin from '../../baseMixins/baseObjectMixin/baseObjectMixin'; +import getNamespacedState from "@webitel/ui-sdk/src/store/helpers/getNamespacedState"; +import { mapActions, mapState } from "vuex"; +import baseObjectMixin from "../../baseMixins/baseObjectMixin/baseObjectMixin"; /** * @fileOverview contains nestedObject common logic @@ -11,46 +10,45 @@ import baseObjectMixin from '../../baseMixins/baseObjectMixin/baseObjectMixin'; * @extends baseObjectMixin */ export default { - mixins: [baseObjectMixin], - created() { - this.loadItem(); - }, + mixins: [baseObjectMixin], + created() { + this.loadItem(); + }, - computed: { - ...mapState({ - id(state) { - return getNamespacedState(state, this.namespace).itemId; - }, - itemInstance(state) { - return getNamespacedState(state, this.namespace).itemInstance; - }, - }), - }, + computed: { + ...mapState({ + id(state) { + return getNamespacedState(state, this.namespace).itemId; + }, + itemInstance(state) { + return getNamespacedState(state, this.namespace).itemInstance; + }, + }), + }, - methods: { - ...mapActions({ - setItemProp(dispatch, payload) { - return dispatch(`${this.namespace}/SET_ITEM_PROPERTY`, payload); - }, - }), + methods: { + ...mapActions({ + setItemProp(dispatch, payload) { + return dispatch(`${this.namespace}/SET_ITEM_PROPERTY`, payload); + }, + }), - async save() { - const invalid = this.checkValidations(); - if (!invalid) { - try { - if (this.id) { - await this.updateItem(); - } else { - await this.addItem(); - } - this.close(); - } catch { - } - } - }, + async save() { + const invalid = this.checkValidations(); + if (!invalid) { + try { + if (this.id) { + await this.updateItem(); + } else { + await this.addItem(); + } + this.close(); + } catch {} + } + }, - close() { - this.$emit('close'); - }, - }, + close() { + this.$emit("close"); + }, + }, }; diff --git a/src/app/mixins/objectPagesMixins/openedObjectMixin/openedObjectMixin.js b/src/app/mixins/objectPagesMixins/openedObjectMixin/openedObjectMixin.js index 3ac1b23e4..c0e240764 100644 --- a/src/app/mixins/objectPagesMixins/openedObjectMixin/openedObjectMixin.js +++ b/src/app/mixins/objectPagesMixins/openedObjectMixin/openedObjectMixin.js @@ -1,13 +1,9 @@ -import getNamespacedState - from '@webitel/ui-sdk/src/store/helpers/getNamespacedState'; -import { mapActions, mapState } from 'vuex'; -import Permissions - from '../../../../modules/_shared/permissions-tab/components/permissions-tab.vue'; -import baseObjectMixin from '../../baseMixins/baseObjectMixin/baseObjectMixin'; -import headlineNavMixin - from '../../baseMixins/headlineNavMixin/headlineNavMixin'; -import openedObjectAccessControlMixin - from './_internals/openedObjectAccessControlMixin'; +import getNamespacedState from "@webitel/ui-sdk/src/store/helpers/getNamespacedState"; +import { mapActions, mapState } from "vuex"; +import Permissions from "../../../../modules/_shared/permissions-tab/components/permissions-tab.vue"; +import baseObjectMixin from "../../baseMixins/baseObjectMixin/baseObjectMixin"; +import headlineNavMixin from "../../baseMixins/headlineNavMixin/headlineNavMixin"; +import openedObjectAccessControlMixin from "./_internals/openedObjectAccessControlMixin"; /** * @fileOverview contains openedObject (wrapper with tabs, like opened-agent.vue) common logic @@ -16,61 +12,57 @@ import openedObjectAccessControlMixin * @extends baseObjectMixin */ export default { - mixins: [ - openedObjectAccessControlMixin, - headlineNavMixin, - baseObjectMixin, - ], - components: { - Permissions, - }, - data: () => ({ - currentTab: { - value: 'general', - }, - }), + mixins: [openedObjectAccessControlMixin, headlineNavMixin, baseObjectMixin], + components: { + Permissions, + }, + data: () => ({ + currentTab: { + value: "general", + }, + }), - created() { - this.setInitialTab(); - this.loadPageData(); - }, + created() { + this.setInitialTab(); + this.loadPageData(); + }, - computed: { - ...mapState({ - id(state) { - return getNamespacedState(state, this.namespace).itemId; - }, - itemInstance(state) { - return getNamespacedState(state, this.namespace).itemInstance; - }, - }), - permissionsTab() { - return { - text: this.$tc('objects.permissions.permissions', 2), - value: 'permissions', - }; - }, - }, + computed: { + ...mapState({ + id(state) { + return getNamespacedState(state, this.namespace).itemId; + }, + itemInstance(state) { + return getNamespacedState(state, this.namespace).itemInstance; + }, + }), + permissionsTab() { + return { + text: this.$tc("objects.permissions.permissions", 2), + value: "permissions", + }; + }, + }, - methods: { - ...mapActions({ - setId(dispatch, payload) { - return dispatch(`${this.namespace}/SET_ITEM_ID`, payload); - }, - }), + methods: { + ...mapActions({ + setId(dispatch, payload) { + return dispatch(`${this.namespace}/SET_ITEM_ID`, payload); + }, + }), - async loadPageData() { - await this.setId(this.$route.params.id); - return this.loadItem(); - }, + async loadPageData() { + await this.setId(this.$route.params.id); + return this.loadItem(); + }, - setInitialTab() { - // eslint-disable-next-line prefer-destructuring - if (this.tabs) this.currentTab = this.tabs[0]; - }, + setInitialTab() { + // eslint-disable-next-line prefer-destructuring + if (this.tabs) this.currentTab = this.tabs[0]; + }, - close() { - this.$router.go(-1); - }, - }, + close() { + this.$router.go(-1); + }, + }, }; diff --git a/src/app/mixins/objectPagesMixins/openedObjectTabMixin/_internals/openedObjectTabAccessControlMixin.js b/src/app/mixins/objectPagesMixins/openedObjectTabMixin/_internals/openedObjectTabAccessControlMixin.js index 46ca8aae2..f92b7ab39 100644 --- a/src/app/mixins/objectPagesMixins/openedObjectTabMixin/_internals/openedObjectTabAccessControlMixin.js +++ b/src/app/mixins/objectPagesMixins/openedObjectTabMixin/_internals/openedObjectTabAccessControlMixin.js @@ -1,12 +1,11 @@ -import accessControlMixin - from '../../../baseMixins/accessControlMixin/accessControlMixin'; +import accessControlMixin from "../../../baseMixins/accessControlMixin/accessControlMixin"; export default { - mixins: [accessControlMixin], - computed: { - disableUserInput() { - if (this.$route.name.includes('-edit')) return !this.hasEditAccess; - return !this.hasCreateAccess; - }, - }, + mixins: [accessControlMixin], + computed: { + disableUserInput() { + if (this.$route.name.includes("-edit")) return !this.hasEditAccess; + return !this.hasCreateAccess; + }, + }, }; diff --git a/src/app/mixins/objectPagesMixins/openedObjectTabMixin/openedTabComponentMixin.js b/src/app/mixins/objectPagesMixins/openedObjectTabMixin/openedTabComponentMixin.js index 20647dc52..bfb4576d8 100644 --- a/src/app/mixins/objectPagesMixins/openedObjectTabMixin/openedTabComponentMixin.js +++ b/src/app/mixins/objectPagesMixins/openedObjectTabMixin/openedTabComponentMixin.js @@ -1,11 +1,8 @@ -import getNamespacedState - from '@webitel/ui-sdk/src/store/helpers/getNamespacedState'; -import { mapActions, mapState } from 'vuex'; +import getNamespacedState from "@webitel/ui-sdk/src/store/helpers/getNamespacedState"; +import { mapActions, mapState } from "vuex"; -import openedObjectValidationMixin - from '../../baseMixins/openedObjectValidationMixin/openedObjectValidationMixin'; -import openedObjectTabAccessControlMixin - from './_internals/openedObjectTabAccessControlMixin'; +import openedObjectValidationMixin from "../../baseMixins/openedObjectValidationMixin/openedObjectValidationMixin"; +import openedObjectTabAccessControlMixin from "./_internals/openedObjectTabAccessControlMixin"; /** * @fileOverview contains openedObject tab @@ -14,34 +11,34 @@ import openedObjectTabAccessControlMixin * @extends openedObjectValidationMixin, openedObjectTabAccessControlMixin */ export default { - mixins: [openedObjectValidationMixin, openedObjectTabAccessControlMixin], - props: { - namespace: { - type: String, - // required: true, FIXME: MAKE ME REQUIRED AFTER REFACTOR - }, - }, - computed: { - ...mapState({ - itemInstance(state) { - return getNamespacedState(state, this.namespace).itemInstance; - }, - }), - }, - methods: { - ...mapActions({ - setItemProp(dispatch, payload) { - return dispatch(`${this.namespace}/SET_ITEM_PROPERTY`, payload); - }, - addVariable(dispatch, payload) { - return dispatch(`${this.namespace}/ADD_VARIABLE_PAIR`, payload); - }, - deleteVariable(dispatch, payload) { - return dispatch(`${this.namespace}/DELETE_VARIABLE_PAIR`, payload); - }, - setVariableProp(dispatch, payload) { - return dispatch(`${this.namespace}/SET_VARIABLE_PROP`, payload); - }, - }), - }, + mixins: [openedObjectValidationMixin, openedObjectTabAccessControlMixin], + props: { + namespace: { + type: String, + // required: true, FIXME: MAKE ME REQUIRED AFTER REFACTOR + }, + }, + computed: { + ...mapState({ + itemInstance(state) { + return getNamespacedState(state, this.namespace).itemInstance; + }, + }), + }, + methods: { + ...mapActions({ + setItemProp(dispatch, payload) { + return dispatch(`${this.namespace}/SET_ITEM_PROPERTY`, payload); + }, + addVariable(dispatch, payload) { + return dispatch(`${this.namespace}/ADD_VARIABLE_PAIR`, payload); + }, + deleteVariable(dispatch, payload) { + return dispatch(`${this.namespace}/DELETE_VARIABLE_PAIR`, payload); + }, + setVariableProp(dispatch, payload) { + return dispatch(`${this.namespace}/SET_VARIABLE_PROP`, payload); + }, + }), + }, }; diff --git a/src/app/mixins/objectPagesMixins/openedObjectTableTabMixin/openedObjectTableTabMixin.js b/src/app/mixins/objectPagesMixins/openedObjectTableTabMixin/openedObjectTableTabMixin.js index fb6579e42..a230490de 100644 --- a/src/app/mixins/objectPagesMixins/openedObjectTableTabMixin/openedObjectTableTabMixin.js +++ b/src/app/mixins/objectPagesMixins/openedObjectTableTabMixin/openedObjectTableTabMixin.js @@ -1,13 +1,9 @@ -import getNamespacedState - from '@webitel/ui-sdk/src/store/helpers/getNamespacedState'; -import { mapActions, mapGetters, mapState } from 'vuex'; -import ObjectListPopup - from '../../../components/utils/object-list-popup/object-list-popup.vue'; -import OnePlusMany - from '../../../components/utils/table-cell/one-plus-many-table-cell/one-plus-many-table-cell.vue'; -import baseTableMixin from '../../baseMixins/baseTableMixin/baseTableMixin'; -import openedTabComponentMixin - from '../openedObjectTabMixin/openedTabComponentMixin'; +import getNamespacedState from "@webitel/ui-sdk/src/store/helpers/getNamespacedState"; +import { mapActions, mapGetters, mapState } from "vuex"; +import ObjectListPopup from "../../../components/utils/object-list-popup/object-list-popup.vue"; +import OnePlusMany from "../../../components/utils/table-cell/one-plus-many-table-cell/one-plus-many-table-cell.vue"; +import baseTableMixin from "../../baseMixins/baseTableMixin/baseTableMixin"; +import openedTabComponentMixin from "../openedObjectTabMixin/openedTabComponentMixin"; /** * @fileOverview contains openedObject tab with table @@ -18,132 +14,184 @@ import openedTabComponentMixin * @extends baseTableMixin */ export default { - mixins: [openedTabComponentMixin, baseTableMixin], - components: { OnePlusMany, ObjectListPopup }, - inject: ['$eventBus'], - watch: { - parentId(value) { - this.setParentId(value); - }, - }, + mixins: [openedTabComponentMixin, baseTableMixin], + components: { OnePlusMany, ObjectListPopup }, + inject: ["$eventBus"], + watch: { + parentId(value) { + this.setParentId(value); + }, + }, - computed: { - ...mapState({ - parentId(state) { - return getNamespacedState(state, `${this.namespace}`).itemId; - }, - headersValue(state) { - return getNamespacedState(state, `${this.namespace}/${this.subNamespace}`).headers; - }, - dataList(state) { - return getNamespacedState(state, `${this.namespace}/${this.subNamespace}`).dataList; - }, - page(state) { - return getNamespacedState(state, `${this.namespace}/${this.subNamespace}`).page; - }, - size(state) { - return getNamespacedState(state, `${this.namespace}/${this.subNamespace}`).size; - }, - search(state) { - return getNamespacedState(state, `${this.namespace}/${this.subNamespace}`).search; - }, - isNext(state) { - return getNamespacedState(state, `${this.namespace}/${this.subNamespace}`).isNextPage; - }, - aggs(state) { - return getNamespacedState(state, `${this.namespace}/${this.subNamespace}`).aggs; - }, - }), - ...mapGetters('appearance', { - darkMode: 'DARK_MODE', - }), - headers() { - if (!this.headersValue) return []; - return this.headersValue.map((header) => ({ - ...header, - text: typeof header.locale === 'string' - ? this.$t(header.locale) - : this.$tc(...header.locale), - })); - }, - }, + computed: { + ...mapState({ + parentId(state) { + return getNamespacedState(state, `${this.namespace}`).itemId; + }, + headersValue(state) { + return getNamespacedState( + state, + `${this.namespace}/${this.subNamespace}`, + ).headers; + }, + dataList(state) { + return getNamespacedState( + state, + `${this.namespace}/${this.subNamespace}`, + ).dataList; + }, + page(state) { + return getNamespacedState( + state, + `${this.namespace}/${this.subNamespace}`, + ).page; + }, + size(state) { + return getNamespacedState( + state, + `${this.namespace}/${this.subNamespace}`, + ).size; + }, + search(state) { + return getNamespacedState( + state, + `${this.namespace}/${this.subNamespace}`, + ).search; + }, + isNext(state) { + return getNamespacedState( + state, + `${this.namespace}/${this.subNamespace}`, + ).isNextPage; + }, + aggs(state) { + return getNamespacedState( + state, + `${this.namespace}/${this.subNamespace}`, + ).aggs; + }, + }), + ...mapGetters("appearance", { + darkMode: "DARK_MODE", + }), + headers() { + if (!this.headersValue) return []; + return this.headersValue.map((header) => ({ + ...header, + text: + typeof header.locale === "string" + ? this.$t(header.locale) + : this.$tc(...header.locale), + })); + }, + }, - methods: { - ...mapActions({ - addParentItem(dispatch, payload) { - return dispatch(`${this.namespace}/ADD_ITEM`, payload); - }, - }), - loadDataList(payload) { - if (!this.parentId) return; - this.loadDataListAction(payload); - }, - ...mapActions({ - setParentId(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/SET_PARENT_ITEM_ID`, payload); - }, - setId(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/SET_ITEM_ID`, payload); - }, - loadDataListAction(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/LOAD_DATA_LIST`, payload); - }, - setSize(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/SET_SIZE`, payload); - }, - setSearch(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/SET_SEARCH`, payload); - }, - nextPage(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/NEXT_PAGE`, payload); - }, - prevPage(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/PREV_PAGE`, payload); - }, - dispatchSort(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/SORT`, payload); - }, - dispatchDelete(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/DELETE`, payload); - }, - patchItem(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/PATCH_ITEM_PROPERTY`, payload); - }, - resetItemState(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/RESET_ITEM_STATE`, payload); - }, - }), + methods: { + ...mapActions({ + addParentItem(dispatch, payload) { + return dispatch(`${this.namespace}/ADD_ITEM`, payload); + }, + }), + loadDataList(payload) { + if (!this.parentId) return; + this.loadDataListAction(payload); + }, + ...mapActions({ + setParentId(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/SET_PARENT_ITEM_ID`, + payload, + ); + }, + setId(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/SET_ITEM_ID`, + payload, + ); + }, + loadDataListAction(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/LOAD_DATA_LIST`, + payload, + ); + }, + setSize(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/SET_SIZE`, + payload, + ); + }, + setSearch(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/SET_SEARCH`, + payload, + ); + }, + nextPage(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/NEXT_PAGE`, + payload, + ); + }, + prevPage(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/PREV_PAGE`, + payload, + ); + }, + dispatchSort(dispatch, payload) { + return dispatch(`${this.namespace}/${this.subNamespace}/SORT`, payload); + }, + dispatchDelete(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/DELETE`, + payload, + ); + }, + patchItem(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/PATCH_ITEM_PROPERTY`, + payload, + ); + }, + resetItemState(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/RESET_ITEM_STATE`, + payload, + ); + }, + }), - async create() { - const invalid = this.checkValidations(); - if (!invalid) { - try { - if (!this.parentId) { - await this.addParentItem(); - const routeName = this.$route.name.replace('-new', '-edit'); - await this.$router.replace({ - name: routeName, - params: { id: this.parentId }, - }); - } - this.openPopup(); - } catch (err) { - throw err; - } - } else { - this.$eventBus.$emit('notification', { - type: 'error', - text: 'Check your validations!', - }); - } - }, + async create() { + const invalid = this.checkValidations(); + if (!invalid) { + try { + if (!this.parentId) { + await this.addParentItem(); + const routeName = this.$route.name.replace("-new", "-edit"); + await this.$router.replace({ + name: routeName, + params: { id: this.parentId }, + }); + } + this.openPopup(); + } catch (err) { + throw err; + } + } else { + this.$eventBus.$emit("notification", { + type: "error", + text: "Check your validations!", + }); + } + }, - edit(item) { - this.setId(item.id); - this.openPopup(); - }, - sort(...params) { - this.dispatchSort({ header: params[0], nextSortOrder: params[1] }); - }, - }, + edit(item) { + this.setId(item.id); + this.openPopup(); + }, + sort(...params) { + this.dispatchSort({ header: params[0], nextSortOrder: params[1] }); + }, + }, }; diff --git a/src/app/mixins/objectPagesMixins/permissionsTabMixin/permissionsTabMixin.js b/src/app/mixins/objectPagesMixins/permissionsTabMixin/permissionsTabMixin.js index 5f08154c8..073be7bd5 100644 --- a/src/app/mixins/objectPagesMixins/permissionsTabMixin/permissionsTabMixin.js +++ b/src/app/mixins/objectPagesMixins/permissionsTabMixin/permissionsTabMixin.js @@ -1,118 +1,169 @@ -import getNamespacedState - from '@webitel/ui-sdk/src/store/helpers/getNamespacedState'; -import { mapActions, mapState } from 'vuex'; -import AccessMode - from '../../../../modules/permissions/modules/objects/store/_internals/enums/AccessMode.enum'; -import tableComponentMixin from '../objectTableMixin/tableComponentMixin'; -import openedTabComponentMixin - from '../openedObjectTabMixin/openedTabComponentMixin'; +import getNamespacedState from "@webitel/ui-sdk/src/store/helpers/getNamespacedState"; +import { mapActions, mapState } from "vuex"; +import AccessMode from "../../../../modules/permissions/modules/objects/store/_internals/enums/AccessMode.enum"; +import tableComponentMixin from "../objectTableMixin/tableComponentMixin"; +import openedTabComponentMixin from "../openedObjectTabMixin/openedTabComponentMixin"; export default { - mixins: [openedTabComponentMixin, tableComponentMixin], - data: () => ({ - isRoleSelectPopup: false, - accessMode: AccessMode, - }), - destroyed() { - this.resetState(); - }, - computed: { - ...mapState({ - parentId(state) { - return getNamespacedState(state, `${this.namespace}`).itemId; - }, - headersValue(state) { - return getNamespacedState(state, `${this.namespace}/${this.subNamespace}`).headers; - }, - dataListValue(state) { - return getNamespacedState(state, `${this.namespace}/${this.subNamespace}`).dataList; - }, - page(state) { - return getNamespacedState(state, `${this.namespace}/${this.subNamespace}`).page; - }, - size(state) { - return getNamespacedState(state, `${this.namespace}/${this.subNamespace}`).size; - }, - search(state) { - return getNamespacedState(state, `${this.namespace}/${this.subNamespace}`).search; - }, - isNext(state) { - return getNamespacedState(state, `${this.namespace}/${this.subNamespace}`).isNextPage; - }, - }), - headers() { - if (!this.headersValue) return []; - return this.headersValue.map((header) => ({ - ...header, - text: typeof header.locale === 'string' - ? this.$t(header.locale) - : this.$tc(...header.locale), - })); - }, - dataList() { - return this.dataListValue.map((item) => { - const access = {}; - Object.keys(item.access).forEach((rule) => { - access[rule] = { - ...item.access[rule], - name: this.$t(`objects.permissions.object.accessMode.${item.access[rule].id}`), - }; - }); - return { ...item, access }; - }); - }, - accessOptions() { - return Object.values(AccessMode).map((mode) => ({ - id: mode, - name: this.$t(`objects.permissions.object.accessMode.${mode}`), - })); - }, - }, + mixins: [openedTabComponentMixin, tableComponentMixin], + data: () => ({ + isRoleSelectPopup: false, + accessMode: AccessMode, + }), + destroyed() { + this.resetState(); + }, + computed: { + ...mapState({ + parentId(state) { + return getNamespacedState(state, `${this.namespace}`).itemId; + }, + headersValue(state) { + return getNamespacedState( + state, + `${this.namespace}/${this.subNamespace}`, + ).headers; + }, + dataListValue(state) { + return getNamespacedState( + state, + `${this.namespace}/${this.subNamespace}`, + ).dataList; + }, + page(state) { + return getNamespacedState( + state, + `${this.namespace}/${this.subNamespace}`, + ).page; + }, + size(state) { + return getNamespacedState( + state, + `${this.namespace}/${this.subNamespace}`, + ).size; + }, + search(state) { + return getNamespacedState( + state, + `${this.namespace}/${this.subNamespace}`, + ).search; + }, + isNext(state) { + return getNamespacedState( + state, + `${this.namespace}/${this.subNamespace}`, + ).isNextPage; + }, + }), + headers() { + if (!this.headersValue) return []; + return this.headersValue.map((header) => ({ + ...header, + text: + typeof header.locale === "string" + ? this.$t(header.locale) + : this.$tc(...header.locale), + })); + }, + dataList() { + return this.dataListValue.map((item) => { + const access = {}; + Object.keys(item.access).forEach((rule) => { + access[rule] = { + ...item.access[rule], + name: this.$t( + `objects.permissions.object.accessMode.${item.access[rule].id}`, + ), + }; + }); + return { ...item, access }; + }); + }, + accessOptions() { + return Object.values(AccessMode).map((mode) => ({ + id: mode, + name: this.$t(`objects.permissions.object.accessMode.${mode}`), + })); + }, + }, - methods: { - ...mapActions({ - setParentId(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/SET_PARENT_ITEM_ID`, payload); - }, - loadDataList(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/LOAD_DATA_LIST`, payload); - }, - setSize(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/SET_SIZE`, payload); - }, - setSearch(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/SET_SEARCH`, payload); - }, - nextPage(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/NEXT_PAGE`, payload); - }, - prevPage(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/PREV_PAGE`, payload); - }, - dispatchSort(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/SORT`, payload); - }, - changeCreateAccessMode(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/CHANGE_CREATE_ACCESS_MODE`, payload); - }, - changeReadAccessMode(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/CHANGE_READ_ACCESS_MODE`, payload); - }, - changeUpdateAccessMode(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/CHANGE_UPDATE_ACCESS_MODE`, payload); - }, - changeDeleteAccessMode(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/CHANGE_DELETE_ACCESS_MODE`, payload); - }, - resetState(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/RESET_ITEM_STATE`, payload); - }, - }), - openRoleSelectPopup() { - this.isRoleSelectPopup = true; - }, - closeRoleSelectPopup() { - this.isRoleSelectPopup = false; - }, - }, + methods: { + ...mapActions({ + setParentId(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/SET_PARENT_ITEM_ID`, + payload, + ); + }, + loadDataList(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/LOAD_DATA_LIST`, + payload, + ); + }, + setSize(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/SET_SIZE`, + payload, + ); + }, + setSearch(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/SET_SEARCH`, + payload, + ); + }, + nextPage(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/NEXT_PAGE`, + payload, + ); + }, + prevPage(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/PREV_PAGE`, + payload, + ); + }, + dispatchSort(dispatch, payload) { + return dispatch(`${this.namespace}/${this.subNamespace}/SORT`, payload); + }, + changeCreateAccessMode(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/CHANGE_CREATE_ACCESS_MODE`, + payload, + ); + }, + changeReadAccessMode(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/CHANGE_READ_ACCESS_MODE`, + payload, + ); + }, + changeUpdateAccessMode(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/CHANGE_UPDATE_ACCESS_MODE`, + payload, + ); + }, + changeDeleteAccessMode(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/CHANGE_DELETE_ACCESS_MODE`, + payload, + ); + }, + resetState(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/RESET_ITEM_STATE`, + payload, + ); + }, + }), + openRoleSelectPopup() { + this.isRoleSelectPopup = true; + }, + closeRoleSelectPopup() { + this.isRoleSelectPopup = false; + }, + }, }; diff --git a/src/app/mixins/objectPagesMixins/permissionsTabMixin/permissionsTabRolePopupMixin.js b/src/app/mixins/objectPagesMixins/permissionsTabMixin/permissionsTabRolePopupMixin.js index f2caff7a4..27838aec2 100644 --- a/src/app/mixins/objectPagesMixins/permissionsTabMixin/permissionsTabRolePopupMixin.js +++ b/src/app/mixins/objectPagesMixins/permissionsTabMixin/permissionsTabRolePopupMixin.js @@ -1,57 +1,64 @@ -import getNamespacedState - from '@webitel/ui-sdk/src/store/helpers/getNamespacedState'; -import { mapActions, mapState } from 'vuex'; -import RolesAPI from '../../../../modules/permissions/modules/roles/api/roles'; +import getNamespacedState from "@webitel/ui-sdk/src/store/helpers/getNamespacedState"; +import { mapActions, mapState } from "vuex"; +import RolesAPI from "../../../../modules/permissions/modules/roles/api/roles"; export default { - props: { - namespace: { - type: String, - required: true, - }, - subNamespace: { - type: String, - required: true, - }, - }, - data: () => ({ - newGrantee: '', - }), - computed: { - ...mapState({ - dataList(state) { - return getNamespacedState(state, `${this.namespace}/${this.subNamespace}`).dataList; - }, - }), - }, - methods: { - ...mapActions({ - addRolePermissions(dispatch, payload) { - return dispatch(`${this.namespace}/${this.subNamespace}/ADD_ROLE_PERMISSIONS`, payload); - }, - }), - async save() { - try { - await this.addRolePermissions(this.newGrantee); - this.close(); - } catch (err) { - throw err; - } - }, + props: { + namespace: { + type: String, + required: true, + }, + subNamespace: { + type: String, + required: true, + }, + }, + data: () => ({ + newGrantee: "", + }), + computed: { + ...mapState({ + dataList(state) { + return getNamespacedState( + state, + `${this.namespace}/${this.subNamespace}`, + ).dataList; + }, + }), + }, + methods: { + ...mapActions({ + addRolePermissions(dispatch, payload) { + return dispatch( + `${this.namespace}/${this.subNamespace}/ADD_ROLE_PERMISSIONS`, + payload, + ); + }, + }), + async save() { + try { + await this.addRolePermissions(this.newGrantee); + this.close(); + } catch (err) { + throw err; + } + }, - // filter new roles - async getAvailableGrantees(params) { - const roles = await this.loadRoles(params); - roles.items = roles.items.filter((role) => ( - !this.dataList.some((usedRoles) => role.id === usedRoles.grantee.id))); - return roles; - }, - async loadRoles(params) { - const fields = ['name', 'id', 'user']; - return RolesAPI.getExtendedRoles({ ...params, fields }); - }, - close() { - this.$emit('close'); - }, - }, + // filter new roles + async getAvailableGrantees(params) { + const roles = await this.loadRoles(params); + roles.items = roles.items.filter( + (role) => + !this.dataList.some((usedRoles) => role.id === usedRoles.grantee.id), + ); + return roles; + }, + async loadRoles(params) { + const fields = ["name", "id", "user"]; + return RolesAPI.getExtendedRoles({ ...params, fields }); + }, + close() { + this.$emit("close"); + }, + }, }; diff --git a/src/app/plugins/breakpoint.js b/src/app/plugins/breakpoint.js index bace09850..9ca163149 100644 --- a/src/app/plugins/breakpoint.js +++ b/src/app/plugins/breakpoint.js @@ -1,5 +1,3 @@ -import { - install, -} from '@webitel/ui-sdk/src/plugins/breakpoint/breakpoint.plugin'; +import { install } from "@webitel/ui-sdk/src/plugins/breakpoint/breakpoint.plugin"; export default { install }; diff --git a/src/app/plugins/webitel-flow-ui.js b/src/app/plugins/webitel-flow-ui.js index 55d693132..a3f2b2fbc 100644 --- a/src/app/plugins/webitel-flow-ui.js +++ b/src/app/plugins/webitel-flow-ui.js @@ -1,10 +1,10 @@ // import locale -import WebitelUIEn from '@webitel/flow-ui-sdk/src/locale/en/en'; -import WebitelUIRu from '@webitel/flow-ui-sdk/src/locale/ru/ru'; -import WebitelUIUa from '@webitel/flow-ui-sdk/src/locale/ua/ua'; -import i18n from '../locale/i18n'; +import WebitelUIEn from "@webitel/flow-ui-sdk/src/locale/en/en"; +import WebitelUIRu from "@webitel/flow-ui-sdk/src/locale/ru/ru"; +import WebitelUIUa from "@webitel/flow-ui-sdk/src/locale/ua/ua"; +import i18n from "../locale/i18n"; // add plugin locales to main i18n -i18n.global.mergeLocaleMessage('en', WebitelUIEn); -i18n.global.mergeLocaleMessage('ru', WebitelUIRu); -i18n.global.mergeLocaleMessage('ua', WebitelUIUa); +i18n.global.mergeLocaleMessage("en", WebitelUIEn); +i18n.global.mergeLocaleMessage("ru", WebitelUIRu); +i18n.global.mergeLocaleMessage("ua", WebitelUIUa); diff --git a/src/app/plugins/webitel-ui.js b/src/app/plugins/webitel-ui.js index 0edd2e95d..bc6efdb54 100644 --- a/src/app/plugins/webitel-ui.js +++ b/src/app/plugins/webitel-ui.js @@ -1,25 +1,25 @@ -import '@webitel/ui-sdk/dist/img/sprite'; +import "@webitel/ui-sdk/dist/img/sprite"; // import styles -import '@webitel/ui-sdk/dist/ui-sdk.css'; -import WebitelUI from '@webitel/ui-sdk/dist/ui-sdk.mjs'; +import "@webitel/ui-sdk/dist/ui-sdk.css"; +import WebitelUI from "@webitel/ui-sdk/dist/ui-sdk.mjs"; // import locale -import WebitelUIEn from '@webitel/ui-sdk/src/locale/en/en'; -import WebitelUIKz from '@webitel/ui-sdk/src/locale/kz/kz'; -import WebitelUIRu from '@webitel/ui-sdk/src/locale/ru/ru'; -import WebitelUIUa from '@webitel/ui-sdk/src/locale/ua/ua'; -import eventBus from '@webitel/ui-sdk/src/scripts/eventBus'; -import i18n from '../locale/i18n'; +import WebitelUIEn from "@webitel/ui-sdk/src/locale/en/en"; +import WebitelUIKz from "@webitel/ui-sdk/src/locale/kz/kz"; +import WebitelUIRu from "@webitel/ui-sdk/src/locale/ru/ru"; +import WebitelUIUa from "@webitel/ui-sdk/src/locale/ua/ua"; +import eventBus from "@webitel/ui-sdk/src/scripts/eventBus"; +import i18n from "../locale/i18n"; const globals = { - $baseURL: import.meta.env.BASE_URL, + $baseURL: import.meta.env.BASE_URL, }; // init plugin export default [WebitelUI, { eventBus, globals }]; // add plugin locales to main i18n -i18n.global.mergeLocaleMessage('en', WebitelUIEn); -i18n.global.mergeLocaleMessage('ru', WebitelUIRu); -i18n.global.mergeLocaleMessage('ua', WebitelUIUa); -i18n.global.mergeLocaleMessage('kz', WebitelUIKz); +i18n.global.mergeLocaleMessage("en", WebitelUIEn); +i18n.global.mergeLocaleMessage("ru", WebitelUIRu); +i18n.global.mergeLocaleMessage("ua", WebitelUIUa); +i18n.global.mergeLocaleMessage("kz", WebitelUIKz); diff --git a/src/app/router/_internals/NavigationPages.lookup.js b/src/app/router/_internals/NavigationPages.lookup.js index 70a5c4b18..80ae6d30c 100644 --- a/src/app/router/_internals/NavigationPages.lookup.js +++ b/src/app/router/_internals/NavigationPages.lookup.js @@ -1,193 +1,217 @@ -import AdminSections - from '@webitel/ui-sdk/src/enums/WebitelApplications/AdminSections.enum'; -import WebitelApplications - from '@webitel/ui-sdk/src/enums/WebitelApplications/WebitelApplications.enum'; +import AdminSections from "@webitel/ui-sdk/src/enums/WebitelApplications/AdminSections.enum"; +import WebitelApplications from "@webitel/ui-sdk/src/enums/WebitelApplications/WebitelApplications.enum"; const nav = Object.freeze([ - { - value: 'directory', - locale: 'nav.directory.directory', - route: '/directory', - subNav: [ - { - value: AdminSections.LICENSE, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.LICENSE}`, - route: 'license', - }, { - value: AdminSections.USERS, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.USERS}`, - route: 'users', - }, { - value: AdminSections.DEVICES, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.DEVICES}`, - route: 'devices', - }, - ], - }, - { - value: 'routing', - locale: 'nav.routing.routing', - route: '/routing', - subNav: [ - { - value: AdminSections.FLOW, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.FLOW}`, - route: 'flow', - }, { - value: AdminSections.DIALPLAN, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.DIALPLAN}`, - route: 'dialplan', - }, { - value: AdminSections.GATEWAYS, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.GATEWAYS}`, - route: 'sip-gateways', - }, { - value: AdminSections.CHATPLAN, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.CHATPLAN}`, - route: 'chatplan', - }, { - value: AdminSections.CHAT_GATEWAYS, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.CHAT_GATEWAYS}`, - route: 'chat-gateways', - }, - ], - }, { - value: 'lookups', - locale: 'nav.lookups.lookups', - route: '/lookups', - subNav: [ - { - value: AdminSections.SKILLS, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.SKILLS}`, - route: 'skills', - }, { - value: AdminSections.BUCKETS, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.BUCKETS}`, - route: 'buckets', - }, { - value: AdminSections.BLACKLIST, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.BLACKLIST}`, - route: 'blacklist', - }, { - value: AdminSections.REGIONS, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.REGIONS}`, - route: 'regions', - }, { - value: AdminSections.CALENDARS, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.CALENDARS}`, - route: 'calendars', - }, { - value: AdminSections.COMMUNICATIONS, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.COMMUNICATIONS}`, - route: 'communications', - }, { - value: AdminSections.PAUSE_CAUSE, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.PAUSE_CAUSE}`, - route: 'pause-cause', - }, { - value: AdminSections.MEDIA, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.MEDIA}`, - route: 'media', - }, - ], - }, { - value: 'contact-center', - locale: 'nav.ccenter.ccenter', - route: '/contact-center', - subNav: [ - { - value: AdminSections.AGENTS, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.AGENTS}`, - route: 'agents', - }, { - value: AdminSections.TEAMS, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.TEAMS}`, - route: 'teams', - }, { - value: AdminSections.RESOURCES, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.RESOURCES}`, - route: 'resources', - }, { - value: AdminSections.RESOURCE_GROUPS, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.RESOURCE_GROUPS}`, - route: 'resource-groups', - }, { - value: AdminSections.QUEUES, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.QUEUES}`, - route: 'queues', - }, - ], - }, { - value: 'integrations', - locale: 'nav.integrations.integrations', - route: '/integrations', - subNav: [ - { - value: AdminSections.STORAGE, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.STORAGE}`, - route: 'storage', - }, { - value: AdminSections.COGNITIVE_PROFILES, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.COGNITIVE_PROFILES}`, - route: 'cognitive-profiles', - }, { - value: AdminSections.EMAIL_PROFILES, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.EMAIL_PROFILES}`, - route: 'email-profiles', - }, - // Note: commented out because of singleSignOn feature is not ready yet - // { - // value: AdminSections.SINGLE_SIGN_ON, - // locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.SINGLE_SIGN_ON}`, - // route: 'single-sign-on', - // }, - { - value: AdminSections.IMPORT_CSV, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.IMPORT_CSV}`, - route: 'import-csv', - }, { - value: AdminSections.TRIGGERS, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.TRIGGERS}`, - route: 'triggers', - }, - ], - }, { - value: 'permissions', - locale: 'nav.permissions.permissions', - route: '/permissions', - subNav: [ - { - value: AdminSections.ROLES, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.ROLES}`, - route: 'roles', - }, { - value: AdminSections.OBJECTS, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.OBJECTS}`, - route: 'objects', - }, - ], - }, { - value: 'system', - locale: 'nav.system.system', - route: '/system', - subNav: [ - { - value: AdminSections.CHANGELOGS, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.CHANGELOGS}`, - route: 'changelogs', - }, - { - value: AdminSections.CONFIGURATION, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.CONFIGURATION}`, - route: 'configuration', - }, - { - value: AdminSections.GLOBAL_VARIABLES, - locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.GLOBAL_VARIABLES}`, - route: 'global-variables', - }, - ], - }, + { + value: "directory", + locale: "nav.directory.directory", + route: "/directory", + subNav: [ + { + value: AdminSections.LICENSE, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.LICENSE}`, + route: "license", + }, + { + value: AdminSections.USERS, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.USERS}`, + route: "users", + }, + { + value: AdminSections.DEVICES, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.DEVICES}`, + route: "devices", + }, + ], + }, + { + value: "routing", + locale: "nav.routing.routing", + route: "/routing", + subNav: [ + { + value: AdminSections.FLOW, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.FLOW}`, + route: "flow", + }, + { + value: AdminSections.DIALPLAN, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.DIALPLAN}`, + route: "dialplan", + }, + { + value: AdminSections.GATEWAYS, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.GATEWAYS}`, + route: "sip-gateways", + }, + { + value: AdminSections.CHATPLAN, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.CHATPLAN}`, + route: "chatplan", + }, + { + value: AdminSections.CHAT_GATEWAYS, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.CHAT_GATEWAYS}`, + route: "chat-gateways", + }, + ], + }, + { + value: "lookups", + locale: "nav.lookups.lookups", + route: "/lookups", + subNav: [ + { + value: AdminSections.SKILLS, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.SKILLS}`, + route: "skills", + }, + { + value: AdminSections.BUCKETS, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.BUCKETS}`, + route: "buckets", + }, + { + value: AdminSections.BLACKLIST, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.BLACKLIST}`, + route: "blacklist", + }, + { + value: AdminSections.REGIONS, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.REGIONS}`, + route: "regions", + }, + { + value: AdminSections.CALENDARS, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.CALENDARS}`, + route: "calendars", + }, + { + value: AdminSections.COMMUNICATIONS, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.COMMUNICATIONS}`, + route: "communications", + }, + { + value: AdminSections.PAUSE_CAUSE, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.PAUSE_CAUSE}`, + route: "pause-cause", + }, + { + value: AdminSections.MEDIA, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.MEDIA}`, + route: "media", + }, + ], + }, + { + value: "contact-center", + locale: "nav.ccenter.ccenter", + route: "/contact-center", + subNav: [ + { + value: AdminSections.AGENTS, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.AGENTS}`, + route: "agents", + }, + { + value: AdminSections.TEAMS, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.TEAMS}`, + route: "teams", + }, + { + value: AdminSections.RESOURCES, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.RESOURCES}`, + route: "resources", + }, + { + value: AdminSections.RESOURCE_GROUPS, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.RESOURCE_GROUPS}`, + route: "resource-groups", + }, + { + value: AdminSections.QUEUES, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.QUEUES}`, + route: "queues", + }, + ], + }, + { + value: "integrations", + locale: "nav.integrations.integrations", + route: "/integrations", + subNav: [ + { + value: AdminSections.STORAGE, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.STORAGE}`, + route: "storage", + }, + { + value: AdminSections.COGNITIVE_PROFILES, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.COGNITIVE_PROFILES}`, + route: "cognitive-profiles", + }, + { + value: AdminSections.EMAIL_PROFILES, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.EMAIL_PROFILES}`, + route: "email-profiles", + }, + // Note: commented out because of singleSignOn feature is not ready yet + // { + // value: AdminSections.SINGLE_SIGN_ON, + // locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.SINGLE_SIGN_ON}`, + // route: 'single-sign-on', + // }, + { + value: AdminSections.IMPORT_CSV, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.IMPORT_CSV}`, + route: "import-csv", + }, + { + value: AdminSections.TRIGGERS, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.TRIGGERS}`, + route: "triggers", + }, + ], + }, + { + value: "permissions", + locale: "nav.permissions.permissions", + route: "/permissions", + subNav: [ + { + value: AdminSections.ROLES, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.ROLES}`, + route: "roles", + }, + { + value: AdminSections.OBJECTS, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.OBJECTS}`, + route: "objects", + }, + ], + }, + { + value: "system", + locale: "nav.system.system", + route: "/system", + subNav: [ + { + value: AdminSections.CHANGELOGS, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.CHANGELOGS}`, + route: "changelogs", + }, + { + value: AdminSections.CONFIGURATION, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.CONFIGURATION}`, + route: "configuration", + }, + { + value: AdminSections.GLOBAL_VARIABLES, + locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.GLOBAL_VARIABLES}`, + route: "global-variables", + }, + ], + }, ]); export default nav; diff --git a/src/app/router/_internals/RouteNames.enum.js b/src/app/router/_internals/RouteNames.enum.js index 72d65dd02..3fdc70438 100644 --- a/src/app/router/_internals/RouteNames.enum.js +++ b/src/app/router/_internals/RouteNames.enum.js @@ -1,57 +1,57 @@ export default Object.freeze({ - AUTH: 'auth', - APPLICATION_HUB: 'application-hub', - HOME: 'home', - START: 'start', - - // DIRECTORY - LICENSE: 'license', - USERS: 'users', - DEVICES: 'devices', - - // ROUTING - FLOW: 'flow', - DIALPLAN: 'dialplan', - GATEWAYS: 'gateways', - CHATPLAN: 'chatplan', - CHAT_GATEWAYS: 'chat-gateways', - - // LOOKUPS - SKILLS: 'skills', - BUCKETS: 'buckets', - BLACKLIST: 'blacklists', - REGIONS: 'regions', - CALENDARS: 'calendars', - COMMUNICATIONS: 'communications', - PAUSE_CAUSE: 'agent-pause-cause', - MEDIA: 'media', - - // CONTACT-CENTER - AGENTS: 'agents', - TEAMS: 'teams', - RESOURCES: 'resources', - RESOURCE_GROUPS: 'resource-groups', - QUEUES: 'queues', - MEMBERS: 'queues-members', - - // INTEGRATIONS - STORAGE: 'storage', - COGNITIVE_PROFILES: 'cognitive-profiles', - EMAIL_PROFILES: 'email-profiles', - SINGLE_SIGN_ON: 'single-sign-on', - IMPORT_CSV: 'import-csv', - TRIGGERS: 'triggers', - - // PERMISSIONS - OBJECTS: 'objects', - ROLES: 'roles', - - // SYSTEM - CHANGELOGS: 'changelogs', - CONFIGURATION: 'configuration', - GLOBAL_VARIABLES: 'global-variables', - - SETTINGS_PAGE: 'settings', - PAGE_403: 'access-denied', - PAGE_404: '', + AUTH: "auth", + APPLICATION_HUB: "application-hub", + HOME: "home", + START: "start", + + // DIRECTORY + LICENSE: "license", + USERS: "users", + DEVICES: "devices", + + // ROUTING + FLOW: "flow", + DIALPLAN: "dialplan", + GATEWAYS: "gateways", + CHATPLAN: "chatplan", + CHAT_GATEWAYS: "chat-gateways", + + // LOOKUPS + SKILLS: "skills", + BUCKETS: "buckets", + BLACKLIST: "blacklists", + REGIONS: "regions", + CALENDARS: "calendars", + COMMUNICATIONS: "communications", + PAUSE_CAUSE: "agent-pause-cause", + MEDIA: "media", + + // CONTACT-CENTER + AGENTS: "agents", + TEAMS: "teams", + RESOURCES: "resources", + RESOURCE_GROUPS: "resource-groups", + QUEUES: "queues", + MEMBERS: "queues-members", + + // INTEGRATIONS + STORAGE: "storage", + COGNITIVE_PROFILES: "cognitive-profiles", + EMAIL_PROFILES: "email-profiles", + SINGLE_SIGN_ON: "single-sign-on", + IMPORT_CSV: "import-csv", + TRIGGERS: "triggers", + + // PERMISSIONS + OBJECTS: "objects", + ROLES: "roles", + + // SYSTEM + CHANGELOGS: "changelogs", + CONFIGURATION: "configuration", + GLOBAL_VARIABLES: "global-variables", + + SETTINGS_PAGE: "settings", + PAGE_403: "access-denied", + PAGE_404: "", }); diff --git a/src/app/router/router.js b/src/app/router/router.js index 1bfa7b225..f12f5a76a 100755 --- a/src/app/router/router.js +++ b/src/app/router/router.js @@ -1,752 +1,918 @@ -import { createRouter, createWebHistory } from 'vue-router'; -import store from '../store/store'; -import RouteNames from './_internals/RouteNames.enum'; +import { createRouter, createWebHistory } from "vue-router"; +import store from "../store/store"; +import RouteNames from "./_internals/RouteNames.enum"; -const ApplicationHub = () => import('../../modules/application-hub/components/application-hub.vue'); -const ModuleWrap = () => import('../../modules/_shared/object-wrap/the-object-wrap.vue'); -const StartPage = () => import('../../modules/start-page/components/the-start-page.vue'); -const Settings = () => import('../../modules/settings/components/the-settings.vue'); -const AccessDenied = () => import('../../modules/error-pages/components/the-access-denied-component.vue'); -const NotFound = () => import('../../modules/error-pages/components/the-not-found-component.vue'); -const PermissionsRoles = () => import('../../modules/permissions/modules/roles/components/the-roles.vue'); -const OpenedPermissionsRoles = () => import('../../modules/permissions/modules/roles/components/opened-role.vue'); -const PermissionsObjects = () => import('../../modules/permissions/modules/objects/components/the-objects-permissions.vue'); -const OpenedPermissionsObjects = () => import('../../modules/permissions/modules/objects/components/opened-object-permissions.vue'); -const Devices = () => import('../../modules/directory/modules/devices/components/the-devices.vue'); -const OpenedDevice = () => import('../../modules/directory/modules/devices/components/opened-device.vue'); -const Users = () => import('../../modules/directory/modules/users/components/the-users.vue'); -const OpenedUser = () => import('../../modules/directory/modules/users/components/opened-user.vue'); -const License = () => import('../../modules/directory/modules/license/components/the-license.vue'); -const Blacklists = () => import('../../modules/lookups/modules/blacklists/components/the-blacklists.vue'); -const Media = () => import('../../modules/lookups/modules/media/components/the-media.vue'); -const OpenedBlacklist = () => import('../../modules/lookups/modules/blacklists/components/opened-blacklist.vue'); -const Calendars = () => import('../../modules/lookups/modules/calendars/components/the-calendars.vue'); -const OpenedCalendar = () => import('../../modules/lookups/modules/calendars/components/opened-calendar.vue'); -const CommunicationTypes = () => import('../../modules/lookups/modules/communications/components/the-communication-types.vue'); -const OpenedCommunicationType = () => import('../../modules/lookups/modules/communications/components/opened-communication-type.vue'); -const Regions = () => import('../../modules/lookups/modules/regions/components/the-regions.vue'); -const OpenedRegion = () => import('../../modules/lookups/modules/regions/components/opened-region.vue'); -const AgentPauseCause = () => import('../../modules/lookups/modules/agent-pause-cause/components/the-agent-pause-cause.vue'); -const OpenedAgentPauseCause = () => import('../../modules/lookups/modules/agent-pause-cause/components/opened-agent-pause-cause.vue'); -const SipGateways = () => import('../../modules/routing/modules/gateways/components/the-sip-gateways.vue'); -const OpenedGateway = () => import('../../modules/routing/modules/gateways/components/opened-sip-gateway.vue'); -const ChatGateways = () => import('../../modules/routing/modules/chat-gateways/components/the-chat-gateways.vue'); -const OpenedChatGateways = () => import('../../modules/routing/modules/chat-gateways/components/opened-chat-gateway.vue'); -const Flow = () => import('../../modules/routing/modules/flow/components/the-flow.vue'); -const OpenedFlow = () => import('../../modules/routing/modules/flow/components/opened-flow.vue'); -const Dialplan = () => import('../../modules/routing/modules/dialplan/components/the-dialplan.vue'); -const OpenedDialplan = () => import('../../modules/routing/modules/dialplan/components/opened-dialplan.vue'); -const Chatplan = () => import('../../modules/routing/modules/chatplan/components/the-chatplan.vue'); -const OpenedChatplan = () => import('../../modules/routing/modules/chatplan/components/opened-chatplan.vue'); -const TheResources = () => import('../../modules/contact-center/modules/resources/components/the-resources.vue'); -const OpenedResource = () => import('../../modules/contact-center/modules/resources/components/opened-resource.vue'); -const ResourceGroups = () => import('../../modules/contact-center/modules/resource-groups/components/the-resource-groups.vue'); -const OpenedResourceGroup = () => import('../../modules/contact-center/modules/resource-groups/components/opened-resource-group.vue'); -const Agents = () => import('../../modules/contact-center/modules/agents/components/the-agents.vue'); -const OpenedAgent = () => import('../../modules/contact-center/modules/agents/components/opened-agent.vue'); -const Teams = () => import('../../modules/contact-center/modules/teams/components/the-teams.vue'); -const OpenedTeam = () => import('../../modules/contact-center/modules/teams/components/opened-team.vue'); -const AgentSkills = () => import('../../modules/lookups/modules/agent-skills/components/the-agent-skills.vue'); -const OpenedAgentSkill = () => import('../../modules/lookups/modules/agent-skills/components/opened-agent-skill.vue'); -const Buckets = () => import('../../modules/lookups/modules/buckets/components/the-buckets.vue'); -const OpenedBucket = () => import('../../modules/lookups/modules/buckets/components/opened-bucket.vue'); -const Queues = () => import('../../modules/contact-center/modules/queues/components/the-queues.vue'); -const Members = () => import('../../modules/contact-center/modules/queues/modules/members/components/the-queue-members.vue'); -const OpenedMember = () => import('../../modules/contact-center/modules/queues/modules/members/components/opened-queue-member.vue'); -const OpenedQueue = () => import('../../modules/contact-center/modules/queues/components/opened-queue.vue'); -const Storage = () => import('../../modules/integrations/modules/storage/components/the-storage.vue'); -const OpenedStorage = () => import('../../modules/integrations/modules/storage/components/opened-storage.vue'); -const CognitiveProfiles = () => import('../../modules/integrations/modules/cognitive-profiles/components/the-cognitive-profiles.vue'); -const EmailProfiles = () => import('../../modules/integrations/modules/email-profiles/components/the-email-profiles.vue'); -const SingleSignOn = () => import('../../modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue'); -const ImportCsv = () => import('../../modules/integrations/modules/import-csv/components/the-import-csv.vue'); -const Triggers = () => import('../../modules/integrations/modules/triggers/components/the-triggers.vue'); -const OpenedCognitiveProfile = () => import('../../modules/integrations/modules/cognitive-profiles/components/opened-cognitive-profile.vue'); -const OpenedEmailProfile = () => import('../../modules/integrations/modules/email-profiles/components/opened-email-profile.vue'); -const OpenedSingleSignOn = () => import('../../modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue'); -const OpenedImportCsv = () => import('../../modules/integrations/modules/import-csv/components/opened-import-csv.vue'); -const OpenedTrigger = () => import('../../modules/integrations/modules/triggers/components/opened-trigger.vue'); -const Changelogs = () => import('../../modules/system/modules/changelogs/components/the-changelogs.vue'); -const OpenedChangelog = () => import('../../modules/system/modules/changelogs/components/opened-changelog.vue'); -const Configuration = () => import('../../modules/system/modules/configuration/components/the-configuration.vue'); -const GlobalVariables = () => import('../../modules/system/modules/global-variables/components/the-global-variables.vue'); +const ApplicationHub = () => + import("../../modules/application-hub/components/application-hub.vue"); +const ModuleWrap = () => + import("../../modules/_shared/object-wrap/the-object-wrap.vue"); +const StartPage = () => + import("../../modules/start-page/components/the-start-page.vue"); +const Settings = () => + import("../../modules/settings/components/the-settings.vue"); +const AccessDenied = () => + import( + "../../modules/error-pages/components/the-access-denied-component.vue" + ); +const NotFound = () => + import("../../modules/error-pages/components/the-not-found-component.vue"); +const PermissionsRoles = () => + import("../../modules/permissions/modules/roles/components/the-roles.vue"); +const OpenedPermissionsRoles = () => + import("../../modules/permissions/modules/roles/components/opened-role.vue"); +const PermissionsObjects = () => + import( + "../../modules/permissions/modules/objects/components/the-objects-permissions.vue" + ); +const OpenedPermissionsObjects = () => + import( + "../../modules/permissions/modules/objects/components/opened-object-permissions.vue" + ); +const Devices = () => + import("../../modules/directory/modules/devices/components/the-devices.vue"); +const OpenedDevice = () => + import( + "../../modules/directory/modules/devices/components/opened-device.vue" + ); +const Users = () => + import("../../modules/directory/modules/users/components/the-users.vue"); +const OpenedUser = () => + import("../../modules/directory/modules/users/components/opened-user.vue"); +const License = () => + import("../../modules/directory/modules/license/components/the-license.vue"); +const Blacklists = () => + import( + "../../modules/lookups/modules/blacklists/components/the-blacklists.vue" + ); +const Media = () => + import("../../modules/lookups/modules/media/components/the-media.vue"); +const OpenedBlacklist = () => + import( + "../../modules/lookups/modules/blacklists/components/opened-blacklist.vue" + ); +const Calendars = () => + import( + "../../modules/lookups/modules/calendars/components/the-calendars.vue" + ); +const OpenedCalendar = () => + import( + "../../modules/lookups/modules/calendars/components/opened-calendar.vue" + ); +const CommunicationTypes = () => + import( + "../../modules/lookups/modules/communications/components/the-communication-types.vue" + ); +const OpenedCommunicationType = () => + import( + "../../modules/lookups/modules/communications/components/opened-communication-type.vue" + ); +const Regions = () => + import("../../modules/lookups/modules/regions/components/the-regions.vue"); +const OpenedRegion = () => + import("../../modules/lookups/modules/regions/components/opened-region.vue"); +const AgentPauseCause = () => + import( + "../../modules/lookups/modules/agent-pause-cause/components/the-agent-pause-cause.vue" + ); +const OpenedAgentPauseCause = () => + import( + "../../modules/lookups/modules/agent-pause-cause/components/opened-agent-pause-cause.vue" + ); +const SipGateways = () => + import( + "../../modules/routing/modules/gateways/components/the-sip-gateways.vue" + ); +const OpenedGateway = () => + import( + "../../modules/routing/modules/gateways/components/opened-sip-gateway.vue" + ); +const ChatGateways = () => + import( + "../../modules/routing/modules/chat-gateways/components/the-chat-gateways.vue" + ); +const OpenedChatGateways = () => + import( + "../../modules/routing/modules/chat-gateways/components/opened-chat-gateway.vue" + ); +const Flow = () => + import("../../modules/routing/modules/flow/components/the-flow.vue"); +const OpenedFlow = () => + import("../../modules/routing/modules/flow/components/opened-flow.vue"); +const Dialplan = () => + import("../../modules/routing/modules/dialplan/components/the-dialplan.vue"); +const OpenedDialplan = () => + import( + "../../modules/routing/modules/dialplan/components/opened-dialplan.vue" + ); +const Chatplan = () => + import("../../modules/routing/modules/chatplan/components/the-chatplan.vue"); +const OpenedChatplan = () => + import( + "../../modules/routing/modules/chatplan/components/opened-chatplan.vue" + ); +const TheResources = () => + import( + "../../modules/contact-center/modules/resources/components/the-resources.vue" + ); +const OpenedResource = () => + import( + "../../modules/contact-center/modules/resources/components/opened-resource.vue" + ); +const ResourceGroups = () => + import( + "../../modules/contact-center/modules/resource-groups/components/the-resource-groups.vue" + ); +const OpenedResourceGroup = () => + import( + "../../modules/contact-center/modules/resource-groups/components/opened-resource-group.vue" + ); +const Agents = () => + import( + "../../modules/contact-center/modules/agents/components/the-agents.vue" + ); +const OpenedAgent = () => + import( + "../../modules/contact-center/modules/agents/components/opened-agent.vue" + ); +const Teams = () => + import("../../modules/contact-center/modules/teams/components/the-teams.vue"); +const OpenedTeam = () => + import( + "../../modules/contact-center/modules/teams/components/opened-team.vue" + ); +const AgentSkills = () => + import( + "../../modules/lookups/modules/agent-skills/components/the-agent-skills.vue" + ); +const OpenedAgentSkill = () => + import( + "../../modules/lookups/modules/agent-skills/components/opened-agent-skill.vue" + ); +const Buckets = () => + import("../../modules/lookups/modules/buckets/components/the-buckets.vue"); +const OpenedBucket = () => + import("../../modules/lookups/modules/buckets/components/opened-bucket.vue"); +const Queues = () => + import( + "../../modules/contact-center/modules/queues/components/the-queues.vue" + ); +const Members = () => + import( + "../../modules/contact-center/modules/queues/modules/members/components/the-queue-members.vue" + ); +const OpenedMember = () => + import( + "../../modules/contact-center/modules/queues/modules/members/components/opened-queue-member.vue" + ); +const OpenedQueue = () => + import( + "../../modules/contact-center/modules/queues/components/opened-queue.vue" + ); +const Storage = () => + import( + "../../modules/integrations/modules/storage/components/the-storage.vue" + ); +const OpenedStorage = () => + import( + "../../modules/integrations/modules/storage/components/opened-storage.vue" + ); +const CognitiveProfiles = () => + import( + "../../modules/integrations/modules/cognitive-profiles/components/the-cognitive-profiles.vue" + ); +const EmailProfiles = () => + import( + "../../modules/integrations/modules/email-profiles/components/the-email-profiles.vue" + ); +const SingleSignOn = () => + import( + "../../modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue" + ); +const ImportCsv = () => + import( + "../../modules/integrations/modules/import-csv/components/the-import-csv.vue" + ); +const Triggers = () => + import( + "../../modules/integrations/modules/triggers/components/the-triggers.vue" + ); +const OpenedCognitiveProfile = () => + import( + "../../modules/integrations/modules/cognitive-profiles/components/opened-cognitive-profile.vue" + ); +const OpenedEmailProfile = () => + import( + "../../modules/integrations/modules/email-profiles/components/opened-email-profile.vue" + ); +const OpenedSingleSignOn = () => + import( + "../../modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue" + ); +const OpenedImportCsv = () => + import( + "../../modules/integrations/modules/import-csv/components/opened-import-csv.vue" + ); +const OpenedTrigger = () => + import( + "../../modules/integrations/modules/triggers/components/opened-trigger.vue" + ); +const Changelogs = () => + import( + "../../modules/system/modules/changelogs/components/the-changelogs.vue" + ); +const OpenedChangelog = () => + import( + "../../modules/system/modules/changelogs/components/opened-changelog.vue" + ); +const Configuration = () => + import( + "../../modules/system/modules/configuration/components/the-configuration.vue" + ); +const GlobalVariables = () => + import( + "../../modules/system/modules/global-variables/components/the-global-variables.vue" + ); const checkAppAccess = (to, from, next) => { - // check for === false because it can be undefined - if (to.meta.requiresAccess === false) next(); + // check for === false because it can be undefined + if (to.meta.requiresAccess === false) next(); - const hasReadAccess = store.getters['userinfo/CHECK_APP_ACCESS'](store.getters['userinfo/THIS_APP']); - if (hasReadAccess) { - next(); - } else { - next('/access-denied'); - } + const hasReadAccess = store.getters["userinfo/CHECK_APP_ACCESS"]( + store.getters["userinfo/THIS_APP"], + ); + if (hasReadAccess) { + next(); + } else { + next("/access-denied"); + } }; -const checkRouteAccess = ((to, from, next) => { - const hasReadAccess = store.getters['userinfo/HAS_READ_ACCESS']({ route: to }); - if (hasReadAccess) { - next(); - } else { - next('/access-denied'); - } -}); +const checkRouteAccess = (to, from, next) => { + const hasReadAccess = store.getters["userinfo/HAS_READ_ACCESS"]({ + route: to, + }); + if (hasReadAccess) { + next(); + } else { + next("/access-denied"); + } +}; const router = createRouter({ - history: createWebHistory(import.meta.env.BASE_URL), - // eslint-disable-next-line no-unused-vars - scrollBehavior(to, from, savedPosition) { - return { left: 0, top: 0 }; - }, - routes: [ - { - path: '/', - name: RouteNames.APPLICATION_HUB, - component: ApplicationHub, - }, - { - path: '/access-denied', - name: RouteNames.PAGE_403, - component: AccessDenied, - }, - { - path: '/admin', - component: ModuleWrap, - redirect: '/start', - beforeEnter: checkAppAccess, - children: [ - { - path: '/start', - name: RouteNames.START, - component: StartPage, - }, - { - path: '/settings', - name: RouteNames.SETTINGS_PAGE, - component: Settings, - meta: { - // prevent beforeEnter: checkAppAccess on parent route [WTEL-4321] - requiresAccess: false, - }, - }, + history: createWebHistory(import.meta.env.BASE_URL), + // eslint-disable-next-line no-unused-vars + scrollBehavior(to, from, savedPosition) { + return { left: 0, top: 0 }; + }, + routes: [ + { + path: "/", + name: RouteNames.APPLICATION_HUB, + component: ApplicationHub, + }, + { + path: "/access-denied", + name: RouteNames.PAGE_403, + component: AccessDenied, + }, + { + path: "/admin", + component: ModuleWrap, + redirect: "/start", + beforeEnter: checkAppAccess, + children: [ + { + path: "/start", + name: RouteNames.START, + component: StartPage, + }, + { + path: "/settings", + name: RouteNames.SETTINGS_PAGE, + component: Settings, + meta: { + // prevent beforeEnter: checkAppAccess on parent route [WTEL-4321] + requiresAccess: false, + }, + }, - // ----------DIRECTORY------------ - { - path: '/directory/devices', - name: RouteNames.DEVICES, - component: Devices, - beforeEnter: checkRouteAccess, - }, - { - path: '/directory/devices/:id', - name: `${RouteNames.DEVICES}-edit`, - component: OpenedDevice, - beforeEnter: checkRouteAccess, - }, - { - path: '/directory/devices/new', - name: `${RouteNames.DEVICES}-new`, - component: OpenedDevice, - beforeEnter: checkRouteAccess, - }, - { - path: '/directory/devices/hotdesk/:id', - name: `${RouteNames.DEVICES}-hotdesk-edit`, - component: OpenedDevice, - beforeEnter: checkRouteAccess, - }, - { - path: '/directory/devices/hotdesk/new', - name: `${RouteNames.DEVICES}-hotdesk-new`, - component: OpenedDevice, - beforeEnter: checkRouteAccess, - }, - { - path: '/directory/license', - name: RouteNames.LICENSE, - component: License, - beforeEnter: checkRouteAccess, - }, - { - path: '/directory/license/:id', - name: `${RouteNames.LICENSE}-edit`, - component: License, - beforeEnter: checkRouteAccess, - }, - { - path: '/directory/users', - name: RouteNames.USERS, - component: Users, - beforeEnter: checkRouteAccess, - }, - { - path: '/directory/users/:id', - name: `${RouteNames.USERS}-edit`, - component: OpenedUser, - beforeEnter: checkRouteAccess, - }, - { - path: '/directory/users/new', - name: `${RouteNames.USERS}-new`, - component: OpenedUser, - beforeEnter: checkRouteAccess, - }, - // ----------DIRECTORY END------------ + // ----------DIRECTORY------------ + { + path: "/directory/devices", + name: RouteNames.DEVICES, + component: Devices, + beforeEnter: checkRouteAccess, + }, + { + path: "/directory/devices/:id", + name: `${RouteNames.DEVICES}-edit`, + component: OpenedDevice, + beforeEnter: checkRouteAccess, + }, + { + path: "/directory/devices/new", + name: `${RouteNames.DEVICES}-new`, + component: OpenedDevice, + beforeEnter: checkRouteAccess, + }, + { + path: "/directory/devices/hotdesk/:id", + name: `${RouteNames.DEVICES}-hotdesk-edit`, + component: OpenedDevice, + beforeEnter: checkRouteAccess, + }, + { + path: "/directory/devices/hotdesk/new", + name: `${RouteNames.DEVICES}-hotdesk-new`, + component: OpenedDevice, + beforeEnter: checkRouteAccess, + }, + { + path: "/directory/license", + name: RouteNames.LICENSE, + component: License, + beforeEnter: checkRouteAccess, + }, + { + path: "/directory/license/:id", + name: `${RouteNames.LICENSE}-edit`, + component: License, + beforeEnter: checkRouteAccess, + }, + { + path: "/directory/users", + name: RouteNames.USERS, + component: Users, + beforeEnter: checkRouteAccess, + }, + { + path: "/directory/users/:id", + name: `${RouteNames.USERS}-edit`, + component: OpenedUser, + beforeEnter: checkRouteAccess, + }, + { + path: "/directory/users/new", + name: `${RouteNames.USERS}-new`, + component: OpenedUser, + beforeEnter: checkRouteAccess, + }, + // ----------DIRECTORY END------------ - // ----------ROUTING------------ - { - path: '/routing/flow', - name: RouteNames.FLOW, - component: Flow, - beforeEnter: checkRouteAccess, - }, - { - path: '/routing/flow/new', - name: `${RouteNames.FLOW}-new`, - component: OpenedFlow, - beforeEnter: checkRouteAccess, - }, - { - path: '/routing/flow/:id', - name: `${RouteNames.FLOW}-edit`, - component: OpenedFlow, - beforeEnter: checkRouteAccess, - }, - { - path: '/routing/dialplan', - name: RouteNames.DIALPLAN, - component: Dialplan, - beforeEnter: checkRouteAccess, - }, - { - path: '/routing/dialplan/new', - name: `${RouteNames.DIALPLAN}-new`, - component: OpenedDialplan, - beforeEnter: checkRouteAccess, - }, - { - path: '/routing/dialplan/:id', - name: `${RouteNames.DIALPLAN}-edit`, - component: OpenedDialplan, - beforeEnter: checkRouteAccess, - }, - { - path: '/routing/sip-gateways', - name: RouteNames.GATEWAYS, - component: SipGateways, - beforeEnter: checkRouteAccess, - }, - { - path: '/routing/sip-gateways/register/new', - name: `${RouteNames.GATEWAYS}-reg-new`, - component: OpenedGateway, - beforeEnter: checkRouteAccess, - }, - { - path: '/routing/sip-gateways/register/:id', - name: `${RouteNames.GATEWAYS}-reg-edit`, - component: OpenedGateway, - beforeEnter: checkRouteAccess, - }, - { - path: '/routing/sip-gateways/trunking/new', - name: `${RouteNames.GATEWAYS}-trunk-new`, - component: OpenedGateway, - beforeEnter: checkRouteAccess, - }, - { - path: '/routing/sip-gateways/trunking/:id', - name: `${RouteNames.GATEWAYS}-trunk-edit`, - component: OpenedGateway, - beforeEnter: checkRouteAccess, - }, - { - path: '/routing/chatplan', - name: RouteNames.CHATPLAN, - component: Chatplan, - beforeEnter: checkRouteAccess, - }, - { - path: '/routing/chatplan/new', - name: `${RouteNames.CHATPLAN}-new`, - component: OpenedChatplan, - beforeEnter: checkRouteAccess, - }, - { - path: '/routing/chatplan/:id', - name: `${RouteNames.CHATPLAN}-edit`, - component: OpenedChatplan, - beforeEnter: checkRouteAccess, - }, - { - path: '/routing/chat-gateways', - name: RouteNames.CHAT_GATEWAYS, - component: ChatGateways, - beforeEnter: checkRouteAccess, - }, - { - path: '/routing/chat-gateways/new', - name: `${RouteNames.CHAT_GATEWAYS}-new`, - component: OpenedChatGateways, - beforeEnter: checkRouteAccess, - }, - { - path: '/routing/chat-gateways/:id', - name: `${RouteNames.CHAT_GATEWAYS}-edit`, - component: OpenedChatGateways, - beforeEnter: checkRouteAccess, - }, - // ----------ROUTING END------------ + // ----------ROUTING------------ + { + path: "/routing/flow", + name: RouteNames.FLOW, + component: Flow, + beforeEnter: checkRouteAccess, + }, + { + path: "/routing/flow/new", + name: `${RouteNames.FLOW}-new`, + component: OpenedFlow, + beforeEnter: checkRouteAccess, + }, + { + path: "/routing/flow/:id", + name: `${RouteNames.FLOW}-edit`, + component: OpenedFlow, + beforeEnter: checkRouteAccess, + }, + { + path: "/routing/dialplan", + name: RouteNames.DIALPLAN, + component: Dialplan, + beforeEnter: checkRouteAccess, + }, + { + path: "/routing/dialplan/new", + name: `${RouteNames.DIALPLAN}-new`, + component: OpenedDialplan, + beforeEnter: checkRouteAccess, + }, + { + path: "/routing/dialplan/:id", + name: `${RouteNames.DIALPLAN}-edit`, + component: OpenedDialplan, + beforeEnter: checkRouteAccess, + }, + { + path: "/routing/sip-gateways", + name: RouteNames.GATEWAYS, + component: SipGateways, + beforeEnter: checkRouteAccess, + }, + { + path: "/routing/sip-gateways/register/new", + name: `${RouteNames.GATEWAYS}-reg-new`, + component: OpenedGateway, + beforeEnter: checkRouteAccess, + }, + { + path: "/routing/sip-gateways/register/:id", + name: `${RouteNames.GATEWAYS}-reg-edit`, + component: OpenedGateway, + beforeEnter: checkRouteAccess, + }, + { + path: "/routing/sip-gateways/trunking/new", + name: `${RouteNames.GATEWAYS}-trunk-new`, + component: OpenedGateway, + beforeEnter: checkRouteAccess, + }, + { + path: "/routing/sip-gateways/trunking/:id", + name: `${RouteNames.GATEWAYS}-trunk-edit`, + component: OpenedGateway, + beforeEnter: checkRouteAccess, + }, + { + path: "/routing/chatplan", + name: RouteNames.CHATPLAN, + component: Chatplan, + beforeEnter: checkRouteAccess, + }, + { + path: "/routing/chatplan/new", + name: `${RouteNames.CHATPLAN}-new`, + component: OpenedChatplan, + beforeEnter: checkRouteAccess, + }, + { + path: "/routing/chatplan/:id", + name: `${RouteNames.CHATPLAN}-edit`, + component: OpenedChatplan, + beforeEnter: checkRouteAccess, + }, + { + path: "/routing/chat-gateways", + name: RouteNames.CHAT_GATEWAYS, + component: ChatGateways, + beforeEnter: checkRouteAccess, + }, + { + path: "/routing/chat-gateways/new", + name: `${RouteNames.CHAT_GATEWAYS}-new`, + component: OpenedChatGateways, + beforeEnter: checkRouteAccess, + }, + { + path: "/routing/chat-gateways/:id", + name: `${RouteNames.CHAT_GATEWAYS}-edit`, + component: OpenedChatGateways, + beforeEnter: checkRouteAccess, + }, + // ----------ROUTING END------------ - // ----------LOOKUPS------------ - { - path: '/lookups/skills', - name: RouteNames.SKILLS, - component: AgentSkills, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/skills/new', - name: `${RouteNames.SKILLS}-new`, - component: OpenedAgentSkill, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/skills/:id', - name: `${RouteNames.SKILLS}-edit`, - component: OpenedAgentSkill, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/buckets', - name: RouteNames.BUCKETS, - component: Buckets, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/buckets/new', - name: `${RouteNames.BUCKETS}-new`, - component: OpenedBucket, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/buckets/:id', - name: `${RouteNames.BUCKETS}-edit`, - component: OpenedBucket, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/blacklist', - name: RouteNames.BLACKLIST, - component: Blacklists, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/blacklist/new', - name: `${RouteNames.BLACKLIST}-new`, - component: OpenedBlacklist, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/blacklist/:id', - name: `${RouteNames.BLACKLIST}-edit`, - component: OpenedBlacklist, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/media', - name: RouteNames.MEDIA, - component: Media, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/calendars', - name: RouteNames.CALENDARS, - component: Calendars, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/calendars/new', - name: `${RouteNames.CALENDARS}-new`, - component: OpenedCalendar, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/calendars/:id', - name: `${RouteNames.CALENDARS}-edit`, - component: OpenedCalendar, - beforeEnter: checkRouteAccess, - }, + // ----------LOOKUPS------------ + { + path: "/lookups/skills", + name: RouteNames.SKILLS, + component: AgentSkills, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/skills/new", + name: `${RouteNames.SKILLS}-new`, + component: OpenedAgentSkill, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/skills/:id", + name: `${RouteNames.SKILLS}-edit`, + component: OpenedAgentSkill, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/buckets", + name: RouteNames.BUCKETS, + component: Buckets, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/buckets/new", + name: `${RouteNames.BUCKETS}-new`, + component: OpenedBucket, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/buckets/:id", + name: `${RouteNames.BUCKETS}-edit`, + component: OpenedBucket, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/blacklist", + name: RouteNames.BLACKLIST, + component: Blacklists, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/blacklist/new", + name: `${RouteNames.BLACKLIST}-new`, + component: OpenedBlacklist, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/blacklist/:id", + name: `${RouteNames.BLACKLIST}-edit`, + component: OpenedBlacklist, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/media", + name: RouteNames.MEDIA, + component: Media, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/calendars", + name: RouteNames.CALENDARS, + component: Calendars, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/calendars/new", + name: `${RouteNames.CALENDARS}-new`, + component: OpenedCalendar, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/calendars/:id", + name: `${RouteNames.CALENDARS}-edit`, + component: OpenedCalendar, + beforeEnter: checkRouteAccess, + }, - { - path: '/lookups/communications', - name: RouteNames.COMMUNICATIONS, - component: CommunicationTypes, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/communications/new', - name: `${RouteNames.COMMUNICATIONS}-new`, - component: OpenedCommunicationType, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/communications/:id', - name: `${RouteNames.COMMUNICATIONS}-edit`, - component: OpenedCommunicationType, - beforeEnter: checkRouteAccess, - }, + { + path: "/lookups/communications", + name: RouteNames.COMMUNICATIONS, + component: CommunicationTypes, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/communications/new", + name: `${RouteNames.COMMUNICATIONS}-new`, + component: OpenedCommunicationType, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/communications/:id", + name: `${RouteNames.COMMUNICATIONS}-edit`, + component: OpenedCommunicationType, + beforeEnter: checkRouteAccess, + }, - { - path: '/lookups/regions', - name: RouteNames.REGIONS, - component: Regions, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/regions/new', - name: `${RouteNames.REGIONS}-new`, - component: OpenedRegion, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/regions/:id', - name: `${RouteNames.REGIONS}-edit`, - component: OpenedRegion, - beforeEnter: checkRouteAccess, - }, + { + path: "/lookups/regions", + name: RouteNames.REGIONS, + component: Regions, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/regions/new", + name: `${RouteNames.REGIONS}-new`, + component: OpenedRegion, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/regions/:id", + name: `${RouteNames.REGIONS}-edit`, + component: OpenedRegion, + beforeEnter: checkRouteAccess, + }, - { - path: '/lookups/pause-cause', - name: RouteNames.PAUSE_CAUSE, - component: AgentPauseCause, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/pause-cause/new', - name: `${RouteNames.PAUSE_CAUSE}-new`, - component: OpenedAgentPauseCause, - beforeEnter: checkRouteAccess, - }, - { - path: '/lookups/pause-cause/:id', - name: `${RouteNames.PAUSE_CAUSE}-edit`, - component: OpenedAgentPauseCause, - beforeEnter: checkRouteAccess, - }, - // ----------LOOKUPS END------------ + { + path: "/lookups/pause-cause", + name: RouteNames.PAUSE_CAUSE, + component: AgentPauseCause, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/pause-cause/new", + name: `${RouteNames.PAUSE_CAUSE}-new`, + component: OpenedAgentPauseCause, + beforeEnter: checkRouteAccess, + }, + { + path: "/lookups/pause-cause/:id", + name: `${RouteNames.PAUSE_CAUSE}-edit`, + component: OpenedAgentPauseCause, + beforeEnter: checkRouteAccess, + }, + // ----------LOOKUPS END------------ - // --------------CONTACT CENTER------------- - { - path: '/contact-center/agents', - name: RouteNames.AGENTS, - component: Agents, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/agents/new', - name: `${RouteNames.AGENTS}-new`, - component: OpenedAgent, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/agents/:id', - name: `${RouteNames.AGENTS}-edit`, - component: OpenedAgent, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/teams', - name: RouteNames.TEAMS, - component: Teams, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/teams/new', - name: `${RouteNames.TEAMS}-new`, - component: OpenedTeam, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/teams/:id', - name: `${RouteNames.TEAMS}-edit`, - component: OpenedTeam, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/resources', - name: RouteNames.RESOURCES, - component: TheResources, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/resources/new', - name: `${RouteNames.RESOURCES}-new`, - component: OpenedResource, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/resources/:id', - name: `${RouteNames.RESOURCES}-edit`, - component: OpenedResource, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/resource-groups', - name: RouteNames.RESOURCE_GROUPS, - component: ResourceGroups, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/resource-groups/new', - name: `${RouteNames.RESOURCE_GROUPS}-new`, - component: OpenedResourceGroup, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/resource-groups/:id', - name: `${RouteNames.RESOURCE_GROUPS}-edit`, - component: OpenedResourceGroup, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/queues', - name: RouteNames.QUEUES, - component: Queues, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/queues/:queueId/members', - name: RouteNames.MEMBERS, - component: Members, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/queues/:queueId/members/new', - name: `${RouteNames.MEMBERS}-new`, - component: OpenedMember, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/queues/:queueId/members/:id', - name: `${RouteNames.MEMBERS}-edit`, - component: OpenedMember, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/queues/new/:type', - name: `${RouteNames.QUEUES}-new`, - component: OpenedQueue, - beforeEnter: checkRouteAccess, - }, - { - path: '/contact-center/queues/:id/:type', - name: `${RouteNames.QUEUES}-edit`, - component: OpenedQueue, - beforeEnter: checkRouteAccess, - }, - // --------------CONTACT CENTER END------------- + // --------------CONTACT CENTER------------- + { + path: "/contact-center/agents", + name: RouteNames.AGENTS, + component: Agents, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/agents/new", + name: `${RouteNames.AGENTS}-new`, + component: OpenedAgent, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/agents/:id", + name: `${RouteNames.AGENTS}-edit`, + component: OpenedAgent, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/teams", + name: RouteNames.TEAMS, + component: Teams, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/teams/new", + name: `${RouteNames.TEAMS}-new`, + component: OpenedTeam, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/teams/:id", + name: `${RouteNames.TEAMS}-edit`, + component: OpenedTeam, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/resources", + name: RouteNames.RESOURCES, + component: TheResources, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/resources/new", + name: `${RouteNames.RESOURCES}-new`, + component: OpenedResource, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/resources/:id", + name: `${RouteNames.RESOURCES}-edit`, + component: OpenedResource, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/resource-groups", + name: RouteNames.RESOURCE_GROUPS, + component: ResourceGroups, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/resource-groups/new", + name: `${RouteNames.RESOURCE_GROUPS}-new`, + component: OpenedResourceGroup, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/resource-groups/:id", + name: `${RouteNames.RESOURCE_GROUPS}-edit`, + component: OpenedResourceGroup, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/queues", + name: RouteNames.QUEUES, + component: Queues, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/queues/:queueId/members", + name: RouteNames.MEMBERS, + component: Members, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/queues/:queueId/members/new", + name: `${RouteNames.MEMBERS}-new`, + component: OpenedMember, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/queues/:queueId/members/:id", + name: `${RouteNames.MEMBERS}-edit`, + component: OpenedMember, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/queues/new/:type", + name: `${RouteNames.QUEUES}-new`, + component: OpenedQueue, + beforeEnter: checkRouteAccess, + }, + { + path: "/contact-center/queues/:id/:type", + name: `${RouteNames.QUEUES}-edit`, + component: OpenedQueue, + beforeEnter: checkRouteAccess, + }, + // --------------CONTACT CENTER END------------- - // ----------INTEGRATIONS----------------- - { - path: '/integrations/storage', - name: RouteNames.STORAGE, - component: Storage, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/storage/:type/new', - name: `${RouteNames.STORAGE}-new`, - component: OpenedStorage, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/storage/:type/:id', - name: `${RouteNames.STORAGE}-edit`, - component: OpenedStorage, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/cognitive-profiles', - name: RouteNames.COGNITIVE_PROFILES, - component: CognitiveProfiles, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/cognitive-profiles/new', - name: `${RouteNames.COGNITIVE_PROFILES}-new`, - component: OpenedCognitiveProfile, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/cognitive-profiles/:id', - name: `${RouteNames.COGNITIVE_PROFILES}-edit`, - component: OpenedCognitiveProfile, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/email-profiles', - name: RouteNames.EMAIL_PROFILES, - component: EmailProfiles, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/email-profiles/new', - name: `${RouteNames.EMAIL_PROFILES}-new`, - component: OpenedEmailProfile, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/email-profiles/:id', - name: `${RouteNames.EMAIL_PROFILES}-edit`, - component: OpenedEmailProfile, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/single-sign-on', - name: RouteNames.SINGLE_SIGN_ON, - component: SingleSignOn, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/single-sign-on/new', - name: `${RouteNames.SINGLE_SIGN_ON}-new`, - component: OpenedSingleSignOn, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/single-sign-on/:id', - name: `${RouteNames.SINGLE_SIGN_ON}-edit`, - component: OpenedSingleSignOn, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/import-csv', - name: RouteNames.IMPORT_CSV, - component: ImportCsv, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/import-csv/new', - name: `${RouteNames.IMPORT_CSV}-new`, - component: OpenedImportCsv, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/import-csv/:id', - name: `${RouteNames.IMPORT_CSV}-edit`, - component: OpenedImportCsv, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/triggers', - name: RouteNames.TRIGGERS, - component: Triggers, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/triggers/new', - name: `${RouteNames.TRIGGERS}-new`, - component: OpenedTrigger, - beforeEnter: checkRouteAccess, - }, - { - path: '/integrations/triggers/:id', - name: `${RouteNames.TRIGGERS}-edit`, - component: OpenedTrigger, - beforeEnter: checkRouteAccess, - }, - // --------------INTEGRATIONS END------------- + // ----------INTEGRATIONS----------------- + { + path: "/integrations/storage", + name: RouteNames.STORAGE, + component: Storage, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/storage/:type/new", + name: `${RouteNames.STORAGE}-new`, + component: OpenedStorage, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/storage/:type/:id", + name: `${RouteNames.STORAGE}-edit`, + component: OpenedStorage, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/cognitive-profiles", + name: RouteNames.COGNITIVE_PROFILES, + component: CognitiveProfiles, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/cognitive-profiles/new", + name: `${RouteNames.COGNITIVE_PROFILES}-new`, + component: OpenedCognitiveProfile, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/cognitive-profiles/:id", + name: `${RouteNames.COGNITIVE_PROFILES}-edit`, + component: OpenedCognitiveProfile, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/email-profiles", + name: RouteNames.EMAIL_PROFILES, + component: EmailProfiles, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/email-profiles/new", + name: `${RouteNames.EMAIL_PROFILES}-new`, + component: OpenedEmailProfile, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/email-profiles/:id", + name: `${RouteNames.EMAIL_PROFILES}-edit`, + component: OpenedEmailProfile, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/single-sign-on", + name: RouteNames.SINGLE_SIGN_ON, + component: SingleSignOn, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/single-sign-on/new", + name: `${RouteNames.SINGLE_SIGN_ON}-new`, + component: OpenedSingleSignOn, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/single-sign-on/:id", + name: `${RouteNames.SINGLE_SIGN_ON}-edit`, + component: OpenedSingleSignOn, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/import-csv", + name: RouteNames.IMPORT_CSV, + component: ImportCsv, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/import-csv/new", + name: `${RouteNames.IMPORT_CSV}-new`, + component: OpenedImportCsv, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/import-csv/:id", + name: `${RouteNames.IMPORT_CSV}-edit`, + component: OpenedImportCsv, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/triggers", + name: RouteNames.TRIGGERS, + component: Triggers, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/triggers/new", + name: `${RouteNames.TRIGGERS}-new`, + component: OpenedTrigger, + beforeEnter: checkRouteAccess, + }, + { + path: "/integrations/triggers/:id", + name: `${RouteNames.TRIGGERS}-edit`, + component: OpenedTrigger, + beforeEnter: checkRouteAccess, + }, + // --------------INTEGRATIONS END------------- - // ----------PERMISSIONS----------------- - { - path: '/permissions/roles', - name: RouteNames.ROLES, - component: PermissionsRoles, - beforeEnter: checkRouteAccess, - }, - { - path: '/permissions/roles/:id', - name: `${RouteNames.ROLES}-edit`, - component: OpenedPermissionsRoles, - beforeEnter: checkRouteAccess, - }, - { - path: '/permissions/roles/new', - name: `${RouteNames.ROLES}-new`, - component: OpenedPermissionsRoles, - beforeEnter: checkRouteAccess, - }, - { - path: '/permissions/objects', - name: RouteNames.OBJECTS, - component: PermissionsObjects, - beforeEnter: checkRouteAccess, - }, - { - path: '/permissions/objects/:id', - name: `${RouteNames.OBJECTS}-edit`, - component: OpenedPermissionsObjects, - beforeEnter: checkRouteAccess, - }, - // ----------PERMISSIONS END----------------- + // ----------PERMISSIONS----------------- + { + path: "/permissions/roles", + name: RouteNames.ROLES, + component: PermissionsRoles, + beforeEnter: checkRouteAccess, + }, + { + path: "/permissions/roles/:id", + name: `${RouteNames.ROLES}-edit`, + component: OpenedPermissionsRoles, + beforeEnter: checkRouteAccess, + }, + { + path: "/permissions/roles/new", + name: `${RouteNames.ROLES}-new`, + component: OpenedPermissionsRoles, + beforeEnter: checkRouteAccess, + }, + { + path: "/permissions/objects", + name: RouteNames.OBJECTS, + component: PermissionsObjects, + beforeEnter: checkRouteAccess, + }, + { + path: "/permissions/objects/:id", + name: `${RouteNames.OBJECTS}-edit`, + component: OpenedPermissionsObjects, + beforeEnter: checkRouteAccess, + }, + // ----------PERMISSIONS END----------------- - // ----------SYSTEM START----------------- - { - path: '/system/changelogs', - name: RouteNames.CHANGELOGS, - component: Changelogs, - beforeEnter: checkRouteAccess, - }, - { - path: '/system/changelogs/new', - name: `${RouteNames.CHANGELOGS}-new`, - component: OpenedChangelog, - beforeEnter: checkRouteAccess, - }, - { - path: '/system/changelogs/:id', - name: `${RouteNames.CHANGELOGS}-edit`, - component: OpenedChangelog, - beforeEnter: checkRouteAccess, - }, - { - path: '/system/configuration', - name: RouteNames.CONFIGURATION, - component: Configuration, - beforeEnter: checkRouteAccess, - }, + // ----------SYSTEM START----------------- + { + path: "/system/changelogs", + name: RouteNames.CHANGELOGS, + component: Changelogs, + beforeEnter: checkRouteAccess, + }, + { + path: "/system/changelogs/new", + name: `${RouteNames.CHANGELOGS}-new`, + component: OpenedChangelog, + beforeEnter: checkRouteAccess, + }, + { + path: "/system/changelogs/:id", + name: `${RouteNames.CHANGELOGS}-edit`, + component: OpenedChangelog, + beforeEnter: checkRouteAccess, + }, + { + path: "/system/configuration", + name: RouteNames.CONFIGURATION, + component: Configuration, + beforeEnter: checkRouteAccess, + }, - { - path: '/system/global-variables', - name: RouteNames.GLOBAL_VARIABLES, - component: GlobalVariables, - beforeEnter: checkRouteAccess, - }, - ], - }, - { - path: '/:pathMatch(.*)*', - name: RouteNames.PAGE_404, - component: NotFound, - }, - // ----------SYSTEM END----------------- - ], + { + path: "/system/global-variables", + name: RouteNames.GLOBAL_VARIABLES, + component: GlobalVariables, + beforeEnter: checkRouteAccess, + }, + ], + }, + { + path: "/:pathMatch(.*)*", + name: RouteNames.PAGE_404, + component: NotFound, + }, + // ----------SYSTEM END----------------- + ], }); router.beforeEach((to, from, next) => { - if (!localStorage.getItem('access-token') && !to.query.accessToken) { - const desiredUrl = encodeURIComponent(window.location.href); - const authUrl = import.meta.env.VITE_AUTH_URL; - window.location.href = `${authUrl}?redirectTo=${desiredUrl}`; - } else if (to.query.accessToken) { - // assume that access token was set from query before app initialization in main.js - const newQuery = { ...to.query }; - delete newQuery.accessToken; - next({ ...to, query: newQuery }); - } else { - next(); - } + if (!localStorage.getItem("access-token") && !to.query.accessToken) { + const desiredUrl = encodeURIComponent(window.location.href); + const authUrl = import.meta.env.VITE_AUTH_URL; + window.location.href = `${authUrl}?redirectTo=${desiredUrl}`; + } else if (to.query.accessToken) { + // assume that access token was set from query before app initialization in main.js + const newQuery = { ...to.query }; + newQuery.accessToken = undefined; + next({ ...to, query: newQuery }); + } else { + next(); + } }); export default router; diff --git a/src/app/store/BaseStoreModules/StoreModuleMixins/BaseOpenedInstanceStoreModuleMixin.js b/src/app/store/BaseStoreModules/StoreModuleMixins/BaseOpenedInstanceStoreModuleMixin.js index e9e97ff5e..5fa8dc99f 100644 --- a/src/app/store/BaseStoreModules/StoreModuleMixins/BaseOpenedInstanceStoreModuleMixin.js +++ b/src/app/store/BaseStoreModules/StoreModuleMixins/BaseOpenedInstanceStoreModuleMixin.js @@ -1,56 +1,56 @@ -import deepCopy from 'deep-copy'; -import set from 'lodash/set'; +import deepCopy from "deep-copy"; +import set from "lodash/set"; const state = { - itemId: 0, - itemInstance: {}, + itemId: 0, + itemInstance: {}, }; const actions = { - SET_PARENT_ITEM_ID: (context, id) => { - context.commit('SET_PARENT_ITEM_ID', id); - }, - SET_ITEM_ID: (context, id) => { - if (id !== 'new') context.commit('SET_ITEM_ID', id); - else context.commit('SET_ITEM_ID', 0); - }, - LOAD_ITEM: async (context) => { - if (context.state.itemId) { - const item = await context.dispatch('GET_ITEM'); - context.commit('SET_ITEM', item); - } - }, - SET_ITEM_PROPERTY: (context, payload) => { - context.commit('SET_ITEM_PROPERTY', payload); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - RESET_ITEM_STATE: async (context) => { - context.commit('RESET_ITEM_STATE'); - }, + SET_PARENT_ITEM_ID: (context, id) => { + context.commit("SET_PARENT_ITEM_ID", id); + }, + SET_ITEM_ID: (context, id) => { + if (id !== "new") context.commit("SET_ITEM_ID", id); + else context.commit("SET_ITEM_ID", 0); + }, + LOAD_ITEM: async (context) => { + if (context.state.itemId) { + const item = await context.dispatch("GET_ITEM"); + context.commit("SET_ITEM", item); + } + }, + SET_ITEM_PROPERTY: (context, payload) => { + context.commit("SET_ITEM_PROPERTY", payload); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + RESET_ITEM_STATE: async (context) => { + context.commit("RESET_ITEM_STATE"); + }, }; const mutations = { - SET_PARENT_ITEM_ID: (state, id) => { - state.parentId = id; - }, - SET_ITEM_ID: (state, id) => { - state.itemId = id; - }, - SET_ITEM_PROPERTY: (state, { prop, value, path }) => { - if (path) { - set(state.itemInstance, path, value); - } else { - // DEPRECATED, LEGACY CODE - state.itemInstance[prop] = value; - } - }, - SET_ITEM: (state, item) => { - state.itemInstance = item; - }, + SET_PARENT_ITEM_ID: (state, id) => { + state.parentId = id; + }, + SET_ITEM_ID: (state, id) => { + state.itemId = id; + }, + SET_ITEM_PROPERTY: (state, { prop, value, path }) => { + if (path) { + set(state.itemInstance, path, value); + } else { + // DEPRECATED, LEGACY CODE + state.itemInstance[prop] = value; + } + }, + SET_ITEM: (state, item) => { + state.itemInstance = item; + }, }; export default { - getActions: () => actions, - getMutations: () => mutations, - generateState: () => deepCopy(state), + getActions: () => actions, + getMutations: () => mutations, + generateState: () => deepCopy(state), }; diff --git a/src/app/store/BaseStoreModules/StoreModuleMixins/BaseTableStoreModuleMixin.js b/src/app/store/BaseStoreModules/StoreModuleMixins/BaseTableStoreModuleMixin.js index b8333dd51..cdd57f5cf 100644 --- a/src/app/store/BaseStoreModules/StoreModuleMixins/BaseTableStoreModuleMixin.js +++ b/src/app/store/BaseStoreModules/StoreModuleMixins/BaseTableStoreModuleMixin.js @@ -1,205 +1,205 @@ import { - SortSymbols, - sortToQueryAdapter, -} from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; -import deepCopy from 'deep-copy'; + SortSymbols, + sortToQueryAdapter, +} from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; +import deepCopy from "deep-copy"; const state = { - headers: [], - dataList: [], - aggs: {}, - size: 10, - search: '', - page: 1, - sort: '', - isNextPage: false, + headers: [], + dataList: [], + aggs: {}, + size: 10, + search: "", + page: 1, + sort: "", + isNextPage: false, }; const actions = { - // HOOKS TO BE OVERRIDEN, IF NEEDED - BEFORE_SET_DATA_LIST_HOOK: (context, { items, next, aggs }) => ({ - items, - next, - aggs, - }), - AFTER_SET_DATA_LIST_HOOK: (context, { items, next }) => ({ items, next }), + // HOOKS TO BE OVERRIDEN, IF NEEDED + BEFORE_SET_DATA_LIST_HOOK: (context, { items, next, aggs }) => ({ + items, + next, + aggs, + }), + AFTER_SET_DATA_LIST_HOOK: (context, { items, next }) => ({ items, next }), - LOAD_DATA_LIST: async (context, _query) => { - /* + LOAD_DATA_LIST: async (context, _query) => { + /* https://my.webitel.com/browse/WTEL-3560 preventively disable isNext to handle case when user is clicking "next" faster than actual request is made */ - context.commit('SET_IS_NEXT', false); + context.commit("SET_IS_NEXT", false); - const query = { ...context.getters['filters/GET_FILTERS'], ..._query }; - try { - let { - items = [], - next = false, - aggs = {}, - } = await context.dispatch('GET_LIST', query); + const query = { ...context.getters["filters/GET_FILTERS"], ..._query }; + try { + let { + items = [], + next = false, + aggs = {}, + } = await context.dispatch("GET_LIST", query); - /* [https://my.webitel.com/browse/WTEL-3793] - * When deleting the last item from list, - * if there are other items on the previous page, you need to go back */ - if (!items.length && context.state.page > - 1) return context.dispatch('PREV_PAGE'); + /* [https://my.webitel.com/browse/WTEL-3793] + * When deleting the last item from list, + * if there are other items on the previous page, you need to go back */ + if (!items.length && context.state.page > 1) + return context.dispatch("PREV_PAGE"); - /* we should set _isSelected property to all items in tables cause their checkbox selection - * is based on this property. Previously, this prop was set it api consumers, but now - * admin-specific were replaced by webitel-sdk consumers and i supposed it will be - * weird to set this property in each api file through defaultListObject */ - items = items.map((item) => ({ ...item, _isSelected: false })); + /* we should set _isSelected property to all items in tables cause their checkbox selection + * is based on this property. Previously, this prop was set it api consumers, but now + * admin-specific were replaced by webitel-sdk consumers and i supposed it will be + * weird to set this property in each api file through defaultListObject */ + items = items.map((item) => ({ ...item, _isSelected: false })); - const afterHook = await context.dispatch('BEFORE_SET_DATA_LIST_HOOK', { - items, - next, - aggs, - }); - context.commit('SET_DATA_LIST', afterHook.items); - context.commit('SET_IS_NEXT', afterHook.next); - context.commit('AGGS', afterHook.aggs); - context.dispatch('AFTER_SET_DATA_LIST_HOOK', afterHook); - } catch (err) { - console.error(err); - } - }, - SET_SIZE: async (context, size) => { - context.commit('SET_SIZE', size); - await context.dispatch('RESET_PAGE'); - }, - SET_SEARCH: async (context, search) => { - context.commit('SET_SEARCH', search); - await context.dispatch('RESET_PAGE'); - }, - NEXT_PAGE: (context) => { - const page = context.state.page + 1; - context.commit('SET_PAGE', page); - context.dispatch('LOAD_DATA_LIST'); - }, - PREV_PAGE: (context) => { - if (context.state.page > 1) { - const page = context.state.page - 1; - context.commit('SET_PAGE', page); - context.dispatch('LOAD_DATA_LIST'); - } - }, - RESET_PAGE: (context) => { - const page = 1; - context.commit('SET_PAGE', page); - }, - SET_HEADERS: (context, headers) => context.commit('SET_HEADERS', headers), - SORT: async (context, { header, nextSortOrder }) => { - const sort = nextSortOrder - ? `${sortToQueryAdapter(nextSortOrder)}${header.field}` - : nextSortOrder; - context.commit('SET_SORT', sort); - context.dispatch('UPDATE_HEADER_SORT', { header, nextSortOrder }); - await context.dispatch('RESET_PAGE'); - return context.dispatch('LOAD_DATA_LIST'); - }, - UPDATE_HEADER_SORT: (context, { header, nextSortOrder }) => { - const headers = context.state.headers.map((oldHeader) => { - // eslint-disable-next-line no-prototype-builtins - if (oldHeader.sort !== undefined) { - return { - ...oldHeader, - sort: oldHeader.field === header.field - ? nextSortOrder - : SortSymbols.NONE, - }; - } - return oldHeader; - }); - context.commit('SET_HEADERS', headers); - }, - PATCH_ITEM_PROPERTY: async (context, { - item, index, prop, value, - }) => { - await context.commit('PATCH_ITEM_PROPERTY', { index, prop, value }); - const id = item?.id || context.state.dataList[index].id; - const changes = { [prop]: value }; - try { - await context.dispatch('PATCH_ITEM', { id, changes }); - context.commit('PATCH_ITEM_PROPERTY', { - item, index, prop, value, - }); - } catch { - context.dispatch('LOAD_DATA_LIST'); - } - }, - DELETE: async (context, deleted) => { - let action = 'DELETE_SINGLE'; - if (Array.isArray(deleted)) { - if (deleted.length) action = 'DELETE_BULK'; - else action = 'DELETE_ALL'; - } - try { - await context.dispatch(action, deleted); - } catch (err) { - throw err; - } finally { - await context.dispatch('LOAD_DATA_LIST'); - } - }, - DELETE_SINGLE: async (context, { id }) => { - try { - await context.dispatch('DELETE_ITEM', id); - } catch (err) { - throw err; - } - }, - DELETE_BULK: async ( - context, - deleted, - ) => Promise.allSettled(deleted.map((item) => context.dispatch('DELETE_SINGLE', item))), - // REMOVE_ITEM: async (context, index) => { - // const id = context.state.dataList[index].id; - // context.commit('REMOVE_ITEM', index); - // try { - // await context.dispatch('DELETE_ITEM', id); - // } catch (err) { - // throw err; - // } - // }, + const afterHook = await context.dispatch("BEFORE_SET_DATA_LIST_HOOK", { + items, + next, + aggs, + }); + context.commit("SET_DATA_LIST", afterHook.items); + context.commit("SET_IS_NEXT", afterHook.next); + context.commit("AGGS", afterHook.aggs); + context.dispatch("AFTER_SET_DATA_LIST_HOOK", afterHook); + } catch (err) { + console.error(err); + } + }, + SET_SIZE: async (context, size) => { + context.commit("SET_SIZE", size); + await context.dispatch("RESET_PAGE"); + }, + SET_SEARCH: async (context, search) => { + context.commit("SET_SEARCH", search); + await context.dispatch("RESET_PAGE"); + }, + NEXT_PAGE: (context) => { + const page = context.state.page + 1; + context.commit("SET_PAGE", page); + context.dispatch("LOAD_DATA_LIST"); + }, + PREV_PAGE: (context) => { + if (context.state.page > 1) { + const page = context.state.page - 1; + context.commit("SET_PAGE", page); + context.dispatch("LOAD_DATA_LIST"); + } + }, + RESET_PAGE: (context) => { + const page = 1; + context.commit("SET_PAGE", page); + }, + SET_HEADERS: (context, headers) => context.commit("SET_HEADERS", headers), + SORT: async (context, { header, nextSortOrder }) => { + const sort = nextSortOrder + ? `${sortToQueryAdapter(nextSortOrder)}${header.field}` + : nextSortOrder; + context.commit("SET_SORT", sort); + context.dispatch("UPDATE_HEADER_SORT", { header, nextSortOrder }); + await context.dispatch("RESET_PAGE"); + return context.dispatch("LOAD_DATA_LIST"); + }, + UPDATE_HEADER_SORT: (context, { header, nextSortOrder }) => { + const headers = context.state.headers.map((oldHeader) => { + // eslint-disable-next-line no-prototype-builtins + if (oldHeader.sort !== undefined) { + return { + ...oldHeader, + sort: + oldHeader.field === header.field ? nextSortOrder : SortSymbols.NONE, + }; + } + return oldHeader; + }); + context.commit("SET_HEADERS", headers); + }, + PATCH_ITEM_PROPERTY: async (context, { item, index, prop, value }) => { + await context.commit("PATCH_ITEM_PROPERTY", { index, prop, value }); + const id = item?.id || context.state.dataList[index].id; + const changes = { [prop]: value }; + try { + await context.dispatch("PATCH_ITEM", { id, changes }); + context.commit("PATCH_ITEM_PROPERTY", { + item, + index, + prop, + value, + }); + } catch { + context.dispatch("LOAD_DATA_LIST"); + } + }, + DELETE: async (context, deleted) => { + let action = "DELETE_SINGLE"; + if (Array.isArray(deleted)) { + if (deleted.length) action = "DELETE_BULK"; + else action = "DELETE_ALL"; + } + try { + await context.dispatch(action, deleted); + } catch (err) { + throw err; + } finally { + await context.dispatch("LOAD_DATA_LIST"); + } + }, + DELETE_SINGLE: async (context, { id }) => { + try { + await context.dispatch("DELETE_ITEM", id); + } catch (err) { + throw err; + } + }, + DELETE_BULK: async (context, deleted) => + Promise.allSettled( + deleted.map((item) => context.dispatch("DELETE_SINGLE", item)), + ), + // REMOVE_ITEM: async (context, index) => { + // const id = context.state.dataList[index].id; + // context.commit('REMOVE_ITEM', index); + // try { + // await context.dispatch('DELETE_ITEM', id); + // } catch (err) { + // throw err; + // } + // }, }; const mutations = { - SET_DATA_LIST: (state, items) => { - state.dataList = items; - }, - SET_SIZE: (state, size) => { - state.size = size; - }, - SET_SEARCH: (state, search) => { - state.search = search; - }, - SET_PAGE: (state, page) => { - state.page = page; - }, - SET_SORT: (state, sort) => { - state.sort = sort; - }, - SET_IS_NEXT: (state, next) => { - state.isNextPage = next; - }, - AGGS: (state, aggs) => { - state.aggs = aggs; - }, - SET_HEADERS: (state, headers) => { - state.headers = headers; - }, - PATCH_ITEM_PROPERTY: (state, { index, prop, value }) => { - state.dataList[index][prop] = value; - }, - // REMOVE_ITEM: (state, index) => { - // state.dataList.splice(index, 1); - // }, + SET_DATA_LIST: (state, items) => { + state.dataList = items; + }, + SET_SIZE: (state, size) => { + state.size = size; + }, + SET_SEARCH: (state, search) => { + state.search = search; + }, + SET_PAGE: (state, page) => { + state.page = page; + }, + SET_SORT: (state, sort) => { + state.sort = sort; + }, + SET_IS_NEXT: (state, next) => { + state.isNextPage = next; + }, + AGGS: (state, aggs) => { + state.aggs = aggs; + }, + SET_HEADERS: (state, headers) => { + state.headers = headers; + }, + PATCH_ITEM_PROPERTY: (state, { index, prop, value }) => { + state.dataList[index][prop] = value; + }, + // REMOVE_ITEM: (state, index) => { + // state.dataList.splice(index, 1); + // }, }; export default { - getActions: () => actions, - getMutations: () => mutations, - generateState: () => deepCopy(state), + getActions: () => actions, + getMutations: () => mutations, + generateState: () => deepCopy(state), }; diff --git a/src/app/store/BaseStoreModules/StoreModules/HistoryStoreModule/HistoryStoreModule.js b/src/app/store/BaseStoreModules/StoreModules/HistoryStoreModule/HistoryStoreModule.js index bec40d20c..16865796b 100644 --- a/src/app/store/BaseStoreModules/StoreModules/HistoryStoreModule/HistoryStoreModule.js +++ b/src/app/store/BaseStoreModules/StoreModules/HistoryStoreModule/HistoryStoreModule.js @@ -1,52 +1,50 @@ -import BaseStoreModule - from '@webitel/ui-sdk/src/store/BaseStoreModules/BaseStoreModule'; -import BaseOpenedInstanceModule - from '../../StoreModuleMixins/BaseOpenedInstanceStoreModuleMixin'; -import BaseTableModule from '../../StoreModuleMixins/BaseTableStoreModuleMixin'; +import BaseStoreModule from "@webitel/ui-sdk/src/store/BaseStoreModules/BaseStoreModule"; +import BaseOpenedInstanceModule from "../../StoreModuleMixins/BaseOpenedInstanceStoreModuleMixin"; +import BaseTableModule from "../../StoreModuleMixins/BaseTableStoreModuleMixin"; export class HistoryStoreModule extends BaseStoreModule { - getters = {}; - actions = { - ...BaseTableModule.getActions(), - ...BaseOpenedInstanceModule.getActions(), + getters = {}; + actions = { + ...BaseTableModule.getActions(), + ...BaseOpenedInstanceModule.getActions(), - SET_FROM: (context, from) => { - context.commit('SET_FROM', from); - context.dispatch('LOAD_DATA_LIST'); - }, - SET_TO: (context, to) => { - context.commit('SET_TO', to); - context.dispatch('LOAD_DATA_LIST'); - }, - }; + SET_FROM: (context, from) => { + context.commit("SET_FROM", from); + context.dispatch("LOAD_DATA_LIST"); + }, + SET_TO: (context, to) => { + context.commit("SET_TO", to); + context.dispatch("LOAD_DATA_LIST"); + }, + }; - _resettableState = () => ({ - ...BaseTableModule.generateState(), - parentId: 0, - from: new Date().setHours(0, 0, 0, 0), - to: Date.now(), - }); + _resettableState = () => ({ + ...BaseTableModule.generateState(), + parentId: 0, + from: new Date().setHours(0, 0, 0, 0), + to: Date.now(), + }); - state = this._resettableState(); - mutations = { - ...BaseTableModule.getMutations(), - ...BaseOpenedInstanceModule.getMutations(), + state = this._resettableState(); + mutations = { + ...BaseTableModule.getMutations(), + ...BaseOpenedInstanceModule.getMutations(), - SET_FROM: (state, from) => { - state.from = from; - }, - SET_TO: (state, to) => { - state.to = to; - }, - RESET_ITEM_STATE: (state) => { - Object.assign(state, this._resettableState()); - }, - }; + SET_FROM: (state, from) => { + state.from = from; + }, + SET_TO: (state, to) => { + state.to = to; + }, + RESET_ITEM_STATE: (state) => { + Object.assign(state, this._resettableState()); + }, + }; - generateGetListAction(APIMethod) { - this.actions.GET_LIST = (context) => APIMethod(context.state); - return this; - } + generateGetListAction(APIMethod) { + this.actions.GET_LIST = (context) => APIMethod(context.state); + return this; + } } export default HistoryStoreModule; diff --git a/src/app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule.js b/src/app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule.js index fcd283ac5..eeb15847c 100644 --- a/src/app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule.js +++ b/src/app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule.js @@ -1,65 +1,72 @@ -import BaseStoreModule - from '@webitel/ui-sdk/src/store/BaseStoreModules/BaseStoreModule'; -import deepCopy from 'deep-copy'; -import BaseOpenedInstanceModule - from '../StoreModuleMixins/BaseOpenedInstanceStoreModuleMixin'; -import BaseTableModule from '../StoreModuleMixins/BaseTableStoreModuleMixin'; +import BaseStoreModule from "@webitel/ui-sdk/src/store/BaseStoreModules/BaseStoreModule"; +import deepCopy from "deep-copy"; +import BaseOpenedInstanceModule from "../StoreModuleMixins/BaseOpenedInstanceStoreModuleMixin"; +import BaseTableModule from "../StoreModuleMixins/BaseTableStoreModuleMixin"; const DEFAULT_STATE = BaseTableModule.generateState(); const DEFAULT_ITEM_STATE = BaseOpenedInstanceModule.generateState(); export default class NestedObjectStoreModule extends BaseStoreModule { - getters = { - GET_ITEM_BY_ID: (state) => (itemId) => ( - state.dataList.find((item) => item.id === itemId) - ), - GET_ITEM_PROP_BY_ID: (state, getters) => (itemId, prop) => ( - getters.GET_ITEM_BY_ID(itemId)[prop] - ), - }; + getters = { + GET_ITEM_BY_ID: (state) => (itemId) => + state.dataList.find((item) => item.id === itemId), + GET_ITEM_PROP_BY_ID: (state, getters) => (itemId, prop) => + getters.GET_ITEM_BY_ID(itemId)[prop], + }; - actions = { - ...BaseTableModule.getActions(), - ...BaseOpenedInstanceModule.getActions(), + actions = { + ...BaseTableModule.getActions(), + ...BaseOpenedInstanceModule.getActions(), - ADD_ITEM: async (context) => { - if (!context.state.itemId) { - const { id } = await context.dispatch('POST_ITEM'); - context.dispatch('SET_ITEM_ID', id); - await context.dispatch('LOAD_DATA_LIST'); - } - }, - UPDATE_ITEM: async (context) => { - if (context.state.itemInstance._dirty) { - await context.dispatch('UPD_ITEM'); - await context.dispatch('LOAD_DATA_LIST'); - } - }, - RESET_STATE: (context) => { - context.commit('RESET_STATE'); - }, - }; + ADD_ITEM: async (context) => { + if (!context.state.itemId) { + const { id } = await context.dispatch("POST_ITEM"); + context.dispatch("SET_ITEM_ID", id); + await context.dispatch("LOAD_DATA_LIST"); + } + }, + UPDATE_ITEM: async (context) => { + if (context.state.itemInstance._dirty) { + await context.dispatch("UPD_ITEM"); + await context.dispatch("LOAD_DATA_LIST"); + } + }, + RESET_STATE: (context) => { + context.commit("RESET_STATE"); + }, + }; - mutations = { - ...BaseTableModule.getMutations(), - ...BaseOpenedInstanceModule.getMutations(), + mutations = { + ...BaseTableModule.getMutations(), + ...BaseOpenedInstanceModule.getMutations(), - RESET_STATE: (state) => { - Object.assign(state, this._resettableState(), this._resettableItemState()); - }, - RESET_ITEM_STATE: (state) => { - Object.assign(state, this._resettableItemState()); - }, - }; + RESET_STATE: (state) => { + Object.assign( + state, + this._resettableState(), + this._resettableItemState(), + ); + }, + RESET_ITEM_STATE: (state) => { + Object.assign(state, this._resettableItemState()); + }, + }; - constructor({ resettableState, resettableItemState, headers } = {}) { - super(); - const state = { parentId: 0 }; - this._resettableState = () => deepCopy({ - ...DEFAULT_STATE, ...resettableState, - headers, - }); - this._resettableItemState = () => deepCopy({ ...DEFAULT_ITEM_STATE, ...resettableItemState }); - this.state = { ...state, ...this._resettableState(), ...this._resettableItemState() }; - } + constructor({ resettableState, resettableItemState, headers } = {}) { + super(); + const state = { parentId: 0 }; + this._resettableState = () => + deepCopy({ + ...DEFAULT_STATE, + ...resettableState, + headers, + }); + this._resettableItemState = () => + deepCopy({ ...DEFAULT_ITEM_STATE, ...resettableItemState }); + this.state = { + ...state, + ...this._resettableState(), + ...this._resettableItemState(), + }; + } } diff --git a/src/app/store/BaseStoreModules/StoreModules/ObjectStoreModule.js b/src/app/store/BaseStoreModules/StoreModules/ObjectStoreModule.js index d004ed654..0934d8175 100644 --- a/src/app/store/BaseStoreModules/StoreModules/ObjectStoreModule.js +++ b/src/app/store/BaseStoreModules/StoreModules/ObjectStoreModule.js @@ -1,53 +1,52 @@ -import BaseStoreModule - from '@webitel/ui-sdk/src/store/BaseStoreModules/BaseStoreModule'; -import deepCopy from 'deep-copy'; -import BaseOpenedInstanceModule - from '../StoreModuleMixins/BaseOpenedInstanceStoreModuleMixin'; -import BaseTableModule from '../StoreModuleMixins/BaseTableStoreModuleMixin'; +import BaseStoreModule from "@webitel/ui-sdk/src/store/BaseStoreModules/BaseStoreModule"; +import deepCopy from "deep-copy"; +import BaseOpenedInstanceModule from "../StoreModuleMixins/BaseOpenedInstanceStoreModuleMixin"; +import BaseTableModule from "../StoreModuleMixins/BaseTableStoreModuleMixin"; export default class ObjectStoreModule extends BaseStoreModule { - getters = {}; + getters = {}; - actions = { - ...BaseTableModule.getActions(), - ...BaseOpenedInstanceModule.getActions(), - // https://webitel.atlassian.net/browse/WTEL-4195 - ADD_ITEM: async (context) => { - if (!context.state.itemId) { - const { id } = await context.dispatch('POST_ITEM'); - await context.dispatch('SET_ITEM_ID', id); - context.dispatch('LOAD_ITEM'); - } - }, - UPDATE_ITEM: async (context) => { - if (context.state.itemInstance._dirty) { - await context.dispatch('UPD_ITEM'); - context.dispatch('LOAD_ITEM'); - } - }, - }; + actions = { + ...BaseTableModule.getActions(), + ...BaseOpenedInstanceModule.getActions(), + // https://webitel.atlassian.net/browse/WTEL-4195 + ADD_ITEM: async (context) => { + if (!context.state.itemId) { + const { id } = await context.dispatch("POST_ITEM"); + await context.dispatch("SET_ITEM_ID", id); + context.dispatch("LOAD_ITEM"); + } + }, + UPDATE_ITEM: async (context) => { + if (context.state.itemInstance._dirty) { + await context.dispatch("UPD_ITEM"); + context.dispatch("LOAD_ITEM"); + } + }, + }; - mutations = { - ...BaseTableModule.getMutations(), - ...BaseOpenedInstanceModule.getMutations(), + mutations = { + ...BaseTableModule.getMutations(), + ...BaseOpenedInstanceModule.getMutations(), - RESET_ITEM_STATE: (state) => { - Object.assign(state, this._resettableState()); - }, - }; + RESET_ITEM_STATE: (state) => { + Object.assign(state, this._resettableState()); + }, + }; - modules = {}; + modules = {}; - constructor({ resettableState, headers } = {}) { - super(); - this._resettableState = () => deepCopy({ - ...BaseOpenedInstanceModule.generateState(), - ...resettableState, - }); - this.state = { - ...BaseTableModule.generateState(), - headers, - ...this._resettableState(), - }; - } + constructor({ resettableState, headers } = {}) { + super(); + this._resettableState = () => + deepCopy({ + ...BaseOpenedInstanceModule.generateState(), + ...resettableState, + }); + this.state = { + ...BaseTableModule.generateState(), + headers, + ...this._resettableState(), + }; + } } diff --git a/src/app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule.js b/src/app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule.js index deb72e8b6..c48641a83 100644 --- a/src/app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule.js +++ b/src/app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule.js @@ -1,43 +1,31 @@ -import BaseStoreModule - from '@webitel/ui-sdk/src/store/BaseStoreModules/BaseStoreModule'; -import PermissionsAPI - from '../../../../../modules/_shared/permissions-tab/api/PermissionsAPI'; -import AccessMode - from '../../../../../modules/permissions/modules/objects/store/_internals/enums/AccessMode.enum'; -import BaseOpenedInstanceModule - from '../../StoreModuleMixins/BaseOpenedInstanceStoreModuleMixin'; -import BaseTableModule from '../../StoreModuleMixins/BaseTableStoreModuleMixin'; -import defaultHeaders from './_internals/headers'; +import BaseStoreModule from "@webitel/ui-sdk/src/store/BaseStoreModules/BaseStoreModule"; +import PermissionsAPI from "../../../../../modules/_shared/permissions-tab/api/PermissionsAPI"; +import AccessMode from "../../../../../modules/permissions/modules/objects/store/_internals/enums/AccessMode.enum"; +import BaseOpenedInstanceModule from "../../StoreModuleMixins/BaseOpenedInstanceStoreModuleMixin"; +import BaseTableModule from "../../StoreModuleMixins/BaseTableStoreModuleMixin"; +import defaultHeaders from "./_internals/headers"; export class PermissionsStoreModule extends BaseStoreModule { - state = {}; + state = {}; - getters = {}; + getters = {}; - actions = { - ...BaseTableModule.getActions(), - ...BaseOpenedInstanceModule.getActions(), + actions = { + ...BaseTableModule.getActions(), + ...BaseOpenedInstanceModule.getActions(), - CHANGE_CREATE_ACCESS_MODE: ( - context, - payload, - ) => context.dispatch('CHANGE_ACCESS_MODE', { ruleName: 'x', ...payload }), - CHANGE_READ_ACCESS_MODE: ( - context, - payload, - ) => context.dispatch('CHANGE_ACCESS_MODE', { ruleName: 'r', ...payload }), - CHANGE_UPDATE_ACCESS_MODE: ( - context, - payload, - ) => context.dispatch('CHANGE_ACCESS_MODE', { ruleName: 'w', ...payload }), - CHANGE_DELETE_ACCESS_MODE: ( - context, - payload, - ) => context.dispatch('CHANGE_ACCESS_MODE', { ruleName: 'd', ...payload }), - CHANGE_ACCESS_MODE: async (context, { mode, ruleName, item }) => { - const have = item.access[ruleName]; - let want; - /* + CHANGE_CREATE_ACCESS_MODE: (context, payload) => + context.dispatch("CHANGE_ACCESS_MODE", { ruleName: "x", ...payload }), + CHANGE_READ_ACCESS_MODE: (context, payload) => + context.dispatch("CHANGE_ACCESS_MODE", { ruleName: "r", ...payload }), + CHANGE_UPDATE_ACCESS_MODE: (context, payload) => + context.dispatch("CHANGE_ACCESS_MODE", { ruleName: "w", ...payload }), + CHANGE_DELETE_ACCESS_MODE: (context, payload) => + context.dispatch("CHANGE_ACCESS_MODE", { ruleName: "d", ...payload }), + CHANGE_ACCESS_MODE: async (context, { mode, ruleName, item }) => { + const have = item.access[ruleName]; + let want; + /* has | patch | got -----+-------+----- - | w | w @@ -47,75 +35,74 @@ export class PermissionsStoreModule extends BaseStoreModule { ww | ww | w ww | w | - */ - switch (mode.id) { - case AccessMode.FORBIDDEN: - want = ruleName; - break; - case AccessMode.ALLOW: - want = have.rule || ruleName; - break; - case AccessMode.MANAGE: - want = `${ruleName}${ruleName}`; - break; - default: - return; - } - const changes = { - grantee: +item.grantee.id, - grants: want, - }; - try { - await context.dispatch('PATCH_ACCESS_MODE', { item, changes }); - } catch (err) { - throw err; - } finally { - context.dispatch('LOAD_DATA_LIST'); - } - }, - ADD_ROLE_PERMISSIONS: async (context, role) => { - const changes = { - grantee: +role.id, - grants: 'r', - }; - try { - await context.dispatch('PATCH_ACCESS_MODE', { changes }); - } catch { - } finally { - context.dispatch('LOAD_DATA_LIST'); - } - }, - RESET_ITEM_STATE: async (context) => { - context.commit('RESET_ITEM_STATE'); - }, - }; + switch (mode.id) { + case AccessMode.FORBIDDEN: + want = ruleName; + break; + case AccessMode.ALLOW: + want = have.rule || ruleName; + break; + case AccessMode.MANAGE: + want = `${ruleName}${ruleName}`; + break; + default: + return; + } + const changes = { + grantee: +item.grantee.id, + grants: want, + }; + try { + await context.dispatch("PATCH_ACCESS_MODE", { item, changes }); + } catch (err) { + throw err; + } finally { + context.dispatch("LOAD_DATA_LIST"); + } + }, + ADD_ROLE_PERMISSIONS: async (context, role) => { + const changes = { + grantee: +role.id, + grants: "r", + }; + try { + await context.dispatch("PATCH_ACCESS_MODE", { changes }); + } catch { + } finally { + context.dispatch("LOAD_DATA_LIST"); + } + }, + RESET_ITEM_STATE: async (context) => { + context.commit("RESET_ITEM_STATE"); + }, + }; - mutations = { - ...BaseTableModule.getMutations(), - ...BaseOpenedInstanceModule.getMutations(), + mutations = { + ...BaseTableModule.getMutations(), + ...BaseOpenedInstanceModule.getMutations(), - RESET_ITEM_STATE: (state) => { - Object.assign(state, this._resettableState()); - }, - }; + RESET_ITEM_STATE: (state) => { + Object.assign(state, this._resettableState()); + }, + }; - constructor({ headers = defaultHeaders } = {}) { - super(); - this._resettableState = () => ({ - ...BaseTableModule.generateState(), - headers, - parentId: 0, - }); - this.state = this._resettableState(); - } + constructor({ headers = defaultHeaders } = {}) { + super(); + this._resettableState = () => ({ + ...BaseTableModule.generateState(), + headers, + parentId: 0, + }); + this.state = this._resettableState(); + } - generateAPIActions(url) { - const permissionsAPI = new PermissionsAPI(url); - this.actions.GET_LIST = (context) => permissionsAPI.getList(context.state); - this.actions.PATCH_ACCESS_MODE = (context, { changes }) => ( - permissionsAPI.patch(context.state.parentId, [changes]) - ); - return this; - } + generateAPIActions(url) { + const permissionsAPI = new PermissionsAPI(url); + this.actions.GET_LIST = (context) => permissionsAPI.getList(context.state); + this.actions.PATCH_ACCESS_MODE = (context, { changes }) => + permissionsAPI.patch(context.state.parentId, [changes]); + return this; + } } export default PermissionsStoreModule; diff --git a/src/app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/_internals/headers.js b/src/app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/_internals/headers.js index edd236ccd..a70438196 100644 --- a/src/app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/_internals/headers.js +++ b/src/app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/_internals/headers.js @@ -1,28 +1,28 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'grantee', - locale: 'objects.name', - field: 'grantee', - sort: SortSymbols.NONE, - }, - { - value: 'read', - locale: 'objects.read', - field: 'r', - sort: SortSymbols.NONE, - }, - { - value: 'edit', - locale: 'objects.edit', - field: 'w', - sort: SortSymbols.NONE, - }, - { - value: 'delete', - locale: 'objects.permissions.object.delete', - field: 'd', - sort: SortSymbols.NONE, - }, + { + value: "grantee", + locale: "objects.name", + field: "grantee", + sort: SortSymbols.NONE, + }, + { + value: "read", + locale: "objects.read", + field: "r", + sort: SortSymbols.NONE, + }, + { + value: "edit", + locale: "objects.edit", + field: "w", + sort: SortSymbols.NONE, + }, + { + value: "delete", + locale: "objects.permissions.object.delete", + field: "d", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/app/store/store.js b/src/app/store/store.js index d27cfa585..bba355493 100755 --- a/src/app/store/store.js +++ b/src/app/store/store.js @@ -1,25 +1,25 @@ -import { createStore } from 'vuex'; -import appearance from '../../modules/appearance/store/appearance'; -import ccenter from '../../modules/contact-center/store/ccenter'; -import directory from '../../modules/directory/store/directory'; -import integrations from '../../modules/integrations/store/integrations'; -import lookups from '../../modules/lookups/store/lookups'; -import permissions from '../../modules/permissions/store/permissions'; -import routing from '../../modules/routing/store/routing'; -import system from '../../modules/system/store/system'; -import userinfo from '../../modules/userinfo/store/userinfo'; +import { createStore } from "vuex"; +import appearance from "../../modules/appearance/store/appearance"; +import ccenter from "../../modules/contact-center/store/ccenter"; +import directory from "../../modules/directory/store/directory"; +import integrations from "../../modules/integrations/store/integrations"; +import lookups from "../../modules/lookups/store/lookups"; +import permissions from "../../modules/permissions/store/permissions"; +import routing from "../../modules/routing/store/routing"; +import system from "../../modules/system/store/system"; +import userinfo from "../../modules/userinfo/store/userinfo"; export default createStore({ - strict: false, - modules: { - userinfo, - directory, - routing, - lookups, - ccenter, - integrations, - permissions, - system, - appearance, - }, + strict: false, + modules: { + userinfo, + directory, + routing, + lookups, + ccenter, + integrations, + permissions, + system, + appearance, + }, }); diff --git a/src/app/utils/download.js b/src/app/utils/download.js index 1f17186d0..d717c4500 100644 --- a/src/app/utils/download.js +++ b/src/app/utils/download.js @@ -1,22 +1,22 @@ export const download = (dataStr, name) => { - const downloadAnchorNode = document.createElement('a'); - downloadAnchorNode.setAttribute('href', dataStr); - downloadAnchorNode.setAttribute('download', name); - document.body.appendChild(downloadAnchorNode); - downloadAnchorNode.click(); - downloadAnchorNode.remove(); + const downloadAnchorNode = document.createElement("a"); + downloadAnchorNode.setAttribute("href", dataStr); + downloadAnchorNode.setAttribute("download", name); + document.body.appendChild(downloadAnchorNode); + downloadAnchorNode.click(); + downloadAnchorNode.remove(); }; export const downloadAsJSON = (obj, filename) => { - const dataStr = `data:text/json;charset=utf-8,${encodeURIComponent(JSON.stringify(obj, null, 4))}`; - download(dataStr, `${filename}.json`); + const dataStr = `data:text/json;charset=utf-8,${encodeURIComponent(JSON.stringify(obj, null, 4))}`; + download(dataStr, `${filename}.json`); }; export const downloadAsTXT = (text, filename) => { - const dataStr = `data:text/plain;charset=utf-8,${text}`; - download(dataStr, `${filename}.txt`); + const dataStr = `data:text/plain;charset=utf-8,${text}`; + download(dataStr, `${filename}.txt`); }; export const downloadAsCSV = (dataStr, name) => { - download(dataStr, name); + download(dataStr, name); }; diff --git a/src/app/utils/validators.js b/src/app/utils/validators.js index 3acad52a3..4195dbab8 100644 --- a/src/app/utils/validators.js +++ b/src/app/utils/validators.js @@ -1,37 +1,43 @@ export const macValidator = (value) => { - if (typeof value === 'undefined' || value === null || value === '') { - return true; - } - return /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/ - .test(value); + if (typeof value === "undefined" || value === null || value === "") { + return true; + } + return /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/.test(value); }; export const ipValidator = (value) => { - if (typeof value === 'undefined' || value === null || value === '') { - return true; - } - if (value === '127.0.0.1' || value === '0.0.0.0') { - return false; - } - return /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/ - .test(value); + if (typeof value === "undefined" || value === null || value === "") { + return true; + } + if (value === "127.0.0.1" || value === "0.0.0.0") { + return false; + } + return /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.test( + value, + ); }; export const gatewayHostValidator = (value) => { - if (typeof value === 'undefined' || value === null || value === '') { - return true; - } - return /^(sips?:)?(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(:[0-9]{1,5})?$/ - .test(value) || - /^(sips?:)?(?=.{1,254}$)((?=[a-z0-9-]{1,63}\.)(xn--+)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}/i - .test(value); + if (typeof value === "undefined" || value === null || value === "") { + return true; + } + return ( + /^(sips?:)?(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(:[0-9]{1,5})?$/.test( + value, + ) || + /^(sips?:)?(?=.{1,254}$)((?=[a-z0-9-]{1,63}\.)(xn--+)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}/i.test( + value, + ) + ); }; export const sipAccountValidator = (value) => { - if (typeof value === 'undefined' || value === null || value === '') { - return true; - } - return /^(sips?:)?([\w\-\.!~\*\(\)&=\+\$,;\?\/]+)(?:@([\w\-\.]+)(?::(\d{3,5}))?)?$/i.test(value); + if (typeof value === "undefined" || value === null || value === "") { + return true; + } + return /^(sips?:)?([\w\-\.!~\*\(\)&=\+\$,;\?\/]+)(?:@([\w\-\.]+)(?::(\d{3,5}))?)?$/i.test( + value, + ); }; export const requiredArrayValue = (array) => array.some((value) => value); @@ -39,35 +45,38 @@ export const requiredArrayValue = (array) => array.some((value) => value); export const timerangeStartLessThanEnd = (object) => object.start < object.end; export const timerangeNotIntersect = (array) => { - let isIntersecting = false; - let ranges = [{ start: array[0].start, end: array[0].end }]; - array.reduce((prev, curr) => { - if (prev.day !== curr.day) { - ranges = [{ start: curr.start, end: curr.end }]; - return curr; - } - ranges.forEach((range) => { - if ((curr.start >= range.start && curr.end <= range.end) // if [..{--}..] - || (curr.start <= range.start && curr.end >= range.start) // or {--[--}....] - || (curr.start <= range.end && curr.end >= range.end)) { // or [....{--]-} - isIntersecting = true; - } - }); - ranges.push({ start: curr.start, end: curr.end }); - return curr; - }); - return !isIntersecting; + let isIntersecting = false; + let ranges = [{ start: array[0].start, end: array[0].end }]; + array.reduce((prev, curr) => { + if (prev.day !== curr.day) { + ranges = [{ start: curr.start, end: curr.end }]; + return curr; + } + ranges.forEach((range) => { + if ( + (curr.start >= range.start && curr.end <= range.end) || // if [..{--}..] + (curr.start <= range.start && curr.end >= range.start) || // or {--[--}....] + (curr.start <= range.end && curr.end >= range.end) + ) { + // or [....{--]-} + isIntersecting = true; + } + }); + ranges.push({ start: curr.start, end: curr.end }); + return curr; + }); + return !isIntersecting; }; -export const lessOrEqualTo = (comparedProp) => (value, vm) => value <= - vm[comparedProp]; -export const moreOrEqualTo = (comparedProp) => (value, vm) => value >= - vm[comparedProp]; +export const lessOrEqualTo = (comparedProp) => (value, vm) => + value <= vm[comparedProp]; +export const moreOrEqualTo = (comparedProp) => (value, vm) => + value >= vm[comparedProp]; export const regExpValidator = (value) => { - try { - return new RegExp(value) instanceof RegExp; - } catch (e) { - return false; - } + try { + return new RegExp(value) instanceof RegExp; + } catch (e) { + return false; + } }; diff --git a/src/main.js b/src/main.js index 1caba7c7b..5a29caa8e 100755 --- a/src/main.js +++ b/src/main.js @@ -1,76 +1,78 @@ -import { createApp } from 'vue'; +import { createApp } from "vue"; // dont know why but when i import dropzone css is css files, it brakes build on firefox (only build!) -import 'vue2-dropzone/dist/vue2Dropzone.min.css'; -import './app/assets/icons/sprite'; -import instance from './app/api/instance'; +import "vue2-dropzone/dist/vue2Dropzone.min.css"; +import "./app/assets/icons/sprite"; +import instance from "./app/api/instance"; /* Don't know why, but without this empty file import styles just breaking :/ I suppose, it's a problem with webpack or sass/sass loader. I think, this issue should go on migration to Vue 3, so I left it "as is". */ -import './app/css/do-not-delete-me.scss'; -import ActionComponents from './app/components/actions'; -import App from './app/components/app.vue'; -import i18n from './app/locale/i18n'; -import BreakpointPlugin from './app/plugins/breakpoint'; -import './app/plugins/webitel-flow-ui'; -import WebitelUi from './app/plugins/webitel-ui'; -import router from './app/router/router'; -import store from './app/store/store'; +import "./app/css/do-not-delete-me.scss"; +import ActionComponents from "./app/components/actions"; +import App from "./app/components/app.vue"; +import i18n from "./app/locale/i18n"; +import BreakpointPlugin from "./app/plugins/breakpoint"; +import "./app/plugins/webitel-flow-ui"; +import WebitelUi from "./app/plugins/webitel-ui"; +import router from "./app/router/router"; +import store from "./app/store/store"; const fetchConfig = async () => { - const response = await fetch(`${import.meta.env.BASE_URL}config.json`); - return response.json(); + const response = await fetch(`${import.meta.env.BASE_URL}config.json`); + return response.json(); }; const setTokenFromUrl = () => { - try { - const queryMap = window.location.search.slice(1) - .split('&') - .reduce((obj, query) => { - const [key, value] = query.split('='); - obj[key] = value; - return obj; - }, {}); + try { + const queryMap = window.location.search + .slice(1) + .split("&") + .reduce((obj, query) => { + const [key, value] = query.split("="); + obj[key] = value; + return obj; + }, {}); - if (queryMap.accessToken) { - localStorage.setItem('access-token', queryMap.accessToken); - } - } catch (err) { - console.error('Error restoring token from url', err); - } + if (queryMap.accessToken) { + localStorage.setItem("access-token", queryMap.accessToken); + } + } catch (err) { + console.error("Error restoring token from url", err); + } }; -const initSession = async () => store.dispatch('userinfo/OPEN_SESSION', { instance }); +const initSession = async () => + store.dispatch("userinfo/OPEN_SESSION", { instance }); const createVueInstance = () => { - const app = createApp(App) - .use(router) - .use(store) - .use(i18n) - .use(...WebitelUi) - .use(BreakpointPlugin); + const app = createApp(App) + .use(router) + .use(store) + .use(i18n) + .use(...WebitelUi) + .use(BreakpointPlugin); - ActionComponents.forEach((component) => { - app.component(component.name, component); - }); + ActionComponents.forEach((component) => { + app.component(component.name, component); + }); - return app; + return app; }; // init IIFE (async () => { - let config = {}; - try { - setTokenFromUrl(); + let config = {}; + try { + setTokenFromUrl(); - config = await fetchConfig(); - await initSession(); - } catch (err) { - } finally { - const app = createVueInstance(); - app.provide('$config', config); - app.mount('#app'); - } + config = await fetchConfig(); + await initSession(); + } catch (err) { + } finally { + const app = createVueInstance(); + app.provide("$config", config); + app.mount("#app"); + } })(); diff --git a/src/modules/_reusable/app-header/components/app-header.vue b/src/modules/_reusable/app-header/components/app-header.vue index 25fa6fcb6..83eead308 100644 --- a/src/modules/_reusable/app-header/components/app-header.vue +++ b/src/modules/_reusable/app-header/components/app-header.vue @@ -26,85 +26,85 @@ diff --git a/src/modules/_shared/object-wrap/the-object-wrap.vue b/src/modules/_shared/object-wrap/the-object-wrap.vue index 02581573f..1f92799e6 100644 --- a/src/modules/_shared/object-wrap/the-object-wrap.vue +++ b/src/modules/_shared/object-wrap/the-object-wrap.vue @@ -11,11 +11,11 @@ diff --git a/src/modules/_shared/permissions-tab/api/PermissionsAPI.js b/src/modules/_shared/permissions-tab/api/PermissionsAPI.js index 3c1c2b88a..a0ca5d362 100644 --- a/src/modules/_shared/permissions-tab/api/PermissionsAPI.js +++ b/src/modules/_shared/permissions-tab/api/PermissionsAPI.js @@ -1,33 +1,32 @@ -import APIPermissionsGetter - from '../../../../app/api/PermissionsAPIService/APIPermissionsGetter'; -import APIPermissionsPatcher - from '../../../../app/api/PermissionsAPIService/APIPermissionsPatcher'; +import APIPermissionsGetter from "../../../../app/api/PermissionsAPIService/APIPermissionsGetter"; +import APIPermissionsPatcher from "../../../../app/api/PermissionsAPIService/APIPermissionsPatcher"; export default class PermissionsAPI { - constructor(url) { - this.url = url; - this._permissionsGetter = new APIPermissionsGetter(url); - this._permissionsPatcher = new APIPermissionsPatcher(url); - } + constructor(url) { + this.url = url; + this._permissionsGetter = new APIPermissionsGetter(url); + this._permissionsPatcher = new APIPermissionsPatcher(url); + } - static getListByUrl = (url) => { - const permissionsGetter = new APIPermissionsGetter(url); - return (params) => permissionsGetter.getList(params); - }; + static getListByUrl = (url) => { + const permissionsGetter = new APIPermissionsGetter(url); + return (params) => permissionsGetter.getList(params); + }; - static patchByUrl = (url) => { - const permissionsPatcher = new APIPermissionsPatcher(url); - return (parentId, changes) => permissionsPatcher.patchItem({ - id: parentId, - changes, - }); - }; + static patchByUrl = (url) => { + const permissionsPatcher = new APIPermissionsPatcher(url); + return (parentId, changes) => + permissionsPatcher.patchItem({ + id: parentId, + changes, + }); + }; - getList(params) { - return this._permissionsGetter.getList(params); - } + getList(params) { + return this._permissionsGetter.getList(params); + } - patch(parentId, changes) { - return this._permissionsPatcher.patchItem({ id: parentId, changes }); - } + patch(parentId, changes) { + return this._permissionsPatcher.patchItem({ id: parentId, changes }); + } } diff --git a/src/modules/_shared/permissions-tab/components/_internals/permissions-role-column.vue b/src/modules/_shared/permissions-tab/components/_internals/permissions-role-column.vue index 7de683b21..1eaa9ddb7 100644 --- a/src/modules/_shared/permissions-tab/components/_internals/permissions-role-column.vue +++ b/src/modules/_shared/permissions-tab/components/_internals/permissions-role-column.vue @@ -9,15 +9,14 @@ diff --git a/src/modules/_shared/permissions-tab/components/_internals/permissions-role-select.vue b/src/modules/_shared/permissions-tab/components/_internals/permissions-role-select.vue index 9dc771b63..ec1115b29 100644 --- a/src/modules/_shared/permissions-tab/components/_internals/permissions-role-select.vue +++ b/src/modules/_shared/permissions-tab/components/_internals/permissions-role-select.vue @@ -28,9 +28,8 @@ diff --git a/src/modules/_shared/permissions-tab/components/permissions-tab-role-popup.vue b/src/modules/_shared/permissions-tab/components/permissions-tab-role-popup.vue index 9b6f22f57..185f9f43b 100644 --- a/src/modules/_shared/permissions-tab/components/permissions-tab-role-popup.vue +++ b/src/modules/_shared/permissions-tab/components/permissions-tab-role-popup.vue @@ -31,14 +31,13 @@ diff --git a/src/modules/_shared/permissions-tab/components/permissions-tab.vue b/src/modules/_shared/permissions-tab/components/permissions-tab.vue index ea4a38e6a..7b128d920 100644 --- a/src/modules/_shared/permissions-tab/components/permissions-tab.vue +++ b/src/modules/_shared/permissions-tab/components/permissions-tab.vue @@ -96,19 +96,18 @@ diff --git a/src/modules/_shared/upload-csv-popup/components/__tests__/upload-csv-popup.spec.js b/src/modules/_shared/upload-csv-popup/components/__tests__/upload-csv-popup.spec.js index cef07e7e6..97769b53d 100644 --- a/src/modules/_shared/upload-csv-popup/components/__tests__/upload-csv-popup.spec.js +++ b/src/modules/_shared/upload-csv-popup/components/__tests__/upload-csv-popup.spec.js @@ -1,15 +1,15 @@ -import { shallowMount } from '@vue/test-utils'; -import UploadCsvPopup from '../upload-csv-popup.vue'; +import { shallowMount } from "@vue/test-utils"; +import UploadCsvPopup from "../upload-csv-popup.vue"; -describe('UploadCsvPopup', () => { - const props = { - file: {}, - }; +describe("UploadCsvPopup", () => { + const props = { + file: {}, + }; - it('renders a component', () => { - const wrapper = shallowMount(UploadCsvPopup, { - props, - }); - expect(wrapper).toBeTruthy(); - }); + it("renders a component", () => { + const wrapper = shallowMount(UploadCsvPopup, { + props, + }); + expect(wrapper).toBeTruthy(); + }); }); diff --git a/src/modules/_shared/upload-csv-popup/components/upload-csv-popup.vue b/src/modules/_shared/upload-csv-popup/components/upload-csv-popup.vue index 3891f8290..81c22fd30 100644 --- a/src/modules/_shared/upload-csv-popup/components/upload-csv-popup.vue +++ b/src/modules/_shared/upload-csv-popup/components/upload-csv-popup.vue @@ -127,17 +127,17 @@ diff --git a/src/modules/_shared/upload-csv-popup/components/upload-csv-preview-popup.vue b/src/modules/_shared/upload-csv-popup/components/upload-csv-preview-popup.vue index 6414d5486..3fc4b8d07 100644 --- a/src/modules/_shared/upload-csv-popup/components/upload-csv-preview-popup.vue +++ b/src/modules/_shared/upload-csv-popup/components/upload-csv-preview-popup.vue @@ -64,25 +64,25 @@ diff --git a/src/modules/_shared/upload-csv-popup/mixins/__tests__/uploadCSVMixin.spec.js b/src/modules/_shared/upload-csv-popup/mixins/__tests__/uploadCSVMixin.spec.js index 2cad4ec63..7687d37a9 100644 --- a/src/modules/_shared/upload-csv-popup/mixins/__tests__/uploadCSVMixin.spec.js +++ b/src/modules/_shared/upload-csv-popup/mixins/__tests__/uploadCSVMixin.spec.js @@ -1,165 +1,165 @@ -import { shallowMount } from '@vue/test-utils'; -import UploadCsvMixin from '../uploadCSVMixin.js'; +import { shallowMount } from "@vue/test-utils"; +import UploadCsvMixin from "../uploadCSVMixin.js"; const Component = { - mixins: [UploadCsvMixin], - render() {}, + mixins: [UploadCsvMixin], + render() {}, }; const makeFile = (content) => { - const blob = new Blob([content], { type: 'text/csv' }); - return new File([blob], 'test.csv', { type: 'text/csv' }); + const blob = new Blob([content], { type: "text/csv" }); + return new File([blob], "test.csv", { type: "text/csv" }); }; -describe('UploadCsvMixin', () => { - it('renders a component with mixin', () => { - const wrapper = shallowMount(Component, { - props: { - file: {}, - }, - }); - expect(wrapper.exists()).toBe(true); - }); - - it('parses and saves simple csv', async () => { - const csv = ` +describe("UploadCsvMixin", () => { + it("renders a component with mixin", () => { + const wrapper = shallowMount(Component, { + props: { + file: {}, + }, + }); + expect(wrapper.exists()).toBe(true); + }); + + it("parses and saves simple csv", async () => { + const csv = ` col1,col2 John,30 Jane,25 - `.replaceAll(/ +?/g, ''); // replace all whitespaces, but not newlines - - const mappings = [ - { name: 'name', csv: 'col1' }, - { name: 'age', csv: 'col2' }, - ]; - - const saveCallback = vi.fn(); - - const wrapper = shallowMount(Component, { - props: { - file: makeFile(csv), - addBulkItems: saveCallback, - mappingFields: mappings, - }, - data: () => ({ skipHeaders: true }), - }); - - // parse file - await new Promise((resolve) => { - setTimeout(resolve, 100); - }); - - await wrapper.vm.processCSV(); - expect(saveCallback).toHaveBeenCalledWith([ - { name: 'John', age: '30' }, - { name: 'Jane', age: '25' }, - ]); - }); - - it('parsing of csv with empty required throws error', async () => { - const csv = ` + `.replaceAll(/ +?/g, ""); // replace all whitespaces, but not newlines + + const mappings = [ + { name: "name", csv: "col1" }, + { name: "age", csv: "col2" }, + ]; + + const saveCallback = vi.fn(); + + const wrapper = shallowMount(Component, { + props: { + file: makeFile(csv), + addBulkItems: saveCallback, + mappingFields: mappings, + }, + data: () => ({ skipHeaders: true }), + }); + + // parse file + await new Promise((resolve) => { + setTimeout(resolve, 100); + }); + + await wrapper.vm.processCSV(); + expect(saveCallback).toHaveBeenCalledWith([ + { name: "John", age: "30" }, + { name: "Jane", age: "25" }, + ]); + }); + + it("parsing of csv with empty required throws error", async () => { + const csv = ` col1,col2 John, Jane,25 - `.replaceAll(/ +?/g, ''); // replace all whitespaces, but not newlines - - const mappings = [ - { name: 'name', csv: 'col1', required: true }, - { name: 'age', csv: 'col2', required: true }, - ]; - - const saveCallback = vi.fn(); - - const wrapper = shallowMount(Component, { - props: { - file: makeFile(csv), - addBulkItems: saveCallback, - mappingFields: mappings, - }, - data: () => ({ skipHeaders: true }), - }); - - // parse file - await new Promise((resolve) => { - setTimeout(resolve, 100); - }); - - try { - await wrapper.vm.processCSV(); - } catch (err) { - expect(err).toBeTruthy(); - } - - expect(saveCallback).not.toHaveBeenCalled(); - }); - - it('parses and saves simple csv', async () => { - const csv = ` + `.replaceAll(/ +?/g, ""); // replace all whitespaces, but not newlines + + const mappings = [ + { name: "name", csv: "col1", required: true }, + { name: "age", csv: "col2", required: true }, + ]; + + const saveCallback = vi.fn(); + + const wrapper = shallowMount(Component, { + props: { + file: makeFile(csv), + addBulkItems: saveCallback, + mappingFields: mappings, + }, + data: () => ({ skipHeaders: true }), + }); + + // parse file + await new Promise((resolve) => { + setTimeout(resolve, 100); + }); + + try { + await wrapper.vm.processCSV(); + } catch (err) { + expect(err).toBeTruthy(); + } + + expect(saveCallback).not.toHaveBeenCalled(); + }); + + it("parses and saves simple csv", async () => { + const csv = ` col1,col2 John,30 Jane,25 - `.replaceAll(/ +?/g, ''); // replace all whitespaces, but not newlines - - const mappings = [ - { name: 'name', csv: 'col1' }, - { name: 'age', csv: 'col2' }, - ]; - - const saveCallback = vi.fn(); - - const wrapper = shallowMount(Component, { - props: { - file: makeFile(csv), - addBulkItems: saveCallback, - mappingFields: mappings, - }, - data: () => ({ skipHeaders: true }), - }); - - // parse file - await new Promise((resolve) => { - setTimeout(resolve, 100); - }); - - await wrapper.vm.processCSV(); - expect(saveCallback).toHaveBeenCalledWith([ - { name: 'John', age: '30' }, - { name: 'Jane', age: '25' }, - ]); - }); - - it('parsing of csv with multiple columns selected to required field', async () => { - const csv = ` + `.replaceAll(/ +?/g, ""); // replace all whitespaces, but not newlines + + const mappings = [ + { name: "name", csv: "col1" }, + { name: "age", csv: "col2" }, + ]; + + const saveCallback = vi.fn(); + + const wrapper = shallowMount(Component, { + props: { + file: makeFile(csv), + addBulkItems: saveCallback, + mappingFields: mappings, + }, + data: () => ({ skipHeaders: true }), + }); + + // parse file + await new Promise((resolve) => { + setTimeout(resolve, 100); + }); + + await wrapper.vm.processCSV(); + expect(saveCallback).toHaveBeenCalledWith([ + { name: "John", age: "30" }, + { name: "Jane", age: "25" }, + ]); + }); + + it("parsing of csv with multiple columns selected to required field", async () => { + const csv = ` col1,col2,col3 John,,30 Jane,25, - `.replaceAll(/ +?/g, ''); // replace all whitespaces, but not newlines - - const mappings = [ - { name: 'name', csv: 'col1', required: true }, - { name: 'age', csv: ['col2', 'col3'], required: true }, - ]; - - const saveCallback = vi.fn(); - - const wrapper = shallowMount(Component, { - props: { - file: makeFile(csv), - addBulkItems: saveCallback, - mappingFields: mappings, - }, - data: () => ({ skipHeaders: true }), - }); - - // parse file - await new Promise((resolve) => { - setTimeout(resolve, 100); - }); - - await wrapper.vm.processCSV(); - expect(saveCallback).toHaveBeenCalledWith([ - { name: 'John', age: ['30'] }, - { name: 'Jane', age: ['25'] }, - ]); - }); + `.replaceAll(/ +?/g, ""); // replace all whitespaces, but not newlines + + const mappings = [ + { name: "name", csv: "col1", required: true }, + { name: "age", csv: ["col2", "col3"], required: true }, + ]; + + const saveCallback = vi.fn(); + + const wrapper = shallowMount(Component, { + props: { + file: makeFile(csv), + addBulkItems: saveCallback, + mappingFields: mappings, + }, + data: () => ({ skipHeaders: true }), + }); + + // parse file + await new Promise((resolve) => { + setTimeout(resolve, 100); + }); + + await wrapper.vm.processCSV(); + expect(saveCallback).toHaveBeenCalledWith([ + { name: "John", age: ["30"] }, + { name: "Jane", age: ["25"] }, + ]); + }); }); diff --git a/src/modules/_shared/upload-csv-popup/mixins/uploadCSVMixin.js b/src/modules/_shared/upload-csv-popup/mixins/uploadCSVMixin.js index 308616e7d..4079efe30 100644 --- a/src/modules/_shared/upload-csv-popup/mixins/uploadCSVMixin.js +++ b/src/modules/_shared/upload-csv-popup/mixins/uploadCSVMixin.js @@ -1,167 +1,173 @@ -import debounce from '@webitel/ui-sdk/src/scripts/debounce'; -import isEmpty from '@webitel/ui-sdk/src/scripts/isEmpty'; -import normalizeCSVData from '../scripts/normalizeCSVData'; -import parseCSV from '../scripts/parseCSV'; -import processFile from '../scripts/processFile'; -import splitAndSaveData from '../scripts/splitAndSaveData'; +import debounce from "@webitel/ui-sdk/src/scripts/debounce"; +import isEmpty from "@webitel/ui-sdk/src/scripts/isEmpty"; +import normalizeCSVData from "../scripts/normalizeCSVData"; +import parseCSV from "../scripts/parseCSV"; +import processFile from "../scripts/processFile"; +import splitAndSaveData from "../scripts/splitAndSaveData"; export default { - props: { - file: { - required: true, - }, - mappingFields: { - type: Array, - description: '[{ name: String, required: Boolean, csv: String, multiple: Boolean }]', - }, - addBulkItems: { - type: Function, - }, - }, - model: { - prop: 'mappingFields', - event: 'changeMappingFields', - }, - data: () => ({ - isReadingFile: false, - isParsingCSV: false, - parsedFile: null, - isParsingPreview: false, - parseErrorStackTrace: '', - csvPreview: [[]], - }), - computed: { - csvValues() { - return this.mappingFields - .filter(field => field.csv) - .map(field => field.csv) - .flat(); - }, - filteredCsvColumns() { - return this.csvColumns.filter(item => this.csvValues.indexOf(item) !== - -1); - }, - csvColumns() { - return this.skipHeaders - ? Object.keys(this.csvPreview[0]) - : Object.keys(this.csvPreview[0]) - .map((col, index) => `${index + 1} column`); - }, - parseCSVOptions() { - /* docs: https://csv.js.org/parse/options/ */ - return { - delimiter: this.separator, - columns: (firstLine) => { - if (this.skipHeaders) return firstLine; - return firstLine.map((item, index) => `${index}`); - }, - // skipLinesWithError: true, - skipEmptyLines: true, - // cast: true, - }; - }, - csvPreviewTableHeaders() { - return this.csvColumns.map((col, index) => ({ - text: col, - value: this.skipHeaders ? col : `${index}`, - })); - }, - filteredCsvPreviewTableHeaders() { - return this.filteredCsvColumns.map((col, index) => ({ - text: col, - value: this.skipHeaders ? col : `${index}`, - })); - }, - csvPreviewTableData() { - return this.csvPreview; - }, - allowSaveAction() { - return this.mappingFields.every((field) => !field.required || - !isEmpty(field.csv)); - }, - }, - methods: { - async initUploadPopup() { - this.isReadingFile = true; + props: { + file: { + required: true, + }, + mappingFields: { + type: Array, + description: + "[{ name: String, required: Boolean, csv: String, multiple: Boolean }]", + }, + addBulkItems: { + type: Function, + }, + }, + model: { + prop: "mappingFields", + event: "changeMappingFields", + }, + data: () => ({ + isReadingFile: false, + isParsingCSV: false, + parsedFile: null, + isParsingPreview: false, + parseErrorStackTrace: "", + csvPreview: [[]], + }), + computed: { + csvValues() { + return this.mappingFields + .filter((field) => field.csv) + .flatMap((field) => field.csv); + }, + filteredCsvColumns() { + return this.csvColumns.filter( + (item) => this.csvValues.indexOf(item) !== -1, + ); + }, + csvColumns() { + return this.skipHeaders + ? Object.keys(this.csvPreview[0]) + : Object.keys(this.csvPreview[0]).map( + (col, index) => `${index + 1} column`, + ); + }, + parseCSVOptions() { + /* docs: https://csv.js.org/parse/options/ */ + return { + delimiter: this.separator, + columns: (firstLine) => { + if (this.skipHeaders) return firstLine; + return firstLine.map((item, index) => `${index}`); + }, + // skipLinesWithError: true, + skipEmptyLines: true, + // cast: true, + }; + }, + csvPreviewTableHeaders() { + return this.csvColumns.map((col, index) => ({ + text: col, + value: this.skipHeaders ? col : `${index}`, + })); + }, + filteredCsvPreviewTableHeaders() { + return this.filteredCsvColumns.map((col, index) => ({ + text: col, + value: this.skipHeaders ? col : `${index}`, + })); + }, + csvPreviewTableData() { + return this.csvPreview; + }, + allowSaveAction() { + return this.mappingFields.every( + (field) => !field.required || !isEmpty(field.csv), + ); + }, + }, + methods: { + async initUploadPopup() { + this.isReadingFile = true; - this.parsedFile = await processFile(this.file, {}); - await this.createCSVPreview(this.parsedFile); + this.parsedFile = await processFile(this.file, {}); + await this.createCSVPreview(this.parsedFile); - this.isReadingFile = false; - }, - async handleParseOptionsChange() { - this.isParsingPreview = true; - await this.createCSVPreview(); - this.resetMappings(); - this.isParsingPreview = false; - }, - async createCSVPreview(file = this.parsedFile) { - try { - this.parseErrorStackTrace = ''; - this.csvPreview = await parseCSV(file, { - ...this.parseCSVOptions, - toLine: 4, - }); - } catch (err) { - this.parseErrorStackTrace = err; - this.csvPreview = [[]]; - } - }, - async processCSV() { - this.isParsingCSV = true; - try { - this.parseErrorStackTrace = ''; + this.isReadingFile = false; + }, + async handleParseOptionsChange() { + this.isParsingPreview = true; + await this.createCSVPreview(); + this.resetMappings(); + this.isParsingPreview = false; + }, + async createCSVPreview(file = this.parsedFile) { + try { + this.parseErrorStackTrace = ""; + this.csvPreview = await parseCSV(file, { + ...this.parseCSVOptions, + toLine: 4, + }); + } catch (err) { + this.parseErrorStackTrace = err; + this.csvPreview = [[]]; + } + }, + async processCSV() { + this.isParsingCSV = true; + try { + this.parseErrorStackTrace = ""; - const sourceData = await parseCSV(this.parsedFile, this.parseCSVOptions); + const sourceData = await parseCSV( + this.parsedFile, + this.parseCSVOptions, + ); - console.info('sourceData', sourceData); + console.info("sourceData", sourceData); - const normalizedData = normalizeCSVData({ - data: sourceData, - mappings: this.mappingFields, - }); + const normalizedData = normalizeCSVData({ + data: sourceData, + mappings: this.mappingFields, + }); - console.info('normalizedData', normalizedData); + console.info("normalizedData", normalizedData); - await splitAndSaveData({ - data: normalizedData, - saveCallback: this.addBulkItems, - }); + await splitAndSaveData({ + data: normalizedData, + saveCallback: this.addBulkItems, + }); - this.close(); - } catch (err) { - this.parseErrorStackTrace = err; - throw err; - } finally { - this.isParsingCSV = false; - } - }, - resetMappings() { - // reset previously selected values - const mappingFields = this.mappingFields.map((field) => ({ - ...field, - csv: field.multiple ? [] : '', - })); - this.$emit('changeMappingFields', mappingFields); - }, - handleSave() { - this.$emit('save'); - return this.processCSV(); - }, - close() { - this.$emit('close'); - }, - }, - watch: { - async skipHeaders() { - await this.handleParseOptionsChange(); - }, - async separator() { - await this.handleParseOptionsChange(); - }, - }, - created() { - this.initUploadPopup(); - this.handleParseOptionsChange = debounce(this.handleParseOptionsChange); - }, + this.close(); + } catch (err) { + this.parseErrorStackTrace = err; + throw err; + } finally { + this.isParsingCSV = false; + } + }, + resetMappings() { + // reset previously selected values + const mappingFields = this.mappingFields.map((field) => ({ + ...field, + csv: field.multiple ? [] : "", + })); + this.$emit("changeMappingFields", mappingFields); + }, + handleSave() { + this.$emit("save"); + return this.processCSV(); + }, + close() { + this.$emit("close"); + }, + }, + watch: { + async skipHeaders() { + await this.handleParseOptionsChange(); + }, + async separator() { + await this.handleParseOptionsChange(); + }, + }, + created() { + this.initUploadPopup(); + this.handleParseOptionsChange = debounce(this.handleParseOptionsChange); + }, }; diff --git a/src/modules/_shared/upload-csv-popup/mixins/uploadCSVWrapperComponentMixin.js b/src/modules/_shared/upload-csv-popup/mixins/uploadCSVWrapperComponentMixin.js index 5834e43ad..06143f77c 100644 --- a/src/modules/_shared/upload-csv-popup/mixins/uploadCSVWrapperComponentMixin.js +++ b/src/modules/_shared/upload-csv-popup/mixins/uploadCSVWrapperComponentMixin.js @@ -1,18 +1,18 @@ -import UploadCsvPopup from '../components/upload-csv-popup.vue'; +import UploadCsvPopup from "../components/upload-csv-popup.vue"; export default { - components: { UploadCsvPopup }, - props: { - file: { - required: true, - }, - }, - data: () => ({ - mappingFields: [], - }), - methods: { - close() { - this.$emit('close'); - }, - }, + components: { UploadCsvPopup }, + props: { + file: { + required: true, + }, + }, + data: () => ({ + mappingFields: [], + }), + methods: { + close() { + this.$emit("close"); + }, + }, }; diff --git a/src/modules/_shared/upload-csv-popup/scripts/__tests__/normalizeCSVData.spec.js b/src/modules/_shared/upload-csv-popup/scripts/__tests__/normalizeCSVData.spec.js index 7f88e0832..ee9bee7a6 100644 --- a/src/modules/_shared/upload-csv-popup/scripts/__tests__/normalizeCSVData.spec.js +++ b/src/modules/_shared/upload-csv-popup/scripts/__tests__/normalizeCSVData.spec.js @@ -1,89 +1,89 @@ -import normalizeCSVData from '../normalizeCSVData'; +import normalizeCSVData from "../normalizeCSVData"; -describe('normalizeCSVData', () => { - const mappings = [ - { - // webitel field name - name: 'name', - // csv column name - csv: 'col1', - // is this webitel field required? - required: true, - // ui - locale: '', - }, - { - name: 'phone', - csv: ['col2', 'col3'], - required: true, - }, - ]; +describe("normalizeCSVData", () => { + const mappings = [ + { + // webitel field name + name: "name", + // csv column name + csv: "col1", + // is this webitel field required? + required: true, + // ui + locale: "", + }, + { + name: "phone", + csv: ["col2", "col3"], + required: true, + }, + ]; - it('normalizes simple data', () => { - const input = [ - { - col1: 'John', - col2: '123', - col3: '456', - }, - { - col1: 'Jane', - col2: '789', - col3: '012', - }, - ]; - const result = normalizeCSVData({ data: input, mappings }); - const output = [ - { name: 'John', phone: ['123', '456'] }, - { name: 'Jane', phone: ['789', '012'] }, - ]; - expect(result).toEqual(output); - }); + it("normalizes simple data", () => { + const input = [ + { + col1: "John", + col2: "123", + col3: "456", + }, + { + col1: "Jane", + col2: "789", + col3: "012", + }, + ]; + const result = normalizeCSVData({ data: input, mappings }); + const output = [ + { name: "John", phone: ["123", "456"] }, + { name: "Jane", phone: ["789", "012"] }, + ]; + expect(result).toEqual(output); + }); - it('throws an error at normalizing data with required (!) empty value', () => { - const input = [ - { - col1: '', - col2: '123', - col3: '3424', - }, - { - col1: 'name', - col2: '131312', - col3: '012', - }, - ]; - try { - normalizeCSVData({ data: input, mappings }); - } catch (err) { - expect(err).toBeTruthy(); - return; - } - expect(false).toBe(true); // reject test if no error - }); + it("throws an error at normalizing data with required (!) empty value", () => { + const input = [ + { + col1: "", + col2: "123", + col3: "3424", + }, + { + col1: "name", + col2: "131312", + col3: "012", + }, + ]; + try { + normalizeCSVData({ data: input, mappings }); + } catch (err) { + expect(err).toBeTruthy(); + return; + } + expect(false).toBe(true); // reject test if no error + }); - it(`succeeds at normalizing data with multiple columns selected to required field, + it(`succeeds at normalizing data with multiple columns selected to required field, if one of them is empty`, () => { - const input = [ - { - col1: 'name', - col2: '123', - col3: '', - }, - { - col1: 'name', - col2: '123', - col3: '012', - }, - ]; + const input = [ + { + col1: "name", + col2: "123", + col3: "", + }, + { + col1: "name", + col2: "123", + col3: "012", + }, + ]; - const result = normalizeCSVData({ data: input, mappings }); + const result = normalizeCSVData({ data: input, mappings }); - const output = [ - { name: 'name', phone: ['123'] }, - { name: 'name', phone: ['123', '012'] }, - ]; + const output = [ + { name: "name", phone: ["123"] }, + { name: "name", phone: ["123", "012"] }, + ]; - expect(result).toEqual(output); - }); + expect(result).toEqual(output); + }); }); diff --git a/src/modules/_shared/upload-csv-popup/scripts/normalizeCSVData.js b/src/modules/_shared/upload-csv-popup/scripts/normalizeCSVData.js index 8cb0c89f7..3271226bf 100644 --- a/src/modules/_shared/upload-csv-popup/scripts/normalizeCSVData.js +++ b/src/modules/_shared/upload-csv-popup/scripts/normalizeCSVData.js @@ -1,4 +1,4 @@ -import isEmpty from '@webitel/ui-sdk/src/scripts/isEmpty'; +import isEmpty from "@webitel/ui-sdk/src/scripts/isEmpty"; /** * @@ -17,47 +17,52 @@ import isEmpty from '@webitel/ui-sdk/src/scripts/isEmpty'; * } */ const normalizeCSVData = ({ data, mappings }) => { - const nonEmptyMappingFields = mappings.filter((field) => !isEmpty(field.csv)); - return data.map((dataItem, index) => { - const normalized = nonEmptyMappingFields.reduce(( - normalizedItem, - { name, csv, required }, - ) => { - return { - ...normalizedItem, - [name]: { - required, - value: Array.isArray(csv) - ? csv.map((csv) => dataItem[csv]) - : dataItem[csv], - }, - }; - }, {}); + const nonEmptyMappingFields = mappings.filter((field) => !isEmpty(field.csv)); + return data.map((dataItem, index) => { + const normalized = nonEmptyMappingFields.reduce( + (normalizedItem, { name, csv, required }) => { + return { + ...normalizedItem, + [name]: { + required, + value: Array.isArray(csv) + ? csv.map((csv) => dataItem[csv]) + : dataItem[csv], + }, + }; + }, + {}, + ); - const filteredEmptyValues = Object.entries(normalized) - .reduce((filtered, [name, { required, value }]) => { - let filteredValue; - if (Array.isArray(value)) { - filteredValue = value.filter((item) => !isEmpty(item)); - } else { - filteredValue = value; - } + const filteredEmptyValues = Object.entries(normalized).reduce( + (filtered, [name, { required, value }]) => { + let filteredValue; + if (Array.isArray(value)) { + filteredValue = value.filter((item) => !isEmpty(item)); + } else { + filteredValue = value; + } - const isValueEmpty = isEmpty(filteredValue); + const isValueEmpty = isEmpty(filteredValue); - if (required && isValueEmpty) { - throw new Error(`Required field is empty: ${name} on row ${index + - 1}`); - } + if (required && isValueEmpty) { + throw new Error( + `Required field is empty: ${name} on row ${index + 1}`, + ); + } - return isValueEmpty ? filtered : { - ...filtered, - [name]: filteredValue, - }; - }, {}); + return isValueEmpty + ? filtered + : { + ...filtered, + [name]: filteredValue, + }; + }, + {}, + ); - return filteredEmptyValues; - }); + return filteredEmptyValues; + }); }; export default normalizeCSVData; diff --git a/src/modules/_shared/upload-csv-popup/scripts/parseCSV.js b/src/modules/_shared/upload-csv-popup/scripts/parseCSV.js index 07e0e488e..9323bfc67 100644 --- a/src/modules/_shared/upload-csv-popup/scripts/parseCSV.js +++ b/src/modules/_shared/upload-csv-popup/scripts/parseCSV.js @@ -1,13 +1,12 @@ -import { parse } from 'csv-parse'; +import { parse } from "csv-parse"; -const parseCSV = (csvStr, options = {}) => ( - new Promise((resolve, reject) => { - const callback = (err, output) => { - if (output) resolve(output, err); - reject(err); - }; - parse(csvStr, options, callback); - }) -); +const parseCSV = (csvStr, options = {}) => + new Promise((resolve, reject) => { + const callback = (err, output) => { + if (output) resolve(output, err); + reject(err); + }; + parse(csvStr, options, callback); + }); export default parseCSV; diff --git a/src/modules/_shared/upload-csv-popup/scripts/processFile.js b/src/modules/_shared/upload-csv-popup/scripts/processFile.js index 0e33628ff..fe25047d3 100644 --- a/src/modules/_shared/upload-csv-popup/scripts/processFile.js +++ b/src/modules/_shared/upload-csv-popup/scripts/processFile.js @@ -1,13 +1,12 @@ -const processFile = (file, { charset = 'utf-8' } = {}) => ( - new Promise((resolve, reject) => { - const reader = new FileReader(); - reader.addEventListener('load', (e) => { - const loadedFile = e.target.result; - resolve(loadedFile); - }); - reader.addEventListener('error', (e) => reject(e)); - reader.readAsText(file, charset); - }) -); +const processFile = (file, { charset = "utf-8" } = {}) => + new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.addEventListener("load", (e) => { + const loadedFile = e.target.result; + resolve(loadedFile); + }); + reader.addEventListener("error", (e) => reject(e)); + reader.readAsText(file, charset); + }); export default processFile; diff --git a/src/modules/_shared/upload-csv-popup/scripts/splitAndSaveData.js b/src/modules/_shared/upload-csv-popup/scripts/splitAndSaveData.js index 82664e313..f6f809e07 100644 --- a/src/modules/_shared/upload-csv-popup/scripts/splitAndSaveData.js +++ b/src/modules/_shared/upload-csv-popup/scripts/splitAndSaveData.js @@ -1,24 +1,26 @@ const splitAndSaveData = async ({ data, saveCallback }) => { - const chunkSize = 100; - const chunksCount = Math.ceil(data.length / chunkSize); - let processedChunkIndex = 1; - try { - for (; processedChunkIndex <= chunksCount; processedChunkIndex += 1) { - // eslint-disable-next-line no-await-in-loop - await saveCallback(data.slice( - (processedChunkIndex - 1) * chunkSize, - processedChunkIndex * chunkSize, - )); - } - } catch (err) { - const errMessage = JSON.stringify(err instanceof Error - ? err.message - : err); - // eslint-disable-next-line no-throw-literal - throw new Error(`An error occurred during saving ${(processedChunkIndex - - 1) * chunkSize}-${processedChunkIndex * - chunkSize} data chunk: ${errMessage}`); - } + const chunkSize = 100; + const chunksCount = Math.ceil(data.length / chunkSize); + let processedChunkIndex = 1; + try { + for (; processedChunkIndex <= chunksCount; processedChunkIndex += 1) { + // eslint-disable-next-line no-await-in-loop + await saveCallback( + data.slice( + (processedChunkIndex - 1) * chunkSize, + processedChunkIndex * chunkSize, + ), + ); + } + } catch (err) { + const errMessage = JSON.stringify(err instanceof Error ? err.message : err); + // eslint-disable-next-line no-throw-literal + throw new Error( + `An error occurred during saving ${ + (processedChunkIndex - 1) * chunkSize + }-${processedChunkIndex * chunkSize} data chunk: ${errMessage}`, + ); + } }; export default splitAndSaveData; diff --git a/src/modules/appearance/store/appearance.js b/src/modules/appearance/store/appearance.js index 685b38408..48fda4497 100644 --- a/src/modules/appearance/store/appearance.js +++ b/src/modules/appearance/store/appearance.js @@ -1,4 +1,3 @@ -import AppearanceStoreModule - from '@webitel/ui-sdk/src/modules/Appearance/store/AppearanceStoreModule'; +import AppearanceStoreModule from "@webitel/ui-sdk/src/modules/Appearance/store/AppearanceStoreModule"; export default new AppearanceStoreModule().getModule(); diff --git a/src/modules/application-hub/components/application-hub.vue b/src/modules/application-hub/components/application-hub.vue index 8677945ab..61ff75cc5 100644 --- a/src/modules/application-hub/components/application-hub.vue +++ b/src/modules/application-hub/components/application-hub.vue @@ -51,149 +51,162 @@ diff --git a/src/modules/contact-center/mixins/agentStatusMixin.js b/src/modules/contact-center/mixins/agentStatusMixin.js index fb26bc146..dd3876199 100644 --- a/src/modules/contact-center/mixins/agentStatusMixin.js +++ b/src/modules/contact-center/mixins/agentStatusMixin.js @@ -1,20 +1,20 @@ export default { - computed: { - statusIndicatorColor() { - return { - online: 'success', - pause: 'primary', - offline: 'disabled', - breakOut: 'secondary', - }; - }, - statusIndicatorText() { - return { - online: this.$t('objects.ccenter.agents.status.online'), - pause: this.$t('objects.ccenter.agents.status.pause'), - offline: this.$t('objects.ccenter.agents.status.offline'), - breakOut: this.$t('objects.ccenter.agents.status.breakOut'), - }; - }, - }, + computed: { + statusIndicatorColor() { + return { + online: "success", + pause: "primary", + offline: "disabled", + breakOut: "secondary", + }; + }, + statusIndicatorText() { + return { + online: this.$t("objects.ccenter.agents.status.online"), + pause: this.$t("objects.ccenter.agents.status.pause"), + offline: this.$t("objects.ccenter.agents.status.offline"), + breakOut: this.$t("objects.ccenter.agents.status.breakOut"), + }; + }, + }, }; diff --git a/src/modules/contact-center/mixins/agentSupervisorsAndSkillsPopupMixin.js b/src/modules/contact-center/mixins/agentSupervisorsAndSkillsPopupMixin.js index fc99593ad..473c4ea53 100644 --- a/src/modules/contact-center/mixins/agentSupervisorsAndSkillsPopupMixin.js +++ b/src/modules/contact-center/mixins/agentSupervisorsAndSkillsPopupMixin.js @@ -1,46 +1,50 @@ export default { - data: () => ({ - openedItemId: null, // "selected" id object list popup - isSupervisorPopup: false, // object list popup - isSkillsPopup: false, // object list popup - }), - computed: { - openedItemSupervisors() { - return this.$store.getters[`${this.namespace}/${this.subNamespace}/GET_ITEM_PROP_BY_ID`](this.openedItemId, 'supervisor'); - }, - openedItemSupervisorHeaders() { - return [{ value: 'name', text: this.$t('reusable.name') }]; - }, - openedItemSkills() { - return this.$store.getters[`${this.namespace}/${this.subNamespace}/GET_ITEM_PROP_BY_ID`](this.openedItemId, 'skills'); - }, - openedItemSkillsHeaders() { - return [{ value: 'name', text: this.$t('reusable.name') }]; - }, - }, - methods: { - readSupervisor(item) { - this.openedItemId = item.id; - this.openSupervisorPopup(); - }, - openSupervisorPopup() { - this.isSupervisorPopup = true; - }, - closeSupervisorPopup() { - this.isSupervisorPopup = false; - this.openedItemId = null; - }, + data: () => ({ + openedItemId: null, // "selected" id object list popup + isSupervisorPopup: false, // object list popup + isSkillsPopup: false, // object list popup + }), + computed: { + openedItemSupervisors() { + return this.$store.getters[ + `${this.namespace}/${this.subNamespace}/GET_ITEM_PROP_BY_ID` + ](this.openedItemId, "supervisor"); + }, + openedItemSupervisorHeaders() { + return [{ value: "name", text: this.$t("reusable.name") }]; + }, + openedItemSkills() { + return this.$store.getters[ + `${this.namespace}/${this.subNamespace}/GET_ITEM_PROP_BY_ID` + ](this.openedItemId, "skills"); + }, + openedItemSkillsHeaders() { + return [{ value: "name", text: this.$t("reusable.name") }]; + }, + }, + methods: { + readSupervisor(item) { + this.openedItemId = item.id; + this.openSupervisorPopup(); + }, + openSupervisorPopup() { + this.isSupervisorPopup = true; + }, + closeSupervisorPopup() { + this.isSupervisorPopup = false; + this.openedItemId = null; + }, - readSkills(item) { - this.openedItemId = item.id; - this.openSkillsPopup(); - }, - openSkillsPopup() { - this.isSkillsPopup = true; - }, - closeSkillsPopup() { - this.isSkillsPopup = false; - this.openedItemId = null; - }, - }, + readSkills(item) { + this.openedItemId = item.id; + this.openSkillsPopup(); + }, + openSkillsPopup() { + this.isSkillsPopup = true; + }, + closeSkillsPopup() { + this.isSkillsPopup = false; + this.openedItemId = null; + }, + }, }; diff --git a/src/modules/contact-center/modules/agents/api/agents.js b/src/modules/contact-center/modules/agents/api/agents.js index 90650a098..38d2950bb 100644 --- a/src/modules/contact-center/modules/agents/api/agents.js +++ b/src/modules/contact-center/modules/agents/api/agents.js @@ -1,289 +1,264 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import convertDuration from '@webitel/ui-sdk/src/scripts/convertDuration'; -import { AgentServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../app/api/instance'; -import configuration from '../../../../../app/api/openAPIConfig'; + camelToSnake, + merge, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import convertDuration from "@webitel/ui-sdk/src/scripts/convertDuration"; +import { AgentServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../app/api/instance"; +import configuration from "../../../../../app/api/openAPIConfig"; -const agentService = new AgentServiceApiFactory(configuration, '', instance); +const agentService = new AgentServiceApiFactory(configuration, "", instance); const convertStatusDuration = (value) => { - if (value > 60 * 60 * 24) return '>24:00:00'; - return convertDuration(value); + if (value > 60 * 60 * 24) return ">24:00:00"; + return convertDuration(value); }; const getAgentsList = async (params) => { - const listResponseHandler = (items) => { - return items.map((item) => ({ - ...item, - statusDuration: convertStatusDuration(item.statusDuration), - })); - }; + const listResponseHandler = (items) => { + return items.map((item) => ({ + ...item, + statusDuration: convertStatusDuration(item.statusDuration), + })); + }; - const { - page, - size, - search, - sort, - fields, - id, - team, - skill, - isSupervisor, - isNotSupervisor, - notTeamId, - supervisorId, - notSkillId, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { + page, + size, + search, + sort, + fields, + id, + team, + skill, + isSupervisor, + isNotSupervisor, + notTeamId, + supervisorId, + notSkillId, + } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); - try { - const response = await agentService.searchAgent( - page, - size, - search, - sort, - fields, - id, - undefined, - supervisorId, - team, - undefined, - undefined, - isSupervisor, - skill, - undefined, - isNotSupervisor, - undefined, - undefined, - notTeamId, - notSkillId, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - listResponseHandler, - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await agentService.searchAgent( + page, + size, + search, + sort, + fields, + id, + undefined, + supervisorId, + team, + undefined, + undefined, + isSupervisor, + skill, + undefined, + isNotSupervisor, + undefined, + undefined, + notTeamId, + notSkillId, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [listResponseHandler]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getAgent = async ({ itemId: id }) => { - const defaultObject = { - user: {}, - team: {}, - supervisor: [], - auditor: [], - region: {}, - progressiveCount: 0, - chatCount: 0, - taskCount: 0, - isSupervisor: false, - description: '', - greetingMedia: {}, - }; + const defaultObject = { + user: {}, + team: {}, + supervisor: [], + auditor: [], + region: {}, + progressiveCount: 0, + chatCount: 0, + taskCount: 0, + isSupervisor: false, + description: "", + greetingMedia: {}, + }; - try { - const response = await agentService.readAgent(id); - return applyTransform(response.data, [ - snakeToCamel(), - merge(defaultObject), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await agentService.readAgent(id); + return applyTransform(response.data, [ + snakeToCamel(), + merge(defaultObject), + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const fieldsToSend = [ - 'user', - 'team', - 'supervisor', - 'auditor', - 'region', - 'greetingMedia', - 'progressiveCount', - 'chatCount', - 'taskCount', - 'isSupervisor', + "user", + "team", + "supervisor", + "auditor", + "region", + "greetingMedia", + "progressiveCount", + "chatCount", + "taskCount", + "isSupervisor", ]; const addAgent = async ({ itemInstance }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await agentService.createAgent(item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await agentService.createAgent(item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patchAgent = async ({ changes, id }) => { - const body = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await agentService.patchAgent(id, body); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const body = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await agentService.patchAgent(id, body); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateAgent = async ({ itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await agentService.updateAgent(id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await agentService.updateAgent(id, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteAgent = async ({ id }) => { - try { - const response = await agentService.deleteAgent(id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await agentService.deleteAgent(id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -const getAgentsLookup = (params) => getAgentsList({ - ...params, - fields: params.fields || ['id', 'name'], -}); +const getAgentsLookup = (params) => + getAgentsList({ + ...params, + fields: params.fields || ["id", "name"], + }); const getAgentHistory = async (params) => { - const { - parentId, - from, - to, - page, - size, - sort = '-joined_at', - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { + parentId, + from, + to, + page, + size, + sort = "-joined_at", + } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); - try { - const response = await agentService.searchAgentStateHistory( - page, size, from, to, parentId, sort, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await agentService.searchAgentStateHistory( + page, + size, + from, + to, + parentId, + sort, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getAgentUsersOptions = async (params) => { - const { - page, - size, - search, - sort, - fields, - id, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { page, size, search, sort, fields, id } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); - try { - const response = await agentService.searchLookupUsersAgentNotExists( - page, - size, - search, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await agentService.searchLookupUsersAgentNotExists( + page, + size, + search, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getSupervisorOptions = async (params) => { - const isSupervisor = true; - return getAgentsList({ ...params, isSupervisor }); + const isSupervisor = true; + return getAgentsList({ ...params, isSupervisor }); }; const getRegularAgentsOptions = async (params) => { - const isNotSupervisor = true; - return getAgentsList({ ...params, isNotSupervisor }); + const isNotSupervisor = true; + return getAgentsList({ ...params, isNotSupervisor }); }; const AgentsAPI = { - getList: getAgentsList, - get: getAgent, - add: addAgent, - patch: patchAgent, - update: updateAgent, - delete: deleteAgent, - getLookup: getAgentsLookup, + getList: getAgentsList, + get: getAgent, + add: addAgent, + patch: patchAgent, + update: updateAgent, + delete: deleteAgent, + getLookup: getAgentsLookup, - getAgentHistory, - getRegularAgentsOptions, - getAgentUsersOptions, - getSupervisorOptions, + getAgentHistory, + getRegularAgentsOptions, + getAgentUsersOptions, + getSupervisorOptions, }; export default AgentsAPI; diff --git a/src/modules/contact-center/modules/agents/components/agent-history-popup.vue b/src/modules/contact-center/modules/agents/components/agent-history-popup.vue index 545a9f4bb..1ceb06013 100644 --- a/src/modules/contact-center/modules/agents/components/agent-history-popup.vue +++ b/src/modules/contact-center/modules/agents/components/agent-history-popup.vue @@ -86,48 +86,59 @@ diff --git a/src/modules/contact-center/modules/agents/components/opened-agent-general.vue b/src/modules/contact-center/modules/agents/components/opened-agent-general.vue index 4de1337ff..8f2095866 100644 --- a/src/modules/contact-center/modules/agents/components/opened-agent-general.vue +++ b/src/modules/contact-center/modules/agents/components/opened-agent-general.vue @@ -99,37 +99,36 @@ diff --git a/src/modules/contact-center/modules/agents/components/opened-agent.vue b/src/modules/contact-center/modules/agents/components/opened-agent.vue index ed9369c86..5c859eb73 100644 --- a/src/modules/contact-center/modules/agents/components/opened-agent.vue +++ b/src/modules/contact-center/modules/agents/components/opened-agent.vue @@ -35,86 +35,88 @@ diff --git a/src/modules/contact-center/modules/agents/components/the-agents.vue b/src/modules/contact-center/modules/agents/components/the-agents.vue index bedf55a94..03982058a 100644 --- a/src/modules/contact-center/modules/agents/components/the-agents.vue +++ b/src/modules/contact-center/modules/agents/components/the-agents.vue @@ -134,87 +134,88 @@ diff --git a/src/modules/contact-center/modules/agents/dictionaries/agentState.dictionary.js b/src/modules/contact-center/modules/agents/dictionaries/agentState.dictionary.js index 54d544344..0fc5e1864 100644 --- a/src/modules/contact-center/modules/agents/dictionaries/agentState.dictionary.js +++ b/src/modules/contact-center/modules/agents/dictionaries/agentState.dictionary.js @@ -1,23 +1,23 @@ -import { AgentStatus, ChannelState, ChannelType } from 'webitel-sdk'; +import { AgentStatus, ChannelState, ChannelType } from "webitel-sdk"; const agentState = Object.freeze({ - [AgentStatus.Online]: 'objects.agent.status.online', - [AgentStatus.Offline]: 'objects.agent.status.offline', - [AgentStatus.Pause]: 'objects.agent.status.pause', - [AgentStatus.BreakOut]: 'objects.agent.status.breakOut', - [ChannelState.Waiting]: 'channel.state.waiting', - [ChannelState.Distribute]: 'channel.state.distribute', - [ChannelState.Offering]: 'channel.state.offering', - [ChannelState.Answered]: 'channel.state.answered', - [ChannelState.Active]: 'channel.state.active', - [ChannelState.Bridged]: 'channel.state.bridged', - [ChannelState.Hold]: 'channel.state.bridged', - [ChannelState.Missed]: 'channel.state.hold', - [ChannelState.WrapTime]: 'channel.state.wrapTime', - [ChannelState.Processing]: 'channel.state.processing', - [ChannelState.Transfer]: 'channel.state.transfer', - [ChannelType.Call]: 'channel.type.call', - [ChannelType.Email]: 'channel.type.email', - [ChannelType.Chat]: 'channel.type.chat', + [AgentStatus.Online]: "objects.agent.status.online", + [AgentStatus.Offline]: "objects.agent.status.offline", + [AgentStatus.Pause]: "objects.agent.status.pause", + [AgentStatus.BreakOut]: "objects.agent.status.breakOut", + [ChannelState.Waiting]: "channel.state.waiting", + [ChannelState.Distribute]: "channel.state.distribute", + [ChannelState.Offering]: "channel.state.offering", + [ChannelState.Answered]: "channel.state.answered", + [ChannelState.Active]: "channel.state.active", + [ChannelState.Bridged]: "channel.state.bridged", + [ChannelState.Hold]: "channel.state.bridged", + [ChannelState.Missed]: "channel.state.hold", + [ChannelState.WrapTime]: "channel.state.wrapTime", + [ChannelState.Processing]: "channel.state.processing", + [ChannelState.Transfer]: "channel.state.transfer", + [ChannelType.Call]: "channel.type.call", + [ChannelType.Email]: "channel.type.email", + [ChannelType.Chat]: "channel.type.chat", }); export default agentState; diff --git a/src/modules/contact-center/modules/agents/modules/queues/api/agentQueues.js b/src/modules/contact-center/modules/agents/modules/queues/api/agentQueues.js index 725efdd88..a86166b50 100644 --- a/src/modules/contact-center/modules/agents/modules/queues/api/agentQueues.js +++ b/src/modules/contact-center/modules/agents/modules/queues/api/agentQueues.js @@ -1,70 +1,57 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - merge, - mergeEach, - notify, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { AgentServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; + merge, + mergeEach, + notify, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { AgentServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; -const agentService = new AgentServiceApiFactory(configuration, '', instance); +const agentService = new AgentServiceApiFactory(configuration, "", instance); const getAgentQueuesList = async (params) => { - const defaultObject = { - countMembers: 0, - waitingMembers: 0, - type: 0, - }; + const defaultObject = { + countMembers: 0, + waitingMembers: 0, + type: 0, + }; - const { - parentId, - page, - size, - search, - sort, - fields, - id, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { parentId, page, size, search, sort, fields, id } = applyTransform( + params, + [merge(getDefaultGetParams()), starToSearch("search")], + ); - try { - const response = await agentService.searchAgentInQueue( - parentId, - page, - size, - search, - sort, - fields, - id, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await agentService.searchAgentInQueue( + parentId, + page, + size, + search, + sort, + fields, + id, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const AgentQueuesAPI = { - getList: getAgentQueuesList, + getList: getAgentQueuesList, }; export default AgentQueuesAPI; diff --git a/src/modules/contact-center/modules/agents/modules/queues/components/opened-agent-queues.vue b/src/modules/contact-center/modules/agents/modules/queues/components/opened-agent-queues.vue index c95836ef4..70ebcb60c 100644 --- a/src/modules/contact-center/modules/agents/modules/queues/components/opened-agent-queues.vue +++ b/src/modules/contact-center/modules/agents/modules/queues/components/opened-agent-queues.vue @@ -62,17 +62,16 @@ diff --git a/src/modules/contact-center/modules/agents/modules/queues/store/_internals/headers.js b/src/modules/contact-center/modules/agents/modules/queues/store/_internals/headers.js index 358e31755..81c6ea59f 100644 --- a/src/modules/contact-center/modules/agents/modules/queues/store/_internals/headers.js +++ b/src/modules/contact-center/modules/agents/modules/queues/store/_internals/headers.js @@ -1,34 +1,34 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: ['objects.ccenter.queues.queues', 2], - field: 'queue', - sort: SortSymbols.NONE, - }, - { - value: 'type', - locale: 'objects.ccenter.queues.type', - field: 'type', - sort: SortSymbols.NONE, - }, - { - value: 'count', - locale: ['objects.ccenter.queues.members', 2], - field: 'count_members', - sort: SortSymbols.NONE, - }, - { - value: 'waiting', - locale: 'objects.ccenter.queues.waiting', - field: 'waiting_members', - sort: SortSymbols.NONE, - }, - { - value: 'strategy', - locale: 'objects.ccenter.queues.strategy', - field: 'strategy', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: ["objects.ccenter.queues.queues", 2], + field: "queue", + sort: SortSymbols.NONE, + }, + { + value: "type", + locale: "objects.ccenter.queues.type", + field: "type", + sort: SortSymbols.NONE, + }, + { + value: "count", + locale: ["objects.ccenter.queues.members", 2], + field: "count_members", + sort: SortSymbols.NONE, + }, + { + value: "waiting", + locale: "objects.ccenter.queues.waiting", + field: "waiting_members", + sort: SortSymbols.NONE, + }, + { + value: "strategy", + locale: "objects.ccenter.queues.strategy", + field: "strategy", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/agents/modules/queues/store/agent-queues.js b/src/modules/contact-center/modules/agents/modules/queues/store/agent-queues.js index 4e858cd8d..78d58a739 100644 --- a/src/modules/contact-center/modules/agents/modules/queues/store/agent-queues.js +++ b/src/modules/contact-center/modules/agents/modules/queues/store/agent-queues.js @@ -1,11 +1,10 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import AgentQueuesAPI from '../api/agentQueues'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import AgentQueuesAPI from "../api/agentQueues"; +import headers from "./_internals/headers"; const agentQueues = new NestedObjectStoreModule({ headers }) -.attachAPIModule(AgentQueuesAPI) -.generateAPIActions() -.getModule(); + .attachAPIModule(AgentQueuesAPI) + .generateAPIActions() + .getModule(); export default agentQueues; diff --git a/src/modules/contact-center/modules/agents/modules/skills/api/agentSkills.js b/src/modules/contact-center/modules/agents/modules/skills/api/agentSkills.js index b9bd71dd2..7f71f48fc 100644 --- a/src/modules/contact-center/modules/agents/modules/skills/api/agentSkills.js +++ b/src/modules/contact-center/modules/agents/modules/skills/api/agentSkills.js @@ -1,159 +1,135 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { AgentSkillServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; - -const agentSkillService = new AgentSkillServiceApiFactory(configuration, '', instance); + camelToSnake, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { AgentSkillServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; + +const agentSkillService = new AgentSkillServiceApiFactory( + configuration, + "", + instance, +); const defaultObject = { - skill: {}, - capacity: 0, - enabled: false, + skill: {}, + capacity: 0, + enabled: false, }; const getAgentSkillsList = async (params) => { - const { - parentId, - page, - size, - search, - sort, - fields, - id, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); - - try { - const response = await agentSkillService.searchAgentSkill( - parentId, - page, - size, - search, - sort, - fields, - id, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const { parentId, page, size, search, sort, fields, id } = applyTransform( + params, + [merge(getDefaultGetParams()), starToSearch("search")], + ); + + try { + const response = await agentSkillService.searchAgentSkill( + parentId, + page, + size, + search, + sort, + fields, + id, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getAgentSkill = async ({ parentId, itemId: id }) => { - try { - const response = await agentSkillService.readAgentSkill(parentId, id); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await agentSkillService.readAgentSkill(parentId, id); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -const fieldsToSend = ['capacity', 'agentId', 'skill', 'enabled']; +const fieldsToSend = ["capacity", "agentId", "skill", "enabled"]; const addAgentSkill = async ({ parentId, itemInstance }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await agentSkillService.createAgentSkill(parentId, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await agentSkillService.createAgentSkill(parentId, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patchAgentSkill = async ({ parentId, id, changes }) => { - const item = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await agentSkillService.patchAgentSkill(parentId, id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await agentSkillService.patchAgentSkill( + parentId, + id, + item, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateAgentSkill = async ({ parentId, itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await agentSkillService.updateAgentSkill(parentId, id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await agentSkillService.updateAgentSkill( + parentId, + id, + item, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteAgentSkill = async ({ parentId, id }) => { - try { - const response = await agentSkillService.deleteAgentSkill(parentId, id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await agentSkillService.deleteAgentSkill(parentId, id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const AgentSkillsAPI = { - getList: getAgentSkillsList, - get: getAgentSkill, - add: addAgentSkill, - patch: patchAgentSkill, - update: updateAgentSkill, - delete: deleteAgentSkill, + getList: getAgentSkillsList, + get: getAgentSkill, + add: addAgentSkill, + patch: patchAgentSkill, + update: updateAgentSkill, + delete: deleteAgentSkill, }; export default AgentSkillsAPI; diff --git a/src/modules/contact-center/modules/agents/modules/skills/components/opened-agent-skills-popup.vue b/src/modules/contact-center/modules/agents/modules/skills/components/opened-agent-skills-popup.vue index aa18ac864..a2739d5f9 100644 --- a/src/modules/contact-center/modules/agents/modules/skills/components/opened-agent-skills-popup.vue +++ b/src/modules/contact-center/modules/agents/modules/skills/components/opened-agent-skills-popup.vue @@ -48,38 +48,38 @@ diff --git a/src/modules/contact-center/modules/agents/modules/skills/components/opened-agent-skills.vue b/src/modules/contact-center/modules/agents/modules/skills/components/opened-agent-skills.vue index e14f76e38..281bdf10f 100644 --- a/src/modules/contact-center/modules/agents/modules/skills/components/opened-agent-skills.vue +++ b/src/modules/contact-center/modules/agents/modules/skills/components/opened-agent-skills.vue @@ -98,42 +98,47 @@ diff --git a/src/modules/contact-center/modules/agents/modules/skills/store/_internals/headers.js b/src/modules/contact-center/modules/agents/modules/skills/store/_internals/headers.js index f0b865d11..ec3c5a731 100644 --- a/src/modules/contact-center/modules/agents/modules/skills/store/_internals/headers.js +++ b/src/modules/contact-center/modules/agents/modules/skills/store/_internals/headers.js @@ -1,22 +1,22 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: ['objects.lookups.skills.skills', 2], - field: 'skill', - sort: SortSymbols.NONE, - }, - { - value: 'capacity', - locale: 'objects.lookups.skills.capacity', - field: 'capacity', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'objects.lookups.skills.state', - field: 'enabled', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: ["objects.lookups.skills.skills", 2], + field: "skill", + sort: SortSymbols.NONE, + }, + { + value: "capacity", + locale: "objects.lookups.skills.capacity", + field: "capacity", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "objects.lookups.skills.state", + field: "enabled", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/agents/modules/skills/store/agent-skills.js b/src/modules/contact-center/modules/agents/modules/skills/store/agent-skills.js index 010c6b384..d9ada5bad 100644 --- a/src/modules/contact-center/modules/agents/modules/skills/store/agent-skills.js +++ b/src/modules/contact-center/modules/agents/modules/skills/store/agent-skills.js @@ -1,22 +1,21 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import AgentSkillAPI from '../api/agentSkills'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import AgentSkillAPI from "../api/agentSkills"; +import headers from "./_internals/headers"; const resettableItemState = { - itemInstance: { - skill: '', - capacity: 10, - enabled: true, - }, + itemInstance: { + skill: "", + capacity: 10, + enabled: true, + }, }; const agentSkills = new NestedObjectStoreModule({ - resettableItemState, - headers, + resettableItemState, + headers, }) -.attachAPIModule(AgentSkillAPI) -.generateAPIActions() -.getModule(); + .attachAPIModule(AgentSkillAPI) + .generateAPIActions() + .getModule(); export default agentSkills; diff --git a/src/modules/contact-center/modules/agents/modules/subordinates/api/agentSubordinates.js b/src/modules/contact-center/modules/agents/modules/subordinates/api/agentSubordinates.js index 5f8101fa0..401ba4505 100644 --- a/src/modules/contact-center/modules/agents/modules/subordinates/api/agentSubordinates.js +++ b/src/modules/contact-center/modules/agents/modules/subordinates/api/agentSubordinates.js @@ -1,79 +1,81 @@ import applyTransform, { - notify, - snakeToCamel, -} from '@webitel/ui-sdk/src/api/transformers'; -import { AgentServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; -import AgentsAPI from '../../../api/agents'; + notify, + snakeToCamel, +} from "@webitel/ui-sdk/src/api/transformers"; +import { AgentServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; +import AgentsAPI from "../../../api/agents"; -const subordinateService = new AgentServiceApiFactory(configuration, '', instance); +const subordinateService = new AgentServiceApiFactory( + configuration, + "", + instance, +); export const getAgentSubordinatesList = (params) => { - const cleanedParams = { - ...params, - fields: ['id', 'name', 'supervisor', 'skills'], - supervisorId: params.parentId, - }; - delete cleanedParams.parentId; - return AgentsAPI.getList(cleanedParams); + const cleanedParams = { + ...params, + fields: ["id", "name", "supervisor", "skills"], + supervisorId: params.parentId, + }; + cleanedParams.parentId = undefined; + return AgentsAPI.getList(cleanedParams); }; export const getAgentSubordinate = async ({ itemId: id }) => { - const subordinateGetterResponseHandler = (agent) => ({ agent }); + const subordinateGetterResponseHandler = (agent) => ({ agent }); - try { - const response = await subordinateService.readAgent(id); - return applyTransform(response.data, [ - snakeToCamel(), - subordinateGetterResponseHandler, - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await subordinateService.readAgent(id); + return applyTransform(response.data, [ + snakeToCamel(), + subordinateGetterResponseHandler, + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; export const addAgentSubordinate = ({ parentId, itemInstance }) => { - const { id, supervisor } = itemInstance.agent; - // Set and .map() from obj to string and backwards is used to prevent duplicates - const newSupervisor = [ - ...new Set(supervisor.map((sup) => sup.id).concat(parentId)), - ].map((id) => ({ id })); - const changes = { supervisor: newSupervisor }; - return AgentsAPI.patch({ id, changes }); + const { id, supervisor } = itemInstance.agent; + // Set and .map() from obj to string and backwards is used to prevent duplicates + const newSupervisor = [ + ...new Set(supervisor.map((sup) => sup.id).concat(parentId)), + ].map((id) => ({ id })); + const changes = { supervisor: newSupervisor }; + return AgentsAPI.patch({ id, changes }); }; export const deleteAgentSubordinate = ({ id, parentId, dataList }) => { - /* deleted subordinate is in dataList, + /* deleted subordinate is in dataList, so first we should find it and retrieve his supervisors list */ - const subordinate = dataList.find((sup) => sup.id === id); - const newSupervisor = subordinate.supervisor.filter(({ id }) => id !== - parentId); - const changes = { supervisor: newSupervisor }; - return AgentsAPI.patch({ id, changes }); + const subordinate = dataList.find((sup) => sup.id === id); + const newSupervisor = subordinate.supervisor.filter( + ({ id }) => id !== parentId, + ); + const changes = { supervisor: newSupervisor }; + return AgentsAPI.patch({ id, changes }); }; export const updateAgentSubordinate = async ({ - parentId, - itemId, - itemInstance, - dataList, - }) => { - try { - await addAgentSubordinate({ parentId, itemInstance }); - await deleteAgentSubordinate({ id: itemId, parentId, dataList }); - } catch (err) { - throw err; - } + parentId, + itemId, + itemInstance, + dataList, +}) => { + try { + await addAgentSubordinate({ parentId, itemInstance }); + await deleteAgentSubordinate({ id: itemId, parentId, dataList }); + } catch (err) { + throw err; + } }; const AgentSubordinatesAPI = { - getList: getAgentSubordinatesList, - get: getAgentSubordinate, - add: addAgentSubordinate, - update: updateAgentSubordinate, - delete: deleteAgentSubordinate, + getList: getAgentSubordinatesList, + get: getAgentSubordinate, + add: addAgentSubordinate, + update: updateAgentSubordinate, + delete: deleteAgentSubordinate, }; export default AgentSubordinatesAPI; diff --git a/src/modules/contact-center/modules/agents/modules/subordinates/components/opened-agent-subordinates-popup.vue b/src/modules/contact-center/modules/agents/modules/subordinates/components/opened-agent-subordinates-popup.vue index 965fc9c64..501623721 100644 --- a/src/modules/contact-center/modules/agents/modules/subordinates/components/opened-agent-subordinates-popup.vue +++ b/src/modules/contact-center/modules/agents/modules/subordinates/components/opened-agent-subordinates-popup.vue @@ -38,38 +38,41 @@ diff --git a/src/modules/contact-center/modules/agents/modules/subordinates/components/opened-agent-subordinates.vue b/src/modules/contact-center/modules/agents/modules/subordinates/components/opened-agent-subordinates.vue index 17b7c4779..2fa9981d4 100644 --- a/src/modules/contact-center/modules/agents/modules/subordinates/components/opened-agent-subordinates.vue +++ b/src/modules/contact-center/modules/agents/modules/subordinates/components/opened-agent-subordinates.vue @@ -117,44 +117,46 @@ diff --git a/src/modules/contact-center/modules/agents/modules/subordinates/store/_internals/headers.js b/src/modules/contact-center/modules/agents/modules/subordinates/store/_internals/headers.js index c6bbb54bf..54617167b 100644 --- a/src/modules/contact-center/modules/agents/modules/subordinates/store/_internals/headers.js +++ b/src/modules/contact-center/modules/agents/modules/subordinates/store/_internals/headers.js @@ -1,22 +1,22 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'supervisor', - locale: ['objects.ccenter.agents.supervisors', 1], - field: 'supervisor', - sort: SortSymbols.NONE, - }, - { - value: 'skills', - locale: ['objects.lookups.skills.skills', 2], - field: 'skills', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "supervisor", + locale: ["objects.ccenter.agents.supervisors", 1], + field: "supervisor", + sort: SortSymbols.NONE, + }, + { + value: "skills", + locale: ["objects.lookups.skills.skills", 2], + field: "skills", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/agents/modules/subordinates/store/agent-subordinates.js b/src/modules/contact-center/modules/agents/modules/subordinates/store/agent-subordinates.js index 901ec2dcc..85019f16f 100644 --- a/src/modules/contact-center/modules/agents/modules/subordinates/store/agent-subordinates.js +++ b/src/modules/contact-center/modules/agents/modules/subordinates/store/agent-subordinates.js @@ -1,20 +1,19 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import AgentSubordinatesAPI from '../api/agentSubordinates'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import AgentSubordinatesAPI from "../api/agentSubordinates"; +import headers from "./_internals/headers"; const resettableItemState = { - itemInstance: { - agent: {}, - }, + itemInstance: { + agent: {}, + }, }; const agentSubordinates = new NestedObjectStoreModule({ - resettableItemState, - headers, + resettableItemState, + headers, }) -.attachAPIModule(AgentSubordinatesAPI) -.generateAPIActions() -.getModule(); + .attachAPIModule(AgentSubordinatesAPI) + .generateAPIActions() + .getModule(); export default agentSubordinates; diff --git a/src/modules/contact-center/modules/agents/store/_internals/headers.js b/src/modules/contact-center/modules/agents/store/_internals/headers.js index 4b4f7e22e..a1430d8db 100644 --- a/src/modules/contact-center/modules/agents/store/_internals/headers.js +++ b/src/modules/contact-center/modules/agents/store/_internals/headers.js @@ -1,28 +1,28 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'objects.ccenter.agents.state', - field: 'status', - sort: SortSymbols.NONE, - }, - { - value: 'time', - locale: 'objects.ccenter.agents.stateTime', - field: 'status_duration', - sort: SortSymbols.NONE, - }, - { - value: 'team', - locale: ['objects.ccenter.teams.teams', 1], - field: 'team', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "objects.ccenter.agents.state", + field: "status", + sort: SortSymbols.NONE, + }, + { + value: "time", + locale: "objects.ccenter.agents.stateTime", + field: "status_duration", + sort: SortSymbols.NONE, + }, + { + value: "team", + locale: ["objects.ccenter.teams.teams", 1], + field: "team", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/agents/store/agents.js b/src/modules/contact-center/modules/agents/store/agents.js index 76fd626b0..fda7ffdfa 100644 --- a/src/modules/contact-center/modules/agents/store/agents.js +++ b/src/modules/contact-center/modules/agents/store/agents.js @@ -1,54 +1,59 @@ -import HistoryStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/HistoryStoreModule/HistoryStoreModule'; -import ObjectStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -import PermissionsStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule'; -import AgentsAPI from '../api/agents'; -import queues from '../modules/queues/store/agent-queues'; -import skills from '../modules/skills/store/agent-skills'; -import subordinates from '../modules/subordinates/store/agent-subordinates'; -import headers from './_internals/headers'; +import HistoryStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/HistoryStoreModule/HistoryStoreModule"; +import ObjectStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule"; +import PermissionsStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule"; +import AgentsAPI from "../api/agents"; +import queues from "../modules/queues/store/agent-queues"; +import skills from "../modules/skills/store/agent-skills"; +import subordinates from "../modules/subordinates/store/agent-subordinates"; +import headers from "./_internals/headers"; const resettableState = { - itemInstance: { - user: {}, - team: {}, - supervisor: [], - auditor: [], - region: {}, - progressiveCount: 1, - chatCount: 1, - taskCount: 1, - isSupervisor: false, - greetingMedia: {}, - }, + itemInstance: { + user: {}, + team: {}, + supervisor: [], + auditor: [], + region: {}, + progressiveCount: 1, + chatCount: 1, + taskCount: 1, + isSupervisor: false, + greetingMedia: {}, + }, }; const actions = { - RESET_ITEM_STATE: async (context) => { - context.commit('RESET_ITEM_STATE'); - context.dispatch('ccenter/agents/queues/RESET_STATE', {}, { root: true }); - context.dispatch('ccenter/agents/skills/RESET_STATE', {}, { root: true }); - context.dispatch('ccenter/agents/subordinates/RESET_STATE', {}, { root: true }); - }, + RESET_ITEM_STATE: async (context) => { + context.commit("RESET_ITEM_STATE"); + context.dispatch("ccenter/agents/queues/RESET_STATE", {}, { root: true }); + context.dispatch("ccenter/agents/skills/RESET_STATE", {}, { root: true }); + context.dispatch( + "ccenter/agents/subordinates/RESET_STATE", + {}, + { root: true }, + ); + }, }; -const PERMISSIONS_API_URL = '/call_center/agents'; +const PERMISSIONS_API_URL = "/call_center/agents"; const permissions = new PermissionsStoreModule() -.generateAPIActions(PERMISSIONS_API_URL) -.getModule(); + .generateAPIActions(PERMISSIONS_API_URL) + .getModule(); const history = new HistoryStoreModule() -.generateGetListAction(AgentsAPI.getAgentHistory) -.getModule(); + .generateGetListAction(AgentsAPI.getAgentHistory) + .getModule(); const agents = new ObjectStoreModule({ resettableState, headers }) -.attachAPIModule(AgentsAPI) -.generateAPIActions() -.setChildModules({ - history, skills, queues, subordinates, permissions, -}) -.getModule({ actions }); + .attachAPIModule(AgentsAPI) + .generateAPIActions() + .setChildModules({ + history, + skills, + queues, + subordinates, + permissions, + }) + .getModule({ actions }); export default agents; diff --git a/src/modules/contact-center/modules/queues/api/queues.js b/src/modules/contact-center/modules/queues/api/queues.js index 69cda3673..4b6f14894 100644 --- a/src/modules/contact-center/modules/queues/api/queues.js +++ b/src/modules/contact-center/modules/queues/api/queues.js @@ -1,272 +1,234 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import isEmpty from '@webitel/ui-sdk/src/scripts/isEmpty'; -import deepCopy from 'deep-copy'; -import { QueueServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../app/api/instance'; -import configuration from '../../../../../app/api/openAPIConfig'; -import processing from '../store/_internals/queueSchema/defaults/processing'; - -const queueService = new QueueServiceApiFactory(configuration, '', instance); - -const doNotConvertKeys = ['variables']; + camelToSnake, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import isEmpty from "@webitel/ui-sdk/src/scripts/isEmpty"; +import deepCopy from "deep-copy"; +import { QueueServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../app/api/instance"; +import configuration from "../../../../../app/api/openAPIConfig"; +import processing from "../store/_internals/queueSchema/defaults/processing"; + +const queueService = new QueueServiceApiFactory(configuration, "", instance); + +const doNotConvertKeys = ["variables"]; const fieldsToSend = [ - 'name', - 'type', - 'strategy', - 'team', - 'priority', - 'dncList', - 'schema', - 'payload', - 'taskProcessing', - 'maxOfRetry', - 'timeout', - 'secBetweenRetries', - 'variables', - 'calendar', - 'description', - 'enabled', - 'ringtone', - 'doSchema', - 'afterSchema', - 'stickyAgent', - 'grantee', - 'tags', + "name", + "type", + "strategy", + "team", + "priority", + "dncList", + "schema", + "payload", + "taskProcessing", + "maxOfRetry", + "timeout", + "secBetweenRetries", + "variables", + "calendar", + "description", + "enabled", + "ringtone", + "doSchema", + "afterSchema", + "stickyAgent", + "grantee", + "tags", ]; const preRequestHandler = (item) => { - const copy = deepCopy(item); - copy.variables = copy.variables.reduce((variables, variable) => { - if (!variable.key) return variables; - return { ...variables, [variable.key]: variable.value }; - }, {}); - return copy; + const copy = deepCopy(item); + copy.variables = copy.variables.reduce((variables, variable) => { + if (!variable.key) return variables; + return { ...variables, [variable.key]: variable.value }; + }, {}); + return copy; }; const getQueuesList = async (params) => { - const defaultObject = { - type: 0, - enabled: false, - active: 0, - waiting: 0, - priority: '0', - }; - - const { - page, - size, - search, - sort, - fields, - id, - queueType, - team, - tags, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); - - try { - const response = await queueService.searchQueue( - page, - size, - search, - sort, - fields, - id, - queueType, - team, - tags, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const defaultObject = { + type: 0, + enabled: false, + active: 0, + waiting: 0, + priority: "0", + }; + + const { page, size, search, sort, fields, id, queueType, team, tags } = + applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); + + try { + const response = await queueService.searchQueue( + page, + size, + search, + sort, + fields, + id, + queueType, + team, + tags, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(doNotConvertKeys), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getQueue = async ({ itemId: id }) => { - const defaultObject = { - tags: [], - type: 0, - formSchema: {}, - taskProcessing: {}, - }; - const responseHandler = (item) => { - const copy = deepCopy(item); - try { - if (copy.variables) { - copy.variables = Object.keys(copy.variables) - .map((key) => ({ - key, - value: copy.variables[key], - })); - } - if (isEmpty(copy.taskProcessing)) { - copy.taskProcessing = processing({ - enabled: !!copy.processing, - formSchema: copy.formSchema, - sec: copy.processingSec || 0, - renewalSec: copy.processingRenewalSec || 0, - }); - } - return copy; - } catch (err) { - throw err; - } - }; - try { - const response = await queueService.readQueue(id); - return applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - merge(defaultObject), - responseHandler, - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const defaultObject = { + tags: [], + type: 0, + formSchema: {}, + taskProcessing: {}, + }; + const responseHandler = (item) => { + const copy = deepCopy(item); + try { + if (copy.variables) { + copy.variables = Object.keys(copy.variables).map((key) => ({ + key, + value: copy.variables[key], + })); + } + if (isEmpty(copy.taskProcessing)) { + copy.taskProcessing = processing({ + enabled: !!copy.processing, + formSchema: copy.formSchema, + sec: copy.processingSec || 0, + renewalSec: copy.processingRenewalSec || 0, + }); + } + return copy; + } catch (err) { + throw err; + } + }; + try { + const response = await queueService.readQueue(id); + return applyTransform(response.data, [ + snakeToCamel(doNotConvertKeys), + merge(defaultObject), + responseHandler, + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addQueue = async ({ itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(doNotConvertKeys), - ]); - try { - const response = await queueService.createQueue(item); - return applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(doNotConvertKeys), + ]); + try { + const response = await queueService.createQueue(item); + return applyTransform(response.data, [snakeToCamel(doNotConvertKeys)]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateQueue = async ({ itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(doNotConvertKeys), - ]); - try { - const response = await queueService.updateQueue(id, item); - return applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(doNotConvertKeys), + ]); + try { + const response = await queueService.updateQueue(id, item); + return applyTransform(response.data, [snakeToCamel(doNotConvertKeys)]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patchQueue = async ({ id, changes }) => { - const item = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(doNotConvertKeys), - ]); - try { - const response = await queueService.patchQueue(id, item); - return applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(doNotConvertKeys), + ]); + try { + const response = await queueService.patchQueue(id, item); + return applyTransform(response.data, [snakeToCamel(doNotConvertKeys)]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteQueue = async ({ id }) => { - try { - const response = await queueService.deleteQueue(id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await queueService.deleteQueue(id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -const getQueuesLookup = (params) => getQueuesList({ - ...params, - fields: params.fields || ['id', 'name', 'type'], -}); +const getQueuesLookup = (params) => + getQueuesList({ + ...params, + fields: params.fields || ["id", "name", "type"], + }); const getQueuesTags = async (params) => { - const { - page, - size, - search, - sort, - fields, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch(), - camelToSnake(doNotConvertKeys), - ]); - try { - const response = await queueService.searchQueueTags( - page, - size, - search, - sort, - fields, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const { page, size, search, sort, fields } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch(), + camelToSnake(doNotConvertKeys), + ]); + try { + const response = await queueService.searchQueueTags( + page, + size, + search, + sort, + fields, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(doNotConvertKeys), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const QueuesAPI = { - getList: getQueuesList, - get: getQueue, - add: addQueue, - patch: patchQueue, - update: updateQueue, - delete: deleteQueue, - getLookup: getQueuesLookup, - getQueuesTags, + getList: getQueuesList, + get: getQueue, + add: addQueue, + patch: patchQueue, + update: updateQueue, + delete: deleteQueue, + getLookup: getQueuesLookup, + getQueuesTags, }; export default QueuesAPI; diff --git a/src/modules/contact-center/modules/queues/components/__tests__/create-queue-popup.spec.js b/src/modules/contact-center/modules/queues/components/__tests__/create-queue-popup.spec.js index c517b4d6e..c13c28578 100644 --- a/src/modules/contact-center/modules/queues/components/__tests__/create-queue-popup.spec.js +++ b/src/modules/contact-center/modules/queues/components/__tests__/create-queue-popup.spec.js @@ -1,9 +1,9 @@ -import { shallowMount } from '@vue/test-utils'; -import CreateQueuePopup from '../create-queue-popup.vue'; +import { shallowMount } from "@vue/test-utils"; +import CreateQueuePopup from "../create-queue-popup.vue"; -describe('CreateQueuePopup', () => { - it('renders a component', () => { - const wrapper = shallowMount(CreateQueuePopup, {}); - expect(wrapper.exists()).toBe(true); - }); +describe("CreateQueuePopup", () => { + it("renders a component", () => { + const wrapper = shallowMount(CreateQueuePopup, {}); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/modules/contact-center/modules/queues/components/__tests__/opened-queue-general.spec.js b/src/modules/contact-center/modules/queues/components/__tests__/opened-queue-general.spec.js index 4164417e1..76760f8a3 100644 --- a/src/modules/contact-center/modules/queues/components/__tests__/opened-queue-general.spec.js +++ b/src/modules/contact-center/modules/queues/components/__tests__/opened-queue-general.spec.js @@ -1,24 +1,26 @@ -import { shallowMount } from '@vue/test-utils'; -import deepmerge from 'deepmerge'; -import OpenedTabComponentMixinMock - from '../../../../../../../tests/unit/mocks/mixinMocks/openedTabComponentMixin.mock'; -import OpenedQueueGeneral from '../opened-queue-general.vue'; +import { shallowMount } from "@vue/test-utils"; +import deepmerge from "deepmerge"; +import OpenedTabComponentMixinMock from "../../../../../../../tests/unit/mocks/mixinMocks/openedTabComponentMixin.mock"; +import OpenedQueueGeneral from "../opened-queue-general.vue"; -describe('OpenedQueueGeneral', () => { - const computed = { - itemInstance: () => ({ - type: 1, - }), - specificControls: () => ({}), - }; +describe("OpenedQueueGeneral", () => { + const computed = { + itemInstance: () => ({ + type: 1, + }), + specificControls: () => ({}), + }; - it('renders a component', () => { - const wrapper = shallowMount(OpenedQueueGeneral, deepmerge.all([ - OpenedTabComponentMixinMock(), - { - computed, - }, - ])); - expect(wrapper.exists()).toBe(true); - }); + it("renders a component", () => { + const wrapper = shallowMount( + OpenedQueueGeneral, + deepmerge.all([ + OpenedTabComponentMixinMock(), + { + computed, + }, + ]), + ); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/modules/contact-center/modules/queues/components/__tests__/opened-queue-params.spec.js b/src/modules/contact-center/modules/queues/components/__tests__/opened-queue-params.spec.js index 5d472a3bb..6b0920f81 100644 --- a/src/modules/contact-center/modules/queues/components/__tests__/opened-queue-params.spec.js +++ b/src/modules/contact-center/modules/queues/components/__tests__/opened-queue-params.spec.js @@ -1,34 +1,34 @@ -import { shallowMount } from '@vue/test-utils'; -import OpenedQueueParams from '../opened-queue-params.vue'; +import { shallowMount } from "@vue/test-utils"; +import OpenedQueueParams from "../opened-queue-params.vue"; -describe('OpenedQueueParams', () => { - const props = { - v: { - itemInstance: { - payload: {}, - }, - }, - }; - const computed = { - itemInstance: () => ({ - type: 1, - payload: {}, - }), - specificControls: () => ({}), - }; +describe("OpenedQueueParams", () => { + const props = { + v: { + itemInstance: { + payload: {}, + }, + }, + }; + const computed = { + itemInstance: () => ({ + type: 1, + payload: {}, + }), + specificControls: () => ({}), + }; - it('renders a component', () => { - const wrapper = shallowMount(OpenedQueueParams, { - computed, - props, - global: { - mocks: { - $route: { - name: 'vi', - }, - }, - }, - }); - expect(wrapper.exists()).toBe(true); - }); + it("renders a component", () => { + const wrapper = shallowMount(OpenedQueueParams, { + computed, + props, + global: { + mocks: { + $route: { + name: "vi", + }, + }, + }, + }); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/modules/contact-center/modules/queues/components/__tests__/opened-queue.spec.js b/src/modules/contact-center/modules/queues/components/__tests__/opened-queue.spec.js index 72e72f18d..960ae1838 100644 --- a/src/modules/contact-center/modules/queues/components/__tests__/opened-queue.spec.js +++ b/src/modules/contact-center/modules/queues/components/__tests__/opened-queue.spec.js @@ -1,17 +1,16 @@ -import { shallowMount } from '@vue/test-utils'; -import deepmerge from 'deepmerge'; -import openedObjectMixinMock - from '../../../../../../../tests/unit/mocks/mixinMocks/openedObjectMixin.mock'; -import OpenedQueue from '../opened-queue.vue'; +import { shallowMount } from "@vue/test-utils"; +import deepmerge from "deepmerge"; +import openedObjectMixinMock from "../../../../../../../tests/unit/mocks/mixinMocks/openedObjectMixin.mock"; +import OpenedQueue from "../opened-queue.vue"; -describe('OpenedQueue', () => { - it('renders a component', () => { - const mock = vi.fn(); - vi.spyOn(OpenedQueue.methods, 'loadPageData').mockImplementation(mock); - const wrapper = shallowMount(OpenedQueue, deepmerge.all([ - openedObjectMixinMock(), - {}, - ])); - expect(wrapper.exists()).toBe(true); - }); +describe("OpenedQueue", () => { + it("renders a component", () => { + const mock = vi.fn(); + vi.spyOn(OpenedQueue.methods, "loadPageData").mockImplementation(mock); + const wrapper = shallowMount( + OpenedQueue, + deepmerge.all([openedObjectMixinMock(), {}]), + ); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/modules/contact-center/modules/queues/components/__tests__/the-queues.spec.js b/src/modules/contact-center/modules/queues/components/__tests__/the-queues.spec.js index 5537ff1bc..6daa312b3 100644 --- a/src/modules/contact-center/modules/queues/components/__tests__/the-queues.spec.js +++ b/src/modules/contact-center/modules/queues/components/__tests__/the-queues.spec.js @@ -1,16 +1,17 @@ -import { shallowMount } from '@vue/test-utils'; -import { reactive } from 'vue'; -import tableComponentComputedMock - from '../../../../../../../tests/unit/mocks/tableComponentComputed.mock'; -import { useDummy } from '../../../../../../app/composables/useDummy'; -import TheQueues from '../the-queues.vue'; +import { shallowMount } from "@vue/test-utils"; +import { reactive } from "vue"; +import tableComponentComputedMock from "../../../../../../../tests/unit/mocks/tableComponentComputed.mock"; +import { useDummy } from "../../../../../../app/composables/useDummy"; +import TheQueues from "../the-queues.vue"; -vi.mock('../../../../../../app/composables/useDummy'); +vi.mock("../../../../../../app/composables/useDummy"); useDummy.mockImplementation(() => ({ store: reactive({}) })); -describe('TheQueues', () => { - it('renders a component', () => { - const wrapper = shallowMount(TheQueues, { computed: tableComponentComputedMock() }); - expect(wrapper.exists()).toBe(true); - }); +describe("TheQueues", () => { + it("renders a component", () => { + const wrapper = shallowMount(TheQueues, { + computed: tableComponentComputedMock(), + }); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/modules/contact-center/modules/queues/components/create-queue-popup.vue b/src/modules/contact-center/modules/queues/components/create-queue-popup.vue index dc2fbe3d3..59545ebae 100644 --- a/src/modules/contact-center/modules/queues/components/create-queue-popup.vue +++ b/src/modules/contact-center/modules/queues/components/create-queue-popup.vue @@ -9,38 +9,41 @@ diff --git a/src/modules/contact-center/modules/queues/components/opened-queue-general.vue b/src/modules/contact-center/modules/queues/components/opened-queue-general.vue index 3b44f1545..36812018a 100644 --- a/src/modules/contact-center/modules/queues/components/opened-queue-general.vue +++ b/src/modules/contact-center/modules/queues/components/opened-queue-general.vue @@ -140,73 +140,78 @@ diff --git a/src/modules/contact-center/modules/queues/components/opened-queue-params.vue b/src/modules/contact-center/modules/queues/components/opened-queue-params.vue index e8bf1a7e5..ad825b19d 100644 --- a/src/modules/contact-center/modules/queues/components/opened-queue-params.vue +++ b/src/modules/contact-center/modules/queues/components/opened-queue-params.vue @@ -289,72 +289,76 @@ diff --git a/src/modules/contact-center/modules/queues/components/opened-queue-processing.vue b/src/modules/contact-center/modules/queues/components/opened-queue-processing.vue index 3dd4fe7ed..f851d63a3 100644 --- a/src/modules/contact-center/modules/queues/components/opened-queue-processing.vue +++ b/src/modules/contact-center/modules/queues/components/opened-queue-processing.vue @@ -46,38 +46,45 @@ diff --git a/src/modules/contact-center/modules/queues/components/opened-queue.vue b/src/modules/contact-center/modules/queues/components/opened-queue.vue index ccfd75afe..52f9f782b 100644 --- a/src/modules/contact-center/modules/queues/components/opened-queue.vue +++ b/src/modules/contact-center/modules/queues/components/opened-queue.vue @@ -47,284 +47,312 @@ diff --git a/src/modules/contact-center/modules/queues/components/shared/amd/opened-queue-amd.vue b/src/modules/contact-center/modules/queues/components/shared/amd/opened-queue-amd.vue index 12303b84b..5cc331a1a 100644 --- a/src/modules/contact-center/modules/queues/components/shared/amd/opened-queue-amd.vue +++ b/src/modules/contact-center/modules/queues/components/shared/amd/opened-queue-amd.vue @@ -127,30 +127,29 @@ diff --git a/src/modules/contact-center/modules/queues/components/shared/variables/opened-queue-variables.vue b/src/modules/contact-center/modules/queues/components/shared/variables/opened-queue-variables.vue index e6d222666..14ed81337 100644 --- a/src/modules/contact-center/modules/queues/components/shared/variables/opened-queue-variables.vue +++ b/src/modules/contact-center/modules/queues/components/shared/variables/opened-queue-variables.vue @@ -42,14 +42,13 @@ diff --git a/src/modules/contact-center/modules/queues/components/the-queues.vue b/src/modules/contact-center/modules/queues/components/the-queues.vue index 97268e22e..18758f276 100644 --- a/src/modules/contact-center/modules/queues/components/the-queues.vue +++ b/src/modules/contact-center/modules/queues/components/the-queues.vue @@ -169,95 +169,98 @@ diff --git a/src/modules/contact-center/modules/queues/enums/AmdAiLabels.enum.js b/src/modules/contact-center/modules/queues/enums/AmdAiLabels.enum.js index ce87eed37..5482a2351 100644 --- a/src/modules/contact-center/modules/queues/enums/AmdAiLabels.enum.js +++ b/src/modules/contact-center/modules/queues/enums/AmdAiLabels.enum.js @@ -1,8 +1,8 @@ const AmdAiLabels = Object.freeze([ - 'human', - 'silence', - 'ringback', - 'voicemail', + "human", + "silence", + "ringback", + "voicemail", ]); export default AmdAiLabels; diff --git a/src/modules/contact-center/modules/queues/lookups/QueueTypeProperties.lookup.js b/src/modules/contact-center/modules/queues/lookups/QueueTypeProperties.lookup.js index 8f274aab9..82861998d 100644 --- a/src/modules/contact-center/modules/queues/lookups/QueueTypeProperties.lookup.js +++ b/src/modules/contact-center/modules/queues/lookups/QueueTypeProperties.lookup.js @@ -1,265 +1,265 @@ -import { QueueType } from 'webitel-sdk/esm2015/enums'; +import { QueueType } from "webitel-sdk/esm2015/enums"; -const baseLocale = 'objects.ccenter.queues'; +const baseLocale = "objects.ccenter.queues"; const QueueTypeProperties = Object.freeze({ - [QueueType.OFFLINE_QUEUE]: { - locale: baseLocale.concat('.offlineQueue'), - subpath: 'offline-queue', - controls: [ - // general specific - 'strategy', - 'team', - 'doSchema', - 'afterSchema', - 'grantee', - // params specific - 'originateTimeout', - 'waitBetweenRetries', - 'maxAttempts', - 'recordings', - 'perNumbers', - 'minOnlineAgents', + [QueueType.OFFLINE_QUEUE]: { + locale: baseLocale.concat(".offlineQueue"), + subpath: "offline-queue", + controls: [ + // general specific + "strategy", + "team", + "doSchema", + "afterSchema", + "grantee", + // params specific + "originateTimeout", + "waitBetweenRetries", + "maxAttempts", + "recordings", + "perNumbers", + "minOnlineAgents", - // processing specific - 'taskProcessing.enabled', - 'taskProcessing.formSchema', - 'taskProcessing.sec', - 'taskProcessing.renewalSec', - ], - }, - [QueueType.INBOUND_QUEUE]: { - locale: baseLocale.concat('.inboundQueue'), - subpath: 'inbound-queue', - controls: [ - // general specific - 'team', - 'ringtone', - 'grantee', + // processing specific + "taskProcessing.enabled", + "taskProcessing.formSchema", + "taskProcessing.sec", + "taskProcessing.renewalSec", + ], + }, + [QueueType.INBOUND_QUEUE]: { + locale: baseLocale.concat(".inboundQueue"), + subpath: "inbound-queue", + controls: [ + // general specific + "team", + "ringtone", + "grantee", - // params specific - 'maxWaitTime', - 'maxWaitingSize', - 'discardAbandonedAfter', - 'allowGreetingAgent', - 'stickyAgent', - 'stickyAgentSec', - 'autoAnswerTone', - 'minOnlineAgents', - 'manualDistribution', + // params specific + "maxWaitTime", + "maxWaitingSize", + "discardAbandonedAfter", + "allowGreetingAgent", + "stickyAgent", + "stickyAgentSec", + "autoAnswerTone", + "minOnlineAgents", + "manualDistribution", - // processing specific - 'taskProcessing.enabled', - 'taskProcessing.formSchema', - 'taskProcessing.sec', - 'taskProcessing.renewalSec', - ], - }, - [QueueType.OUTBOUND_IVR_QUEUE]: { - locale: baseLocale.concat('.outboundIVRQueue'), - subpath: 'outbound-ivr-queue', - controls: [ - // general specific - 'strategy', - 'schema', - 'doSchema', - 'afterSchema', - 'grantee', + // processing specific + "taskProcessing.enabled", + "taskProcessing.formSchema", + "taskProcessing.sec", + "taskProcessing.renewalSec", + ], + }, + [QueueType.OUTBOUND_IVR_QUEUE]: { + locale: baseLocale.concat(".outboundIVRQueue"), + subpath: "outbound-ivr-queue", + controls: [ + // general specific + "strategy", + "schema", + "doSchema", + "afterSchema", + "grantee", - // params specific - 'originateTimeout', - 'maxAttempts', - 'waitBetweenRetries', - 'minDuration', - 'maxCalls', - 'waitBetweenRetriesDesc', - 'strictCircuit', - 'recordings', - 'perNumbers', - ], - }, - [QueueType.PREVIEW_DIALER]: { - locale: baseLocale.concat('.previewDialer'), - subpath: 'preview-dialer', - controls: [ - // general specific - 'strategy', - 'team', - 'doSchema', - 'afterSchema', - 'grantee', + // params specific + "originateTimeout", + "maxAttempts", + "waitBetweenRetries", + "minDuration", + "maxCalls", + "waitBetweenRetriesDesc", + "strictCircuit", + "recordings", + "perNumbers", + ], + }, + [QueueType.PREVIEW_DIALER]: { + locale: baseLocale.concat(".previewDialer"), + subpath: "preview-dialer", + controls: [ + // general specific + "strategy", + "team", + "doSchema", + "afterSchema", + "grantee", - // params specific - 'originateTimeout', - 'maxAttempts', - 'waitBetweenRetries', - 'maxCalls', - 'waitBetweenRetriesDesc', - 'strictCircuit', - 'recordings', - 'perNumbers', - 'allowGreetingAgent', - 'endless', - 'stickyAgent', - 'minOnlineAgents', + // params specific + "originateTimeout", + "maxAttempts", + "waitBetweenRetries", + "maxCalls", + "waitBetweenRetriesDesc", + "strictCircuit", + "recordings", + "perNumbers", + "allowGreetingAgent", + "endless", + "stickyAgent", + "minOnlineAgents", - // processing specific - 'taskProcessing.enabled', - 'taskProcessing.formSchema', - 'taskProcessing.sec', - 'taskProcessing.renewalSec', - ], - }, - [QueueType.PROGRESSIVE_DIALER]: { - locale: baseLocale.concat('.progressiveDialer'), - subpath: 'progressive-dialer', - controls: [ - // general specific - 'strategy', - 'team', - 'doSchema', - 'afterSchema', - 'ringtone', - 'grantee', + // processing specific + "taskProcessing.enabled", + "taskProcessing.formSchema", + "taskProcessing.sec", + "taskProcessing.renewalSec", + ], + }, + [QueueType.PROGRESSIVE_DIALER]: { + locale: baseLocale.concat(".progressiveDialer"), + subpath: "progressive-dialer", + controls: [ + // general specific + "strategy", + "team", + "doSchema", + "afterSchema", + "ringtone", + "grantee", - // params specific - 'originateTimeout', - 'maxAttempts', - 'waitBetweenRetries', - 'maxCalls', - 'waitBetweenRetriesDesc', - 'strictCircuit', - 'recordings', - 'perNumbers', - 'allowGreetingAgent', - 'endless', - 'stickyAgent', - 'autoAnswerTone', - 'minOnlineAgents', + // params specific + "originateTimeout", + "maxAttempts", + "waitBetweenRetries", + "maxCalls", + "waitBetweenRetriesDesc", + "strictCircuit", + "recordings", + "perNumbers", + "allowGreetingAgent", + "endless", + "stickyAgent", + "autoAnswerTone", + "minOnlineAgents", - // processing specific - 'taskProcessing.enabled', - 'taskProcessing.formSchema', - 'taskProcessing.sec', - 'taskProcessing.renewalSec', - ], - }, - [QueueType.PREDICTIVE_DIALER]: { - locale: baseLocale.concat('.predictiveDialer'), - subpath: 'predictive-dialer', - controls: [ - // general specific - 'strategy', - 'team', - 'ringtone', - 'doSchema', - 'afterSchema', - 'grantee', + // processing specific + "taskProcessing.enabled", + "taskProcessing.formSchema", + "taskProcessing.sec", + "taskProcessing.renewalSec", + ], + }, + [QueueType.PREDICTIVE_DIALER]: { + locale: baseLocale.concat(".predictiveDialer"), + subpath: "predictive-dialer", + controls: [ + // general specific + "strategy", + "team", + "ringtone", + "doSchema", + "afterSchema", + "grantee", - // params specific - 'originateTimeout', - 'maxWaitTime', - 'waitBetweenRetries', - 'statisticTime', - 'maxAttempts', - 'minAttempts', - 'maxAgentLose', - 'maxAgentLine', - 'maxAbandonedRate', - 'targetAbandonedRate', - 'loadFactor', - 'abandonRateAdjustment', - 'playbackSilence', - 'maxCalls', - 'waitBetweenRetriesDesc', - 'strictCircuit', - 'retryAbandoned', - 'recordings', - 'perNumbers', - 'allowGreetingAgent', - 'endless', - 'stickyAgent', - 'stickyAgentSec', - 'autoAnswerTone', - 'minOnlineAgents', + // params specific + "originateTimeout", + "maxWaitTime", + "waitBetweenRetries", + "statisticTime", + "maxAttempts", + "minAttempts", + "maxAgentLose", + "maxAgentLine", + "maxAbandonedRate", + "targetAbandonedRate", + "loadFactor", + "abandonRateAdjustment", + "playbackSilence", + "maxCalls", + "waitBetweenRetriesDesc", + "strictCircuit", + "retryAbandoned", + "recordings", + "perNumbers", + "allowGreetingAgent", + "endless", + "stickyAgent", + "stickyAgentSec", + "autoAnswerTone", + "minOnlineAgents", - // processing specific - 'taskProcessing.enabled', - 'taskProcessing.formSchema', - 'taskProcessing.sec', - 'taskProcessing.renewalSec', - ], - }, - [QueueType.CHAT_INBOUND_QUEUE]: { - locale: baseLocale.concat('.chatInboundQueue'), - subpath: 'chat-inbound-queue', - controls: [ - // general specific - 'strategy', - 'team', - // params specific - 'maxWaitTime', - 'maxWaitingSize', - 'discardAbandonedAfter', - 'maxIdleAgent', - 'maxIdleClient', - 'maxIdleDialog', - 'stickyAgent', - 'stickyAgentSec', - 'minOnlineAgents', - 'manualDistribution', - 'lastMessageTimeout', + // processing specific + "taskProcessing.enabled", + "taskProcessing.formSchema", + "taskProcessing.sec", + "taskProcessing.renewalSec", + ], + }, + [QueueType.CHAT_INBOUND_QUEUE]: { + locale: baseLocale.concat(".chatInboundQueue"), + subpath: "chat-inbound-queue", + controls: [ + // general specific + "strategy", + "team", + // params specific + "maxWaitTime", + "maxWaitingSize", + "discardAbandonedAfter", + "maxIdleAgent", + "maxIdleClient", + "maxIdleDialog", + "stickyAgent", + "stickyAgentSec", + "minOnlineAgents", + "manualDistribution", + "lastMessageTimeout", - // processing specific - 'taskProcessing.enabled', - 'taskProcessing.formSchema', - 'taskProcessing.sec', - 'taskProcessing.renewalSec', - ], - }, - [QueueType.INBOUND_JOB_QUEUE]: { - locale: baseLocale.concat('.inboundJobQueue'), - subpath: 'inbound-job-queue', - controls: [ - // general specific - 'strategy', - 'team', - 'doSchema', - 'afterSchema', - // params specific - 'maxAttempts', - 'maxCalls', - 'waitBetweenRetries', - 'waitBetweenRetriesDesc', - 'stickyAgent', - 'minOnlineAgents', + // processing specific + "taskProcessing.enabled", + "taskProcessing.formSchema", + "taskProcessing.sec", + "taskProcessing.renewalSec", + ], + }, + [QueueType.INBOUND_JOB_QUEUE]: { + locale: baseLocale.concat(".inboundJobQueue"), + subpath: "inbound-job-queue", + controls: [ + // general specific + "strategy", + "team", + "doSchema", + "afterSchema", + // params specific + "maxAttempts", + "maxCalls", + "waitBetweenRetries", + "waitBetweenRetriesDesc", + "stickyAgent", + "minOnlineAgents", - // processing specific - 'taskProcessing.enabled', - 'taskProcessing.formSchema', - 'taskProcessing.sec', - 'taskProcessing.renewalSec', - ], - }, - [QueueType.OUTBOUND_JOB_QUEUE]: { - locale: baseLocale.concat('.outboundJobQueue'), - subpath: 'outbound-job-queue', - controls: [ - // general specific - 'strategy', - 'schema', - 'doSchema', - 'afterSchema', - // params specific - 'originateTimeout', - 'maxAttempts', - 'waitBetweenRetries', - 'maxCalls', - 'waitBetweenRetriesDesc', - 'strictCircuit', - 'perNumbers', - ], - }, + // processing specific + "taskProcessing.enabled", + "taskProcessing.formSchema", + "taskProcessing.sec", + "taskProcessing.renewalSec", + ], + }, + [QueueType.OUTBOUND_JOB_QUEUE]: { + locale: baseLocale.concat(".outboundJobQueue"), + subpath: "outbound-job-queue", + controls: [ + // general specific + "strategy", + "schema", + "doSchema", + "afterSchema", + // params specific + "originateTimeout", + "maxAttempts", + "waitBetweenRetries", + "maxCalls", + "waitBetweenRetriesDesc", + "strictCircuit", + "perNumbers", + ], + }, }); export default QueueTypeProperties; diff --git a/src/modules/contact-center/modules/queues/modules/agents/api/queueAgents.js b/src/modules/contact-center/modules/queues/modules/agents/api/queueAgents.js index 26d606de6..eca5ca80d 100644 --- a/src/modules/contact-center/modules/queues/modules/agents/api/queueAgents.js +++ b/src/modules/contact-center/modules/queues/modules/agents/api/queueAgents.js @@ -1,89 +1,84 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { AgentServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { AgentServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; -const agentService = new AgentServiceApiFactory(configuration, '', instance); +const agentService = new AgentServiceApiFactory(configuration, "", instance); const getQueueAgentsList = async (params) => { - const fieldsToSend = [ - 'page', - 'size', - 'search', - 'sort', - 'fields', - 'id', - 'parentId', - ]; - const fields = ['id', 'name', 'status', 'supervisor', 'skills']; + const fieldsToSend = [ + "page", + "size", + "search", + "sort", + "fields", + "id", + "parentId", + ]; + const fields = ["id", "name", "status", "supervisor", "skills"]; - const defaultObject = { - name: '', - status: '', - supervisor: {}, - skills: [], - }; + const defaultObject = { + name: "", + status: "", + supervisor: {}, + skills: [], + }; - const { - parentId, - page = 1, - size = 10, - search, - sort, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - sanitize(fieldsToSend), - ]); + const { + parentId, + page = 1, + size = 10, + search, + sort, + } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + sanitize(fieldsToSend), + ]); - try { - const response = await agentService.searchAgent( - page, - size, - search, - sort, - fields, - undefined, - undefined, - undefined, - undefined, - undefined, - undefined, - undefined, - undefined, - parentId, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await agentService.searchAgent( + page, + size, + search, + sort, + fields, + undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + parentId, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const QueueAgentsAPI = { - getList: getQueueAgentsList, + getList: getQueueAgentsList, }; export default QueueAgentsAPI; diff --git a/src/modules/contact-center/modules/queues/modules/agents/components/opened-queue-agent-skills-popup.vue b/src/modules/contact-center/modules/queues/modules/agents/components/opened-queue-agent-skills-popup.vue index 02a4ed3b3..63ba59909 100644 --- a/src/modules/contact-center/modules/queues/modules/agents/components/opened-queue-agent-skills-popup.vue +++ b/src/modules/contact-center/modules/queues/modules/agents/components/opened-queue-agent-skills-popup.vue @@ -24,34 +24,34 @@ diff --git a/src/modules/contact-center/modules/queues/modules/agents/components/opened-queue-agents.vue b/src/modules/contact-center/modules/queues/modules/agents/components/opened-queue-agents.vue index b1c426768..bf11959d9 100644 --- a/src/modules/contact-center/modules/queues/modules/agents/components/opened-queue-agents.vue +++ b/src/modules/contact-center/modules/queues/modules/agents/components/opened-queue-agents.vue @@ -106,35 +106,41 @@ diff --git a/src/modules/contact-center/modules/queues/modules/agents/store/_internals/headers.js b/src/modules/contact-center/modules/queues/modules/agents/store/_internals/headers.js index c84fa5a56..126e64227 100644 --- a/src/modules/contact-center/modules/queues/modules/agents/store/_internals/headers.js +++ b/src/modules/contact-center/modules/queues/modules/agents/store/_internals/headers.js @@ -1,28 +1,28 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'supervisor', - locale: ['objects.ccenter.agents.supervisors', 1], - field: 'supervisor', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'objects.ccenter.agents.state', - field: 'status', - sort: SortSymbols.NONE, - }, - { - value: 'skills', - locale: ['objects.lookups.skills.skills', 1], - field: 'skills', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "supervisor", + locale: ["objects.ccenter.agents.supervisors", 1], + field: "supervisor", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "objects.ccenter.agents.state", + field: "status", + sort: SortSymbols.NONE, + }, + { + value: "skills", + locale: ["objects.lookups.skills.skills", 1], + field: "skills", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/queues/modules/agents/store/queue-agents.js b/src/modules/contact-center/modules/queues/modules/agents/store/queue-agents.js index d058541f2..94ff304e8 100644 --- a/src/modules/contact-center/modules/queues/modules/agents/store/queue-agents.js +++ b/src/modules/contact-center/modules/queues/modules/agents/store/queue-agents.js @@ -1,11 +1,10 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import QueueAgentsAPI from '../api/queueAgents'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import QueueAgentsAPI from "../api/queueAgents"; +import headers from "./_internals/headers"; const queueAgents = new NestedObjectStoreModule({ headers }) -.attachAPIModule(QueueAgentsAPI) -.generateAPIActions() -.getModule(); + .attachAPIModule(QueueAgentsAPI) + .generateAPIActions() + .getModule(); export default queueAgents; diff --git a/src/modules/contact-center/modules/queues/modules/buckets/api/queueBuckets.js b/src/modules/contact-center/modules/queues/modules/buckets/api/queueBuckets.js index a1860e875..3df6338dd 100644 --- a/src/modules/contact-center/modules/queues/modules/buckets/api/queueBuckets.js +++ b/src/modules/contact-center/modules/queues/modules/buckets/api/queueBuckets.js @@ -1,182 +1,166 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { QueueBucketServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; - -const queueBucketsService = new QueueBucketServiceApiFactory(configuration, '', instance); - -const fieldsToSend = ['bucket', 'priority', 'queueId', 'disabled']; + camelToSnake, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { QueueBucketServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; + +const queueBucketsService = new QueueBucketServiceApiFactory( + configuration, + "", + instance, +); + +const fieldsToSend = ["bucket", "priority", "queueId", "disabled"]; const preRequestHandler = (parentId) => (item) => ({ - ...item, - queueId: parentId, + ...item, + queueId: parentId, }); const getQueueBucketsList = async (params) => { - const fieldsToSend = [ - 'page', - 'size', - 'search', - 'sort', - 'fields', - 'id', - 'parentId', - ]; - - const defaultObject = { - priority: 0, - disabled: false, - }; - - const { - page, - size, - search, - sort, - fields, - id, - parentId, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - sanitize(fieldsToSend), - ]); - - try { - const response = await queueBucketsService.searchQueueBucket( - parentId, - page, - size, - search, - sort, - fields, - id, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const fieldsToSend = [ + "page", + "size", + "search", + "sort", + "fields", + "id", + "parentId", + ]; + + const defaultObject = { + priority: 0, + disabled: false, + }; + + const { page, size, search, sort, fields, id, parentId } = applyTransform( + params, + [ + merge(getDefaultGetParams()), + starToSearch("search"), + sanitize(fieldsToSend), + ], + ); + + try { + const response = await queueBucketsService.searchQueueBucket( + parentId, + page, + size, + search, + sort, + fields, + id, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getQueueBucket = async ({ parentId, itemId: id }) => { - const defaultObject = { - priority: 0, - disabled: false, - }; - - try { - const response = await queueBucketsService.readQueueBucket(parentId, id); - return applyTransform(response.data, [ - snakeToCamel(), - merge(defaultObject), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const defaultObject = { + priority: 0, + disabled: false, + }; + + try { + const response = await queueBucketsService.readQueueBucket(parentId, id); + return applyTransform(response.data, [ + snakeToCamel(), + merge(defaultObject), + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addQueueBucket = async ({ parentId, itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler(parentId), - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await queueBucketsService.createQueueBucket(parentId, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler(parentId), + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await queueBucketsService.createQueueBucket( + parentId, + item, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateQueueBucket = async ({ itemInstance, itemId: id, parentId }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler(parentId), - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await queueBucketsService.updateQueueBucket(parentId, id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler(parentId), + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await queueBucketsService.updateQueueBucket( + parentId, + id, + item, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patchQueueBucket = async ({ changes, id, parentId }) => { - const body = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await queueBucketsService.patchQueueBucket(parentId, id, body); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const body = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await queueBucketsService.patchQueueBucket( + parentId, + id, + body, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteQueueBucket = async ({ parentId, id }) => { - try { - const response = await queueBucketsService.deleteQueueBucket(parentId, id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await queueBucketsService.deleteQueueBucket(parentId, id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const QueueBucketsAPI = { - getList: getQueueBucketsList, - get: getQueueBucket, - add: addQueueBucket, - update: updateQueueBucket, - delete: deleteQueueBucket, - patch: patchQueueBucket, + getList: getQueueBucketsList, + get: getQueueBucket, + add: addQueueBucket, + update: updateQueueBucket, + delete: deleteQueueBucket, + patch: patchQueueBucket, }; export default QueueBucketsAPI; diff --git a/src/modules/contact-center/modules/queues/modules/buckets/components/opened-queue-buckets-popup.vue b/src/modules/contact-center/modules/queues/modules/buckets/components/opened-queue-buckets-popup.vue index 2178dda10..35cfad993 100644 --- a/src/modules/contact-center/modules/queues/modules/buckets/components/opened-queue-buckets-popup.vue +++ b/src/modules/contact-center/modules/queues/modules/buckets/components/opened-queue-buckets-popup.vue @@ -46,38 +46,38 @@ diff --git a/src/modules/contact-center/modules/queues/modules/buckets/components/opened-queue-buckets.vue b/src/modules/contact-center/modules/queues/modules/buckets/components/opened-queue-buckets.vue index dd2228614..593e86ce4 100644 --- a/src/modules/contact-center/modules/queues/modules/buckets/components/opened-queue-buckets.vue +++ b/src/modules/contact-center/modules/queues/modules/buckets/components/opened-queue-buckets.vue @@ -96,36 +96,38 @@ diff --git a/src/modules/contact-center/modules/queues/modules/buckets/store/_internals/headers.js b/src/modules/contact-center/modules/queues/modules/buckets/store/_internals/headers.js index 1079d4504..796a32243 100644 --- a/src/modules/contact-center/modules/queues/modules/buckets/store/_internals/headers.js +++ b/src/modules/contact-center/modules/queues/modules/buckets/store/_internals/headers.js @@ -1,22 +1,22 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: ['objects.lookups.buckets.buckets', 2], - field: 'bucket', - sort: SortSymbols.NONE, - }, - { - value: 'priority', - locale: 'objects.ccenter.queues.bucketPriority', - field: 'priority', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'objects.ccenter.queues.state', - field: 'disabled', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: ["objects.lookups.buckets.buckets", 2], + field: "bucket", + sort: SortSymbols.NONE, + }, + { + value: "priority", + locale: "objects.ccenter.queues.bucketPriority", + field: "priority", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "objects.ccenter.queues.state", + field: "disabled", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/queues/modules/buckets/store/queue-buckets.js b/src/modules/contact-center/modules/queues/modules/buckets/store/queue-buckets.js index 81931915b..13a0f141b 100644 --- a/src/modules/contact-center/modules/queues/modules/buckets/store/queue-buckets.js +++ b/src/modules/contact-center/modules/queues/modules/buckets/store/queue-buckets.js @@ -1,22 +1,21 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import QueueBucketsAPI from '../api/queueBuckets'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import QueueBucketsAPI from "../api/queueBuckets"; +import headers from "./_internals/headers"; const resettableItemState = { - itemInstance: { - bucket: '', - priority: 0, - disabled: false, - }, + itemInstance: { + bucket: "", + priority: 0, + disabled: false, + }, }; const queueBuckets = new NestedObjectStoreModule({ - resettableItemState, - headers, + resettableItemState, + headers, }) -.attachAPIModule(QueueBucketsAPI) -.generateAPIActions() -.getModule(); + .attachAPIModule(QueueBucketsAPI) + .generateAPIActions() + .getModule(); export default queueBuckets; diff --git a/src/modules/contact-center/modules/queues/modules/filters/api/teamLookupApi.js b/src/modules/contact-center/modules/queues/modules/filters/api/teamLookupApi.js index 701efe130..52bef3b4f 100644 --- a/src/modules/contact-center/modules/queues/modules/filters/api/teamLookupApi.js +++ b/src/modules/contact-center/modules/queues/modules/filters/api/teamLookupApi.js @@ -1,55 +1,46 @@ -import { AgentTeamServiceApiFactory } from 'webitel-sdk'; import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - merge, - notify, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; + merge, + notify, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { AgentTeamServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; -const teamService = new AgentTeamServiceApiFactory(configuration, '', instance); +const teamService = new AgentTeamServiceApiFactory(configuration, "", instance); const getList = async (params) => { - const { - page, - size, - search, - sort, - fields, - id, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { page, size, search, sort, fields, id } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); - try { - const response = await teamService.searchAgentTeam( - page, - size, - search, - sort, - fields, - id, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); + try { + const response = await teamService.searchAgentTeam( + page, + size, + search, + sort, + fields, + id, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; export default getList; diff --git a/src/modules/contact-center/modules/queues/modules/filters/components/queues-tags-filter.vue b/src/modules/contact-center/modules/queues/modules/filters/components/queues-tags-filter.vue index c51ea1b0e..7ddafe229 100644 --- a/src/modules/contact-center/modules/queues/modules/filters/components/queues-tags-filter.vue +++ b/src/modules/contact-center/modules/queues/modules/filters/components/queues-tags-filter.vue @@ -15,30 +15,30 @@ diff --git a/src/modules/contact-center/modules/queues/modules/filters/components/the-queues-filters.vue b/src/modules/contact-center/modules/queues/modules/filters/components/the-queues-filters.vue index e848c9abf..a4c9ce154 100644 --- a/src/modules/contact-center/modules/queues/modules/filters/components/the-queues-filters.vue +++ b/src/modules/contact-center/modules/queues/modules/filters/components/the-queues-filters.vue @@ -15,44 +15,44 @@ diff --git a/src/modules/contact-center/modules/queues/modules/filters/store/QueueTypeOptions.js b/src/modules/contact-center/modules/queues/modules/filters/store/QueueTypeOptions.js index 5f56b9b32..24fc6a5d6 100644 --- a/src/modules/contact-center/modules/queues/modules/filters/store/QueueTypeOptions.js +++ b/src/modules/contact-center/modules/queues/modules/filters/store/QueueTypeOptions.js @@ -1,10 +1,10 @@ -import { QueueType } from 'webitel-sdk/esm2015/enums'; +import { QueueType } from "webitel-sdk/esm2015/enums"; export default Object.keys(QueueType) -// eslint-disable-next-line no-restricted-globals -.filter((key) => isNaN(+key)) -.map((key) => ({ - name: key, - value: `${QueueType[key]}`, - locale: `objects.queue.type.${QueueType[key]}`, -})); + // eslint-disable-next-line no-restricted-globals + .filter((key) => Number.isNaN(+key)) + .map((key) => ({ + name: key, + value: `${QueueType[key]}`, + locale: `objects.queue.type.${QueueType[key]}`, + })); diff --git a/src/modules/contact-center/modules/queues/modules/filters/store/filters.js b/src/modules/contact-center/modules/queues/modules/filters/store/filters.js index 6ee064142..954c4c707 100644 --- a/src/modules/contact-center/modules/queues/modules/filters/store/filters.js +++ b/src/modules/contact-center/modules/queues/modules/filters/store/filters.js @@ -1,31 +1,28 @@ -import ApiFilterSchema - from '@webitel/ui-sdk/src/modules/QueryFilters/classes/ApiFilterSchema'; -import BaseFilterSchema - from '@webitel/ui-sdk/src/modules/QueryFilters/classes/BaseFilterSchema'; -import QueryFiltersStoreModule - from '@webitel/ui-sdk/src/modules/QueryFilters/store/QueryFiltersStoreModule'; -import EnumFilterSchema from '@webitel/ui-sdk/src/modules/QueryFilters/classes/EnumFilterSchema'; -import QueueTypeOptions from './QueueTypeOptions'; -import TeamLookupApi from '../api/teamLookupApi'; -import QueuesAPI from '../../../api/queues'; +import ApiFilterSchema from "@webitel/ui-sdk/src/modules/QueryFilters/classes/ApiFilterSchema"; +import BaseFilterSchema from "@webitel/ui-sdk/src/modules/QueryFilters/classes/BaseFilterSchema"; +import EnumFilterSchema from "@webitel/ui-sdk/src/modules/QueryFilters/classes/EnumFilterSchema"; +import QueryFiltersStoreModule from "@webitel/ui-sdk/src/modules/QueryFilters/store/QueryFiltersStoreModule"; +import QueuesAPI from "../../../api/queues"; +import TeamLookupApi from "../api/teamLookupApi"; +import QueueTypeOptions from "./QueueTypeOptions"; const state = { - search: new BaseFilterSchema(), - queueType: new EnumFilterSchema({ - options: QueueTypeOptions, - locale: { label: 'filters.queueType' }, - }), - team: new ApiFilterSchema({ - API: TeamLookupApi, - locale: { label: 'filters.team' }, - }), - tags: new ApiFilterSchema({ - value: [], - defaultValue: [], - API: QueuesAPI.getQueuesTags, - locale: { label: ['vocabulary.tag', 2] }, - storedProp: 'name', - }), + search: new BaseFilterSchema(), + queueType: new EnumFilterSchema({ + options: QueueTypeOptions, + locale: { label: "filters.queueType" }, + }), + team: new ApiFilterSchema({ + API: TeamLookupApi, + locale: { label: "filters.team" }, + }), + tags: new ApiFilterSchema({ + value: [], + defaultValue: [], + API: QueuesAPI.getQueuesTags, + locale: { label: ["vocabulary.tag", 2] }, + storedProp: "name", + }), }; export default new QueryFiltersStoreModule({ state }).getModule(); diff --git a/src/modules/contact-center/modules/queues/modules/hooks/api/queueHooks.js b/src/modules/contact-center/modules/queues/modules/hooks/api/queueHooks.js index b595cff62..b80911eb1 100644 --- a/src/modules/contact-center/modules/queues/modules/hooks/api/queueHooks.js +++ b/src/modules/contact-center/modules/queues/modules/hooks/api/queueHooks.js @@ -1,167 +1,143 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { QueueHookServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; + camelToSnake, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { QueueHookServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; -const queueHookService = new QueueHookServiceApiFactory(configuration, '', instance); +const queueHookService = new QueueHookServiceApiFactory( + configuration, + "", + instance, +); -const fieldsToSend = ['event', 'properties', 'schema', 'enabled']; +const fieldsToSend = ["event", "properties", "schema", "enabled"]; const preRequestHandler = (parentId) => (item) => ({ - ...item, - queueId: parentId, + ...item, + queueId: parentId, }); const getQueueHooksList = async (params) => { - const defaultObject = { - enabled: false, - }; + const defaultObject = { + enabled: false, + }; - const { - page, - size, - search, - sort, - fields, - id, - parentId, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { page, size, search, sort, fields, id, parentId } = applyTransform( + params, + [merge(getDefaultGetParams()), starToSearch("search")], + ); - try { - const response = await queueHookService.searchQueueHook( - parentId, - page, - size, - search, - sort, - fields, - id, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await queueHookService.searchQueueHook( + parentId, + page, + size, + search, + sort, + fields, + id, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getQueueHook = async ({ parentId, itemId: id }) => { - const defaultObject = { - event: '', - properties: [], - schema: {}, - enabled: false, - }; + const defaultObject = { + event: "", + properties: [], + schema: {}, + enabled: false, + }; - try { - const response = await queueHookService.readQueueHook(parentId, id); - return applyTransform(response.data, [ - snakeToCamel(), - merge(defaultObject), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await queueHookService.readQueueHook(parentId, id); + return applyTransform(response.data, [ + snakeToCamel(), + merge(defaultObject), + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addQueueHook = async ({ parentId, itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler(parentId), - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await queueHookService.createQueueHook(parentId, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler(parentId), + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await queueHookService.createQueueHook(parentId, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patchQueueHook = async ({ changes, id, parentId }) => { - const body = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); + const body = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); - try { - const response = await queueHookService.patchQueueHook(parentId, id, body); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await queueHookService.patchQueueHook(parentId, id, body); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateQueueHook = async ({ itemInstance, itemId: id, parentId }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler(parentId), - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await queueHookService.updateQueueHook(parentId, id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler(parentId), + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await queueHookService.updateQueueHook(parentId, id, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteQueueHook = async ({ parentId, id }) => { - try { - const response = await queueHookService.deleteQueueHook(parentId, id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await queueHookService.deleteQueueHook(parentId, id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const QueueHooksAPI = { - getList: getQueueHooksList, - get: getQueueHook, - add: addQueueHook, - patch: patchQueueHook, - update: updateQueueHook, - delete: deleteQueueHook, + getList: getQueueHooksList, + get: getQueueHook, + add: addQueueHook, + patch: patchQueueHook, + update: updateQueueHook, + delete: deleteQueueHook, }; export default QueueHooksAPI; diff --git a/src/modules/contact-center/modules/queues/modules/hooks/components/opened-queue-hooks-popup.vue b/src/modules/contact-center/modules/queues/modules/hooks/components/opened-queue-hooks-popup.vue index 1ead94daf..94778b2b2 100644 --- a/src/modules/contact-center/modules/queues/modules/hooks/components/opened-queue-hooks-popup.vue +++ b/src/modules/contact-center/modules/queues/modules/hooks/components/opened-queue-hooks-popup.vue @@ -47,56 +47,61 @@ diff --git a/src/modules/contact-center/modules/queues/modules/hooks/components/opened-queue-hooks.vue b/src/modules/contact-center/modules/queues/modules/hooks/components/opened-queue-hooks.vue index e1c05827e..2d8f0bb3f 100644 --- a/src/modules/contact-center/modules/queues/modules/hooks/components/opened-queue-hooks.vue +++ b/src/modules/contact-center/modules/queues/modules/hooks/components/opened-queue-hooks.vue @@ -101,55 +101,56 @@ diff --git a/src/modules/contact-center/modules/queues/modules/hooks/enum/HookQueueEvent.enum.js b/src/modules/contact-center/modules/queues/modules/hooks/enum/HookQueueEvent.enum.js index ef068b580..3b10fd785 100644 --- a/src/modules/contact-center/modules/queues/modules/hooks/enum/HookQueueEvent.enum.js +++ b/src/modules/contact-center/modules/queues/modules/hooks/enum/HookQueueEvent.enum.js @@ -1,10 +1,10 @@ export default Object.freeze({ - JOINED: 'joined', - ANSWERED: 'answered', - OFFERING: 'offering', - BRIDGED: 'bridged', - MISSED: 'missed', - LEAVING: 'leaving', - PROCESSING: 'processing', - ACTIVE: 'active', + JOINED: "joined", + ANSWERED: "answered", + OFFERING: "offering", + BRIDGED: "bridged", + MISSED: "missed", + LEAVING: "leaving", + PROCESSING: "processing", + ACTIVE: "active", }); diff --git a/src/modules/contact-center/modules/queues/modules/hooks/store/_internals/headers.js b/src/modules/contact-center/modules/queues/modules/hooks/store/_internals/headers.js index 41988077b..44597ae52 100644 --- a/src/modules/contact-center/modules/queues/modules/hooks/store/_internals/headers.js +++ b/src/modules/contact-center/modules/queues/modules/hooks/store/_internals/headers.js @@ -1,22 +1,22 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'event', - locale: 'objects.ccenter.queues.hooks.event', - field: 'event', - sort: SortSymbols.NONE, - }, - { - value: 'schema', - locale: ['objects.routing.flow.flow', 1], - field: 'schema', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'reusable.state', - field: 'enabled', - sort: SortSymbols.NONE, - }, + { + value: "event", + locale: "objects.ccenter.queues.hooks.event", + field: "event", + sort: SortSymbols.NONE, + }, + { + value: "schema", + locale: ["objects.routing.flow.flow", 1], + field: "schema", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "reusable.state", + field: "enabled", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/queues/modules/hooks/store/queue-hooks.js b/src/modules/contact-center/modules/queues/modules/hooks/store/queue-hooks.js index 42b8a9743..c7fef83c1 100644 --- a/src/modules/contact-center/modules/queues/modules/hooks/store/queue-hooks.js +++ b/src/modules/contact-center/modules/queues/modules/hooks/store/queue-hooks.js @@ -1,20 +1,19 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import QueueHooksAPI from '../api/queueHooks'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import QueueHooksAPI from "../api/queueHooks"; +import headers from "./_internals/headers"; const resettableItemState = { - itemInstance: { - event: '', - properties: [], - schema: {}, - enabled: true, - }, + itemInstance: { + event: "", + properties: [], + schema: {}, + enabled: true, + }, }; const queueHooks = new NestedObjectStoreModule({ resettableItemState, headers }) -.attachAPIModule(QueueHooksAPI) -.generateAPIActions() -.getModule(); + .attachAPIModule(QueueHooksAPI) + .generateAPIActions() + .getModule(); export default queueHooks; diff --git a/src/modules/contact-center/modules/queues/modules/logs/api/queueLog.js b/src/modules/contact-center/modules/queues/modules/logs/api/queueLog.js index b8e2ff25f..db80d4b43 100644 --- a/src/modules/contact-center/modules/queues/modules/logs/api/queueLog.js +++ b/src/modules/contact-center/modules/queues/modules/logs/api/queueLog.js @@ -1,81 +1,83 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - merge, - notify, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { MemberServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; + merge, + notify, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { MemberServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; -const queueMemberAttemptsService = new MemberServiceApiFactory(configuration, '', instance); +const queueMemberAttemptsService = new MemberServiceApiFactory( + configuration, + "", + instance, +); const getQueueLogs = async (params) => { - const { - parentId, - page = 1, - size = 10, - search, - sort = '+joined_at', - fields, - joinedAtFrom, - joinedAtTo, - result, - agent, - leavingAtFrom, - leavingAtTo, - offeringAtFrom, - offeringAtTo, - durationFrom, - durationTo, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { + parentId, + page = 1, + size = 10, + search, + sort = "+joined_at", + fields, + joinedAtFrom, + joinedAtTo, + result, + agent, + leavingAtFrom, + leavingAtTo, + offeringAtFrom, + offeringAtTo, + durationFrom, + durationTo, + } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); - try { - const response = await queueMemberAttemptsService.searchAttemptsHistory( - page, - size, - search, - sort, - fields, - joinedAtFrom, - joinedAtTo, - undefined, - parentId, - undefined, - undefined, - agent, - result, - leavingAtFrom, - leavingAtTo, - offeringAtFrom, - offeringAtTo, - durationFrom, - durationTo, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await queueMemberAttemptsService.searchAttemptsHistory( + page, + size, + search, + sort, + fields, + joinedAtFrom, + joinedAtTo, + undefined, + parentId, + undefined, + undefined, + agent, + result, + leavingAtFrom, + leavingAtTo, + offeringAtFrom, + offeringAtTo, + durationFrom, + durationTo, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const QueueLogsAPI = { - getList: getQueueLogs, + getList: getQueueLogs, }; export default QueueLogsAPI; diff --git a/src/modules/contact-center/modules/queues/modules/logs/components/opened-queue-logs.vue b/src/modules/contact-center/modules/queues/modules/logs/components/opened-queue-logs.vue index 057b8370c..e76fffc21 100644 --- a/src/modules/contact-center/modules/queues/modules/logs/components/opened-queue-logs.vue +++ b/src/modules/contact-center/modules/queues/modules/logs/components/opened-queue-logs.vue @@ -84,52 +84,51 @@ diff --git a/src/modules/contact-center/modules/queues/modules/logs/modules/filters/components/the-queue-logs-filters.vue b/src/modules/contact-center/modules/queues/modules/logs/modules/filters/components/the-queue-logs-filters.vue index e4a74d332..7ed73365c 100644 --- a/src/modules/contact-center/modules/queues/modules/logs/modules/filters/components/the-queue-logs-filters.vue +++ b/src/modules/contact-center/modules/queues/modules/logs/modules/filters/components/the-queue-logs-filters.vue @@ -27,46 +27,46 @@ diff --git a/src/modules/contact-center/modules/queues/modules/logs/modules/filters/store/filters.js b/src/modules/contact-center/modules/queues/modules/logs/modules/filters/store/filters.js index f196075f9..01c2fed09 100644 --- a/src/modules/contact-center/modules/queues/modules/logs/modules/filters/store/filters.js +++ b/src/modules/contact-center/modules/queues/modules/logs/modules/filters/store/filters.js @@ -1,40 +1,35 @@ -import ApiFilterSchema - from '@webitel/ui-sdk/src/modules/QueryFilters/classes/ApiFilterSchema'; -import BaseFilterSchema - from '@webitel/ui-sdk/src/modules/QueryFilters/classes/BaseFilterSchema'; -import EnumFilterSchema - from '@webitel/ui-sdk/src/modules/QueryFilters/classes/EnumFilterSchema'; -import QueryFiltersStoreModule - from '@webitel/ui-sdk/src/modules/QueryFilters/store/QueryFiltersStoreModule'; -import { CallReportingStatus } from 'webitel-sdk'; -import AgentsAPI from '../../../../../../agents/api/agents'; +import ApiFilterSchema from "@webitel/ui-sdk/src/modules/QueryFilters/classes/ApiFilterSchema"; +import BaseFilterSchema from "@webitel/ui-sdk/src/modules/QueryFilters/classes/BaseFilterSchema"; +import EnumFilterSchema from "@webitel/ui-sdk/src/modules/QueryFilters/classes/EnumFilterSchema"; +import QueryFiltersStoreModule from "@webitel/ui-sdk/src/modules/QueryFilters/store/QueryFiltersStoreModule"; +import { CallReportingStatus } from "webitel-sdk"; +import AgentsAPI from "../../../../../../agents/api/agents"; const state = { - search: new BaseFilterSchema(), - joinedAtFrom: new BaseFilterSchema({ - value: new Date().setHours(0, 0, 0, 0), - defaultValue: new Date().setHours(0, 0, 0, 0), - }), - joinedAtTo: new BaseFilterSchema({ - value: new Date().setHours(23, 59, 59, 0), - defaultValue: new Date().setHours(23, 59, 59, 0), - }), - result: new EnumFilterSchema({ - options: Object.values(CallReportingStatus) - .map((value) => ({ - value, - locale: `objects.ccenter.queues.logs.resultName.${value}`, - })), - locale: { label: 'objects.ccenter.queues.logs.result' }, - }), - agent: new ApiFilterSchema({ - API: AgentsAPI.getLookup, - locale: { label: ['objects.ccenter.agents.agents', 1] }, - }), - duration: new BaseFilterSchema({ - value: { from: 0, to: undefined }, - defaultValue: { from: 0, to: undefined }, - }), + search: new BaseFilterSchema(), + joinedAtFrom: new BaseFilterSchema({ + value: new Date().setHours(0, 0, 0, 0), + defaultValue: new Date().setHours(0, 0, 0, 0), + }), + joinedAtTo: new BaseFilterSchema({ + value: new Date().setHours(23, 59, 59, 0), + defaultValue: new Date().setHours(23, 59, 59, 0), + }), + result: new EnumFilterSchema({ + options: Object.values(CallReportingStatus).map((value) => ({ + value, + locale: `objects.ccenter.queues.logs.resultName.${value}`, + })), + locale: { label: "objects.ccenter.queues.logs.result" }, + }), + agent: new ApiFilterSchema({ + API: AgentsAPI.getLookup, + locale: { label: ["objects.ccenter.agents.agents", 1] }, + }), + duration: new BaseFilterSchema({ + value: { from: 0, to: undefined }, + defaultValue: { from: 0, to: undefined }, + }), }; export default new QueryFiltersStoreModule({ state }).getModule(); diff --git a/src/modules/contact-center/modules/queues/modules/logs/store/_internals/headers.js b/src/modules/contact-center/modules/queues/modules/logs/store/_internals/headers.js index b4e386ad7..3203b16d4 100644 --- a/src/modules/contact-center/modules/queues/modules/logs/store/_internals/headers.js +++ b/src/modules/contact-center/modules/queues/modules/logs/store/_internals/headers.js @@ -1,58 +1,58 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'destination', - locale: 'objects.ccenter.queues.logs.destination', - field: 'destination', - sort: SortSymbols.NONE, - }, - { - value: 'agent', - locale: ['objects.ccenter.agents.agents', 1], - field: 'agent', - sort: SortSymbols.NONE, - }, - { - value: 'joinedAt', - locale: 'objects.ccenter.queues.logs.joinedAt', - field: 'joined_at', - sort: SortSymbols.NONE, - }, - { - value: 'leavingAt', - locale: 'objects.ccenter.queues.logs.leavingAt', - field: 'leaving_at', - sort: SortSymbols.NONE, - }, - { - value: 'offeringAt', - locale: 'objects.ccenter.queues.logs.offeringAt', - field: 'offering_at', - sort: SortSymbols.NONE, - }, - { - value: 'duration', - locale: 'objects.ccenter.queues.logs.duration', - field: 'joined_at', - sort: SortSymbols.NONE, - }, - { - value: 'viewNumber', - locale: 'objects.ccenter.queues.logs.viewNumber', - field: 'destination', - sort: SortSymbols.NONE, - }, - { - value: 'attempts', - locale: 'objects.ccenter.queues.logs.attempts', - field: 'attempts', - sort: SortSymbols.NONE, - }, - { - value: 'result', - locale: 'objects.ccenter.queues.logs.result', - field: 'result', - sort: SortSymbols.NONE, - }, + { + value: "destination", + locale: "objects.ccenter.queues.logs.destination", + field: "destination", + sort: SortSymbols.NONE, + }, + { + value: "agent", + locale: ["objects.ccenter.agents.agents", 1], + field: "agent", + sort: SortSymbols.NONE, + }, + { + value: "joinedAt", + locale: "objects.ccenter.queues.logs.joinedAt", + field: "joined_at", + sort: SortSymbols.NONE, + }, + { + value: "leavingAt", + locale: "objects.ccenter.queues.logs.leavingAt", + field: "leaving_at", + sort: SortSymbols.NONE, + }, + { + value: "offeringAt", + locale: "objects.ccenter.queues.logs.offeringAt", + field: "offering_at", + sort: SortSymbols.NONE, + }, + { + value: "duration", + locale: "objects.ccenter.queues.logs.duration", + field: "joined_at", + sort: SortSymbols.NONE, + }, + { + value: "viewNumber", + locale: "objects.ccenter.queues.logs.viewNumber", + field: "destination", + sort: SortSymbols.NONE, + }, + { + value: "attempts", + locale: "objects.ccenter.queues.logs.attempts", + field: "attempts", + sort: SortSymbols.NONE, + }, + { + value: "result", + locale: "objects.ccenter.queues.logs.result", + field: "result", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/queues/modules/logs/store/queue-logs.js b/src/modules/contact-center/modules/queues/modules/logs/store/queue-logs.js index a0346c0ce..f7085ac05 100644 --- a/src/modules/contact-center/modules/queues/modules/logs/store/queue-logs.js +++ b/src/modules/contact-center/modules/queues/modules/logs/store/queue-logs.js @@ -1,13 +1,12 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import QueueLogsAPI from '../api/queueLog'; -import filters from '../modules/filters/store/filters'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import QueueLogsAPI from "../api/queueLog"; +import filters from "../modules/filters/store/filters"; +import headers from "./_internals/headers"; const queueLogs = new NestedObjectStoreModule({ headers }) -.attachAPIModule(QueueLogsAPI) -.generateAPIActions() -.setChildModules({ filters }) -.getModule(); + .attachAPIModule(QueueLogsAPI) + .generateAPIActions() + .setChildModules({ filters }) + .getModule(); export default queueLogs; diff --git a/src/modules/contact-center/modules/queues/modules/members/api/queueMembers.js b/src/modules/contact-center/modules/queues/modules/members/api/queueMembers.js index 4077bb852..19d357782 100644 --- a/src/modules/contact-center/modules/queues/modules/members/api/queueMembers.js +++ b/src/modules/contact-center/modules/queues/modules/members/api/queueMembers.js @@ -1,303 +1,288 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import deepCopy from 'deep-copy'; -import { MemberServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; + camelToSnake, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import deepCopy from "deep-copy"; +import { MemberServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; -const memberService = new MemberServiceApiFactory(configuration, '', instance); +const memberService = new MemberServiceApiFactory(configuration, "", instance); const fieldsToSend = [ - 'queueId', 'name', 'priority', 'bucket', 'timezone', 'communications', - 'variables', 'expireAt', 'minOfferingAt', 'agent', 'stopCause', + "queueId", + "name", + "priority", + "bucket", + "timezone", + "communications", + "variables", + "expireAt", + "minOfferingAt", + "agent", + "stopCause", ]; const communicationsFieldsToSend = [ - 'destination', - 'display', - 'priority', - 'type', - 'resource', - 'description', - 'dtmf', + "destination", + "display", + "priority", + "type", + "resource", + "description", + "dtmf", ]; const defaultSingleObjectCommunication = { - destination: '', - display: '', - priority: 0, - type: {}, - resource: {}, - description: '', - dtmf: '', + destination: "", + display: "", + priority: 0, + type: {}, + resource: {}, + description: "", + dtmf: "", }; const mapDefaultCommunications = (item) => { - const copy = deepCopy(item); - return copy.communications ? copy.communications - .map((comm) => ({ ...defaultSingleObjectCommunication, ...comm })) : []; + const copy = deepCopy(item); + return copy.communications + ? copy.communications.map((comm) => ({ + ...defaultSingleObjectCommunication, + ...comm, + })) + : []; }; const preRequestHandler = (item) => { - const copy = deepCopy(item); - copy.communications - .forEach((copy) => sanitize(copy, communicationsFieldsToSend)); - const variables = copy.variables.reduce((variables, variable) => ({ - ...variables, - [variable.key]: variable.value, - }), {}); - return { ...copy, variables }; + const copy = deepCopy(item); + copy.communications.forEach((copy) => + sanitize(copy, communicationsFieldsToSend), + ); + const variables = copy.variables.reduce( + (variables, variable) => ({ + ...variables, + [variable.key]: variable.value, + }), + {}, + ); + return { ...copy, variables }; }; const getMembersList = async (params) => { - const defaultObject = { - createdAt: 'unknown', - priority: 0, - }; + const defaultObject = { + createdAt: "unknown", + priority: 0, + }; - const listHandler = (items) => { - const copy = deepCopy(items); - return copy.map((item) => ({ - ...item, - communications: applyTransform(item, [ - mapDefaultCommunications, - ]), - })); - }; + const listHandler = (items) => { + const copy = deepCopy(items); + return copy.map((item) => ({ + ...item, + communications: applyTransform(item, [mapDefaultCommunications]), + })); + }; - const { - page, - size, - search, - sort, - fields, - id, - parentId, - from, - to, - bucket, - priorityFrom, - priorityTo, - priority, - cause, - agent, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { + page, + size, + search, + sort, + fields, + id, + parentId, + from, + to, + bucket, + priorityFrom, + priorityTo, + priority, + cause, + agent, + } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); - try { - const response = await memberService.searchMemberInQueue( - parentId, - page, - size, - search, - sort, - fields, - id, - bucket, - undefined, - from, - to, - undefined, - undefined, - cause, - priorityFrom || priority?.from, - priorityTo || priority?.to, - undefined, - undefined, - undefined, - agent, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(['variables']), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - listHandler, - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await memberService.searchMemberInQueue( + parentId, + page, + size, + search, + sort, + fields, + id, + bucket, + undefined, + from, + to, + undefined, + undefined, + cause, + priorityFrom || priority?.from, + priorityTo || priority?.to, + undefined, + undefined, + undefined, + agent, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(["variables"]), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject), listHandler]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getMember = async ({ parentId, itemId: id }) => { - const defaultObject = { - createdAt: 'unknown', - priority: '0', - name: 'member', - expireAt: 0, - bucket: {}, - timezone: {}, - agent: {}, - communications: [], - variables: [], - }; + const defaultObject = { + createdAt: "unknown", + priority: "0", + name: "member", + expireAt: 0, + bucket: {}, + timezone: {}, + agent: {}, + communications: [], + variables: [], + }; - const responseHandler = (response) => { - const copy = deepCopy(response); - let variables = []; - if (copy.variables) { - variables = Object.keys(copy.variables).map((key) => ({ - key, - value: copy.variables[key], - })); - } - const communications = mapDefaultCommunications(copy); - return { ...response, variables, communications }; - }; + const responseHandler = (response) => { + const copy = deepCopy(response); + let variables = []; + if (copy.variables) { + variables = Object.keys(copy.variables).map((key) => ({ + key, + value: copy.variables[key], + })); + } + const communications = mapDefaultCommunications(copy); + return { ...response, variables, communications }; + }; - try { - const response = await memberService.readMember(parentId, id); - return applyTransform(response.data, [ - snakeToCamel(['variables']), - merge(defaultObject), - responseHandler, - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await memberService.readMember(parentId, id); + return applyTransform(response.data, [ + snakeToCamel(["variables"]), + merge(defaultObject), + responseHandler, + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addMember = async ({ parentId, itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(['variables']), - ]); - try { - const response = await memberService.createMember(parentId, item); - return applyTransform(response.data, [ - snakeToCamel(['variables']), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(["variables"]), + ]); + try { + const response = await memberService.createMember(parentId, item); + return applyTransform(response.data, [snakeToCamel(["variables"])]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateMember = async ({ itemInstance, itemId: id, parentId }) => { - const body = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(['variables']), - ]); - try { - const response = await memberService.updateMember(parentId, id, body); - return applyTransform(response.data, [ - snakeToCamel(['variables']), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const body = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(["variables"]), + ]); + try { + const response = await memberService.updateMember(parentId, id, body); + return applyTransform(response.data, [snakeToCamel(["variables"])]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteMember = async ({ parentId, id }) => { - try { - const response = await memberService.deleteMember(parentId, id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await memberService.deleteMember(parentId, id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const resetMembers = async ({ parentId }) => { - try { - const response = await memberService.resetMembers(parentId, {}); - return applyTransform(response.data, [ - snakeToCamel(['variables']), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await memberService.resetMembers(parentId, {}); + return applyTransform(response.data, [snakeToCamel(["variables"])]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addMembersBulk = async (parentId, fileName, items) => { - const body = { parentId, fileName, items }; - try { - const response = await memberService.createMemberBulk(parentId, body); - return applyTransform(response.data, [ - snakeToCamel(['variables']), - notify(({ callback }) => callback({ - type: 'info', - text: 'Successfully added', - })), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const body = { parentId, fileName, items }; + try { + const response = await memberService.createMemberBulk(parentId, body); + return applyTransform(response.data, [ + snakeToCamel(["variables"]), + notify(({ callback }) => + callback({ + type: "info", + text: "Successfully added", + }), + ), + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -export const deleteMembersBulk = async (parentId, { - search, - id, - from, - to, - bucket, - priority, - cause, -}) => { - let body = { - id, - q: search, - createdAt: (from || to) ? { from, to } : undefined, - priority, - stopCause: cause, - bucketId: bucket, - withoutMembers: true, - }; +export const deleteMembersBulk = async ( + parentId, + { search, id, from, to, bucket, priority, cause }, +) => { + let body = { + id, + q: search, + createdAt: from || to ? { from, to } : undefined, + priority, + stopCause: cause, + bucketId: bucket, + withoutMembers: true, + }; - body = applyTransform(body, [ - camelToSnake(), - ]); + body = applyTransform(body, [camelToSnake()]); - try { - const response = await memberService.deleteMembers(parentId, body); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await memberService.deleteMembers(parentId, body); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const QueueMembersAPI = { - getList: getMembersList, - get: getMember, - add: addMember, - addBulk: addMembersBulk, - update: updateMember, - delete: deleteMember, - deleteBulk: deleteMembersBulk, - resetMembers, + getList: getMembersList, + get: getMember, + add: addMember, + addBulk: addMembersBulk, + update: updateMember, + delete: deleteMember, + deleteBulk: deleteMembersBulk, + resetMembers, }; export default QueueMembersAPI; diff --git a/src/modules/contact-center/modules/queues/modules/members/components/communications/opened-queue-member-communication-popup.vue b/src/modules/contact-center/modules/queues/modules/members/components/communications/opened-queue-member-communication-popup.vue index 80f3c9316..b64c4996d 100644 --- a/src/modules/contact-center/modules/queues/modules/members/components/communications/opened-queue-member-communication-popup.vue +++ b/src/modules/contact-center/modules/queues/modules/members/components/communications/opened-queue-member-communication-popup.vue @@ -65,108 +65,109 @@ diff --git a/src/modules/contact-center/modules/queues/modules/members/components/communications/opened-queue-member-communication.vue b/src/modules/contact-center/modules/queues/modules/members/components/communications/opened-queue-member-communication.vue index 506af9ad2..e20c0f6ce 100644 --- a/src/modules/contact-center/modules/queues/modules/members/components/communications/opened-queue-member-communication.vue +++ b/src/modules/contact-center/modules/queues/modules/members/components/communications/opened-queue-member-communication.vue @@ -80,113 +80,113 @@ diff --git a/src/modules/contact-center/modules/queues/modules/members/components/communications/opened-queue-member-destinations-popup.vue b/src/modules/contact-center/modules/queues/modules/members/components/communications/opened-queue-member-destinations-popup.vue index 1768d529e..b0a9f1b81 100644 --- a/src/modules/contact-center/modules/queues/modules/members/components/communications/opened-queue-member-destinations-popup.vue +++ b/src/modules/contact-center/modules/queues/modules/members/components/communications/opened-queue-member-destinations-popup.vue @@ -41,34 +41,36 @@ diff --git a/src/modules/contact-center/modules/queues/modules/members/components/opened-queue-member-general.vue b/src/modules/contact-center/modules/queues/modules/members/components/opened-queue-member-general.vue index 0825ea047..dc74f71b9 100644 --- a/src/modules/contact-center/modules/queues/modules/members/components/opened-queue-member-general.vue +++ b/src/modules/contact-center/modules/queues/modules/members/components/opened-queue-member-general.vue @@ -55,32 +55,31 @@ diff --git a/src/modules/contact-center/modules/queues/modules/members/components/opened-queue-member-variables.vue b/src/modules/contact-center/modules/queues/modules/members/components/opened-queue-member-variables.vue index e62443031..e39ac9d4f 100644 --- a/src/modules/contact-center/modules/queues/modules/members/components/opened-queue-member-variables.vue +++ b/src/modules/contact-center/modules/queues/modules/members/components/opened-queue-member-variables.vue @@ -42,17 +42,16 @@ diff --git a/src/modules/contact-center/modules/queues/modules/members/components/opened-queue-member.vue b/src/modules/contact-center/modules/queues/modules/members/components/opened-queue-member.vue index 948a8d741..f329ddb28 100644 --- a/src/modules/contact-center/modules/queues/modules/members/components/opened-queue-member.vue +++ b/src/modules/contact-center/modules/queues/modules/members/components/opened-queue-member.vue @@ -38,107 +38,112 @@ diff --git a/src/modules/contact-center/modules/queues/modules/members/components/reset-members-popup.vue b/src/modules/contact-center/modules/queues/modules/members/components/reset-members-popup.vue index 9c7ee0754..6e46bc3f6 100644 --- a/src/modules/contact-center/modules/queues/modules/members/components/reset-members-popup.vue +++ b/src/modules/contact-center/modules/queues/modules/members/components/reset-members-popup.vue @@ -33,43 +33,46 @@ diff --git a/src/modules/contact-center/modules/queues/modules/members/components/the-queue-members.vue b/src/modules/contact-center/modules/queues/modules/members/components/the-queue-members.vue index 6f7b60a2b..789534559 100644 --- a/src/modules/contact-center/modules/queues/modules/members/components/the-queue-members.vue +++ b/src/modules/contact-center/modules/queues/modules/members/components/the-queue-members.vue @@ -197,251 +197,253 @@ diff --git a/src/modules/contact-center/modules/queues/modules/members/components/upload-members-popup.vue b/src/modules/contact-center/modules/queues/modules/members/components/upload-members-popup.vue index f7f271e49..79c753e4d 100644 --- a/src/modules/contact-center/modules/queues/modules/members/components/upload-members-popup.vue +++ b/src/modules/contact-center/modules/queues/modules/members/components/upload-members-popup.vue @@ -8,29 +8,29 @@ diff --git a/src/modules/contact-center/modules/queues/modules/members/mixins/normalizeCsvMembers.js b/src/modules/contact-center/modules/queues/modules/members/mixins/normalizeCsvMembers.js index 128bce4f0..5273f1b9f 100644 --- a/src/modules/contact-center/modules/queues/modules/members/mixins/normalizeCsvMembers.js +++ b/src/modules/contact-center/modules/queues/modules/members/mixins/normalizeCsvMembers.js @@ -1,137 +1,140 @@ -import CommunicationsAPI - from '../../../../../../lookups/modules/communications/api/communications'; -import QueueMembersAPI from '../api/queueMembers'; -import { digitsDtmfOnly } from '../validation/dtmf'; +import CommunicationsAPI from "../../../../../../lookups/modules/communications/api/communications"; +import QueueMembersAPI from "../api/queueMembers"; +import { digitsDtmfOnly } from "../validation/dtmf"; -const findCommunicationIdByCode = ({ communications, code }) => ( - communications.find((communication) => communication.code === code).id -); +const findCommunicationIdByCode = ({ communications, code }) => + communications.find((communication) => communication.code === code).id; export default { - methods: { - async saveBulkData(data) { - try { - const normalizedData = await this.normalizeData(data); - return QueueMembersAPI.addBulk(this.parentId, this.file.name, normalizedData); - } catch (err) { - throw err; - } - }, - - async getCommunicationTypes() { - const communications = await CommunicationsAPI.getList({ size: 5000 }); - this.allCommunications = communications.items; - }, - - async normalizeData(data) { - await this.getCommunicationTypes(); - - return data.map((item) => { - const normalizedItem = { - ...item, - }; - - if (normalizedItem.timezoneId) { - normalizedItem.timezone = { id: item.timezoneId }; - delete normalizedItem.timezoneId; - } - if (normalizedItem.bucketId) { - normalizedItem.bucket = { id: item.bucketId }; - delete normalizedItem.bucketId; - } - if (normalizedItem.agentId) { - normalizedItem.agent = { id: item.agentId }; - delete normalizedItem.agentId; - } - if (normalizedItem.variables) { - const variablesMappings = this.mappingFields.find((field) => field.name === - 'variables'); - normalizedItem.variables = item.variables.reduce(( - variables, - variable, - index, - ) => ({ - ...variables, - [variablesMappings.csv[index]]: variable, // csv is arr of tags - }), {}); - } - if (!normalizedItem.priority) { - normalizedItem.priority = 0; - } - - // start filling communications from parsed item - normalizedItem.communications = []; - - // decide how many communications we should fill - // if there's destination without code or code without destination, - // there's no point to even try to fill it because it would be an error, - // so we find minimum communications count - const commLength = Math.min( - normalizedItem.destination.length, - normalizedItem.code.length, - ); - - // now fill each communication one by one - for (let index = 0; index < commLength; index += 1) { - let id; - try { - // try to get the communication type Id - id = findCommunicationIdByCode({ - communications: this.allCommunications, - code: normalizedItem.code[index], - }); - } catch (err) { - // if there's no id, show console error - console.error(`cannot find communication: ${normalizedItem.code[index]}`); - } - - // if there's no (required) id or destination, skip to the next one - if (!id || !normalizedItem.destination[index]) break; - - // if there's actually an Id, continue processing - const communication = { - destination: normalizedItem.destination[index], - type: { id }, - }; - - // fill communication priority, if present - if (normalizedItem.commPriority && - normalizedItem.commPriority[index]) { - communication.priority = normalizedItem.commPriority[index]; - } - - // fill communication description, if present - if (normalizedItem.description && normalizedItem.description[index]) { - communication.description = normalizedItem.description[index]; - } - - // fill communication dtmf, if present - if (normalizedItem.dtmf && normalizedItem.dtmf[index]) { - if (!digitsDtmfOnly(normalizedItem.dtmf[index])) { - throw new SyntaxError('No valid DTMF were passed!'); - } - communication.dtmf = normalizedItem.dtmf[index]; - } - - // and add this communication to list - normalizedItem.communications.push(communication); - } - - /* in the end, check if there's any communications + methods: { + async saveBulkData(data) { + try { + const normalizedData = await this.normalizeData(data); + return QueueMembersAPI.addBulk( + this.parentId, + this.file.name, + normalizedData, + ); + } catch (err) { + throw err; + } + }, + + async getCommunicationTypes() { + const communications = await CommunicationsAPI.getList({ size: 5000 }); + this.allCommunications = communications.items; + }, + + async normalizeData(data) { + await this.getCommunicationTypes(); + + return data.map((item) => { + const normalizedItem = { + ...item, + }; + + if (normalizedItem.timezoneId) { + normalizedItem.timezone = { id: item.timezoneId }; + normalizedItem.timezoneId = undefined; + } + if (normalizedItem.bucketId) { + normalizedItem.bucket = { id: item.bucketId }; + normalizedItem.bucketId = undefined; + } + if (normalizedItem.agentId) { + normalizedItem.agent = { id: item.agentId }; + normalizedItem.agentId = undefined; + } + if (normalizedItem.variables) { + const variablesMappings = this.mappingFields.find( + (field) => field.name === "variables", + ); + normalizedItem.variables = item.variables.reduce( + (variables, variable, index) => ({ + ...variables, + [variablesMappings.csv[index]]: variable, // csv is arr of tags + }), + {}, + ); + } + if (!normalizedItem.priority) { + normalizedItem.priority = 0; + } + + // start filling communications from parsed item + normalizedItem.communications = []; + + // decide how many communications we should fill + // if there's destination without code or code without destination, + // there's no point to even try to fill it because it would be an error, + // so we find minimum communications count + const commLength = Math.min( + normalizedItem.destination.length, + normalizedItem.code.length, + ); + + // now fill each communication one by one + for (let index = 0; index < commLength; index += 1) { + let id; + try { + // try to get the communication type Id + id = findCommunicationIdByCode({ + communications: this.allCommunications, + code: normalizedItem.code[index], + }); + } catch (err) { + // if there's no id, show console error + console.error( + `cannot find communication: ${normalizedItem.code[index]}`, + ); + } + + // if there's no (required) id or destination, skip to the next one + if (!id || !normalizedItem.destination[index]) break; + + // if there's actually an Id, continue processing + const communication = { + destination: normalizedItem.destination[index], + type: { id }, + }; + + // fill communication priority, if present + if (normalizedItem.commPriority?.[index]) { + communication.priority = normalizedItem.commPriority[index]; + } + + // fill communication description, if present + if (normalizedItem.description?.[index]) { + communication.description = normalizedItem.description[index]; + } + + // fill communication dtmf, if present + if (normalizedItem.dtmf?.[index]) { + if (!digitsDtmfOnly(normalizedItem.dtmf[index])) { + throw new SyntaxError("No valid DTMF were passed!"); + } + communication.dtmf = normalizedItem.dtmf[index]; + } + + // and add this communication to list + normalizedItem.communications.push(communication); + } + + /* in the end, check if there's any communications remember: we skip communications where's no destination or code */ - if (!normalizedItem.communications.length) { - throw new RangeError('No valid communications were passed!'); - } - - delete normalizedItem.destination; - delete normalizedItem.code; - delete normalizedItem.commPriority; - delete normalizedItem.description; - delete normalizedItem.dtmf; - - return normalizedItem; - }); - }, - }, + if (!normalizedItem.communications.length) { + throw new RangeError("No valid communications were passed!"); + } + + normalizedItem.destination = undefined; + normalizedItem.code = undefined; + normalizedItem.commPriority = undefined; + normalizedItem.description = undefined; + normalizedItem.dtmf = undefined; + + return normalizedItem; + }); + }, + }, }; diff --git a/src/modules/contact-center/modules/queues/modules/members/modules/filters/components/the-queue-members-filters.vue b/src/modules/contact-center/modules/queues/modules/members/modules/filters/components/the-queue-members-filters.vue index 39177b0a8..96205bf87 100644 --- a/src/modules/contact-center/modules/queues/modules/members/modules/filters/components/the-queue-members-filters.vue +++ b/src/modules/contact-center/modules/queues/modules/members/modules/filters/components/the-queue-members-filters.vue @@ -27,47 +27,47 @@ diff --git a/src/modules/contact-center/modules/queues/modules/members/modules/filters/store/filters.js b/src/modules/contact-center/modules/queues/modules/members/modules/filters/store/filters.js index 34fac2eb7..652d6915d 100644 --- a/src/modules/contact-center/modules/queues/modules/members/modules/filters/store/filters.js +++ b/src/modules/contact-center/modules/queues/modules/members/modules/filters/store/filters.js @@ -1,52 +1,46 @@ -import ApiFilterSchema - from '@webitel/ui-sdk/src/modules/QueryFilters/classes/ApiFilterSchema'; -import BaseFilterSchema - from '@webitel/ui-sdk/src/modules/QueryFilters/classes/BaseFilterSchema'; -import EnumFilterSchema - from '@webitel/ui-sdk/src/modules/QueryFilters/classes/EnumFilterSchema'; -import QueryFiltersStoreModule - from '@webitel/ui-sdk/src/modules/QueryFilters/store/QueryFiltersStoreModule'; -import { MemberStopCause } from 'webitel-sdk/esm2015/enums'; -import BucketsAPI - from '../../../../../../../../lookups/modules/buckets/api/buckets'; -import AgentsAPI from '../../../../../../agents/api/agents'; +import ApiFilterSchema from "@webitel/ui-sdk/src/modules/QueryFilters/classes/ApiFilterSchema"; +import BaseFilterSchema from "@webitel/ui-sdk/src/modules/QueryFilters/classes/BaseFilterSchema"; +import EnumFilterSchema from "@webitel/ui-sdk/src/modules/QueryFilters/classes/EnumFilterSchema"; +import QueryFiltersStoreModule from "@webitel/ui-sdk/src/modules/QueryFilters/store/QueryFiltersStoreModule"; +import { MemberStopCause } from "webitel-sdk/esm2015/enums"; +import BucketsAPI from "../../../../../../../../lookups/modules/buckets/api/buckets"; +import AgentsAPI from "../../../../../../agents/api/agents"; const defaultDateFrom = () => { - const dateNow = new Date(); - dateNow.setMonth(dateNow.getMonth() - 1, 1); - return dateNow.setHours(0, 0, 0, 0); + const dateNow = new Date(); + dateNow.setMonth(dateNow.getMonth() - 1, 1); + return dateNow.setHours(0, 0, 0, 0); }; const state = { - search: new BaseFilterSchema(), - from: new BaseFilterSchema({ - value: defaultDateFrom(), - defaultValue: defaultDateFrom(), - }), - to: new BaseFilterSchema({ - value: new Date().setHours(23, 59, 59, 0), - defaultValue: new Date().setHours(23, 59, 59, 0), - }), - cause: new EnumFilterSchema({ - options: Object.values(MemberStopCause) - .map((value) => ({ - value, - locale: `objects.ccenter.members.endCause.${value}`, - })), - locale: { label: 'objects.ccenter.queues.endCause' }, - }), - bucket: new ApiFilterSchema({ - API: BucketsAPI.getLookup, - locale: { label: ['objects.lookups.buckets.buckets', 1] }, - }), - agent: new ApiFilterSchema({ - API: AgentsAPI.getLookup, - locale: { label: ['objects.ccenter.agents.agents', 1] }, - }), - priority: new BaseFilterSchema({ - value: { from: 0, to: undefined }, - defaultValue: { from: 0, to: undefined }, - }), + search: new BaseFilterSchema(), + from: new BaseFilterSchema({ + value: defaultDateFrom(), + defaultValue: defaultDateFrom(), + }), + to: new BaseFilterSchema({ + value: new Date().setHours(23, 59, 59, 0), + defaultValue: new Date().setHours(23, 59, 59, 0), + }), + cause: new EnumFilterSchema({ + options: Object.values(MemberStopCause).map((value) => ({ + value, + locale: `objects.ccenter.members.endCause.${value}`, + })), + locale: { label: "objects.ccenter.queues.endCause" }, + }), + bucket: new ApiFilterSchema({ + API: BucketsAPI.getLookup, + locale: { label: ["objects.lookups.buckets.buckets", 1] }, + }), + agent: new ApiFilterSchema({ + API: AgentsAPI.getLookup, + locale: { label: ["objects.ccenter.agents.agents", 1] }, + }), + priority: new BaseFilterSchema({ + value: { from: 0, to: undefined }, + defaultValue: { from: 0, to: undefined }, + }), }; export default new QueryFiltersStoreModule({ state }).getModule(); diff --git a/src/modules/contact-center/modules/queues/modules/members/store/_internals/headers.js b/src/modules/contact-center/modules/queues/modules/members/store/_internals/headers.js index fee406bbb..f16db394c 100644 --- a/src/modules/contact-center/modules/queues/modules/members/store/_internals/headers.js +++ b/src/modules/contact-center/modules/queues/modules/members/store/_internals/headers.js @@ -1,52 +1,52 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'createdAt', - locale: 'objects.createdAt', - field: 'created_at', - sort: SortSymbols.NONE, - }, - { - value: 'offeringAt', - locale: 'objects.ccenter.queues.offeringAt', - field: 'min_offering_at', - sort: SortSymbols.NONE, - }, - { - value: 'destination', - locale: ['objects.ccenter.queues.destination', 2], - field: 'communications', - sort: SortSymbols.NONE, - }, - { - value: 'priority', - locale: 'objects.ccenter.queues.priority', - field: 'priority', - sort: SortSymbols.NONE, - }, - { - value: 'endCause', - locale: 'objects.ccenter.queues.endCause', - field: 'stop_cause', - sort: SortSymbols.NONE, - }, - { - value: 'attempts', - locale: 'objects.ccenter.members.attempts', - field: 'attempts', - sort: SortSymbols.NONE, - }, - { - value: 'agent', - locale: ['objects.ccenter.agents.agents', 1], - field: 'agent', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "createdAt", + locale: "objects.createdAt", + field: "created_at", + sort: SortSymbols.NONE, + }, + { + value: "offeringAt", + locale: "objects.ccenter.queues.offeringAt", + field: "min_offering_at", + sort: SortSymbols.NONE, + }, + { + value: "destination", + locale: ["objects.ccenter.queues.destination", 2], + field: "communications", + sort: SortSymbols.NONE, + }, + { + value: "priority", + locale: "objects.ccenter.queues.priority", + field: "priority", + sort: SortSymbols.NONE, + }, + { + value: "endCause", + locale: "objects.ccenter.queues.endCause", + field: "stop_cause", + sort: SortSymbols.NONE, + }, + { + value: "attempts", + locale: "objects.ccenter.members.attempts", + field: "attempts", + sort: SortSymbols.NONE, + }, + { + value: "agent", + locale: ["objects.ccenter.agents.agents", 1], + field: "agent", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/queues/modules/members/store/queue-members.js b/src/modules/contact-center/modules/queues/modules/members/store/queue-members.js index c326b07ee..e320ea169 100644 --- a/src/modules/contact-center/modules/queues/modules/members/store/queue-members.js +++ b/src/modules/contact-center/modules/queues/modules/members/store/queue-members.js @@ -1,150 +1,151 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import QueuesAPI from '../../../api/queues'; -import MembersAPI from '../api/queueMembers'; -import filters from '../modules/filters/store/filters'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import QueuesAPI from "../../../api/queues"; +import MembersAPI from "../api/queueMembers"; +import filters from "../modules/filters/store/filters"; +import headers from "./_internals/headers"; const resettableItemState = { - parentQueue: {}, - itemInstance: { - name: '', - priority: 0, - expireAt: Date.now() + 7 * 24 * 60 * 60 * 1000, - bucket: {}, - timezone: {}, - agent: {}, - communications: [], - variables: [], - }, + parentQueue: {}, + itemInstance: { + name: "", + priority: 0, + expireAt: Date.now() + 7 * 24 * 60 * 60 * 1000, + bucket: {}, + timezone: {}, + agent: {}, + communications: [], + variables: [], + }, }; const actions = { - LOAD_PARENT_QUEUE: async (context) => { - try { - const queue = await QueuesAPI.get({ itemId: context.state.parentId }); - context.commit('SET_PARENT_QUEUE', queue); - } catch (err) { - throw err; - } - }, - ADD_ITEM: async (context) => { - if (!context.state.itemId) { - const { id } = await context.dispatch('POST_ITEM'); - context.dispatch('SET_ITEM_ID', id); - await context.dispatch('LOAD_ITEM'); - } - }, - UPDATE_ITEM: async (context) => { - if (context.state.itemInstance._dirty) { - await context.dispatch('UPD_ITEM'); - await context.dispatch('LOAD_ITEM'); - } - }, - DELETE_SINGLE: (context, { id }) => context.dispatch('DELETE_ITEM', id), - DELETE_BULK: (context, deleted) => { - const id = deleted.map((item) => item.id); - return MembersAPI.deleteBulk(context.state.parentId, { id }); - }, - DELETE_FILTERED: ( - context, - query = context.getters['filters/GET_FILTERS'], - ) => { - return MembersAPI.deleteBulk(context.state.parentId, query); - }, - DELETE_ALL: (context) => MembersAPI.deleteBulk(context.state.parentId, { id: [] }), - RESET_MEMBERS: (context) => { - const response = MembersAPI.resetMembers(context.state); - context.dispatch('LOAD_DATA_LIST'); - return response; - }, - SET_PARENT_ITEM_ID: (context, id) => { - context.commit('SET_PARENT_ITEM_ID', id); - return context.dispatch('LOAD_PARENT_QUEUE'); - }, - ADD_MEMBER_COMMUNICATION: (context, item) => { - const value = context.state.itemInstance.communications.concat(item); - context.commit('SET_ITEM_PROPERTY', { prop: 'communications', value }); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - UPDATE_MEMBER_COMMUNICATION: (context, { index, item }) => { - const value = [...context.state.itemInstance.communications]; - value.splice(index, 1, item); - context.commit('SET_ITEM_PROPERTY', { prop: 'communications', value }); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - DELETE_MEMBER_COMMUNICATION: (context, deleted) => { - let action = 'DELETE_SINGLE_COMMUNICATION'; - if (Array.isArray(deleted)) { - if (deleted.length) action = 'DELETE_BULK_COMMUNICATIONS'; - else action = 'DELETE_ALL_COMMUNICATIONS'; - } - return context.dispatch(action, deleted); - }, - DELETE_SINGLE_COMMUNICATION: (context, deleted) => { - const communications = [...context.state.itemInstance.communications]; - communications.splice(communications.indexOf(deleted), 1); - context.commit('SET_ITEM_PROPERTY', { - prop: 'communications', - value: communications, - }); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - DELETE_BULK_COMMUNICATIONS: (context, deleted) => { - const communications = context.state.itemInstance.communications - .filter((comm) => !deleted.some((delComm) => delComm.destination === - comm.destination)); - context.commit('SET_ITEM_PROPERTY', { - prop: 'communications', - value: communications, - }); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - DELETE_ALL_COMMUNICATIONS: (context) => { - const communications = []; - context.commit('SET_ITEM_PROPERTY', { - prop: 'communications', - value: communications, - }); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - ADD_VARIABLE_PAIR: (context) => { - const pair = { key: '', value: '' }; - context.commit('ADD_VARIABLE_PAIR', pair); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - SET_VARIABLE_PROP: (context, { index, prop, value }) => { - context.commit('SET_VARIABLE_PROP', { index, prop, value }); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - DELETE_VARIABLE_PAIR: (context, index) => { - context.commit('DELETE_VARIABLE_PAIR', index); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, + LOAD_PARENT_QUEUE: async (context) => { + try { + const queue = await QueuesAPI.get({ itemId: context.state.parentId }); + context.commit("SET_PARENT_QUEUE", queue); + } catch (err) { + throw err; + } + }, + ADD_ITEM: async (context) => { + if (!context.state.itemId) { + const { id } = await context.dispatch("POST_ITEM"); + context.dispatch("SET_ITEM_ID", id); + await context.dispatch("LOAD_ITEM"); + } + }, + UPDATE_ITEM: async (context) => { + if (context.state.itemInstance._dirty) { + await context.dispatch("UPD_ITEM"); + await context.dispatch("LOAD_ITEM"); + } + }, + DELETE_SINGLE: (context, { id }) => context.dispatch("DELETE_ITEM", id), + DELETE_BULK: (context, deleted) => { + const id = deleted.map((item) => item.id); + return MembersAPI.deleteBulk(context.state.parentId, { id }); + }, + DELETE_FILTERED: ( + context, + query = context.getters["filters/GET_FILTERS"], + ) => { + return MembersAPI.deleteBulk(context.state.parentId, query); + }, + DELETE_ALL: (context) => + MembersAPI.deleteBulk(context.state.parentId, { id: [] }), + RESET_MEMBERS: (context) => { + const response = MembersAPI.resetMembers(context.state); + context.dispatch("LOAD_DATA_LIST"); + return response; + }, + SET_PARENT_ITEM_ID: (context, id) => { + context.commit("SET_PARENT_ITEM_ID", id); + return context.dispatch("LOAD_PARENT_QUEUE"); + }, + ADD_MEMBER_COMMUNICATION: (context, item) => { + const value = context.state.itemInstance.communications.concat(item); + context.commit("SET_ITEM_PROPERTY", { prop: "communications", value }); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + UPDATE_MEMBER_COMMUNICATION: (context, { index, item }) => { + const value = [...context.state.itemInstance.communications]; + value.splice(index, 1, item); + context.commit("SET_ITEM_PROPERTY", { prop: "communications", value }); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + DELETE_MEMBER_COMMUNICATION: (context, deleted) => { + let action = "DELETE_SINGLE_COMMUNICATION"; + if (Array.isArray(deleted)) { + if (deleted.length) action = "DELETE_BULK_COMMUNICATIONS"; + else action = "DELETE_ALL_COMMUNICATIONS"; + } + return context.dispatch(action, deleted); + }, + DELETE_SINGLE_COMMUNICATION: (context, deleted) => { + const communications = [...context.state.itemInstance.communications]; + communications.splice(communications.indexOf(deleted), 1); + context.commit("SET_ITEM_PROPERTY", { + prop: "communications", + value: communications, + }); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + DELETE_BULK_COMMUNICATIONS: (context, deleted) => { + const communications = context.state.itemInstance.communications.filter( + (comm) => + !deleted.some((delComm) => delComm.destination === comm.destination), + ); + context.commit("SET_ITEM_PROPERTY", { + prop: "communications", + value: communications, + }); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + DELETE_ALL_COMMUNICATIONS: (context) => { + const communications = []; + context.commit("SET_ITEM_PROPERTY", { + prop: "communications", + value: communications, + }); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + ADD_VARIABLE_PAIR: (context) => { + const pair = { key: "", value: "" }; + context.commit("ADD_VARIABLE_PAIR", pair); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + SET_VARIABLE_PROP: (context, { index, prop, value }) => { + context.commit("SET_VARIABLE_PROP", { index, prop, value }); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + DELETE_VARIABLE_PAIR: (context, index) => { + context.commit("DELETE_VARIABLE_PAIR", index); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, }; const mutations = { - SET_PARENT_QUEUE: (state, queue) => { - state.parentQueue = queue; - }, - ADD_VARIABLE_PAIR: (state, pair) => { - state.itemInstance.variables.push(pair); - }, - SET_VARIABLE_PROP: (state, { index, prop, value }) => { - state.itemInstance.variables[index][prop] = value; - }, - DELETE_VARIABLE_PAIR: (state, index) => { - state.itemInstance.variables.splice(index, 1); - }, + SET_PARENT_QUEUE: (state, queue) => { + state.parentQueue = queue; + }, + ADD_VARIABLE_PAIR: (state, pair) => { + state.itemInstance.variables.push(pair); + }, + SET_VARIABLE_PROP: (state, { index, prop, value }) => { + state.itemInstance.variables[index][prop] = value; + }, + DELETE_VARIABLE_PAIR: (state, index) => { + state.itemInstance.variables.splice(index, 1); + }, }; const queueMembers = new NestedObjectStoreModule({ - resettableItemState, - headers, + resettableItemState, + headers, }) -.attachAPIModule(MembersAPI) -.generateAPIActions() -.setChildModules({ filters }) -.getModule({ actions, mutations }); + .attachAPIModule(MembersAPI) + .generateAPIActions() + .setChildModules({ filters }) + .getModule({ actions, mutations }); export default queueMembers; diff --git a/src/modules/contact-center/modules/queues/modules/res-groups/api/queueResGroups.js b/src/modules/contact-center/modules/queues/modules/res-groups/api/queueResGroups.js index 80ae8b5a3..7e5680b0b 100644 --- a/src/modules/contact-center/modules/queues/modules/res-groups/api/queueResGroups.js +++ b/src/modules/contact-center/modules/queues/modules/res-groups/api/queueResGroups.js @@ -1,131 +1,125 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { QueueResourcesServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; + camelToSnake, + merge, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { QueueResourcesServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; -const queueResService = new QueueResourcesServiceApiFactory(configuration, '', instance); +const queueResService = new QueueResourcesServiceApiFactory( + configuration, + "", + instance, +); -const fieldsToSend = ['resourceGroup', 'queueId', 'communication']; +const fieldsToSend = ["resourceGroup", "queueId", "communication"]; const preRequestHandler = (item, parentId) => ({ ...item, queueId: parentId }); const getQueueResGroupsList = async (params) => { - const { - parentId, - page, - size, - search, - sort, - fields, - id, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { parentId, page, size, search, sort, fields, id } = applyTransform( + params, + [merge(getDefaultGetParams()), starToSearch("search")], + ); - try { - const response = await queueResService.searchQueueResourceGroup( - parentId, - page, - size, - search, - sort, - fields, - id, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await queueResService.searchQueueResourceGroup( + parentId, + page, + size, + search, + sort, + fields, + id, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getQueueResGroup = async ({ parentId, itemId: id, domainId }) => { - try { - const response = await queueResService.readQueueResourceGroup(parentId, id, domainId); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await queueResService.readQueueResourceGroup( + parentId, + id, + domainId, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addQueueResGroup = async ({ parentId, itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await queueResService.createQueueResourceGroup(parentId, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await queueResService.createQueueResourceGroup( + parentId, + item, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateQueueResGroup = async ({ parentId, itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await queueResService.updateQueueResourceGroup(parentId, id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await queueResService.updateQueueResourceGroup( + parentId, + id, + item, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteQueueResGroup = async ({ parentId, id, domainId }) => { - try { - const response = await queueResService.deleteQueueResourceGroup(parentId, id, domainId); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await queueResService.deleteQueueResourceGroup( + parentId, + id, + domainId, + ); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const QueueResourceGroupsAPI = { - getList: getQueueResGroupsList, - get: getQueueResGroup, - add: addQueueResGroup, - update: updateQueueResGroup, - delete: deleteQueueResGroup, + getList: getQueueResGroupsList, + get: getQueueResGroup, + add: addQueueResGroup, + update: updateQueueResGroup, + delete: deleteQueueResGroup, }; export default QueueResourceGroupsAPI; diff --git a/src/modules/contact-center/modules/queues/modules/res-groups/components/opened-queue-resources-popup.vue b/src/modules/contact-center/modules/queues/modules/res-groups/components/opened-queue-resources-popup.vue index afa716ba4..0641d275f 100644 --- a/src/modules/contact-center/modules/queues/modules/res-groups/components/opened-queue-resources-popup.vue +++ b/src/modules/contact-center/modules/queues/modules/res-groups/components/opened-queue-resources-popup.vue @@ -38,32 +38,32 @@ diff --git a/src/modules/contact-center/modules/queues/modules/res-groups/components/opened-queue-resources.vue b/src/modules/contact-center/modules/queues/modules/res-groups/components/opened-queue-resources.vue index a4caccee0..d387726de 100644 --- a/src/modules/contact-center/modules/queues/modules/res-groups/components/opened-queue-resources.vue +++ b/src/modules/contact-center/modules/queues/modules/res-groups/components/opened-queue-resources.vue @@ -93,37 +93,39 @@ diff --git a/src/modules/contact-center/modules/queues/modules/res-groups/store/_internals/headers.js b/src/modules/contact-center/modules/queues/modules/res-groups/store/_internals/headers.js index 0a1622f0b..83262da3e 100644 --- a/src/modules/contact-center/modules/queues/modules/res-groups/store/_internals/headers.js +++ b/src/modules/contact-center/modules/queues/modules/res-groups/store/_internals/headers.js @@ -1,16 +1,16 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'resource_group', - sort: SortSymbols.NONE, - }, - { - value: 'communication', - locale: 'objects.ccenter.queues.communications', - field: 'communication', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "resource_group", + sort: SortSymbols.NONE, + }, + { + value: "communication", + locale: "objects.ccenter.queues.communications", + field: "communication", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/queues/modules/res-groups/store/queue-res-groups.js b/src/modules/contact-center/modules/queues/modules/res-groups/store/queue-res-groups.js index 7c60e4f2b..36cd24988 100644 --- a/src/modules/contact-center/modules/queues/modules/res-groups/store/queue-res-groups.js +++ b/src/modules/contact-center/modules/queues/modules/res-groups/store/queue-res-groups.js @@ -1,21 +1,20 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import QueueResGroupsAPI from '../api/queueResGroups'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import QueueResGroupsAPI from "../api/queueResGroups"; +import headers from "./_internals/headers"; const resettableItemState = { - itemInstance: { - resourceGroup: {}, - communication: {}, - }, + itemInstance: { + resourceGroup: {}, + communication: {}, + }, }; const queueResGroups = new NestedObjectStoreModule({ - resettableItemState, - headers, + resettableItemState, + headers, }) -.attachAPIModule(QueueResGroupsAPI) -.generateAPIActions() -.getModule(); + .attachAPIModule(QueueResGroupsAPI) + .generateAPIActions() + .getModule(); export default queueResGroups; diff --git a/src/modules/contact-center/modules/queues/modules/skills/api/queueSkills.js b/src/modules/contact-center/modules/queues/modules/skills/api/queueSkills.js index fb6e7eed9..2327785e7 100644 --- a/src/modules/contact-center/modules/queues/modules/skills/api/queueSkills.js +++ b/src/modules/contact-center/modules/queues/modules/skills/api/queueSkills.js @@ -1,200 +1,183 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { QueueSkillServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; - -const queueSkillService = new QueueSkillServiceApiFactory(configuration, '', instance); + camelToSnake, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { QueueSkillServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; + +const queueSkillService = new QueueSkillServiceApiFactory( + configuration, + "", + instance, +); const fieldsToSend = [ - 'maxCapacity', 'minCapacity', 'queueId', 'lvl', 'buckets', 'skill', - 'enabled', + "maxCapacity", + "minCapacity", + "queueId", + "lvl", + "buckets", + "skill", + "enabled", ]; const preRequestHandler = (parentId) => (item) => ({ - ...item, - queueId: parentId, + ...item, + queueId: parentId, }); export const getQueueSkillsList = async (params) => { - const fieldsToSend = [ - 'page', - 'size', - 'search', - 'sort', - 'fields', - 'id', - 'parentId', - 'skillId', - ]; - - const defaultObject = { - agent: {}, - minCapacity: 0, - maxCapacity: 0, - buckets: [], - lvl: 0, - enabled: false, - }; - - const { - page, - size, - search, - sort, - fields, - id, - parentId, - skillId, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - sanitize(fieldsToSend), - ]); - - try { - const response = await queueSkillService.searchQueueSkill( - parentId, - page, - size, - search, - sort, - fields, - id, - skillId, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const fieldsToSend = [ + "page", + "size", + "search", + "sort", + "fields", + "id", + "parentId", + "skillId", + ]; + + const defaultObject = { + agent: {}, + minCapacity: 0, + maxCapacity: 0, + buckets: [], + lvl: 0, + enabled: false, + }; + + const { page, size, search, sort, fields, id, parentId, skillId } = + applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + sanitize(fieldsToSend), + ]); + + try { + const response = await queueSkillService.searchQueueSkill( + parentId, + page, + size, + search, + sort, + fields, + id, + skillId, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; export const getQueueSkill = async ({ parentId, itemId: id }) => { - const defaultObject = { - agent: {}, - minCapacity: 0, - maxCapacity: 0, - buckets: [], - lvl: 0, - enabled: false, - }; - - try { - const response = await queueSkillService.readQueueSkill(parentId, id); - return applyTransform(response.data, [ - snakeToCamel(), - merge(defaultObject), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const defaultObject = { + agent: {}, + minCapacity: 0, + maxCapacity: 0, + buckets: [], + lvl: 0, + enabled: false, + }; + + try { + const response = await queueSkillService.readQueueSkill(parentId, id); + return applyTransform(response.data, [ + snakeToCamel(), + merge(defaultObject), + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; export const addQueueSkill = async ({ parentId, itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler(parentId), - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await queueSkillService.createQueueSkill(parentId, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler(parentId), + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await queueSkillService.createQueueSkill(parentId, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; export const patchQueueSkill = async ({ changes, id, parentId }) => { - const body = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await queueSkillService.patchQueueSkill(parentId, id, body); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const body = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await queueSkillService.patchQueueSkill( + parentId, + id, + body, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; export const updateQueueSkill = async ({ - itemInstance, - itemId: id, - parentId, - }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler(parentId), - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await queueSkillService.updateQueueSkill(parentId, id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + itemInstance, + itemId: id, + parentId, +}) => { + const item = applyTransform(itemInstance, [ + preRequestHandler(parentId), + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await queueSkillService.updateQueueSkill( + parentId, + id, + item, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; export const deleteQueueSkill = async ({ parentId, id }) => { - try { - const response = await queueSkillService.deleteQueueSkill(parentId, id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await queueSkillService.deleteQueueSkill(parentId, id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const QueueSkillsAPI = { - getList: getQueueSkillsList, - get: getQueueSkill, - add: addQueueSkill, - patch: patchQueueSkill, - update: updateQueueSkill, - delete: deleteQueueSkill, + getList: getQueueSkillsList, + get: getQueueSkill, + add: addQueueSkill, + patch: patchQueueSkill, + update: updateQueueSkill, + delete: deleteQueueSkill, }; export default QueueSkillsAPI; diff --git a/src/modules/contact-center/modules/queues/modules/skills/components/opened-queue-skills-buckets-popup.vue b/src/modules/contact-center/modules/queues/modules/skills/components/opened-queue-skills-buckets-popup.vue index dd824c66e..226b69dea 100644 --- a/src/modules/contact-center/modules/queues/modules/skills/components/opened-queue-skills-buckets-popup.vue +++ b/src/modules/contact-center/modules/queues/modules/skills/components/opened-queue-skills-buckets-popup.vue @@ -24,35 +24,33 @@ diff --git a/src/modules/contact-center/modules/queues/modules/skills/components/opened-queue-skills-popup.vue b/src/modules/contact-center/modules/queues/modules/skills/components/opened-queue-skills-popup.vue index 281511d27..a4cffb4b9 100644 --- a/src/modules/contact-center/modules/queues/modules/skills/components/opened-queue-skills-popup.vue +++ b/src/modules/contact-center/modules/queues/modules/skills/components/opened-queue-skills-popup.vue @@ -75,71 +75,78 @@ diff --git a/src/modules/contact-center/modules/queues/modules/skills/components/opened-queue-skills.vue b/src/modules/contact-center/modules/queues/modules/skills/components/opened-queue-skills.vue index 6bae95c3a..727b4e60f 100644 --- a/src/modules/contact-center/modules/queues/modules/skills/components/opened-queue-skills.vue +++ b/src/modules/contact-center/modules/queues/modules/skills/components/opened-queue-skills.vue @@ -120,57 +120,59 @@ diff --git a/src/modules/contact-center/modules/queues/modules/skills/store/_internals/headers.js b/src/modules/contact-center/modules/queues/modules/skills/store/_internals/headers.js index b380a36fd..ca9a8dd2e 100644 --- a/src/modules/contact-center/modules/queues/modules/skills/store/_internals/headers.js +++ b/src/modules/contact-center/modules/queues/modules/skills/store/_internals/headers.js @@ -1,34 +1,34 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'skill', - sort: SortSymbols.NONE, - }, - { - value: 'capacity', - locale: 'objects.lookups.skills.capacity', - field: 'max_capacity', - sort: SortSymbols.NONE, - }, - { - value: 'lvl', - locale: 'objects.lookups.skills.lvl', - field: 'lvl', - sort: SortSymbols.NONE, - }, - { - value: 'buckets', - locale: ['objects.lookups.buckets.buckets', 1], - field: 'buckets', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'objects.lookups.skills.state', - field: 'enabled', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "skill", + sort: SortSymbols.NONE, + }, + { + value: "capacity", + locale: "objects.lookups.skills.capacity", + field: "max_capacity", + sort: SortSymbols.NONE, + }, + { + value: "lvl", + locale: "objects.lookups.skills.lvl", + field: "lvl", + sort: SortSymbols.NONE, + }, + { + value: "buckets", + locale: ["objects.lookups.buckets.buckets", 1], + field: "buckets", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "objects.lookups.skills.state", + field: "enabled", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/queues/modules/skills/store/queue-skills.js b/src/modules/contact-center/modules/queues/modules/skills/store/queue-skills.js index 90cea593d..92fa12b53 100644 --- a/src/modules/contact-center/modules/queues/modules/skills/store/queue-skills.js +++ b/src/modules/contact-center/modules/queues/modules/skills/store/queue-skills.js @@ -1,32 +1,31 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import QueueSkillsAPI from '../api/queueSkills'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import QueueSkillsAPI from "../api/queueSkills"; +import headers from "./_internals/headers"; const resettableItemState = { - itemInstance: { - skill: {}, - lvl: 0, - minCapacity: 0, - maxCapacity: 10, - buckets: [], - enabled: true, - }, + itemInstance: { + skill: {}, + lvl: 0, + minCapacity: 0, + maxCapacity: 10, + buckets: [], + enabled: true, + }, }; const getters = { - GET_ITEM_BUCKETS: (state) => (id) => { - const item = state.dataList.filter((item) => item.id === id)[0]; - return item.buckets; - }, + GET_ITEM_BUCKETS: (state) => (id) => { + const item = state.dataList.filter((item) => item.id === id)[0]; + return item.buckets; + }, }; const queueSkills = new NestedObjectStoreModule({ - resettableItemState, - headers, + resettableItemState, + headers, }) -.attachAPIModule(QueueSkillsAPI) -.generateAPIActions() -.getModule({ getters }); + .attachAPIModule(QueueSkillsAPI) + .generateAPIActions() + .getModule({ getters }); export default queueSkills; diff --git a/src/modules/contact-center/modules/queues/store/_internals/enums/Strategy.enum.js b/src/modules/contact-center/modules/queues/store/_internals/enums/Strategy.enum.js index 42dccfb72..fe37a367e 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/enums/Strategy.enum.js +++ b/src/modules/contact-center/modules/queues/store/_internals/enums/Strategy.enum.js @@ -1,11 +1,11 @@ export const StrategyList = Object.freeze([ - { name: 'FIFO', value: 'fifo' }, - { name: 'LIFO', value: 'lifo' }, - { name: 'STRICT_FIFO', value: 'strict_fifo' }, + { name: "FIFO", value: "fifo" }, + { name: "LIFO", value: "lifo" }, + { name: "STRICT_FIFO", value: "strict_fifo" }, ]); export const Strategy = Object.freeze({ - FIFO: 'fifo', - LIFO: 'lifo', - STRICT_FIFO: 'strict_fifo', + FIFO: "fifo", + LIFO: "lifo", + STRICT_FIFO: "strict_fifo", }); diff --git a/src/modules/contact-center/modules/queues/store/_internals/enums/TimeBaseScore.enum.js b/src/modules/contact-center/modules/queues/store/_internals/enums/TimeBaseScore.enum.js index bf8dc1618..50966243f 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/enums/TimeBaseScore.enum.js +++ b/src/modules/contact-center/modules/queues/store/_internals/enums/TimeBaseScore.enum.js @@ -1,4 +1,4 @@ export const TimeBaseScore = Object.freeze({ - QUEUE: 'queue', - SYSTEM: 'system', + QUEUE: "queue", + SYSTEM: "system", }); diff --git a/src/modules/contact-center/modules/queues/store/_internals/headers.js b/src/modules/contact-center/modules/queues/store/_internals/headers.js index 12a0227d5..bf1ee79c5 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/headers.js +++ b/src/modules/contact-center/modules/queues/store/_internals/headers.js @@ -1,52 +1,52 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'type', - locale: 'objects.ccenter.queues.type', - field: 'type', - sort: SortSymbols.NONE, - }, - { - value: 'activeCalls', - locale: 'objects.ccenter.queues.activeCalls', - field: 'active', - sort: SortSymbols.NONE, - }, - { - value: 'waiting', - locale: 'objects.ccenter.queues.waiting', - field: 'waiting', - sort: SortSymbols.NONE, - }, - { - value: 'priority', - locale: 'objects.ccenter.queues.priority', - field: 'priority', - sort: SortSymbols.NONE, - }, - { - value: 'team', - locale: ['objects.ccenter.queues.teams', 1], - field: 'team', - sort: SortSymbols.NONE, - }, - { - value: 'tags', - locale: ['objects.ccenter.queues.tags', 1], - field: 'tags', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'objects.ccenter.queues.state', - field: 'enabled', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "type", + locale: "objects.ccenter.queues.type", + field: "type", + sort: SortSymbols.NONE, + }, + { + value: "activeCalls", + locale: "objects.ccenter.queues.activeCalls", + field: "active", + sort: SortSymbols.NONE, + }, + { + value: "waiting", + locale: "objects.ccenter.queues.waiting", + field: "waiting", + sort: SortSymbols.NONE, + }, + { + value: "priority", + locale: "objects.ccenter.queues.priority", + field: "priority", + sort: SortSymbols.NONE, + }, + { + value: "team", + locale: ["objects.ccenter.queues.teams", 1], + field: "team", + sort: SortSymbols.NONE, + }, + { + value: "tags", + locale: ["objects.ccenter.queues.tags", 1], + field: "tags", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "objects.ccenter.queues.state", + field: "enabled", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/queues/store/_internals/lookups/StatisticTime.lookup.js b/src/modules/contact-center/modules/queues/store/_internals/lookups/StatisticTime.lookup.js index d56e749d9..be2c3de69 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/lookups/StatisticTime.lookup.js +++ b/src/modules/contact-center/modules/queues/store/_internals/lookups/StatisticTime.lookup.js @@ -1,8 +1,8 @@ export default Object.freeze([ - { name: 't15m', value: 15 }, - { name: 't30m', value: 30 }, - { name: 't45m', value: 45 }, - { name: 't1h', value: 60 }, - { name: 't3h', value: 3 * 60 }, - { name: 't6h', value: 6 * 60 }, + { name: "t15m", value: 15 }, + { name: "t30m", value: 30 }, + { name: "t45m", value: 45 }, + { name: "t1h", value: 60 }, + { name: "t3h", value: 3 * 60 }, + { name: "t6h", value: 6 * 60 }, ]); diff --git a/src/modules/contact-center/modules/queues/store/_internals/lookups/Tone.lookup.js b/src/modules/contact-center/modules/queues/store/_internals/lookups/Tone.lookup.js index cf9e2c566..4475d0536 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/lookups/Tone.lookup.js +++ b/src/modules/contact-center/modules/queues/store/_internals/lookups/Tone.lookup.js @@ -1,13 +1,13 @@ export default Object.freeze([ - { name: 'None', value: 'none' }, - { name: 'Default', value: 'default' }, - { name: 'AT&T 1', value: 'at1' }, - { name: 'AT&T 2', value: 'at2' }, - { name: 'Australian', value: 'australian' }, - { name: 'Egypt', value: 'egypt' }, - { name: 'Germany', value: 'germany' }, - { name: 'France', value: 'france' }, - { name: 'Spain', value: 'spain' }, - { name: 'UK', value: 'uk' }, - { name: 'US', value: 'us' }, + { name: "None", value: "none" }, + { name: "Default", value: "default" }, + { name: "AT&T 1", value: "at1" }, + { name: "AT&T 2", value: "at2" }, + { name: "Australian", value: "australian" }, + { name: "Egypt", value: "egypt" }, + { name: "Germany", value: "germany" }, + { name: "France", value: "france" }, + { name: "Spain", value: "spain" }, + { name: "UK", value: "uk" }, + { name: "US", value: "us" }, ]); diff --git a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/chatInboundQueue.js b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/chatInboundQueue.js index 1f3d81b00..111e51683 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/chatInboundQueue.js +++ b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/chatInboundQueue.js @@ -1,30 +1,30 @@ -import { QueueType } from 'webitel-sdk/esm2015/enums'; -import { Strategy } from '../enums/Strategy.enum'; -import { TimeBaseScore } from '../enums/TimeBaseScore.enum'; -import queue from './defaults/defaultQueue'; -import processing from './defaults/processing'; +import { QueueType } from "webitel-sdk/esm2015/enums"; +import { Strategy } from "../enums/Strategy.enum"; +import { TimeBaseScore } from "../enums/TimeBaseScore.enum"; +import queue from "./defaults/defaultQueue"; +import processing from "./defaults/processing"; const chatInboundQueue = () => ({ - ...queue(), - type: QueueType.CHAT_INBOUND_QUEUE, - team: {}, // required - strategy: Strategy.FIFO, // required - formSchema: {}, - stickyAgent: false, - taskProcessing: processing(), - payload: { - discardAbandonedAfter: 0, - timeBaseScore: TimeBaseScore.QUEUE, // required - maxWaitTime: 60 * 60, // required - stickyAgentSec: 5, - maxIdleAgent: 60 * 60, // hour - maxIdleClient: 60 * 60, // hour - maxIdleDialog: 0, - maxWaitingSize: 0, - minOnlineAgents: 0, - manualDistribution: false, - lastMessageTimeout: false, - }, + ...queue(), + type: QueueType.CHAT_INBOUND_QUEUE, + team: {}, // required + strategy: Strategy.FIFO, // required + formSchema: {}, + stickyAgent: false, + taskProcessing: processing(), + payload: { + discardAbandonedAfter: 0, + timeBaseScore: TimeBaseScore.QUEUE, // required + maxWaitTime: 60 * 60, // required + stickyAgentSec: 5, + maxIdleAgent: 60 * 60, // hour + maxIdleClient: 60 * 60, // hour + maxIdleDialog: 0, + maxWaitingSize: 0, + minOnlineAgents: 0, + manualDistribution: false, + lastMessageTimeout: false, + }, }); export default chatInboundQueue; diff --git a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/defaults/amd.js b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/defaults/amd.js index d6bdbe0d3..fa3b496ba 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/defaults/amd.js +++ b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/defaults/amd.js @@ -1,19 +1,19 @@ const amd = () => ({ - enabled: false, - ai: false, - positive: [], - playback: {}, - allowNotSure: false, - silenceNotSure: false, - maxWordLength: 5000, - maxNumberOfWords: 3, - betweenWordsSilence: 50, - minWordLength: 100, - totalAnalysisTime: 5000, - silenceThreshold: 256, - afterGreetingSilence: 800, - greeting: 1500, - initialSilence: 2500, + enabled: false, + ai: false, + positive: [], + playback: {}, + allowNotSure: false, + silenceNotSure: false, + maxWordLength: 5000, + maxNumberOfWords: 3, + betweenWordsSilence: 50, + minWordLength: 100, + totalAnalysisTime: 5000, + silenceThreshold: 256, + afterGreetingSilence: 800, + greeting: 1500, + initialSilence: 2500, }); export default amd; diff --git a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/defaults/defaultQueue.js b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/defaults/defaultQueue.js index 45d1b480b..35c992857 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/defaults/defaultQueue.js +++ b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/defaults/defaultQueue.js @@ -1,10 +1,10 @@ const queue = () => ({ - name: '', // required - description: '', - priority: 0, - dncList: {}, - calendar: {}, // required - variables: [], + name: "", // required + description: "", + priority: 0, + dncList: {}, + calendar: {}, // required + variables: [], }); export default queue; diff --git a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/defaults/processing.js b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/defaults/processing.js index a37ee409c..8b935edfe 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/defaults/processing.js +++ b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/defaults/processing.js @@ -1,10 +1,14 @@ -import deepmerge from 'deepmerge'; +import deepmerge from "deepmerge"; -const processing = (processing = {}) => (deepmerge({ - enabled: false, - formSchema: {}, - sec: 30, - renewalSec: 15, -}, processing)); +const processing = (processing = {}) => + deepmerge( + { + enabled: false, + formSchema: {}, + sec: 30, + renewalSec: 15, + }, + processing, + ); export default processing; diff --git a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/inboundJobQueue.js b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/inboundJobQueue.js index 740a70357..4733941b0 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/inboundJobQueue.js +++ b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/inboundJobQueue.js @@ -1,24 +1,24 @@ -import { QueueType } from 'webitel-sdk/esm2015/enums'; -import { Strategy } from '../enums/Strategy.enum'; -import queue from './defaults/defaultQueue'; -import processing from './defaults/processing'; +import { QueueType } from "webitel-sdk/esm2015/enums"; +import { Strategy } from "../enums/Strategy.enum"; +import queue from "./defaults/defaultQueue"; +import processing from "./defaults/processing"; const inboundJobQueue = () => ({ - ...queue(), - type: QueueType.INBOUND_JOB_QUEUE, - team: {}, // required - strategy: Strategy.FIFO, // required - doSchema: {}, - afterSchema: {}, - stickyAgent: false, - taskProcessing: processing(), - payload: { - maxAttempts: 3, // required - waitBetweenRetries: 30 * 60, // required - maxCalls: 10, - waitBetweenRetriesDesc: false, - minOnlineAgents: 0, - }, + ...queue(), + type: QueueType.INBOUND_JOB_QUEUE, + team: {}, // required + strategy: Strategy.FIFO, // required + doSchema: {}, + afterSchema: {}, + stickyAgent: false, + taskProcessing: processing(), + payload: { + maxAttempts: 3, // required + waitBetweenRetries: 30 * 60, // required + maxCalls: 10, + waitBetweenRetriesDesc: false, + minOnlineAgents: 0, + }, }); export default inboundJobQueue; diff --git a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/inboundQueue.js b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/inboundQueue.js index 74b42fdec..31fcf375d 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/inboundQueue.js +++ b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/inboundQueue.js @@ -1,27 +1,27 @@ -import { QueueType } from 'webitel-sdk/esm2015/enums'; -import { TimeBaseScore } from '../enums/TimeBaseScore.enum'; -import queue from './defaults/defaultQueue'; -import processing from './defaults/processing'; +import { QueueType } from "webitel-sdk/esm2015/enums"; +import { TimeBaseScore } from "../enums/TimeBaseScore.enum"; +import queue from "./defaults/defaultQueue"; +import processing from "./defaults/processing"; const inboundQueue = () => ({ - ...queue(), - type: QueueType.INBOUND_QUEUE, - team: {}, // required - ringtone: {}, - grantee: {}, - stickyAgent: false, - taskProcessing: processing(), - payload: { - discardAbandonedAfter: 0, - timeBaseScore: TimeBaseScore.QUEUE, // required - maxWaitTime: 60 * 60, // required - allowGreetingAgent: false, - stickyAgentSec: 5, - maxWaitingSize: 0, - autoAnswerTone: null, - minOnlineAgents: 0, - manualDistribution: false, - }, + ...queue(), + type: QueueType.INBOUND_QUEUE, + team: {}, // required + ringtone: {}, + grantee: {}, + stickyAgent: false, + taskProcessing: processing(), + payload: { + discardAbandonedAfter: 0, + timeBaseScore: TimeBaseScore.QUEUE, // required + maxWaitTime: 60 * 60, // required + allowGreetingAgent: false, + stickyAgentSec: 5, + maxWaitingSize: 0, + autoAnswerTone: null, + minOnlineAgents: 0, + manualDistribution: false, + }, }); export default inboundQueue; diff --git a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/offlineQueue.js b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/offlineQueue.js index 468937297..1aad48092 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/offlineQueue.js +++ b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/offlineQueue.js @@ -1,26 +1,26 @@ -import { QueueType } from 'webitel-sdk/esm2015/enums'; -import { Strategy } from '../enums/Strategy.enum'; -import queue from './defaults/defaultQueue'; -import processing from './defaults/processing'; +import { QueueType } from "webitel-sdk/esm2015/enums"; +import { Strategy } from "../enums/Strategy.enum"; +import queue from "./defaults/defaultQueue"; +import processing from "./defaults/processing"; const offlineQueue = () => ({ - ...queue(), - type: QueueType.OFFLINE_QUEUE, - team: {}, // required - strategy: Strategy.FIFO, // required - doSchema: {}, - afterSchema: {}, - grantee: {}, - taskProcessing: processing(), - payload: { - maxAttempts: 3, // required - waitBetweenRetries: 30 * 60, // required - originateTimeout: 60, // required - recordings: false, - recordAll: false, - perNumbers: false, - minOnlineAgents: 0, - }, + ...queue(), + type: QueueType.OFFLINE_QUEUE, + team: {}, // required + strategy: Strategy.FIFO, // required + doSchema: {}, + afterSchema: {}, + grantee: {}, + taskProcessing: processing(), + payload: { + maxAttempts: 3, // required + waitBetweenRetries: 30 * 60, // required + originateTimeout: 60, // required + recordings: false, + recordAll: false, + perNumbers: false, + minOnlineAgents: 0, + }, }); export default offlineQueue; diff --git a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/outboundIVRQueue.js b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/outboundIVRQueue.js index 8911c8601..14115f2e5 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/outboundIVRQueue.js +++ b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/outboundIVRQueue.js @@ -1,29 +1,29 @@ -import { QueueType } from 'webitel-sdk/esm2015/enums'; -import { Strategy } from '../enums/Strategy.enum'; -import amd from './defaults/amd'; -import queue from './defaults/defaultQueue'; +import { QueueType } from "webitel-sdk/esm2015/enums"; +import { Strategy } from "../enums/Strategy.enum"; +import amd from "./defaults/amd"; +import queue from "./defaults/defaultQueue"; const outboundIVRQueue = () => ({ - ...queue(), - type: QueueType.OUTBOUND_IVR_QUEUE, - strategy: Strategy.FIFO, // required - schema: {}, - doSchema: {}, - afterSchema: {}, - grantee: {}, - payload: { - minDuration: 3, - maxAttempts: 3, // required - originateTimeout: 60, // required - waitBetweenRetries: 30 * 60, // required - waitBetweenRetriesDesc: false, - maxCalls: 10, - recordings: false, - recordAll: false, - amd: amd(), - strictCircuit: false, - perNumbers: false, - }, + ...queue(), + type: QueueType.OUTBOUND_IVR_QUEUE, + strategy: Strategy.FIFO, // required + schema: {}, + doSchema: {}, + afterSchema: {}, + grantee: {}, + payload: { + minDuration: 3, + maxAttempts: 3, // required + originateTimeout: 60, // required + waitBetweenRetries: 30 * 60, // required + waitBetweenRetriesDesc: false, + maxCalls: 10, + recordings: false, + recordAll: false, + amd: amd(), + strictCircuit: false, + perNumbers: false, + }, }); export default outboundIVRQueue; diff --git a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/outboundJobQueue.js b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/outboundJobQueue.js index 88b2b57ad..298b0c584 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/outboundJobQueue.js +++ b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/outboundJobQueue.js @@ -1,24 +1,23 @@ -import { QueueType } from 'webitel-sdk/esm2015/enums'; -import { Strategy } from '../enums/Strategy.enum'; -import queue from './defaults/defaultQueue'; +import { QueueType } from "webitel-sdk/esm2015/enums"; +import { Strategy } from "../enums/Strategy.enum"; +import queue from "./defaults/defaultQueue"; const outboundJobQueue = () => ({ - ...queue(), - type: QueueType.OUTBOUND_JOB_QUEUE, - strategy: Strategy.FIFO, // required - schema: {}, - doSchema: {}, - afterSchema: {}, - payload: { - - maxAttempts: 3, // required - originateTimeout: 60, // required - waitBetweenRetries: 30 * 60, // required - waitBetweenRetriesDesc: false, - maxCalls: 10, - strictCircuit: false, - perNumbers: false, - }, + ...queue(), + type: QueueType.OUTBOUND_JOB_QUEUE, + strategy: Strategy.FIFO, // required + schema: {}, + doSchema: {}, + afterSchema: {}, + payload: { + maxAttempts: 3, // required + originateTimeout: 60, // required + waitBetweenRetries: 30 * 60, // required + waitBetweenRetriesDesc: false, + maxCalls: 10, + strictCircuit: false, + perNumbers: false, + }, }); export default outboundJobQueue; diff --git a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/predictiveDialer.js b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/predictiveDialer.js index ece84ef39..4016e77d7 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/predictiveDialer.js +++ b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/predictiveDialer.js @@ -1,48 +1,48 @@ -import { QueueType } from 'webitel-sdk/esm2015/enums'; -import { Strategy } from '../enums/Strategy.enum'; -import amd from './defaults/amd'; -import queue from './defaults/defaultQueue'; -import processing from './defaults/processing'; +import { QueueType } from "webitel-sdk/esm2015/enums"; +import { Strategy } from "../enums/Strategy.enum"; +import amd from "./defaults/amd"; +import queue from "./defaults/defaultQueue"; +import processing from "./defaults/processing"; const predictiveDialer = () => ({ - ...queue(), - type: QueueType.PREDICTIVE_DIALER, - strategy: Strategy.FIFO, // required - team: {}, // required - doSchema: {}, - afterSchema: {}, - ringtone: {}, - grantee: {}, - stickyAgent: false, - taskProcessing: processing(), - payload: { - maxWaitTime: 10, - maxAttempts: 3, // required - originateTimeout: 60, // required - waitBetweenRetries: 30 * 60, // required - waitBetweenRetriesDesc: false, - retryAbandoned: false, - recordings: false, - recordAll: false, - allowGreetingAgent: false, - maxCalls: 10, - amd: amd(), - maxAgentLine: 5, - minAttempts: 3, - maxAbandonedRate: 5.0, - targetAbandonedRate: 3.0, - loadFactor: 10, - maxAgentLose: 1, - abandonRateAdjustment: 0, - playbackSilence: 0, - strictCircuit: false, - statisticTime: 60, - endless: false, - perNumbers: false, - stickyAgentSec: 5, - autoAnswerTone: null, - minOnlineAgents: 0, - }, + ...queue(), + type: QueueType.PREDICTIVE_DIALER, + strategy: Strategy.FIFO, // required + team: {}, // required + doSchema: {}, + afterSchema: {}, + ringtone: {}, + grantee: {}, + stickyAgent: false, + taskProcessing: processing(), + payload: { + maxWaitTime: 10, + maxAttempts: 3, // required + originateTimeout: 60, // required + waitBetweenRetries: 30 * 60, // required + waitBetweenRetriesDesc: false, + retryAbandoned: false, + recordings: false, + recordAll: false, + allowGreetingAgent: false, + maxCalls: 10, + amd: amd(), + maxAgentLine: 5, + minAttempts: 3, + maxAbandonedRate: 5.0, + targetAbandonedRate: 3.0, + loadFactor: 10, + maxAgentLose: 1, + abandonRateAdjustment: 0, + playbackSilence: 0, + strictCircuit: false, + statisticTime: 60, + endless: false, + perNumbers: false, + stickyAgentSec: 5, + autoAnswerTone: null, + minOnlineAgents: 0, + }, }); export default predictiveDialer; diff --git a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/previewDialer.js b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/previewDialer.js index 7ddf40afa..03091ac85 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/previewDialer.js +++ b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/previewDialer.js @@ -1,32 +1,32 @@ -import { QueueType } from 'webitel-sdk/esm2015/enums'; -import { Strategy } from '../enums/Strategy.enum'; -import queue from './defaults/defaultQueue'; -import processing from './defaults/processing'; +import { QueueType } from "webitel-sdk/esm2015/enums"; +import { Strategy } from "../enums/Strategy.enum"; +import queue from "./defaults/defaultQueue"; +import processing from "./defaults/processing"; const previewDialer = () => ({ - ...queue(), - type: QueueType.PREVIEW_DIALER, - team: {}, // required - strategy: Strategy.FIFO, // required - doSchema: {}, - afterSchema: {}, - grantee: {}, - stickyAgent: false, - taskProcessing: processing(), - payload: { - maxAttempts: 3, // required - originateTimeout: 60, // required - waitBetweenRetries: 30 * 60, // required - waitBetweenRetriesDesc: false, - maxCalls: 10, - recordings: false, - recordAll: false, - allowGreetingAgent: false, - strictCircuit: false, - endless: false, - perNumbers: false, - minOnlineAgents: 0, - }, + ...queue(), + type: QueueType.PREVIEW_DIALER, + team: {}, // required + strategy: Strategy.FIFO, // required + doSchema: {}, + afterSchema: {}, + grantee: {}, + stickyAgent: false, + taskProcessing: processing(), + payload: { + maxAttempts: 3, // required + originateTimeout: 60, // required + waitBetweenRetries: 30 * 60, // required + waitBetweenRetriesDesc: false, + maxCalls: 10, + recordings: false, + recordAll: false, + allowGreetingAgent: false, + strictCircuit: false, + endless: false, + perNumbers: false, + minOnlineAgents: 0, + }, }); export default previewDialer; diff --git a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/progressiveDialer.js b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/progressiveDialer.js index 1273717b6..65903c34a 100644 --- a/src/modules/contact-center/modules/queues/store/_internals/queueSchema/progressiveDialer.js +++ b/src/modules/contact-center/modules/queues/store/_internals/queueSchema/progressiveDialer.js @@ -1,36 +1,36 @@ -import { QueueType } from 'webitel-sdk/esm2015/enums'; -import { Strategy } from '../enums/Strategy.enum'; -import amd from './defaults/amd'; -import queue from './defaults/defaultQueue'; -import processing from './defaults/processing'; +import { QueueType } from "webitel-sdk/esm2015/enums"; +import { Strategy } from "../enums/Strategy.enum"; +import amd from "./defaults/amd"; +import queue from "./defaults/defaultQueue"; +import processing from "./defaults/processing"; const progressiveDialer = () => ({ - ...queue(), - type: QueueType.PROGRESSIVE_DIALER, - team: {}, // required - strategy: Strategy.FIFO, // required - doSchema: {}, - afterSchema: {}, - ringtone: {}, - grantee: {}, - stickyAgent: false, - taskProcessing: processing(), - payload: { - maxAttempts: 3, // required - originateTimeout: 60, // required - waitBetweenRetries: 30 * 60, // required - waitBetweenRetriesDesc: false, - recordings: false, - recordAll: false, - allowGreetingAgent: false, - maxCalls: 10, - amd: amd(), - strictCircuit: false, - endless: false, - perNumbers: false, - autoAnswerTone: null, - minOnlineAgents: 0, - }, + ...queue(), + type: QueueType.PROGRESSIVE_DIALER, + team: {}, // required + strategy: Strategy.FIFO, // required + doSchema: {}, + afterSchema: {}, + ringtone: {}, + grantee: {}, + stickyAgent: false, + taskProcessing: processing(), + payload: { + maxAttempts: 3, // required + originateTimeout: 60, // required + waitBetweenRetries: 30 * 60, // required + waitBetweenRetriesDesc: false, + recordings: false, + recordAll: false, + allowGreetingAgent: false, + maxCalls: 10, + amd: amd(), + strictCircuit: false, + endless: false, + perNumbers: false, + autoAnswerTone: null, + minOnlineAgents: 0, + }, }); export default progressiveDialer; diff --git a/src/modules/contact-center/modules/queues/store/queues.js b/src/modules/contact-center/modules/queues/store/queues.js index 9f54de98a..816ce7a73 100644 --- a/src/modules/contact-center/modules/queues/store/queues.js +++ b/src/modules/contact-center/modules/queues/store/queues.js @@ -1,133 +1,137 @@ -import deepMerge from 'deepmerge'; -import { QueueType } from 'webitel-sdk/esm2015/enums'; -import ObjectStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -import PermissionsStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule'; -import QueuesAPI from '../api/queues'; -import agents from '../modules/agents/store/queue-agents'; -import buckets from '../modules/buckets/store/queue-buckets'; -import filters from '../modules/filters/store/filters'; -import hooks from '../modules/hooks/store/queue-hooks'; -import log from '../modules/logs/store/queue-logs'; -import members from '../modules/members/store/queue-members'; -import resGroups from '../modules/res-groups/store/queue-res-groups'; -import skills from '../modules/skills/store/queue-skills'; -import headers from './_internals/headers'; -import defaultChatInboundQueueState - from './_internals/queueSchema/chatInboundQueue'; -import defaultQueueState from './_internals/queueSchema/defaults/defaultQueue'; -import defaultInboundJobQueueState - from './_internals/queueSchema/inboundJobQueue'; -import defaultInboundQueueState from './_internals/queueSchema/inboundQueue'; -import defaultOfflineQueueState from './_internals/queueSchema/offlineQueue'; -import defaultOutboundIVRQueueState - from './_internals/queueSchema/outboundIVRQueue'; -import defaultOutboundJobQueueState - from './_internals/queueSchema/outboundJobQueue'; -import defaultPredictiveDialerState - from './_internals/queueSchema/predictiveDialer'; -import defaultPreviewDialerState from './_internals/queueSchema/previewDialer'; -import defaultProgressiveDialerState - from './_internals/queueSchema/progressiveDialer'; +import deepMerge from "deepmerge"; +import { QueueType } from "webitel-sdk/esm2015/enums"; +import ObjectStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule"; +import PermissionsStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule"; +import QueuesAPI from "../api/queues"; +import agents from "../modules/agents/store/queue-agents"; +import buckets from "../modules/buckets/store/queue-buckets"; +import filters from "../modules/filters/store/filters"; +import hooks from "../modules/hooks/store/queue-hooks"; +import log from "../modules/logs/store/queue-logs"; +import members from "../modules/members/store/queue-members"; +import resGroups from "../modules/res-groups/store/queue-res-groups"; +import skills from "../modules/skills/store/queue-skills"; +import headers from "./_internals/headers"; +import defaultChatInboundQueueState from "./_internals/queueSchema/chatInboundQueue"; +import defaultQueueState from "./_internals/queueSchema/defaults/defaultQueue"; +import defaultInboundJobQueueState from "./_internals/queueSchema/inboundJobQueue"; +import defaultInboundQueueState from "./_internals/queueSchema/inboundQueue"; +import defaultOfflineQueueState from "./_internals/queueSchema/offlineQueue"; +import defaultOutboundIVRQueueState from "./_internals/queueSchema/outboundIVRQueue"; +import defaultOutboundJobQueueState from "./_internals/queueSchema/outboundJobQueue"; +import defaultPredictiveDialerState from "./_internals/queueSchema/predictiveDialer"; +import defaultPreviewDialerState from "./_internals/queueSchema/previewDialer"; +import defaultProgressiveDialerState from "./_internals/queueSchema/progressiveDialer"; const resettableState = { - itemInstance: defaultQueueState(), + itemInstance: defaultQueueState(), }; const queueStateMap = { - [QueueType.OFFLINE_QUEUE]: defaultOfflineQueueState, - [QueueType.INBOUND_QUEUE]: defaultInboundQueueState, - [QueueType.OUTBOUND_IVR_QUEUE]: defaultOutboundIVRQueueState, - [QueueType.PREVIEW_DIALER]: defaultPreviewDialerState, - [QueueType.PROGRESSIVE_DIALER]: defaultProgressiveDialerState, - [QueueType.PREDICTIVE_DIALER]: defaultPredictiveDialerState, - [QueueType.CHAT_INBOUND_QUEUE]: defaultChatInboundQueueState, - [QueueType.INBOUND_JOB_QUEUE]: defaultInboundJobQueueState, - [QueueType.OUTBOUND_JOB_QUEUE]: defaultOutboundJobQueueState, + [QueueType.OFFLINE_QUEUE]: defaultOfflineQueueState, + [QueueType.INBOUND_QUEUE]: defaultInboundQueueState, + [QueueType.OUTBOUND_IVR_QUEUE]: defaultOutboundIVRQueueState, + [QueueType.PREVIEW_DIALER]: defaultPreviewDialerState, + [QueueType.PROGRESSIVE_DIALER]: defaultProgressiveDialerState, + [QueueType.PREDICTIVE_DIALER]: defaultPredictiveDialerState, + [QueueType.CHAT_INBOUND_QUEUE]: defaultChatInboundQueueState, + [QueueType.INBOUND_JOB_QUEUE]: defaultInboundJobQueueState, + [QueueType.OUTBOUND_JOB_QUEUE]: defaultOutboundJobQueueState, }; const actions = { - LOAD_ITEM: async (context, type) => { - if (context.state.itemId) { - const item = await context.dispatch('GET_ITEM'); - context.dispatch('SET_TYPED_ITEM', { item, type: item.type }); - } else { - context.dispatch('SET_TYPED_ITEM', { type }); - } - }, - SET_TYPED_ITEM: (context, { type, item = {} }) => { - const typedItem = deepMerge(queueStateMap[type](), item); - context.commit('SET_ITEM', typedItem); - }, - SET_ITEM_PAYLOAD_PROPERTY: (context, payload) => { - context.commit('SET_ITEM_PAYLOAD_PROPERTY', payload); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - SET_ITEM_PROCESSING_PROPERTY: (context, payload) => { - context.commit('SET_ITEM_PROCESSING_PROPERTY', payload); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - SET_AMD_ITEM_PROPERTY: (context, payload) => { - context.commit('SET_AMD_ITEM_PROPERTY', payload); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - ADD_VARIABLE_PAIR: (context) => { - const pair = { key: '', value: '' }; - context.commit('ADD_VARIABLE_PAIR', pair); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - SET_VARIABLE_PROP: (context, { index, prop, value }) => { - context.commit('SET_VARIABLE_PROP', { index, prop, value }); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - DELETE_VARIABLE_PAIR: (context, index) => { - context.commit('DELETE_VARIABLE_PAIR', index); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - RESET_ITEM_STATE: async (context) => { - context.commit('RESET_ITEM_STATE'); - context.dispatch('ccenter/queues/skills/RESET_STATE', {}, { root: true }); - context.dispatch('ccenter/queues/agents/RESET_STATE', {}, { root: true }); - context.dispatch('ccenter/queues/hooks/RESET_STATE', {}, { root: true }); - context.dispatch('ccenter/queues/buckets/RESET_STATE', {}, { root: true }); - context.dispatch('ccenter/queues/resGroups/RESET_STATE', {}, { root: true }); - context.dispatch('ccenter/queues/members/RESET_STATE', {}, { root: true }); - }, + LOAD_ITEM: async (context, type) => { + if (context.state.itemId) { + const item = await context.dispatch("GET_ITEM"); + context.dispatch("SET_TYPED_ITEM", { item, type: item.type }); + } else { + context.dispatch("SET_TYPED_ITEM", { type }); + } + }, + SET_TYPED_ITEM: (context, { type, item = {} }) => { + const typedItem = deepMerge(queueStateMap[type](), item); + context.commit("SET_ITEM", typedItem); + }, + SET_ITEM_PAYLOAD_PROPERTY: (context, payload) => { + context.commit("SET_ITEM_PAYLOAD_PROPERTY", payload); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + SET_ITEM_PROCESSING_PROPERTY: (context, payload) => { + context.commit("SET_ITEM_PROCESSING_PROPERTY", payload); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + SET_AMD_ITEM_PROPERTY: (context, payload) => { + context.commit("SET_AMD_ITEM_PROPERTY", payload); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + ADD_VARIABLE_PAIR: (context) => { + const pair = { key: "", value: "" }; + context.commit("ADD_VARIABLE_PAIR", pair); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + SET_VARIABLE_PROP: (context, { index, prop, value }) => { + context.commit("SET_VARIABLE_PROP", { index, prop, value }); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + DELETE_VARIABLE_PAIR: (context, index) => { + context.commit("DELETE_VARIABLE_PAIR", index); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + RESET_ITEM_STATE: async (context) => { + context.commit("RESET_ITEM_STATE"); + context.dispatch("ccenter/queues/skills/RESET_STATE", {}, { root: true }); + context.dispatch("ccenter/queues/agents/RESET_STATE", {}, { root: true }); + context.dispatch("ccenter/queues/hooks/RESET_STATE", {}, { root: true }); + context.dispatch("ccenter/queues/buckets/RESET_STATE", {}, { root: true }); + context.dispatch( + "ccenter/queues/resGroups/RESET_STATE", + {}, + { root: true }, + ); + context.dispatch("ccenter/queues/members/RESET_STATE", {}, { root: true }); + }, }; const mutations = { - SET_ITEM_PAYLOAD_PROPERTY: (state, { prop, value }) => { - state.itemInstance.payload[prop] = value; - }, - SET_ITEM_PROCESSING_PROPERTY: (state, { prop, value }) => { - state.itemInstance.taskProcessing[prop] = value; - }, - SET_AMD_ITEM_PROPERTY: (state, { prop, value }) => { - state.itemInstance.payload.amd[prop] = value; - }, - ADD_VARIABLE_PAIR: (state, pair) => { - state.itemInstance.variables.push(pair); - }, - SET_VARIABLE_PROP: (state, { index, prop, value }) => { - state.itemInstance.variables[index][prop] = value; - }, - DELETE_VARIABLE_PAIR: (state, index) => { - state.itemInstance.variables.splice(index, 1); - }, + SET_ITEM_PAYLOAD_PROPERTY: (state, { prop, value }) => { + state.itemInstance.payload[prop] = value; + }, + SET_ITEM_PROCESSING_PROPERTY: (state, { prop, value }) => { + state.itemInstance.taskProcessing[prop] = value; + }, + SET_AMD_ITEM_PROPERTY: (state, { prop, value }) => { + state.itemInstance.payload.amd[prop] = value; + }, + ADD_VARIABLE_PAIR: (state, pair) => { + state.itemInstance.variables.push(pair); + }, + SET_VARIABLE_PROP: (state, { index, prop, value }) => { + state.itemInstance.variables[index][prop] = value; + }, + DELETE_VARIABLE_PAIR: (state, index) => { + state.itemInstance.variables.splice(index, 1); + }, }; -const PERMISSIONS_API_URL = '/call_center/queues'; +const PERMISSIONS_API_URL = "/call_center/queues"; const permissions = new PermissionsStoreModule() -.generateAPIActions(PERMISSIONS_API_URL) -.getModule(); + .generateAPIActions(PERMISSIONS_API_URL) + .getModule(); const queues = new ObjectStoreModule({ resettableState, headers }) -.attachAPIModule(QueuesAPI) -.generateAPIActions() -.setChildModules({ - agents, skills, buckets, resGroups, hooks, log, members, permissions, filters, -}) -.getModule({ actions, mutations }); + .attachAPIModule(QueuesAPI) + .generateAPIActions() + .setChildModules({ + agents, + skills, + buckets, + resGroups, + hooks, + log, + members, + permissions, + filters, + }) + .getModule({ actions, mutations }); export default queues; diff --git a/src/modules/contact-center/modules/resource-groups/api/resourceGroups.js b/src/modules/contact-center/modules/resource-groups/api/resourceGroups.js index a352b6ae8..ddc0394e4 100644 --- a/src/modules/contact-center/modules/resource-groups/api/resourceGroups.js +++ b/src/modules/contact-center/modules/resource-groups/api/resourceGroups.js @@ -1,168 +1,152 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - log, - merge, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import deepCopy from 'deep-copy'; -import { OutboundResourceGroupServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../app/api/instance'; -import configuration from '../../../../../app/api/openAPIConfig'; + camelToSnake, + log, + merge, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import deepCopy from "deep-copy"; +import { OutboundResourceGroupServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../app/api/instance"; +import configuration from "../../../../../app/api/openAPIConfig"; -const resGrService = new OutboundResourceGroupServiceApiFactory(configuration, '', instance); +const resGrService = new OutboundResourceGroupServiceApiFactory( + configuration, + "", + instance, +); const fieldsToSend = [ - 'name', - 'description', - 'strategy', - 'communication', - 'time', + "name", + "description", + "strategy", + "communication", + "time", ]; const preRequestHandler = (item) => { - const copy = deepCopy(item); - copy.time = copy.time.map((range) => ({ - startTimeOfDay: range.start, - endTimeOfDay: range.end, - })); - return copy; + const copy = deepCopy(item); + copy.time = copy.time.map((range) => ({ + startTimeOfDay: range.start, + endTimeOfDay: range.end, + })); + return copy; }; const getResGroupList = async (params) => { - const { - page, - size, - search, - sort, - fields, - id, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { page, size, search, sort, fields, id } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); - try { - const response = await resGrService.searchOutboundResourceGroup( - page, - size, - search, - sort, - fields, - id, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await resGrService.searchOutboundResourceGroup( + page, + size, + search, + sort, + fields, + id, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getResGroup = async ({ itemId: id }) => { - const defaultObject = { - name: '', - strategy: '', - description: '', - communication: {}, - time: [], - }; + const defaultObject = { + name: "", + strategy: "", + description: "", + communication: {}, + time: [], + }; - const responseHandler = (response) => { - const time = response.time.map((range) => ({ - start: range.startTimeOfDay || 0, - end: range.endTimeOfDay || 0, - })); - return { ...response, time }; - }; + const responseHandler = (response) => { + const time = response.time.map((range) => ({ + start: range.startTimeOfDay || 0, + end: range.endTimeOfDay || 0, + })); + return { ...response, time }; + }; - try { - const response = await resGrService.readOutboundResourceGroup(id); - return applyTransform(response.data, [ - snakeToCamel(), - merge(defaultObject), - responseHandler, - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await resGrService.readOutboundResourceGroup(id); + return applyTransform(response.data, [ + snakeToCamel(), + merge(defaultObject), + responseHandler, + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addResGroup = async ({ itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await resGrService.createOutboundResourceGroup(item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await resGrService.createOutboundResourceGroup(item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateResGroup = async ({ itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - log, - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await resGrService.updateOutboundResourceGroup(id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + log, + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await resGrService.updateOutboundResourceGroup(id, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteResGroup = async ({ id }) => { - try { - const response = await resGrService.deleteOutboundResourceGroup(id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await resGrService.deleteOutboundResourceGroup(id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -const getResGroupsLookup = (params) => getResGroupList({ - ...params, - fields: params.fields || ['id', 'name'], -}); +const getResGroupsLookup = (params) => + getResGroupList({ + ...params, + fields: params.fields || ["id", "name"], + }); const ResourceGroupsAPI = { - getList: getResGroupList, - get: getResGroup, - add: addResGroup, - update: updateResGroup, - delete: deleteResGroup, - getLookup: getResGroupsLookup, + getList: getResGroupList, + get: getResGroup, + add: addResGroup, + update: updateResGroup, + delete: deleteResGroup, + getLookup: getResGroupsLookup, }; export default ResourceGroupsAPI; diff --git a/src/modules/contact-center/modules/resource-groups/components/opened-resource-group-general.vue b/src/modules/contact-center/modules/resource-groups/components/opened-resource-group-general.vue index 290b29c6c..ddd736879 100644 --- a/src/modules/contact-center/modules/resource-groups/components/opened-resource-group-general.vue +++ b/src/modules/contact-center/modules/resource-groups/components/opened-resource-group-general.vue @@ -35,17 +35,16 @@ diff --git a/src/modules/contact-center/modules/resource-groups/components/opened-resource-group-timerange.vue b/src/modules/contact-center/modules/resource-groups/components/opened-resource-group-timerange.vue index dfb30379b..fdf98c527 100644 --- a/src/modules/contact-center/modules/resource-groups/components/opened-resource-group-timerange.vue +++ b/src/modules/contact-center/modules/resource-groups/components/opened-resource-group-timerange.vue @@ -48,12 +48,11 @@ diff --git a/src/modules/contact-center/modules/resource-groups/components/opened-resource-group.vue b/src/modules/contact-center/modules/resource-groups/components/opened-resource-group.vue index 520f8ec36..9e89a86c7 100644 --- a/src/modules/contact-center/modules/resource-groups/components/opened-resource-group.vue +++ b/src/modules/contact-center/modules/resource-groups/components/opened-resource-group.vue @@ -35,70 +35,76 @@ diff --git a/src/modules/contact-center/modules/resource-groups/components/the-resource-groups.vue b/src/modules/contact-center/modules/resource-groups/components/the-resource-groups.vue index 7b3baceed..1bb0ec9ce 100644 --- a/src/modules/contact-center/modules/resource-groups/components/the-resource-groups.vue +++ b/src/modules/contact-center/modules/resource-groups/components/the-resource-groups.vue @@ -118,53 +118,55 @@ diff --git a/src/modules/contact-center/modules/resource-groups/modules/resources/api/resInGroup.js b/src/modules/contact-center/modules/resource-groups/modules/resources/api/resInGroup.js index 00e75d4a6..e3b03cde2 100644 --- a/src/modules/contact-center/modules/resource-groups/modules/resources/api/resInGroup.js +++ b/src/modules/contact-center/modules/resource-groups/modules/resources/api/resInGroup.js @@ -1,145 +1,133 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { OutboundResourceGroupServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; - -const resGrService = new OutboundResourceGroupServiceApiFactory(configuration, '', instance); + camelToSnake, + merge, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { OutboundResourceGroupServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; + +const resGrService = new OutboundResourceGroupServiceApiFactory( + configuration, + "", + instance, +); const fieldsToSend = [ - 'groupId', - 'name', - 'description', - 'resource', - 'reserveResource', - 'priority', + "groupId", + "name", + "description", + "resource", + "reserveResource", + "priority", ]; const preRequestHandler = (parentId) => (item) => ({ - ...item, - groupId: parentId, + ...item, + groupId: parentId, }); const getResInGroupList = async (params) => { - const { - page, - size, - search, - sort, - fields, - id, - parentId, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); - - try { - const response = await resGrService.searchOutboundResourceInGroup( - parentId, - page, - size, - search, - sort, - fields, - id, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const { page, size, search, sort, fields, id, parentId } = applyTransform( + params, + [merge(getDefaultGetParams()), starToSearch("search")], + ); + + try { + const response = await resGrService.searchOutboundResourceInGroup( + parentId, + page, + size, + search, + sort, + fields, + id, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getResInGroup = async ({ parentId, itemId: id }) => { - try { - const response = await resGrService.readOutboundResourceInGroup(parentId, id); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await resGrService.readOutboundResourceInGroup( + parentId, + id, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addResInGroup = async ({ parentId, itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler(parentId), - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await resGrService.createOutboundResourceInGroup(parentId, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler(parentId), + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await resGrService.createOutboundResourceInGroup( + parentId, + item, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateResInGroup = async ({ itemInstance, itemId: id, parentId }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler(parentId), - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await resGrService.updateOutboundResourceInGroup(parentId, id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler(parentId), + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await resGrService.updateOutboundResourceInGroup( + parentId, + id, + item, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteResInGroup = async ({ parentId, id }) => { - try { - const response = await resGrService.deleteOutboundResourceInGroup(parentId, id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await resGrService.deleteOutboundResourceInGroup( + parentId, + id, + ); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const ResInGroupAPI = { - getList: getResInGroupList, - get: getResInGroup, - add: addResInGroup, - update: updateResInGroup, - delete: deleteResInGroup, + getList: getResInGroupList, + get: getResInGroup, + add: addResInGroup, + update: updateResInGroup, + delete: deleteResInGroup, }; export default ResInGroupAPI; diff --git a/src/modules/contact-center/modules/resource-groups/modules/resources/components/opened-resource-group-resource-popup.vue b/src/modules/contact-center/modules/resource-groups/modules/resources/components/opened-resource-group-resource-popup.vue index 6490e3a41..82ec7d15f 100644 --- a/src/modules/contact-center/modules/resource-groups/modules/resources/components/opened-resource-group-resource-popup.vue +++ b/src/modules/contact-center/modules/resource-groups/modules/resources/components/opened-resource-group-resource-popup.vue @@ -52,32 +52,32 @@ diff --git a/src/modules/contact-center/modules/resource-groups/modules/resources/components/opened-resource-group-resources.vue b/src/modules/contact-center/modules/resource-groups/modules/resources/components/opened-resource-group-resources.vue index 93e8fe7c3..bd50bc873 100644 --- a/src/modules/contact-center/modules/resource-groups/modules/resources/components/opened-resource-group-resources.vue +++ b/src/modules/contact-center/modules/resource-groups/modules/resources/components/opened-resource-group-resources.vue @@ -113,55 +113,56 @@ diff --git a/src/modules/contact-center/modules/resource-groups/modules/resources/store/_internals/headers.js b/src/modules/contact-center/modules/resource-groups/modules/resources/store/_internals/headers.js index f339699f7..75b3578ce 100644 --- a/src/modules/contact-center/modules/resource-groups/modules/resources/store/_internals/headers.js +++ b/src/modules/contact-center/modules/resource-groups/modules/resources/store/_internals/headers.js @@ -1,22 +1,22 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'resource', - sort: SortSymbols.NONE, - }, - { - value: 'priority', - locale: 'objects.ccenter.res.priority', - field: 'priority', - sort: SortSymbols.NONE, - }, - { - value: 'reserveResource', - locale: 'objects.ccenter.res.reserveResource', - field: 'reserveResource', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "resource", + sort: SortSymbols.NONE, + }, + { + value: "priority", + locale: "objects.ccenter.res.priority", + field: "priority", + sort: SortSymbols.NONE, + }, + { + value: "reserveResource", + locale: "objects.ccenter.res.reserveResource", + field: "reserveResource", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/resource-groups/modules/resources/store/res-in-group.js b/src/modules/contact-center/modules/resource-groups/modules/resources/store/res-in-group.js index 2e3ade806..332332740 100644 --- a/src/modules/contact-center/modules/resource-groups/modules/resources/store/res-in-group.js +++ b/src/modules/contact-center/modules/resource-groups/modules/resources/store/res-in-group.js @@ -1,19 +1,18 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import ResInGroupAPI from '../api/resInGroup'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import ResInGroupAPI from "../api/resInGroup"; +import headers from "./_internals/headers"; const resettableItemState = { - itemInstance: { - resource: {}, - reserveResource: {}, - priority: 0, - }, + itemInstance: { + resource: {}, + reserveResource: {}, + priority: 0, + }, }; const resInGroup = new NestedObjectStoreModule({ resettableItemState, headers }) -.attachAPIModule(ResInGroupAPI) -.generateAPIActions() -.getModule(); + .attachAPIModule(ResInGroupAPI) + .generateAPIActions() + .getModule(); export default resInGroup; diff --git a/src/modules/contact-center/modules/resource-groups/store/_internals/headers.js b/src/modules/contact-center/modules/resource-groups/store/_internals/headers.js index bbec159e8..c8b47f78e 100644 --- a/src/modules/contact-center/modules/resource-groups/store/_internals/headers.js +++ b/src/modules/contact-center/modules/resource-groups/store/_internals/headers.js @@ -1,22 +1,22 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'communication', - locale: ['objects.lookups.communications.communications', 1], - field: 'communication', - sort: SortSymbols.NONE, - }, - { - value: 'description', - locale: 'objects.description', - field: 'description', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "communication", + locale: ["objects.lookups.communications.communications", 1], + field: "communication", + sort: SortSymbols.NONE, + }, + { + value: "description", + locale: "objects.description", + field: "description", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/resource-groups/store/resource-groups.js b/src/modules/contact-center/modules/resource-groups/store/resource-groups.js index 2a798f1d5..c319876e3 100644 --- a/src/modules/contact-center/modules/resource-groups/store/resource-groups.js +++ b/src/modules/contact-center/modules/resource-groups/store/resource-groups.js @@ -1,71 +1,69 @@ -import ObjectStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -import PermissionsStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule'; -import ResGroupsAPI from '../api/resourceGroups'; -import res from '../modules/resources/store/res-in-group'; -import headers from './_internals/headers'; +import ObjectStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule"; +import PermissionsStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule"; +import ResGroupsAPI from "../api/resourceGroups"; +import res from "../modules/resources/store/res-in-group"; +import headers from "./_internals/headers"; const resettableState = { - itemInstance: { - name: '', - communication: {}, - description: '', - time: [ - { - start: 540, - end: 1200, - }, - ], - }, + itemInstance: { + name: "", + communication: {}, + description: "", + time: [ + { + start: 540, + end: 1200, + }, + ], + }, }; const actions = { - ADD_VARIABLE_PAIR: (context) => { - const pair = { start: 540, end: 1200 }; - context.commit('ADD_VARIABLE_PAIR', pair); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, + ADD_VARIABLE_PAIR: (context) => { + const pair = { start: 540, end: 1200 }; + context.commit("ADD_VARIABLE_PAIR", pair); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, - SET_VARIABLE_PROP: (context, { index, prop, value }) => { - context.commit('SET_VARIABLE_PROP', { index, prop, value }); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, + SET_VARIABLE_PROP: (context, { index, prop, value }) => { + context.commit("SET_VARIABLE_PROP", { index, prop, value }); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, - DELETE_VARIABLE_PAIR: (context, index) => { - context.commit('DELETE_VARIABLE_PAIR', index); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, + DELETE_VARIABLE_PAIR: (context, index) => { + context.commit("DELETE_VARIABLE_PAIR", index); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, - RESET_ITEM_STATE: (context) => { - context.commit('RESET_ITEM_STATE'); - context.dispatch('ccenter/resGroups/res/RESET_STATE', {}, { root: true }); - }, + RESET_ITEM_STATE: (context) => { + context.commit("RESET_ITEM_STATE"); + context.dispatch("ccenter/resGroups/res/RESET_STATE", {}, { root: true }); + }, }; const mutations = { - ADD_VARIABLE_PAIR: (state, pair) => { - state.itemInstance.time.push(pair); - }, + ADD_VARIABLE_PAIR: (state, pair) => { + state.itemInstance.time.push(pair); + }, - SET_VARIABLE_PROP: (state, { index, prop, value }) => { - state.itemInstance.time[index][prop] = value; - }, + SET_VARIABLE_PROP: (state, { index, prop, value }) => { + state.itemInstance.time[index][prop] = value; + }, - DELETE_VARIABLE_PAIR: (state, index) => { - state.itemInstance.time.splice(index, 1); - }, + DELETE_VARIABLE_PAIR: (state, index) => { + state.itemInstance.time.splice(index, 1); + }, }; -const PERMISSIONS_API_URL = '/call_center/resource_group'; +const PERMISSIONS_API_URL = "/call_center/resource_group"; const permissions = new PermissionsStoreModule() -.generateAPIActions(PERMISSIONS_API_URL) -.getModule(); + .generateAPIActions(PERMISSIONS_API_URL) + .getModule(); const resGroups = new ObjectStoreModule({ resettableState, headers }) -.attachAPIModule(ResGroupsAPI) -.generateAPIActions() -.setChildModules({ res, permissions }) -.getModule({ actions, mutations }); + .attachAPIModule(ResGroupsAPI) + .generateAPIActions() + .setChildModules({ res, permissions }) + .getModule({ actions, mutations }); export default resGroups; diff --git a/src/modules/contact-center/modules/resources/api/resources.js b/src/modules/contact-center/modules/resources/api/resources.js index 6e4e0fe24..3f966ab66 100644 --- a/src/modules/contact-center/modules/resources/api/resources.js +++ b/src/modules/contact-center/modules/resources/api/resources.js @@ -1,199 +1,187 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import deepCopy from 'deep-copy'; -import { OutboundResourceServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../app/api/instance'; -import configuration from '../../../../../app/api/openAPIConfig'; - -const resService = new OutboundResourceServiceApiFactory(configuration, '', instance); + camelToSnake, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import deepCopy from "deep-copy"; +import { OutboundResourceServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../app/api/instance"; +import configuration from "../../../../../app/api/openAPIConfig"; + +const resService = new OutboundResourceServiceApiFactory( + configuration, + "", + instance, +); const fieldsToSend = [ - 'limit', 'enabled', 'rps', 'maxSuccessivelyErrors', - 'name', 'errorIds', 'display', 'description', 'resourceId', 'gateway', - 'patterns', 'failureDialDelay', 'parameters', + "limit", + "enabled", + "rps", + "maxSuccessivelyErrors", + "name", + "errorIds", + "display", + "description", + "resourceId", + "gateway", + "patterns", + "failureDialDelay", + "parameters", ]; const preRequestHandler = (item) => { - const copy = deepCopy(item); - copy.maxSuccessivelyErrors = copy.maxErrors; - copy.rps = copy.cps; - return copy; + const copy = deepCopy(item); + copy.maxSuccessivelyErrors = copy.maxErrors; + copy.rps = copy.cps; + return copy; }; const getResourceList = async (params) => { - const defaultObject = { - gateway: null, - enabled: false, - }; - - const { - page, - size, - search, - sort, - fields, - id, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); - - try { - const response = await resService.searchOutboundResource( - page, - size, - search, - sort, - fields, - id, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const defaultObject = { + gateway: null, + enabled: false, + }; + + const { page, size, search, sort, fields, id } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); + + try { + const response = await resService.searchOutboundResource( + page, + size, + search, + sort, + fields, + id, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getResource = async ({ itemId: id }) => { - const defaultObject = { - name: '', - gateway: {}, - rps: 0, - limit: 0, - description: '', - maxSuccessivelyErrors: 0, - errorIds: [], - patterns: [], - failureDialDelay: 0, - parameters: { - cidType: '', - ignoreEarlyMedia: '', - }, - }; - - const responseHandler = (response) => { - const copy = deepCopy(response); - copy.maxErrors = copy.maxSuccessivelyErrors; - copy.cps = copy.rps; - copy.parameters = { - ...defaultObject.parameters, - ...copy.parameters, - }; - return copy; - }; - - try { - const response = await resService.readOutboundResource(id); - return applyTransform(response.data, [ - snakeToCamel(), - merge(defaultObject), - responseHandler, - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const defaultObject = { + name: "", + gateway: {}, + rps: 0, + limit: 0, + description: "", + maxSuccessivelyErrors: 0, + errorIds: [], + patterns: [], + failureDialDelay: 0, + parameters: { + cidType: "", + ignoreEarlyMedia: "", + }, + }; + + const responseHandler = (response) => { + const copy = deepCopy(response); + copy.maxErrors = copy.maxSuccessivelyErrors; + copy.cps = copy.rps; + copy.parameters = { + ...defaultObject.parameters, + ...copy.parameters, + }; + return copy; + }; + + try { + const response = await resService.readOutboundResource(id); + return applyTransform(response.data, [ + snakeToCamel(), + merge(defaultObject), + responseHandler, + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addResource = async ({ itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await resService.createOutboundResource(item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await resService.createOutboundResource(item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateResource = async ({ itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await resService.updateOutboundResource(id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await resService.updateOutboundResource(id, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patchResource = async ({ changes, id }) => { - const body = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await resService.patchOutboundResource(id, body); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const body = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await resService.patchOutboundResource(id, body); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteResource = async ({ id }) => { - try { - const response = await resService.deleteOutboundResource(id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await resService.deleteOutboundResource(id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -const getResourcesLookup = (params) => getResourceList({ - ...params, - fields: params.fields || ['id', 'name'], -}); +const getResourcesLookup = (params) => + getResourceList({ + ...params, + fields: params.fields || ["id", "name"], + }); const ResourcesAPI = { - getList: getResourceList, - get: getResource, - add: addResource, - patch: patchResource, - update: updateResource, - delete: deleteResource, - getLookup: getResourcesLookup, + getList: getResourceList, + get: getResource, + add: addResource, + patch: patchResource, + update: updateResource, + delete: deleteResource, + getLookup: getResourcesLookup, }; export default ResourcesAPI; diff --git a/src/modules/contact-center/modules/resources/components/opened-resource-failure.vue b/src/modules/contact-center/modules/resources/components/opened-resource-failure.vue index d55d143df..f94f717e1 100644 --- a/src/modules/contact-center/modules/resources/components/opened-resource-failure.vue +++ b/src/modules/contact-center/modules/resources/components/opened-resource-failure.vue @@ -33,21 +33,14 @@ diff --git a/src/modules/contact-center/modules/resources/components/opened-resource-general.vue b/src/modules/contact-center/modules/resources/components/opened-resource-general.vue index 5d629cdb8..adbfae96c 100644 --- a/src/modules/contact-center/modules/resources/components/opened-resource-general.vue +++ b/src/modules/contact-center/modules/resources/components/opened-resource-general.vue @@ -76,31 +76,33 @@ diff --git a/src/modules/contact-center/modules/resources/components/opened-resource.vue b/src/modules/contact-center/modules/resources/components/opened-resource.vue index 8be555605..03426a57b 100644 --- a/src/modules/contact-center/modules/resources/components/opened-resource.vue +++ b/src/modules/contact-center/modules/resources/components/opened-resource.vue @@ -35,81 +35,83 @@ diff --git a/src/modules/contact-center/modules/resources/components/the-resources.vue b/src/modules/contact-center/modules/resources/components/the-resources.vue index aa0c31aa6..f5363956f 100644 --- a/src/modules/contact-center/modules/resources/components/the-resources.vue +++ b/src/modules/contact-center/modules/resources/components/the-resources.vue @@ -120,53 +120,55 @@ diff --git a/src/modules/contact-center/modules/resources/lookups/CidType.lookup.js b/src/modules/contact-center/modules/resources/lookups/CidType.lookup.js index 94925071c..b401d9e73 100644 --- a/src/modules/contact-center/modules/resources/lookups/CidType.lookup.js +++ b/src/modules/contact-center/modules/resources/lookups/CidType.lookup.js @@ -1,5 +1 @@ -export default Object.freeze([ - 'none', - 'rpid', - 'pid', -]); +export default Object.freeze(["none", "rpid", "pid"]); diff --git a/src/modules/contact-center/modules/resources/lookups/EarlyMedia.lookup.js b/src/modules/contact-center/modules/resources/lookups/EarlyMedia.lookup.js index fa0b33022..cecadc287 100644 --- a/src/modules/contact-center/modules/resources/lookups/EarlyMedia.lookup.js +++ b/src/modules/contact-center/modules/resources/lookups/EarlyMedia.lookup.js @@ -1,6 +1 @@ -export default Object.freeze([ - 'true', - 'false', - 'consume', - 'ring_ready', -]); +export default Object.freeze(["true", "false", "consume", "ring_ready"]); diff --git a/src/modules/contact-center/modules/resources/modules/display/api/resourceDisplay.js b/src/modules/contact-center/modules/resources/modules/display/api/resourceDisplay.js index abb1ee64d..2514cbeb7 100644 --- a/src/modules/contact-center/modules/resources/modules/display/api/resourceDisplay.js +++ b/src/modules/contact-center/modules/resources/modules/display/api/resourceDisplay.js @@ -1,132 +1,121 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { OutboundResourceServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; + camelToSnake, + merge, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { OutboundResourceServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; -const resService = new OutboundResourceServiceApiFactory(configuration, '', instance); +const resService = new OutboundResourceServiceApiFactory( + configuration, + "", + instance, +); -const fieldsToSend = ['display', 'resourceId']; +const fieldsToSend = ["display", "resourceId"]; const preRequestHandler = (parentId) => (item) => ({ - ...item, - resourceId: parentId, + ...item, + resourceId: parentId, }); const getResDisplayList = async (params) => { - const { - page, - size, - search, - sort, - fields, - id, - parentId, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { page, size, search, sort, fields, id, parentId } = applyTransform( + params, + [merge(getDefaultGetParams()), starToSearch("search")], + ); - try { - const response = await resService.searchOutboundResourceDisplay( - parentId, - page, - size, - search, - sort, - fields, - id, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await resService.searchOutboundResourceDisplay( + parentId, + page, + size, + search, + sort, + fields, + id, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getResDisplay = async ({ parentId, itemId: id }) => { - try { - const response = await resService.readOutboundResourceDisplay(parentId, id); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await resService.readOutboundResourceDisplay(parentId, id); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addResDisplay = async ({ parentId, itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler(parentId), - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await resService.createOutboundResourceDisplay(parentId, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler(parentId), + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await resService.createOutboundResourceDisplay( + parentId, + item, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateResDisplay = async ({ itemInstance, itemId: id, parentId }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler(parentId), - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await resService.updateOutboundResourceDisplay(parentId, id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler(parentId), + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await resService.updateOutboundResourceDisplay( + parentId, + id, + item, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteResDisplay = async ({ parentId, id }) => { - try { - const response = await resService.deleteOutboundResourceDisplay(parentId, id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await resService.deleteOutboundResourceDisplay( + parentId, + id, + ); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; export default { - getList: getResDisplayList, - get: getResDisplay, - add: addResDisplay, - update: updateResDisplay, - delete: deleteResDisplay, + getList: getResDisplayList, + get: getResDisplay, + add: addResDisplay, + update: updateResDisplay, + delete: deleteResDisplay, }; diff --git a/src/modules/contact-center/modules/resources/modules/display/components/opened-resource-numbers-popup.vue b/src/modules/contact-center/modules/resources/modules/display/components/opened-resource-numbers-popup.vue index 20cc2fa17..6c594dbde 100644 --- a/src/modules/contact-center/modules/resources/modules/display/components/opened-resource-numbers-popup.vue +++ b/src/modules/contact-center/modules/resources/modules/display/components/opened-resource-numbers-popup.vue @@ -36,25 +36,25 @@ diff --git a/src/modules/contact-center/modules/resources/modules/display/components/opened-resource-numbers.vue b/src/modules/contact-center/modules/resources/modules/display/components/opened-resource-numbers.vue index 418708e9f..9429a1c9c 100644 --- a/src/modules/contact-center/modules/resources/modules/display/components/opened-resource-numbers.vue +++ b/src/modules/contact-center/modules/resources/modules/display/components/opened-resource-numbers.vue @@ -98,58 +98,59 @@ diff --git a/src/modules/contact-center/modules/resources/modules/display/store/_internals/headers.js b/src/modules/contact-center/modules/resources/modules/display/store/_internals/headers.js index 89560c670..0f66426ec 100644 --- a/src/modules/contact-center/modules/resources/modules/display/store/_internals/headers.js +++ b/src/modules/contact-center/modules/resources/modules/display/store/_internals/headers.js @@ -1,10 +1,10 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: ['objects.ccenter.res.numbers', 2], - field: 'display', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: ["objects.ccenter.res.numbers", 2], + field: "display", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/resources/modules/display/store/resource-display.js b/src/modules/contact-center/modules/resources/modules/display/store/resource-display.js index 7effe8095..4a2b13b20 100644 --- a/src/modules/contact-center/modules/resources/modules/display/store/resource-display.js +++ b/src/modules/contact-center/modules/resources/modules/display/store/resource-display.js @@ -1,17 +1,16 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import ResDisplayAPI from '../api/resourceDisplay'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import ResDisplayAPI from "../api/resourceDisplay"; +import headers from "./_internals/headers"; const resettableItemState = { - itemInstance: { - display: '', - }, + itemInstance: { + display: "", + }, }; const resDisplay = new NestedObjectStoreModule({ resettableItemState, headers }) -.attachAPIModule(ResDisplayAPI) -.generateAPIActions() -.getModule(); + .attachAPIModule(ResDisplayAPI) + .generateAPIActions() + .getModule(); export default resDisplay; diff --git a/src/modules/contact-center/modules/resources/store/_internals/headers.js b/src/modules/contact-center/modules/resources/store/_internals/headers.js index bb38c64dc..a74f94f5b 100644 --- a/src/modules/contact-center/modules/resources/store/_internals/headers.js +++ b/src/modules/contact-center/modules/resources/store/_internals/headers.js @@ -1,23 +1,23 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'gateway', - locale: ['objects.routing.gateways.gateways', 1], - field: 'gateway', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'reusable.state', - width: '120px', - field: 'enabled', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "gateway", + locale: ["objects.routing.gateways.gateways", 1], + field: "gateway", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "reusable.state", + width: "120px", + field: "enabled", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/resources/store/resources.js b/src/modules/contact-center/modules/resources/store/resources.js index b358a0895..99694f0a7 100644 --- a/src/modules/contact-center/modules/resources/store/resources.js +++ b/src/modules/contact-center/modules/resources/store/resources.js @@ -1,55 +1,53 @@ -import ObjectStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -import PermissionsStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule'; -import ResourcesAPI from '../api/resources'; -import numbers from '../modules/display/store/resource-display'; -import headers from './_internals/headers'; +import ObjectStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule"; +import PermissionsStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule"; +import ResourcesAPI from "../api/resources"; +import numbers from "../modules/display/store/resource-display"; +import headers from "./_internals/headers"; const resettableState = { - itemInstance: { - name: '', - gateway: {}, - cps: 10, - limit: 10, - description: '', - maxErrors: 2, - errorIds: [], - patterns: [], - failureDialDelay: 0, - parameters: { - cidType: '', - ignoreEarlyMedia: '', - }, - }, + itemInstance: { + name: "", + gateway: {}, + cps: 10, + limit: 10, + description: "", + maxErrors: 2, + errorIds: [], + patterns: [], + failureDialDelay: 0, + parameters: { + cidType: "", + ignoreEarlyMedia: "", + }, + }, }; const actions = { - RESET_ITEM_STATE: (context) => { - context.commit('RESET_ITEM_STATE'); - context.dispatch('ccenter/res/numbers/RESET_STATE', {}, { root: true }); - }, - SET_ITEM_PARAMETERS_PROPERTY: (context, parameters) => { - context.commit('SET_ITEM_PARAMETERS_PROPERTY', parameters); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, + RESET_ITEM_STATE: (context) => { + context.commit("RESET_ITEM_STATE"); + context.dispatch("ccenter/res/numbers/RESET_STATE", {}, { root: true }); + }, + SET_ITEM_PARAMETERS_PROPERTY: (context, parameters) => { + context.commit("SET_ITEM_PARAMETERS_PROPERTY", parameters); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, }; const mutations = { - SET_ITEM_PARAMETERS_PROPERTY: (state, { prop, value }) => { - state.itemInstance.parameters[prop] = value; - }, + SET_ITEM_PARAMETERS_PROPERTY: (state, { prop, value }) => { + state.itemInstance.parameters[prop] = value; + }, }; -const PERMISSIONS_API_URL = '/call_center/resources'; +const PERMISSIONS_API_URL = "/call_center/resources"; const permissions = new PermissionsStoreModule() -.generateAPIActions(PERMISSIONS_API_URL) -.getModule(); + .generateAPIActions(PERMISSIONS_API_URL) + .getModule(); const resources = new ObjectStoreModule({ resettableState, headers }) -.attachAPIModule(ResourcesAPI) -.generateAPIActions() -.setChildModules({ numbers, permissions }) -.getModule({ actions, mutations }); + .attachAPIModule(ResourcesAPI) + .generateAPIActions() + .setChildModules({ numbers, permissions }) + .getModule({ actions, mutations }); export default resources; diff --git a/src/modules/contact-center/modules/teams/api/teams.js b/src/modules/contact-center/modules/teams/api/teams.js index 892d2105a..f836dc2b1 100644 --- a/src/modules/contact-center/modules/teams/api/teams.js +++ b/src/modules/contact-center/modules/teams/api/teams.js @@ -1,153 +1,140 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { AgentTeamServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../app/api/instance'; -import configuration from '../../../../../app/api/openAPIConfig'; + camelToSnake, + merge, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { AgentTeamServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../app/api/instance"; +import configuration from "../../../../../app/api/openAPIConfig"; -const teamService = new AgentTeamServiceApiFactory(configuration, '', instance); +const teamService = new AgentTeamServiceApiFactory(configuration, "", instance); const fieldsToSend = [ - 'name', 'description', 'strategy', 'admin', 'maxNoAnswer', 'wrapUpTime', - 'noAnswerDelayTime', 'taskAcceptTimeout', 'callTimeout', 'inviteChatTimeout', + "name", + "description", + "strategy", + "admin", + "maxNoAnswer", + "wrapUpTime", + "noAnswerDelayTime", + "taskAcceptTimeout", + "callTimeout", + "inviteChatTimeout", ]; const getTeamsList = async (params) => { - const { - page, - size, - search, - sort, - fields, - id, - strategy, - adminId, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { page, size, search, sort, fields, id, strategy, adminId } = + applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); - try { - const response = await teamService.searchAgentTeam( - page, - size, - search, - sort, - fields, - id, - strategy, - adminId, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await teamService.searchAgentTeam( + page, + size, + search, + sort, + fields, + id, + strategy, + adminId, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getTeam = async ({ itemId: id }) => { - const defaultObject = { - name: '', - strategy: {}, - admin: [], - description: '', - busyDelayTime: 0, - callTimeout: 0, - maxNoAnswer: 0, - noAnswerDelayTime: 0, - taskAcceptTimeout: 0, - inviteChatTimeout: 0, - rejectDelayTime: 0, - wrapUpTime: 0, - }; + const defaultObject = { + name: "", + strategy: {}, + admin: [], + description: "", + busyDelayTime: 0, + callTimeout: 0, + maxNoAnswer: 0, + noAnswerDelayTime: 0, + taskAcceptTimeout: 0, + inviteChatTimeout: 0, + rejectDelayTime: 0, + wrapUpTime: 0, + }; - try { - const response = await teamService.readAgentTeam(id); - return applyTransform(response.data, [ - snakeToCamel(), - merge(defaultObject), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await teamService.readAgentTeam(id); + return applyTransform(response.data, [ + snakeToCamel(), + merge(defaultObject), + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addTeam = async ({ itemInstance }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await teamService.createAgentTeam(item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await teamService.createAgentTeam(item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateTeam = async ({ itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await teamService.updateAgentTeam(id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await teamService.updateAgentTeam(id, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteTeam = async ({ id }) => { - try { - const response = await teamService.deleteAgentTeam(id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await teamService.deleteAgentTeam(id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -const getTeamsLookup = (params) => getTeamsList({ - ...params, - fields: params.fields || ['id', 'name'], -}); +const getTeamsLookup = (params) => + getTeamsList({ + ...params, + fields: params.fields || ["id", "name"], + }); const TeamsAPI = { - getList: getTeamsList, - get: getTeam, - add: addTeam, - update: updateTeam, - delete: deleteTeam, - getLookup: getTeamsLookup, + getList: getTeamsList, + get: getTeam, + add: addTeam, + update: updateTeam, + delete: deleteTeam, + getLookup: getTeamsLookup, }; export default TeamsAPI; diff --git a/src/modules/contact-center/modules/teams/components/opened-team-general.vue b/src/modules/contact-center/modules/teams/components/opened-team-general.vue index cefb6f130..4fca12b7c 100644 --- a/src/modules/contact-center/modules/teams/components/opened-team-general.vue +++ b/src/modules/contact-center/modules/teams/components/opened-team-general.vue @@ -44,38 +44,40 @@ diff --git a/src/modules/contact-center/modules/teams/components/opened-team-parameters.vue b/src/modules/contact-center/modules/teams/components/opened-team-parameters.vue index 082d44878..2be100827 100644 --- a/src/modules/contact-center/modules/teams/components/opened-team-parameters.vue +++ b/src/modules/contact-center/modules/teams/components/opened-team-parameters.vue @@ -65,12 +65,11 @@ diff --git a/src/modules/contact-center/modules/teams/components/opened-team.vue b/src/modules/contact-center/modules/teams/components/opened-team.vue index 67188388d..0f0268615 100644 --- a/src/modules/contact-center/modules/teams/components/opened-team.vue +++ b/src/modules/contact-center/modules/teams/components/opened-team.vue @@ -35,87 +35,92 @@ diff --git a/src/modules/contact-center/modules/teams/components/the-teams.vue b/src/modules/contact-center/modules/teams/components/the-teams.vue index 799f6ca5d..02397324c 100644 --- a/src/modules/contact-center/modules/teams/components/the-teams.vue +++ b/src/modules/contact-center/modules/teams/components/the-teams.vue @@ -110,61 +110,63 @@ diff --git a/src/modules/contact-center/modules/teams/modules/agents/api/teamAgents.js b/src/modules/contact-center/modules/teams/modules/agents/api/teamAgents.js index bb4398274..9719e16d7 100644 --- a/src/modules/contact-center/modules/teams/modules/agents/api/teamAgents.js +++ b/src/modules/contact-center/modules/teams/modules/agents/api/teamAgents.js @@ -1,129 +1,114 @@ -import { AgentServiceApiFactory } from 'webitel-sdk'; import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, mergeEach, - notify, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; + camelToSnake, + merge, + mergeEach, + notify, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { AgentServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; -const agentService = new AgentServiceApiFactory(configuration, '', instance); +const agentService = new AgentServiceApiFactory(configuration, "", instance); const getTeamAgentsList = async (params) => { - const fields = ['id', 'name', 'status', 'supervisor', 'skills']; + const fields = ["id", "name", "status", "supervisor", "skills"]; - const defaultObject = { - name: '', - status: '', - supervisor: {}, - skills: [], - }; + const defaultObject = { + name: "", + status: "", + supervisor: {}, + skills: [], + }; - const { - parentId, - page = 1, - size = 10, - search, - sort, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { + parentId, + page = 1, + size = 10, + search, + sort, + } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); - try { - const response = await agentService.searchAgent( - page, - size, - search, - sort, - fields, - undefined, - undefined, - undefined, - parentId, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await agentService.searchAgent( + page, + size, + search, + sort, + fields, + undefined, + undefined, + undefined, + parentId, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getTeamAgent = async ({ itemId: id }) => { - const responseHandler = (agent) => ({ agent }); + const responseHandler = (agent) => ({ agent }); - try { - const response = await agentService.readAgent(id); - return applyTransform(response.data, [ - snakeToCamel(), - responseHandler, - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await agentService.readAgent(id); + return applyTransform(response.data, [snakeToCamel(), responseHandler]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patchAgent = async ({ id, changes }) => { - const item = applyTransform(changes, [ - camelToSnake(), - ]); - try { - const response = await agentService.patchAgent(id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(changes, [camelToSnake()]); + try { + const response = await agentService.patchAgent(id, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addTeamAgent = ({ parentId, itemInstance }) => { - const { id } = itemInstance.agent; - const changes = { team: { id: parentId } }; - return patchAgent({ id, changes }); + const { id } = itemInstance.agent; + const changes = { team: { id: parentId } }; + return patchAgent({ id, changes }); }; - const deleteTeamAgent = ({ id }) => { - const changes = { team: { id: null } }; - return patchAgent({ id, changes }); + const changes = { team: { id: null } }; + return patchAgent({ id, changes }); }; const updateTeamAgent = async ({ parentId, itemId, itemInstance }) => { - try { - await addTeamAgent({ parentId, itemInstance }); - await deleteTeamAgent({ id: itemId }); - } catch (err) { - throw err; - } + try { + await addTeamAgent({ parentId, itemInstance }); + await deleteTeamAgent({ id: itemId }); + } catch (err) { + throw err; + } }; const TeamAgentsAPI = { - getList: getTeamAgentsList, - get: getTeamAgent, - add: addTeamAgent, - update: updateTeamAgent, - delete: deleteTeamAgent, + getList: getTeamAgentsList, + get: getTeamAgent, + add: addTeamAgent, + update: updateTeamAgent, + delete: deleteTeamAgent, }; export default TeamAgentsAPI; diff --git a/src/modules/contact-center/modules/teams/modules/agents/components/create-team-agent-popup.vue b/src/modules/contact-center/modules/teams/modules/agents/components/create-team-agent-popup.vue index d30ff66ac..eea268509 100644 --- a/src/modules/contact-center/modules/teams/modules/agents/components/create-team-agent-popup.vue +++ b/src/modules/contact-center/modules/teams/modules/agents/components/create-team-agent-popup.vue @@ -38,32 +38,32 @@ diff --git a/src/modules/contact-center/modules/teams/modules/agents/components/opened-team-agents.vue b/src/modules/contact-center/modules/teams/modules/agents/components/opened-team-agents.vue index ea074a048..e6a250950 100644 --- a/src/modules/contact-center/modules/teams/modules/agents/components/opened-team-agents.vue +++ b/src/modules/contact-center/modules/teams/modules/agents/components/opened-team-agents.vue @@ -107,51 +107,57 @@ diff --git a/src/modules/contact-center/modules/teams/modules/agents/store/_internals/headers.js b/src/modules/contact-center/modules/teams/modules/agents/store/_internals/headers.js index 2546a5b8d..59084f2f8 100644 --- a/src/modules/contact-center/modules/teams/modules/agents/store/_internals/headers.js +++ b/src/modules/contact-center/modules/teams/modules/agents/store/_internals/headers.js @@ -1,28 +1,28 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'objects.ccenter.agents.state', - field: 'status', - sort: SortSymbols.NONE, - }, - { - value: 'supervisor', - locale: ['objects.ccenter.agents.supervisors', 1], - field: 'supervisor', - sort: SortSymbols.NONE, - }, - { - value: 'skills', - locale: ['objects.lookups.skills.skills', 2], - field: 'skills', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "objects.ccenter.agents.state", + field: "status", + sort: SortSymbols.NONE, + }, + { + value: "supervisor", + locale: ["objects.ccenter.agents.supervisors", 1], + field: "supervisor", + sort: SortSymbols.NONE, + }, + { + value: "skills", + locale: ["objects.lookups.skills.skills", 2], + field: "skills", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/teams/modules/agents/store/team-agents.js b/src/modules/contact-center/modules/teams/modules/agents/store/team-agents.js index e597c8e1e..3e4782fd6 100644 --- a/src/modules/contact-center/modules/teams/modules/agents/store/team-agents.js +++ b/src/modules/contact-center/modules/teams/modules/agents/store/team-agents.js @@ -1,17 +1,16 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import TeamAgentsAPI from '../api/teamAgents'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import TeamAgentsAPI from "../api/teamAgents"; +import headers from "./_internals/headers"; const resettableItemState = { - itemInstance: { - agent: {}, - }, + itemInstance: { + agent: {}, + }, }; const teamAgents = new NestedObjectStoreModule({ resettableItemState, headers }) -.attachAPIModule(TeamAgentsAPI) -.generateAPIActions() -.getModule(); + .attachAPIModule(TeamAgentsAPI) + .generateAPIActions() + .getModule(); export default teamAgents; diff --git a/src/modules/contact-center/modules/teams/modules/flow/api/teamFlows.js b/src/modules/contact-center/modules/teams/modules/flow/api/teamFlows.js index ad2e84e15..071e857dd 100644 --- a/src/modules/contact-center/modules/teams/modules/flow/api/teamFlows.js +++ b/src/modules/contact-center/modules/teams/modules/flow/api/teamFlows.js @@ -1,167 +1,153 @@ -import { TeamTriggerServiceApiFactory } from 'webitel-sdk'; import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, mergeEach, - notify, sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; + camelToSnake, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { TeamTriggerServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; -const flowSchemaService = new TeamTriggerServiceApiFactory(configuration, '', instance); +const flowSchemaService = new TeamTriggerServiceApiFactory( + configuration, + "", + instance, +); -const fieldsToSend = ['name', 'schema', 'enabled', 'description']; +const fieldsToSend = ["name", "schema", "enabled", "description"]; const preRequestHandler = (parentId) => (item) => ({ - ...item, - teamId: parentId, + ...item, + teamId: parentId, }); const getTeamFlowSchemasList = async (params) => { - const defaultObject = { - enabled: false, - }; + const defaultObject = { + enabled: false, + }; - const { - page, - size, - search, - sort, - fields, - id, - enabled, - parentId, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { page, size, search, sort, fields, id, enabled, parentId } = + applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); - try { - const response = await flowSchemaService.searchTeamTrigger( - parentId, - page, - size, - search, - sort, - fields, - enabled, - id, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await flowSchemaService.searchTeamTrigger( + parentId, + page, + size, + search, + sort, + fields, + enabled, + id, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getTeamFlowSchema = async ({ parentId, itemId: id }) => { - const defaultObject = { - name: '', - description: '', - enabled: false, - schema: {}, - }; + const defaultObject = { + name: "", + description: "", + enabled: false, + schema: {}, + }; - try { - const response = await flowSchemaService.readTeamTrigger(parentId, id); - return applyTransform(response.data, [ - snakeToCamel(), - merge(defaultObject), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await flowSchemaService.readTeamTrigger(parentId, id); + return applyTransform(response.data, [ + snakeToCamel(), + merge(defaultObject), + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addTeamFlowSchema = async ({ parentId, itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler(parentId), - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await flowSchemaService.createTeamTrigger(parentId, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler(parentId), + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await flowSchemaService.createTeamTrigger(parentId, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patchTeamFlowSchema = async ({ changes, id, parentId }) => { - const body = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); + const body = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); - try { - const response = await flowSchemaService.patchTeamTrigger(parentId, id, body); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await flowSchemaService.patchTeamTrigger( + parentId, + id, + body, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateTeamFlowSchema = async ({ itemInstance, itemId: id, parentId }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler(parentId), - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await flowSchemaService.updateTeamTrigger(parentId, id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler(parentId), + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await flowSchemaService.updateTeamTrigger( + parentId, + id, + item, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteTeamFlowSchema = async ({ parentId, id }) => { - try { - const response = await flowSchemaService.deleteTeamTrigger(parentId, id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await flowSchemaService.deleteTeamTrigger(parentId, id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const TeamFlowsAPI = { - getList: getTeamFlowSchemasList, - get: getTeamFlowSchema, - add: addTeamFlowSchema, - update: updateTeamFlowSchema, - patch: patchTeamFlowSchema, - delete: deleteTeamFlowSchema, + getList: getTeamFlowSchemasList, + get: getTeamFlowSchema, + add: addTeamFlowSchema, + update: updateTeamFlowSchema, + patch: patchTeamFlowSchema, + delete: deleteTeamFlowSchema, }; export default TeamFlowsAPI; diff --git a/src/modules/contact-center/modules/teams/modules/flow/components/opened-team-flow-popup.vue b/src/modules/contact-center/modules/teams/modules/flow/components/opened-team-flow-popup.vue index 59cb171b0..32ad01968 100644 --- a/src/modules/contact-center/modules/teams/modules/flow/components/opened-team-flow-popup.vue +++ b/src/modules/contact-center/modules/teams/modules/flow/components/opened-team-flow-popup.vue @@ -45,41 +45,44 @@ diff --git a/src/modules/contact-center/modules/teams/modules/flow/components/opened-team-flows.vue b/src/modules/contact-center/modules/teams/modules/flow/components/opened-team-flows.vue index ba52587f8..437b925ac 100644 --- a/src/modules/contact-center/modules/teams/modules/flow/components/opened-team-flows.vue +++ b/src/modules/contact-center/modules/teams/modules/flow/components/opened-team-flows.vue @@ -109,57 +109,58 @@ diff --git a/src/modules/contact-center/modules/teams/modules/flow/store/_internals/headers.js b/src/modules/contact-center/modules/teams/modules/flow/store/_internals/headers.js index 0ce9f9e74..93cc7396f 100644 --- a/src/modules/contact-center/modules/teams/modules/flow/store/_internals/headers.js +++ b/src/modules/contact-center/modules/teams/modules/flow/store/_internals/headers.js @@ -1,16 +1,16 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'schema', - locale: 'objects.title', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'reusable.state', - field: 'enabled', - sort: SortSymbols.NONE, - }, + { + value: "schema", + locale: "objects.title", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "reusable.state", + field: "enabled", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/teams/modules/flow/store/team-flows.js b/src/modules/contact-center/modules/teams/modules/flow/store/team-flows.js index 2d763d528..fc9122c6f 100644 --- a/src/modules/contact-center/modules/teams/modules/flow/store/team-flows.js +++ b/src/modules/contact-center/modules/teams/modules/flow/store/team-flows.js @@ -1,20 +1,19 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import TeamFlowsAPI from '../api/teamFlows'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import TeamFlowsAPI from "../api/teamFlows"; +import headers from "./_internals/headers"; const resettableItemState = { - itemInstance: { - name: '', - description: '', - enabled: true, - schema: {}, - }, + itemInstance: { + name: "", + description: "", + enabled: true, + schema: {}, + }, }; const teamFlows = new NestedObjectStoreModule({ resettableItemState, headers }) -.attachAPIModule(TeamFlowsAPI) -.generateAPIActions() -.getModule(); + .attachAPIModule(TeamFlowsAPI) + .generateAPIActions() + .getModule(); export default teamFlows; diff --git a/src/modules/contact-center/modules/teams/modules/hooks/api/teamHooks.js b/src/modules/contact-center/modules/teams/modules/hooks/api/teamHooks.js index 79eba7875..bae6c6953 100644 --- a/src/modules/contact-center/modules/teams/modules/hooks/api/teamHooks.js +++ b/src/modules/contact-center/modules/teams/modules/hooks/api/teamHooks.js @@ -1,167 +1,143 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { TeamHookServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; + camelToSnake, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { TeamHookServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; -const teamHookService = new TeamHookServiceApiFactory(configuration, '', instance); +const teamHookService = new TeamHookServiceApiFactory( + configuration, + "", + instance, +); -const fieldsToSend = ['event', 'properties', 'schema', 'enabled']; +const fieldsToSend = ["event", "properties", "schema", "enabled"]; const preRequestHandler = (parentId) => (item) => ({ - ...item, - teamId: parentId, + ...item, + teamId: parentId, }); const getTeamHooksList = async (params) => { - const defaultObject = { - enabled: false, - }; + const defaultObject = { + enabled: false, + }; - const { - page, - size, - search, - sort, - fields, - id, - parentId, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { page, size, search, sort, fields, id, parentId } = applyTransform( + params, + [merge(getDefaultGetParams()), starToSearch("search")], + ); - try { - const response = await teamHookService.searchTeamHook( - parentId, - page, - size, - search, - sort, - fields, - id, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await teamHookService.searchTeamHook( + parentId, + page, + size, + search, + sort, + fields, + id, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getTeamHook = async ({ parentId, itemId: id }) => { - const defaultObject = { - event: '', - properties: [], - schema: {}, - enabled: false, - }; + const defaultObject = { + event: "", + properties: [], + schema: {}, + enabled: false, + }; - try { - const response = await teamHookService.readTeamHook(parentId, id); - return applyTransform(response.data, [ - snakeToCamel(), - merge(defaultObject), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await teamHookService.readTeamHook(parentId, id); + return applyTransform(response.data, [ + snakeToCamel(), + merge(defaultObject), + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addTeamHook = async ({ parentId, itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler(parentId), - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await teamHookService.createTeamHook(parentId, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler(parentId), + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await teamHookService.createTeamHook(parentId, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patchTeamHook = async ({ changes, id, parentId }) => { - const body = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); + const body = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); - try { - const response = await teamHookService.patchTeamHook(parentId, id, body); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await teamHookService.patchTeamHook(parentId, id, body); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateTeamHook = async ({ itemInstance, itemId: id, parentId }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler(parentId), - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await teamHookService.updateTeamHook(parentId, id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler(parentId), + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await teamHookService.updateTeamHook(parentId, id, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteTeamHook = async ({ parentId, id }) => { - try { - const response = await teamHookService.deleteTeamHook(parentId, id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await teamHookService.deleteTeamHook(parentId, id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const TeamHooksAPI = { - getList: getTeamHooksList, - get: getTeamHook, - add: addTeamHook, - patch: patchTeamHook, - update: updateTeamHook, - delete: deleteTeamHook, + getList: getTeamHooksList, + get: getTeamHook, + add: addTeamHook, + patch: patchTeamHook, + update: updateTeamHook, + delete: deleteTeamHook, }; export default TeamHooksAPI; diff --git a/src/modules/contact-center/modules/teams/modules/hooks/components/opened-team-hooks-popup.vue b/src/modules/contact-center/modules/teams/modules/hooks/components/opened-team-hooks-popup.vue index d6fa6f421..da7402325 100644 --- a/src/modules/contact-center/modules/teams/modules/hooks/components/opened-team-hooks-popup.vue +++ b/src/modules/contact-center/modules/teams/modules/hooks/components/opened-team-hooks-popup.vue @@ -48,53 +48,62 @@ diff --git a/src/modules/contact-center/modules/teams/modules/hooks/components/opened-team-hooks.vue b/src/modules/contact-center/modules/teams/modules/hooks/components/opened-team-hooks.vue index 850dbc3f1..247942e08 100644 --- a/src/modules/contact-center/modules/teams/modules/hooks/components/opened-team-hooks.vue +++ b/src/modules/contact-center/modules/teams/modules/hooks/components/opened-team-hooks.vue @@ -101,57 +101,58 @@ diff --git a/src/modules/contact-center/modules/teams/modules/hooks/enum/HookTeamEvent.enum.js b/src/modules/contact-center/modules/teams/modules/hooks/enum/HookTeamEvent.enum.js index 3eb9a7101..c5521e6e7 100644 --- a/src/modules/contact-center/modules/teams/modules/hooks/enum/HookTeamEvent.enum.js +++ b/src/modules/contact-center/modules/teams/modules/hooks/enum/HookTeamEvent.enum.js @@ -1,3 +1,3 @@ export default Object.freeze({ - AGENT_STATUS: 'agent_status', + AGENT_STATUS: "agent_status", }); diff --git a/src/modules/contact-center/modules/teams/modules/hooks/store/_internals/headers.js b/src/modules/contact-center/modules/teams/modules/hooks/store/_internals/headers.js index 41988077b..44597ae52 100644 --- a/src/modules/contact-center/modules/teams/modules/hooks/store/_internals/headers.js +++ b/src/modules/contact-center/modules/teams/modules/hooks/store/_internals/headers.js @@ -1,22 +1,22 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'event', - locale: 'objects.ccenter.queues.hooks.event', - field: 'event', - sort: SortSymbols.NONE, - }, - { - value: 'schema', - locale: ['objects.routing.flow.flow', 1], - field: 'schema', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'reusable.state', - field: 'enabled', - sort: SortSymbols.NONE, - }, + { + value: "event", + locale: "objects.ccenter.queues.hooks.event", + field: "event", + sort: SortSymbols.NONE, + }, + { + value: "schema", + locale: ["objects.routing.flow.flow", 1], + field: "schema", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "reusable.state", + field: "enabled", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/teams/modules/hooks/store/team-hooks.js b/src/modules/contact-center/modules/teams/modules/hooks/store/team-hooks.js index d0f455a59..5f363367e 100644 --- a/src/modules/contact-center/modules/teams/modules/hooks/store/team-hooks.js +++ b/src/modules/contact-center/modules/teams/modules/hooks/store/team-hooks.js @@ -1,20 +1,19 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import TeamHooksAPI from '../api/teamHooks'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import TeamHooksAPI from "../api/teamHooks"; +import headers from "./_internals/headers"; const resettableItemState = { - itemInstance: { - event: '', - properties: [], - schema: {}, - enabled: true, - }, + itemInstance: { + event: "", + properties: [], + schema: {}, + enabled: true, + }, }; const teamHooks = new NestedObjectStoreModule({ resettableItemState, headers }) - .attachAPIModule(TeamHooksAPI) - .generateAPIActions() - .getModule(); + .attachAPIModule(TeamHooksAPI) + .generateAPIActions() + .getModule(); export default teamHooks; diff --git a/src/modules/contact-center/modules/teams/modules/supervisors/api/teamSupervisors.js b/src/modules/contact-center/modules/teams/modules/supervisors/api/teamSupervisors.js index d3b5b662e..ce0600fd5 100644 --- a/src/modules/contact-center/modules/teams/modules/supervisors/api/teamSupervisors.js +++ b/src/modules/contact-center/modules/teams/modules/supervisors/api/teamSupervisors.js @@ -1,168 +1,144 @@ -import { AgentServiceApiFactory } from 'webitel-sdk'; import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - notify, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; - -const teamSupervisorService = new AgentServiceApiFactory(configuration, '', instance); + camelToSnake, + merge, + notify, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { AgentServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; + +const teamSupervisorService = new AgentServiceApiFactory( + configuration, + "", + instance, +); const getTeamSupervisorsList = async (params) => { - const isSupervisor = true; - const fields = ['id', 'name']; - - const { - page, - size, - search, - parentId, - sort, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); - - try { - const response = await teamSupervisorService.searchAgent( - page, - size, - search, - sort, - fields, - undefined, - undefined, - undefined, - parentId, - undefined, - undefined, - isSupervisor, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const isSupervisor = true; + const fields = ["id", "name"]; + + const { page, size, search, parentId, sort } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); + + try { + const response = await teamSupervisorService.searchAgent( + page, + size, + search, + sort, + fields, + undefined, + undefined, + undefined, + parentId, + undefined, + undefined, + isSupervisor, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getTeamSupervisor = async ({ itemId: id }) => { - const responseHandler = (agent) => ({ agent }); - - try { - const response = await teamSupervisorService.readAgent(id); - return applyTransform(response.data, [ - snakeToCamel(), - responseHandler, - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const responseHandler = (agent) => ({ agent }); + + try { + const response = await teamSupervisorService.readAgent(id); + return applyTransform(response.data, [snakeToCamel(), responseHandler]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patchAgent = async ({ id, changes }) => { - const item = applyTransform(changes, [ - camelToSnake(), - ]); - try { - const response = await teamSupervisorService.patchAgent(id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(changes, [camelToSnake()]); + try { + const response = await teamSupervisorService.patchAgent(id, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getTeamSupervisorSubordinatesList = async (params) => { - const fields = ['id', 'user']; - - const { - page, - size, - search, - supervisorId, - teamId, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); - - try { - const response = await teamSupervisorService.searchAgent( - page, - size, - search, - undefined, - fields, - undefined, - undefined, - supervisorId, - teamId, - undefined, - undefined, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const fields = ["id", "user"]; + + const { page, size, search, supervisorId, teamId } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); + + try { + const response = await teamSupervisorService.searchAgent( + page, + size, + search, + undefined, + fields, + undefined, + undefined, + supervisorId, + teamId, + undefined, + undefined, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addTeamSupervisor = ({ parentId, itemInstance }) => { - const { id } = itemInstance.agent; - const changes = { team: { id: parentId } }; - return patchAgent({ id, changes }); + const { id } = itemInstance.agent; + const changes = { team: { id: parentId } }; + return patchAgent({ id, changes }); }; const deleteTeamSupervisor = ({ id }) => { - const changes = { team: { id: null } }; - return patchAgent({ id, changes }); + const changes = { team: { id: null } }; + return patchAgent({ id, changes }); }; const updateTeamSupervisor = async ({ parentId, itemId, itemInstance }) => { - try { - await addTeamSupervisor({ parentId, itemInstance }); - await deleteTeamSupervisor({ id: itemId }); - } catch (err) { - throw err; - } + try { + await addTeamSupervisor({ parentId, itemInstance }); + await deleteTeamSupervisor({ id: itemId }); + } catch (err) { + throw err; + } }; - const TeamSupervisorsAPI = { - getList: getTeamSupervisorsList, - get: getTeamSupervisor, - add: addTeamSupervisor, - update: updateTeamSupervisor, - delete: deleteTeamSupervisor, - getTeamSupervisorSubordinatesList, + getList: getTeamSupervisorsList, + get: getTeamSupervisor, + add: addTeamSupervisor, + update: updateTeamSupervisor, + delete: deleteTeamSupervisor, + getTeamSupervisorSubordinatesList, }; export default TeamSupervisorsAPI; diff --git a/src/modules/contact-center/modules/teams/modules/supervisors/components/opened-team-supervisor-subordinates-popup.vue b/src/modules/contact-center/modules/teams/modules/supervisors/components/opened-team-supervisor-subordinates-popup.vue index 0a6df415d..a188773bb 100644 --- a/src/modules/contact-center/modules/teams/modules/supervisors/components/opened-team-supervisor-subordinates-popup.vue +++ b/src/modules/contact-center/modules/teams/modules/supervisors/components/opened-team-supervisor-subordinates-popup.vue @@ -24,47 +24,50 @@ diff --git a/src/modules/contact-center/modules/teams/modules/supervisors/components/opened-team-supervisors-popup.vue b/src/modules/contact-center/modules/teams/modules/supervisors/components/opened-team-supervisors-popup.vue index 3181160d6..be44a50c7 100644 --- a/src/modules/contact-center/modules/teams/modules/supervisors/components/opened-team-supervisors-popup.vue +++ b/src/modules/contact-center/modules/teams/modules/supervisors/components/opened-team-supervisors-popup.vue @@ -38,51 +38,54 @@ diff --git a/src/modules/contact-center/modules/teams/modules/supervisors/components/opened-team-supervisors.vue b/src/modules/contact-center/modules/teams/modules/supervisors/components/opened-team-supervisors.vue index f4371ca1a..e807e6c3d 100644 --- a/src/modules/contact-center/modules/teams/modules/supervisors/components/opened-team-supervisors.vue +++ b/src/modules/contact-center/modules/teams/modules/supervisors/components/opened-team-supervisors.vue @@ -118,80 +118,81 @@ diff --git a/src/modules/contact-center/modules/teams/modules/supervisors/store/_internals/headers.js b/src/modules/contact-center/modules/teams/modules/supervisors/store/_internals/headers.js index df7fb9f2e..9c66f4625 100644 --- a/src/modules/contact-center/modules/teams/modules/supervisors/store/_internals/headers.js +++ b/src/modules/contact-center/modules/teams/modules/supervisors/store/_internals/headers.js @@ -1,10 +1,10 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/teams/modules/supervisors/store/team-supervisors.js b/src/modules/contact-center/modules/teams/modules/supervisors/store/team-supervisors.js index 6bf89a8b8..ba52f423c 100644 --- a/src/modules/contact-center/modules/teams/modules/supervisors/store/team-supervisors.js +++ b/src/modules/contact-center/modules/teams/modules/supervisors/store/team-supervisors.js @@ -1,20 +1,19 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import TeamSupervisorsAPI from '../api/teamSupervisors'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import TeamSupervisorsAPI from "../api/teamSupervisors"; +import headers from "./_internals/headers"; const resettableItemState = { - itemInstance: { - agent: {}, - }, + itemInstance: { + agent: {}, + }, }; const teamSupervisors = new NestedObjectStoreModule({ - resettableItemState, - headers, + resettableItemState, + headers, }) -.attachAPIModule(TeamSupervisorsAPI) -.generateAPIActions() -.getModule(); + .attachAPIModule(TeamSupervisorsAPI) + .generateAPIActions() + .getModule(); export default teamSupervisors; diff --git a/src/modules/contact-center/modules/teams/store/_internals/enums/TeamStrategy.enum.js b/src/modules/contact-center/modules/teams/store/_internals/enums/TeamStrategy.enum.js index cdd0b2814..87b180396 100644 --- a/src/modules/contact-center/modules/teams/store/_internals/enums/TeamStrategy.enum.js +++ b/src/modules/contact-center/modules/teams/store/_internals/enums/TeamStrategy.enum.js @@ -1,12 +1,12 @@ const TeamStrategy = Object.freeze({ - RANDOM: 'random', - FEWEST_CALLS: 'fewest-calls', - LEAST_TALK_TIME: 'least-talk-time', - TOP_DOWN: 'top-down', - ROUND_ROBIN: 'round-robin', - ROUND_ROBIN_BUCKET: 'round-robin-bucket', - LONGEST_IDLE_AGENT: 'longest-idle-agent', - SKILL_CAPACITY: 'skill-capacity', + RANDOM: "random", + FEWEST_CALLS: "fewest-calls", + LEAST_TALK_TIME: "least-talk-time", + TOP_DOWN: "top-down", + ROUND_ROBIN: "round-robin", + ROUND_ROBIN_BUCKET: "round-robin-bucket", + LONGEST_IDLE_AGENT: "longest-idle-agent", + SKILL_CAPACITY: "skill-capacity", }); export default TeamStrategy; diff --git a/src/modules/contact-center/modules/teams/store/_internals/headers.js b/src/modules/contact-center/modules/teams/store/_internals/headers.js index f43ebe724..5501bd90f 100644 --- a/src/modules/contact-center/modules/teams/store/_internals/headers.js +++ b/src/modules/contact-center/modules/teams/store/_internals/headers.js @@ -1,16 +1,16 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'strategy', - locale: 'objects.ccenter.teams.strategy', - field: 'strategy', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "strategy", + locale: "objects.ccenter.teams.strategy", + field: "strategy", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/contact-center/modules/teams/store/teams.js b/src/modules/contact-center/modules/teams/store/teams.js index fdb6d8f73..f5937fa1f 100644 --- a/src/modules/contact-center/modules/teams/store/teams.js +++ b/src/modules/contact-center/modules/teams/store/teams.js @@ -1,48 +1,50 @@ -import ObjectStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -import PermissionsStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule'; -import TeamsAPI from '../api/teams'; -import agents from '../modules/agents/store/team-agents'; -import supervisors from '../modules/supervisors/store/team-supervisors'; -import hooks from '../modules/hooks/store/team-hooks'; -import flow from '../modules/flow/store/team-flows'; -import headers from './_internals/headers'; +import ObjectStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule"; +import PermissionsStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule"; +import TeamsAPI from "../api/teams"; +import agents from "../modules/agents/store/team-agents"; +import flow from "../modules/flow/store/team-flows"; +import hooks from "../modules/hooks/store/team-hooks"; +import supervisors from "../modules/supervisors/store/team-supervisors"; +import headers from "./_internals/headers"; const resettableState = { - itemInstance: { - name: '', - description: '', - strategy: {}, - admin: [], - maxNoAnswer: 3, - wrapUpTime: 15, - noAnswerDelayTime: 30, - taskAcceptTimeout: 30, - callTimeout: 60, - inviteChatTimeout: 30, - }, + itemInstance: { + name: "", + description: "", + strategy: {}, + admin: [], + maxNoAnswer: 3, + wrapUpTime: 15, + noAnswerDelayTime: 30, + taskAcceptTimeout: 30, + callTimeout: 60, + inviteChatTimeout: 30, + }, }; const actions = { - RESET_ITEM_STATE: (context) => { - context.commit('RESET_ITEM_STATE'); - context.dispatch('ccenter/teams/supervisors/RESET_STATE', {}, { root: true }); - context.dispatch('ccenter/teams/agents/RESET_STATE', {}, { root: true }); - context.dispatch('ccenter/teams/hooks/RESET_STATE', {}, { root: true }); - context.dispatch('ccenter/teams/flows/RESET_STATE', {}, { root: true }); - }, + RESET_ITEM_STATE: (context) => { + context.commit("RESET_ITEM_STATE"); + context.dispatch( + "ccenter/teams/supervisors/RESET_STATE", + {}, + { root: true }, + ); + context.dispatch("ccenter/teams/agents/RESET_STATE", {}, { root: true }); + context.dispatch("ccenter/teams/hooks/RESET_STATE", {}, { root: true }); + context.dispatch("ccenter/teams/flows/RESET_STATE", {}, { root: true }); + }, }; -const PERMISSIONS_API_URL = '/call_center/teams'; +const PERMISSIONS_API_URL = "/call_center/teams"; const permissions = new PermissionsStoreModule() -.generateAPIActions(PERMISSIONS_API_URL) -.getModule(); + .generateAPIActions(PERMISSIONS_API_URL) + .getModule(); const teams = new ObjectStoreModule({ resettableState, headers }) -.attachAPIModule(TeamsAPI) -.generateAPIActions() -.setChildModules({ supervisors, agents, hooks, flow, permissions }) -.getModule({ actions }); + .attachAPIModule(TeamsAPI) + .generateAPIActions() + .setChildModules({ supervisors, agents, hooks, flow, permissions }) + .getModule({ actions }); export default teams; diff --git a/src/modules/contact-center/store/ccenter.js b/src/modules/contact-center/store/ccenter.js index b371f48b9..f39844541 100644 --- a/src/modules/contact-center/store/ccenter.js +++ b/src/modules/contact-center/store/ccenter.js @@ -1,18 +1,18 @@ -import agents from '../modules/agents/store/agents'; -import queues from '../modules/queues/store/queues'; -import resGroups from '../modules/resource-groups/store/resource-groups'; -import res from '../modules/resources/store/resources'; -import teams from '../modules/teams/store/teams'; +import agents from "../modules/agents/store/agents"; +import queues from "../modules/queues/store/queues"; +import resGroups from "../modules/resource-groups/store/resource-groups"; +import res from "../modules/resources/store/resources"; +import teams from "../modules/teams/store/teams"; const modules = { - agents, - teams, - queues, - res, - resGroups, + agents, + teams, + queues, + res, + resGroups, }; export default { - namespaced: true, - modules, + namespaced: true, + modules, }; diff --git a/src/modules/directory/modules/devices/api/devices.js b/src/modules/directory/modules/devices/api/devices.js index 886b364ac..00bfb9d0f 100644 --- a/src/modules/directory/modules/devices/api/devices.js +++ b/src/modules/directory/modules/devices/api/devices.js @@ -1,195 +1,178 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - generateUrl, - log, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import deepCopy from 'deep-copy'; -import instance from '../../../../../app/api/instance'; - -const baseUrl = '/devices'; + camelToSnake, + generateUrl, + log, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import deepCopy from "deep-copy"; +import instance from "../../../../../app/api/instance"; + +const baseUrl = "/devices"; const fieldsToSend = [ - 'name', 'account', 'password', 'user', - 'mac', 'ip', 'brand', 'model', 'hotdesks', 'hotdesk', + "name", + "account", + "password", + "user", + "mac", + "ip", + "brand", + "model", + "hotdesks", + "hotdesk", ]; const getDeviceList = async (params) => { - const fieldsToSend = ['page', 'size', 'q', 'sort', 'fields', 'id']; - - const defaultObject = { - state: 0, - }; - - const url = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - (params) => ({ ...params, q: params.search }), - sanitize(fieldsToSend), - camelToSnake(), - generateUrl(baseUrl), - ]); - try { - const response = await instance.get(url); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const fieldsToSend = ["page", "size", "q", "sort", "fields", "id"]; + + const defaultObject = { + state: 0, + }; + + const url = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + (params) => ({ ...params, q: params.search }), + sanitize(fieldsToSend), + camelToSnake(), + generateUrl(baseUrl), + ]); + try { + const response = await instance.get(url); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getDevice = async ({ itemId: id }) => { - const defaultObject = { - state: 0, - hotdesks: [], - hotdesk: false, - }; - - const url = `${baseUrl}/${id}`; - - try { - const response = await instance.get(url); - return applyTransform(response.data, [ - snakeToCamel(), - merge(defaultObject), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const defaultObject = { + state: 0, + hotdesks: [], + hotdesk: false, + }; + + const url = `${baseUrl}/${id}`; + + try { + const response = await instance.get(url); + return applyTransform(response.data, [ + snakeToCamel(), + merge(defaultObject), + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const preRequestHandler = (item) => { - const copy = deepCopy(item); - if (!copy.password) delete copy.password; - return copy; + const copy = deepCopy(item); + if (!copy.password) copy.password = undefined; + return copy; }; const addDevice = async ({ itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await instance.post(baseUrl, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await instance.post(baseUrl, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateDevice = async ({ itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(), - ]); - - const url = `${baseUrl}/${id}`; - try { - const response = await instance.put(url, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(), + ]); + + const url = `${baseUrl}/${id}`; + try { + const response = await instance.put(url, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteDevice = async ({ id }) => { - const url = `${baseUrl}/${id}`; - try { - const response = await instance.delete(url); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const url = `${baseUrl}/${id}`; + try { + const response = await instance.delete(url); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -const getDevicesLookup = (params) => getDeviceList({ - ...params, - fields: params.fields || ['id', 'name'], -}); - -const getDeviceHistory = async ({ - parentId, from, to, ...rest - }) => { - const fieldsToSend = [ - 'page', - 'size', - 'search', - 'fields', - 'id', - 'timeFrom', - 'timeTo', - ]; - const url = applyTransform({ ...rest, timeFrom: from, timeTo: to }, [ - merge(getDefaultGetParams()), - starToSearch('search'), - (params) => ({ ...params, q: params.search }), - sanitize(fieldsToSend), - camelToSnake(), - generateUrl(`${baseUrl}/${parentId}/users/audit`), - log, - ]); - try { - const response = await instance.get(url); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } +const getDevicesLookup = (params) => + getDeviceList({ + ...params, + fields: params.fields || ["id", "name"], + }); + +const getDeviceHistory = async ({ parentId, from, to, ...rest }) => { + const fieldsToSend = [ + "page", + "size", + "search", + "fields", + "id", + "timeFrom", + "timeTo", + ]; + const url = applyTransform({ ...rest, timeFrom: from, timeTo: to }, [ + merge(getDefaultGetParams()), + starToSearch("search"), + (params) => ({ ...params, q: params.search }), + sanitize(fieldsToSend), + camelToSnake(), + generateUrl(`${baseUrl}/${parentId}/users/audit`), + log, + ]); + try { + const response = await instance.get(url); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const DevicesAPI = { - getList: getDeviceList, - get: getDevice, - add: addDevice, - update: updateDevice, - delete: deleteDevice, - getLookup: getDevicesLookup, - getDeviceHistory, + getList: getDeviceList, + get: getDevice, + add: addDevice, + update: updateDevice, + delete: deleteDevice, + getLookup: getDevicesLookup, + getDeviceHistory, }; export default DevicesAPI; diff --git a/src/modules/directory/modules/devices/components/create-device-popup.vue b/src/modules/directory/modules/devices/components/create-device-popup.vue index c574b8182..819dd8c3d 100644 --- a/src/modules/directory/modules/devices/components/create-device-popup.vue +++ b/src/modules/directory/modules/devices/components/create-device-popup.vue @@ -41,54 +41,57 @@ diff --git a/src/modules/directory/modules/devices/components/device-history-popup.vue b/src/modules/directory/modules/devices/components/device-history-popup.vue index 5b2a60133..e4eb21b32 100644 --- a/src/modules/directory/modules/devices/components/device-history-popup.vue +++ b/src/modules/directory/modules/devices/components/device-history-popup.vue @@ -69,24 +69,30 @@ diff --git a/src/modules/directory/modules/devices/components/opened-device-general.vue b/src/modules/directory/modules/devices/components/opened-device-general.vue index e978057b0..d70fac621 100644 --- a/src/modules/directory/modules/devices/components/opened-device-general.vue +++ b/src/modules/directory/modules/devices/components/opened-device-general.vue @@ -41,20 +41,19 @@ diff --git a/src/modules/directory/modules/devices/components/opened-device-phone-info.vue b/src/modules/directory/modules/devices/components/opened-device-phone-info.vue index 1f7d8c362..4f73ea9fe 100644 --- a/src/modules/directory/modules/devices/components/opened-device-phone-info.vue +++ b/src/modules/directory/modules/devices/components/opened-device-phone-info.vue @@ -44,35 +44,35 @@ diff --git a/src/modules/directory/modules/devices/components/opened-device.vue b/src/modules/directory/modules/devices/components/opened-device.vue index 214fc72fc..916162333 100644 --- a/src/modules/directory/modules/devices/components/opened-device.vue +++ b/src/modules/directory/modules/devices/components/opened-device.vue @@ -36,111 +36,118 @@ diff --git a/src/modules/directory/modules/devices/components/opened-hotdesk-device-general.vue b/src/modules/directory/modules/devices/components/opened-hotdesk-device-general.vue index 851b8f4ae..ef4c0bd39 100644 --- a/src/modules/directory/modules/devices/components/opened-hotdesk-device-general.vue +++ b/src/modules/directory/modules/devices/components/opened-hotdesk-device-general.vue @@ -40,21 +40,20 @@ diff --git a/src/modules/directory/modules/devices/components/opened-hotdesk-device-hotdesking.vue b/src/modules/directory/modules/devices/components/opened-hotdesk-device-hotdesking.vue index ebc3d24dc..726ca74c4 100644 --- a/src/modules/directory/modules/devices/components/opened-hotdesk-device-hotdesking.vue +++ b/src/modules/directory/modules/devices/components/opened-hotdesk-device-hotdesking.vue @@ -21,17 +21,21 @@ diff --git a/src/modules/directory/modules/devices/components/the-devices.vue b/src/modules/directory/modules/devices/components/the-devices.vue index afe60471c..d48025953 100644 --- a/src/modules/directory/modules/devices/components/the-devices.vue +++ b/src/modules/directory/modules/devices/components/the-devices.vue @@ -160,143 +160,148 @@ diff --git a/src/modules/directory/modules/devices/components/upload-devices-popup.vue b/src/modules/directory/modules/devices/components/upload-devices-popup.vue index 706e957f1..3ec524573 100644 --- a/src/modules/directory/modules/devices/components/upload-devices-popup.vue +++ b/src/modules/directory/modules/devices/components/upload-devices-popup.vue @@ -8,76 +8,76 @@ diff --git a/src/modules/directory/modules/devices/store/_internals/deviceSchema/defaults/defaultDevice.js b/src/modules/directory/modules/devices/store/_internals/deviceSchema/defaults/defaultDevice.js index 794221957..b9de237be 100644 --- a/src/modules/directory/modules/devices/store/_internals/deviceSchema/defaults/defaultDevice.js +++ b/src/modules/directory/modules/devices/store/_internals/deviceSchema/defaults/defaultDevice.js @@ -1,14 +1,14 @@ const defaultDevice = () => ({ - name: '', - account: '', - password: '', - user: {}, - phone: {}, - ip: '', - brand: '', - model: '', - mac: '', - vars: [], + name: "", + account: "", + password: "", + user: {}, + phone: {}, + ip: "", + brand: "", + model: "", + mac: "", + vars: [], }); export default defaultDevice; diff --git a/src/modules/directory/modules/devices/store/_internals/deviceSchema/hotdeskDevice.js b/src/modules/directory/modules/devices/store/_internals/deviceSchema/hotdeskDevice.js index 6e813a3ec..1b4ae099f 100644 --- a/src/modules/directory/modules/devices/store/_internals/deviceSchema/hotdeskDevice.js +++ b/src/modules/directory/modules/devices/store/_internals/deviceSchema/hotdeskDevice.js @@ -1,11 +1,11 @@ -import generateHotdeskAccount from '../scripts/generateHotdeskAccount'; -import defaultDevice from './defaults/defaultDevice'; +import generateHotdeskAccount from "../scripts/generateHotdeskAccount"; +import defaultDevice from "./defaults/defaultDevice"; const hotdeskDevice = () => ({ - ...defaultDevice(), - account: generateHotdeskAccount(), - hotdesk: true, - hotdesks: [], + ...defaultDevice(), + account: generateHotdeskAccount(), + hotdesk: true, + hotdesks: [], }); export default hotdeskDevice; diff --git a/src/modules/directory/modules/devices/store/_internals/headers.js b/src/modules/directory/modules/devices/store/_internals/headers.js index cd5bead01..5d7386d13 100644 --- a/src/modules/directory/modules/devices/store/_internals/headers.js +++ b/src/modules/directory/modules/devices/store/_internals/headers.js @@ -1,28 +1,28 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'account', - locale: 'objects.directory.devices.authId', - field: 'account', - sort: SortSymbols.NONE, - }, - { - value: 'user', - locale: 'objects.user', - field: 'user', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'objects.directory.devices.presence', - field: 'reged', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "account", + locale: "objects.directory.devices.authId", + field: "account", + sort: SortSymbols.NONE, + }, + { + value: "user", + locale: "objects.user", + field: "user", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "objects.directory.devices.presence", + field: "reged", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/directory/modules/devices/store/_internals/scripts/generateHotdeskAccount.js b/src/modules/directory/modules/devices/store/_internals/scripts/generateHotdeskAccount.js index b820c4fb1..1438a917f 100644 --- a/src/modules/directory/modules/devices/store/_internals/scripts/generateHotdeskAccount.js +++ b/src/modules/directory/modules/devices/store/_internals/scripts/generateHotdeskAccount.js @@ -1,8 +1,8 @@ export default (length = 7) => { - const charset = 'abcdefghijklmnopqrstuvwxyz0123456789'; - let value = 'hot-'; - for (let i = 0; i < length; i += 1) { - value += charset.charAt(Math.floor(Math.random() * charset.length)); - } - return value; + const charset = "abcdefghijklmnopqrstuvwxyz0123456789"; + let value = "hot-"; + for (let i = 0; i < length; i += 1) { + value += charset.charAt(Math.floor(Math.random() * charset.length)); + } + return value; }; diff --git a/src/modules/directory/modules/devices/store/devices.js b/src/modules/directory/modules/devices/store/devices.js index 31d6a0345..b0e5ac4f4 100644 --- a/src/modules/directory/modules/devices/store/devices.js +++ b/src/modules/directory/modules/devices/store/devices.js @@ -1,51 +1,48 @@ -import deepMerge from 'deepmerge'; -import HistoryStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/HistoryStoreModule/HistoryStoreModule'; -import ObjectStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -import PermissionsStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule'; -import DevicesAPI from '../api/devices'; -import defaultDevice from './_internals/deviceSchema/defaults/defaultDevice'; -import hotdeskDevice from './_internals/deviceSchema/hotdeskDevice'; -import headers from './_internals/headers'; +import deepMerge from "deepmerge"; +import HistoryStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/HistoryStoreModule/HistoryStoreModule"; +import ObjectStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule"; +import PermissionsStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule"; +import DevicesAPI from "../api/devices"; +import defaultDevice from "./_internals/deviceSchema/defaults/defaultDevice"; +import hotdeskDevice from "./_internals/deviceSchema/hotdeskDevice"; +import headers from "./_internals/headers"; const resettableState = { - itemInstance: defaultDevice(), + itemInstance: defaultDevice(), }; const actions = { - LOAD_ITEM: async (context, isHotdesk) => { - if (context.state.itemId) { - const item = await context.dispatch('GET_ITEM'); - context.dispatch('SET_TYPED_ITEM', { item, isHotdesk }); - } else { - context.dispatch('SET_TYPED_ITEM', { isHotdesk }); - } - }, - SET_TYPED_ITEM: (context, { isHotdesk, item = {} }) => { - if (isHotdesk) { - item = deepMerge(hotdeskDevice(), item); - } else { - item = deepMerge(defaultDevice(), item); - } - context.commit('SET_ITEM', item); - }, + LOAD_ITEM: async (context, isHotdesk) => { + if (context.state.itemId) { + const item = await context.dispatch("GET_ITEM"); + context.dispatch("SET_TYPED_ITEM", { item, isHotdesk }); + } else { + context.dispatch("SET_TYPED_ITEM", { isHotdesk }); + } + }, + SET_TYPED_ITEM: (context, { isHotdesk, item = {} }) => { + if (isHotdesk) { + item = deepMerge(hotdeskDevice(), item); + } else { + item = deepMerge(defaultDevice(), item); + } + context.commit("SET_ITEM", item); + }, }; -const PERMISSIONS_API_URL = '/devices'; +const PERMISSIONS_API_URL = "/devices"; const permissions = new PermissionsStoreModule() -.generateAPIActions(PERMISSIONS_API_URL) -.getModule(); + .generateAPIActions(PERMISSIONS_API_URL) + .getModule(); const history = new HistoryStoreModule() -.generateGetListAction(DevicesAPI.getDeviceHistory) -.getModule(); + .generateGetListAction(DevicesAPI.getDeviceHistory) + .getModule(); const devices = new ObjectStoreModule({ resettableState, headers }) -.attachAPIModule(DevicesAPI) -.generateAPIActions() -.setChildModules({ history, permissions }) -.getModule({ actions }); + .attachAPIModule(DevicesAPI) + .generateAPIActions() + .setChildModules({ history, permissions }) + .getModule({ actions }); export default devices; diff --git a/src/modules/directory/modules/license/api/license.js b/src/modules/directory/modules/license/api/license.js index 35f17ca92..0f325138e 100644 --- a/src/modules/directory/modules/license/api/license.js +++ b/src/modules/directory/modules/license/api/license.js @@ -1,74 +1,65 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - generateUrl, - log, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import instance from '../../../../../app/api/instance'; + camelToSnake, + generateUrl, + log, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import instance from "../../../../../app/api/instance"; -const LICENSE_URL = '/license'; -const CUSTOMER_URL = '/customer'; +const LICENSE_URL = "/license"; +const CUSTOMER_URL = "/customer"; const getLicenseList = async (params) => { - const fieldsToSend = ['page', 'size', 'q', 'sort', 'fields', 'id']; + const fieldsToSend = ["page", "size", "q", "sort", "fields", "id"]; - const defaultObject = { - remain: 0, - limit: 0, - }; + const defaultObject = { + remain: 0, + limit: 0, + }; - const url = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - (params) => ({ ...params, q: params.search }), - sanitize(fieldsToSend), - camelToSnake(), - generateUrl(LICENSE_URL), - ]); - try { - const response = await instance.get(url); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - log, - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const url = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + (params) => ({ ...params, q: params.search }), + sanitize(fieldsToSend), + camelToSnake(), + generateUrl(LICENSE_URL), + ]); + try { + const response = await instance.get(url); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject), log]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateLicense = async (data) => { - try { - const response = await instance.put(CUSTOMER_URL, data); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await instance.put(CUSTOMER_URL, data); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const licenseAPI = { - getList: getLicenseList, - update: updateLicense, + getList: getLicenseList, + update: updateLicense, }; export default licenseAPI; diff --git a/src/modules/directory/modules/license/components/all-licenses/all-licenses.vue b/src/modules/directory/modules/license/components/all-licenses/all-licenses.vue index 9144c7076..ee8e4fe7b 100644 --- a/src/modules/directory/modules/license/components/all-licenses/all-licenses.vue +++ b/src/modules/directory/modules/license/components/all-licenses/all-licenses.vue @@ -118,57 +118,60 @@ diff --git a/src/modules/directory/modules/license/components/all-licenses/license-popup.vue b/src/modules/directory/modules/license/components/all-licenses/license-popup.vue index 08be75645..2d1cdc9ae 100644 --- a/src/modules/directory/modules/license/components/all-licenses/license-popup.vue +++ b/src/modules/directory/modules/license/components/all-licenses/license-popup.vue @@ -34,47 +34,47 @@ diff --git a/src/modules/directory/modules/license/components/the-license.vue b/src/modules/directory/modules/license/components/the-license.vue index 0c66257cb..0f765b698 100644 --- a/src/modules/directory/modules/license/components/the-license.vue +++ b/src/modules/directory/modules/license/components/the-license.vue @@ -21,37 +21,40 @@ diff --git a/src/modules/directory/modules/license/modules/license-users/api/licenseUsers.js b/src/modules/directory/modules/license/modules/license-users/api/licenseUsers.js index 82a0b54e4..1faba78e4 100644 --- a/src/modules/directory/modules/license/modules/license-users/api/licenseUsers.js +++ b/src/modules/directory/modules/license/modules/license-users/api/licenseUsers.js @@ -1,61 +1,56 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - generateUrl, - log, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import instance from '../../../../../../../app/api/instance'; + camelToSnake, + generateUrl, + log, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import instance from "../../../../../../../app/api/instance"; -const baseUrl = '/products'; -const nestedUrl = 'users'; +const baseUrl = "/products"; +const nestedUrl = "users"; const getList = async ({ parentId, ...rest }) => { - const fieldsToSend = ['page', 'size', 'q', 'sort', 'fields', 'id']; + const fieldsToSend = ["page", "size", "q", "sort", "fields", "id"]; - const defaultObject = { - sessions: 0, - }; + const defaultObject = { + sessions: 0, + }; - const url = applyTransform(rest, [ - log, - merge(getDefaultGetParams()), - starToSearch('search'), - (params) => ({ ...params, q: params.search }), - sanitize(fieldsToSend), - camelToSnake(), - generateUrl(`${baseUrl}/${parentId}/${nestedUrl}`), - ]); - try { - const response = await instance.get(url); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const url = applyTransform(rest, [ + log, + merge(getDefaultGetParams()), + starToSearch("search"), + (params) => ({ ...params, q: params.search }), + sanitize(fieldsToSend), + camelToSnake(), + generateUrl(`${baseUrl}/${parentId}/${nestedUrl}`), + ]); + try { + const response = await instance.get(url); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const LicenseUsersAPI = { - getList, + getList, }; export default LicenseUsersAPI; diff --git a/src/modules/directory/modules/license/modules/license-users/components/license-users-popup.vue b/src/modules/directory/modules/license/modules/license-users/components/license-users-popup.vue index 018659a9f..c46b4358f 100644 --- a/src/modules/directory/modules/license/modules/license-users/components/license-users-popup.vue +++ b/src/modules/directory/modules/license/modules/license-users/components/license-users-popup.vue @@ -75,49 +75,57 @@ diff --git a/src/modules/directory/modules/license/modules/license-users/components/user-logout-control.vue b/src/modules/directory/modules/license/modules/license-users/components/user-logout-control.vue index c95f770b2..efe5139eb 100644 --- a/src/modules/directory/modules/license/modules/license-users/components/user-logout-control.vue +++ b/src/modules/directory/modules/license/modules/license-users/components/user-logout-control.vue @@ -7,37 +7,41 @@ diff --git a/src/modules/directory/modules/license/modules/license-users/store/_internals/headers.js b/src/modules/directory/modules/license/modules/license-users/store/_internals/headers.js index 253566248..c74bb18aa 100644 --- a/src/modules/directory/modules/license/modules/license-users/store/_internals/headers.js +++ b/src/modules/directory/modules/license/modules/license-users/store/_internals/headers.js @@ -1,27 +1,27 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'domain', - locale: 'objects.directory.license.domain', - field: 'domain', - show: true, - sort: SortSymbols.NONE, - width: '3fr', - }, - { - value: 'name', - locale: ['objects.directory.users.users', 1], - field: 'user', - show: true, - sort: SortSymbols.NONE, - width: '3fr', - }, - { - value: 'used', - locale: 'objects.directory.license.used', - field: 'sessions', - show: true, - sort: SortSymbols.NONE, - }, + { + value: "domain", + locale: "objects.directory.license.domain", + field: "domain", + show: true, + sort: SortSymbols.NONE, + width: "3fr", + }, + { + value: "name", + locale: ["objects.directory.users.users", 1], + field: "user", + show: true, + sort: SortSymbols.NONE, + width: "3fr", + }, + { + value: "used", + locale: "objects.directory.license.used", + field: "sessions", + show: true, + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/directory/modules/license/modules/license-users/store/licenseUsers.js b/src/modules/directory/modules/license/modules/license-users/store/licenseUsers.js index a4e064b1e..f00018ba1 100644 --- a/src/modules/directory/modules/license/modules/license-users/store/licenseUsers.js +++ b/src/modules/directory/modules/license/modules/license-users/store/licenseUsers.js @@ -1,30 +1,30 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import UsersAPI from '../../../../users/api/users'; -import LicenseUsersAPI from '../api/licenseUsers'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import UsersAPI from "../../../../users/api/users"; +import LicenseUsersAPI from "../api/licenseUsers"; +import headers from "./_internals/headers"; const state = { - // fields: ['id', 'name', 'license'], + // fields: ['id', 'name', 'license'], }; const actions = { - LOGOUT_USER: async (context, _user) => { - try { - await UsersAPI.logoutUser(_user); - const thisUser = context.state.dataList.find(({ user }) => user === - _user); - /* i decided to mutate user directly to avoid all dataList redraw */ - thisUser.sessions = 0; - } catch (err) { - throw err; - } - }, + LOGOUT_USER: async (context, _user) => { + try { + await UsersAPI.logoutUser(_user); + const thisUser = context.state.dataList.find( + ({ user }) => user === _user, + ); + /* i decided to mutate user directly to avoid all dataList redraw */ + thisUser.sessions = 0; + } catch (err) { + throw err; + } + }, }; const license = new NestedObjectStoreModule({ headers }) -.attachAPIModule(LicenseUsersAPI) -.generateAPIActions() -.getModule({ state, actions }); + .attachAPIModule(LicenseUsersAPI) + .generateAPIActions() + .getModule({ state, actions }); export default license; diff --git a/src/modules/directory/modules/license/modules/users/components/licenses-by-user.vue b/src/modules/directory/modules/license/modules/users/components/licenses-by-user.vue index e337d5c3c..246bdc994 100644 --- a/src/modules/directory/modules/license/modules/users/components/licenses-by-user.vue +++ b/src/modules/directory/modules/license/modules/users/components/licenses-by-user.vue @@ -81,46 +81,47 @@ diff --git a/src/modules/directory/modules/license/modules/users/store/_internals/headers.js b/src/modules/directory/modules/license/modules/users/store/_internals/headers.js index c08342cb4..4752ad643 100644 --- a/src/modules/directory/modules/license/modules/users/store/_internals/headers.js +++ b/src/modules/directory/modules/license/modules/users/store/_internals/headers.js @@ -1,11 +1,11 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - show: true, - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + show: true, + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/directory/modules/license/modules/users/store/users.js b/src/modules/directory/modules/license/modules/users/store/users.js index 797ad1341..60de58956 100644 --- a/src/modules/directory/modules/license/modules/users/store/users.js +++ b/src/modules/directory/modules/license/modules/users/store/users.js @@ -1,67 +1,69 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; -import ObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -import UsersAPI from '../../../../users/api/users'; -import staticHeaders from './_internals/headers'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; +import ObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule"; +import UsersAPI from "../../../../users/api/users"; +import staticHeaders from "./_internals/headers"; const state = { - fields: ['id', 'name', 'license'], + fields: ["id", "name", "license"], }; const actions = { - INITIALIZE_HEADERS: (context) => { - const licenses = context.rootState.directory.license.dataList; - const licenseHeaders = licenses.map(({ id, product, notAfter }, index) => ({ - value: id, - name: product, - text: product.concat(` (${new Date(+notAfter).toLocaleDateString()})`), - field: `license.${id}`, - show: index < 5, // show only first 4 licenses - sort: SortSymbols.NONE, - })); - const headers = [...staticHeaders, ...licenseHeaders]; - context.commit('SET_HEADERS', headers); - }, - BEFORE_SET_DATA_LIST_HOOK: (context, { items, ...rest }) => { - const licenseHeaders = context.state.headers.slice(1); // without "name" column - const _items = items.map((item) => ({ - ...item, - _license: item.license || [], // save "default" format for api license patching - license: licenseHeaders.reduce((licenses, { value: licenseId }) => ({ - ...licenses, - [licenseId]: item.license && - item.license.some(({ id }) => id === licenseId), - }), {}), - })); - return { items: _items, ...rest }; - }, - TOGGLE_USER_LICENSE: async (context, { user, license }) => { - try { - const licenseId = license.value; // "value" from license col header is its id - const licenseIndex = user._license.findIndex(({ id }) => id === - licenseId); - const changes = { license: [...user._license] }; - if (licenseIndex !== -1) { - changes.license.splice(licenseIndex, 1); - } else { - changes.license.push({ id: licenseId }); - } - await context.dispatch('PATCH_ITEM', { id: user.id, changes }); - /* i decided to mutate user directly to avoid all dataList redraw */ - // eslint-disable-next-line no-param-reassign - user._license = changes.license; - /* i decided to mutate user directly to avoid all dataList redraw */ - // eslint-disable-next-line no-param-reassign - user.license[licenseId] = !user.license[licenseId]; - } catch (err) { - throw err; - } - }, + INITIALIZE_HEADERS: (context) => { + const licenses = context.rootState.directory.license.dataList; + const licenseHeaders = licenses.map(({ id, product, notAfter }, index) => ({ + value: id, + name: product, + text: product.concat(` (${new Date(+notAfter).toLocaleDateString()})`), + field: `license.${id}`, + show: index < 5, // show only first 4 licenses + sort: SortSymbols.NONE, + })); + const headers = [...staticHeaders, ...licenseHeaders]; + context.commit("SET_HEADERS", headers); + }, + BEFORE_SET_DATA_LIST_HOOK: (context, { items, ...rest }) => { + const licenseHeaders = context.state.headers.slice(1); // without "name" column + const _items = items.map((item) => ({ + ...item, + _license: item.license || [], // save "default" format for api license patching + license: licenseHeaders.reduce( + (licenses, { value: licenseId }) => ({ + ...licenses, + [licenseId]: item.license?.some(({ id }) => id === licenseId), + }), + {}, + ), + })); + return { items: _items, ...rest }; + }, + TOGGLE_USER_LICENSE: async (context, { user, license }) => { + try { + const licenseId = license.value; // "value" from license col header is its id + const licenseIndex = user._license.findIndex( + ({ id }) => id === licenseId, + ); + const changes = { license: [...user._license] }; + if (licenseIndex !== -1) { + changes.license.splice(licenseIndex, 1); + } else { + changes.license.push({ id: licenseId }); + } + await context.dispatch("PATCH_ITEM", { id: user.id, changes }); + /* i decided to mutate user directly to avoid all dataList redraw */ + // eslint-disable-next-line no-param-reassign + user._license = changes.license; + /* i decided to mutate user directly to avoid all dataList redraw */ + // eslint-disable-next-line no-param-reassign + user.license[licenseId] = !user.license[licenseId]; + } catch (err) { + throw err; + } + }, }; const license = new ObjectStoreModule({ headers: staticHeaders }) -.attachAPIModule(UsersAPI) -.generateAPIActions() -.getModule({ state, actions }); + .attachAPIModule(UsersAPI) + .generateAPIActions() + .getModule({ state, actions }); export default license; diff --git a/src/modules/directory/modules/license/store/_internals/headers.js b/src/modules/directory/modules/license/store/_internals/headers.js index cb0c691ed..b03d2fdd3 100644 --- a/src/modules/directory/modules/license/store/_internals/headers.js +++ b/src/modules/directory/modules/license/store/_internals/headers.js @@ -1,55 +1,55 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'id', - locale: 'objects.directory.license.licenseId', - width: '50px', - field: 'id', - sort: SortSymbols.NONE, - }, - { - value: 'product', - locale: 'objects.directory.license.product', - field: 'product', - sort: SortSymbols.NONE, - }, - { - value: 'valid-from', - locale: 'objects.directory.license.validFrom', - width: '150px', - field: 'not_before', - sort: SortSymbols.NONE, - }, - { - value: 'valid-till', - locale: 'objects.directory.license.validTill', - field: 'not_after', - sort: SortSymbols.NONE, - }, - { - value: 'used', - locale: 'objects.directory.license.used', - field: 'used', - sort: SortSymbols.NONE, - }, - { - value: 'limit', - locale: 'objects.directory.license.limit', - field: 'limit', - sort: SortSymbols.NONE, - }, - { - value: 'competitive', - locale: 'objects.directory.license.competitive', - field: 'competitive', - sort: SortSymbols.NONE, - }, - { - value: 'status', - locale: 'objects.directory.license.status', - width: '120px', - field: 'not_after', - sort: SortSymbols.NONE, - }, + { + value: "id", + locale: "objects.directory.license.licenseId", + width: "50px", + field: "id", + sort: SortSymbols.NONE, + }, + { + value: "product", + locale: "objects.directory.license.product", + field: "product", + sort: SortSymbols.NONE, + }, + { + value: "valid-from", + locale: "objects.directory.license.validFrom", + width: "150px", + field: "not_before", + sort: SortSymbols.NONE, + }, + { + value: "valid-till", + locale: "objects.directory.license.validTill", + field: "not_after", + sort: SortSymbols.NONE, + }, + { + value: "used", + locale: "objects.directory.license.used", + field: "used", + sort: SortSymbols.NONE, + }, + { + value: "limit", + locale: "objects.directory.license.limit", + field: "limit", + sort: SortSymbols.NONE, + }, + { + value: "competitive", + locale: "objects.directory.license.competitive", + field: "competitive", + sort: SortSymbols.NONE, + }, + { + value: "status", + locale: "objects.directory.license.status", + width: "120px", + field: "not_after", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/directory/modules/license/store/license.js b/src/modules/directory/modules/license/store/license.js index 20c091eed..3833fdcca 100644 --- a/src/modules/directory/modules/license/store/license.js +++ b/src/modules/directory/modules/license/store/license.js @@ -1,27 +1,28 @@ -import ObjectStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -import LicenseAPI from '../api/license'; -import licenseUsers from '../modules/license-users/store/licenseUsers'; -import users from '../modules/users/store/users'; -import headers from './_internals/headers'; +import ObjectStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule"; +import LicenseAPI from "../api/license"; +import licenseUsers from "../modules/license-users/store/licenseUsers"; +import users from "../modules/users/store/users"; +import headers from "./_internals/headers"; const actions = { - AFTER_SET_DATA_LIST_HOOK: (context, payload) => { - context.dispatch('directory/license/users/INITIALIZE_HEADERS', null, { root: true }); - return payload; - }, + AFTER_SET_DATA_LIST_HOOK: (context, payload) => { + context.dispatch("directory/license/users/INITIALIZE_HEADERS", null, { + root: true, + }); + return payload; + }, - UPD_ITEM: (context, certificate) => LicenseAPI.update(certificate), - UPDATE_ITEM: async (context, payload) => { - await context.dispatch('UPD_ITEM', payload); - context.dispatch('LOAD_DATA_LIST'); - }, + UPD_ITEM: (context, certificate) => LicenseAPI.update(certificate), + UPDATE_ITEM: async (context, payload) => { + await context.dispatch("UPD_ITEM", payload); + context.dispatch("LOAD_DATA_LIST"); + }, }; const license = new ObjectStoreModule({ headers }) -.attachAPIModule(LicenseAPI) -.generateAPIActions() -.setChildModules({ users, licenseUsers }) -.getModule({ actions }); + .attachAPIModule(LicenseAPI) + .generateAPIActions() + .setChildModules({ users, licenseUsers }) + .getModule({ actions }); export default license; diff --git a/src/modules/directory/modules/users/api/users-2fa.js b/src/modules/directory/modules/users/api/users-2fa.js index f5c3c8e45..aebc75da8 100644 --- a/src/modules/directory/modules/users/api/users-2fa.js +++ b/src/modules/directory/modules/users/api/users-2fa.js @@ -1,21 +1,21 @@ -import applyTransform, { notify } from '@webitel/ui-sdk/src/api/transformers/index.js'; -import instance from '../../../../../app/api/instance'; +import applyTransform, { + notify, +} from "@webitel/ui-sdk/src/api/transformers/index.js"; +import instance from "../../../../../app/api/instance"; const generateUrl = async ({ id }) => { - const url = `users/${id}/2fa`; + const url = `users/${id}/2fa`; - try { - const response = await instance.post(url,{}); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await instance.post(url, {}); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const Users2faAPI = { - generate: generateUrl, + generate: generateUrl, }; export default Users2faAPI; diff --git a/src/modules/directory/modules/users/api/users.js b/src/modules/directory/modules/users/api/users.js index 84bc9ec90..e8a51eb3e 100644 --- a/src/modules/directory/modules/users/api/users.js +++ b/src/modules/directory/modules/users/api/users.js @@ -1,3 +1,3 @@ -import users from '@webitel/ui-sdk/src/api/clients/users/users.js'; +import users from "@webitel/ui-sdk/src/api/clients/users/users.js"; export default users; diff --git a/src/modules/directory/modules/users/components/_internals/qrcode-two-factor-auth.vue b/src/modules/directory/modules/users/components/_internals/qrcode-two-factor-auth.vue index abb0144f8..223afcacd 100644 --- a/src/modules/directory/modules/users/components/_internals/qrcode-two-factor-auth.vue +++ b/src/modules/directory/modules/users/components/_internals/qrcode-two-factor-auth.vue @@ -62,18 +62,18 @@ diff --git a/src/modules/directory/modules/users/components/_internals/user-status-chips.vue b/src/modules/directory/modules/users/components/_internals/user-status-chips.vue index 5d81ee7e6..bb6fddfe5 100644 --- a/src/modules/directory/modules/users/components/_internals/user-status-chips.vue +++ b/src/modules/directory/modules/users/components/_internals/user-status-chips.vue @@ -25,30 +25,30 @@ diff --git a/src/modules/directory/modules/users/components/opened-user-devices.vue b/src/modules/directory/modules/users/components/opened-user-devices.vue index b8ae7b5b3..a67616566 100644 --- a/src/modules/directory/modules/users/components/opened-user-devices.vue +++ b/src/modules/directory/modules/users/components/opened-user-devices.vue @@ -42,21 +42,20 @@ diff --git a/src/modules/directory/modules/users/components/opened-user-general.vue b/src/modules/directory/modules/users/components/opened-user-general.vue index 20ce3f6e6..76f4975af 100644 --- a/src/modules/directory/modules/users/components/opened-user-general.vue +++ b/src/modules/directory/modules/users/components/opened-user-general.vue @@ -54,21 +54,20 @@ diff --git a/src/modules/directory/modules/users/components/opened-user-license.vue b/src/modules/directory/modules/users/components/opened-user-license.vue index 68869ff35..bff5af90f 100644 --- a/src/modules/directory/modules/users/components/opened-user-license.vue +++ b/src/modules/directory/modules/users/components/opened-user-license.vue @@ -20,21 +20,23 @@ diff --git a/src/modules/directory/modules/users/components/opened-user-roles.vue b/src/modules/directory/modules/users/components/opened-user-roles.vue index 9d076a773..d2ca7668a 100644 --- a/src/modules/directory/modules/users/components/opened-user-roles.vue +++ b/src/modules/directory/modules/users/components/opened-user-roles.vue @@ -20,17 +20,16 @@ diff --git a/src/modules/directory/modules/users/components/opened-user-variables.vue b/src/modules/directory/modules/users/components/opened-user-variables.vue index 73089072d..ee0d90924 100644 --- a/src/modules/directory/modules/users/components/opened-user-variables.vue +++ b/src/modules/directory/modules/users/components/opened-user-variables.vue @@ -44,12 +44,11 @@ diff --git a/src/modules/directory/modules/users/components/opened-user.vue b/src/modules/directory/modules/users/components/opened-user.vue index 8f2fd4f7f..ca716a349 100644 --- a/src/modules/directory/modules/users/components/opened-user.vue +++ b/src/modules/directory/modules/users/components/opened-user.vue @@ -45,104 +45,109 @@ diff --git a/src/modules/directory/modules/users/components/the-users.vue b/src/modules/directory/modules/users/components/the-users.vue index 78b6208c6..938d1c4e2 100644 --- a/src/modules/directory/modules/users/components/the-users.vue +++ b/src/modules/directory/modules/users/components/the-users.vue @@ -134,93 +134,95 @@ diff --git a/src/modules/directory/modules/users/components/upload-users-popup.vue b/src/modules/directory/modules/users/components/upload-users-popup.vue index b581337e6..e6c832ce9 100644 --- a/src/modules/directory/modules/users/components/upload-users-popup.vue +++ b/src/modules/directory/modules/users/components/upload-users-popup.vue @@ -8,55 +8,55 @@ diff --git a/src/modules/directory/modules/users/modules/logs/api/logs.js b/src/modules/directory/modules/users/modules/logs/api/logs.js index 78a0e1d07..ef985633e 100644 --- a/src/modules/directory/modules/users/modules/logs/api/logs.js +++ b/src/modules/directory/modules/users/modules/logs/api/logs.js @@ -1,84 +1,82 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - merge, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { LoggerServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; + merge, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { LoggerServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; -const service = new LoggerServiceApiFactory(configuration, '', instance); +const service = new LoggerServiceApiFactory(configuration, "", instance); const getList = async (params) => { - const fieldsToSend = [ - 'parentId', - 'page', - 'size', - 'search', - 'sort', - 'fields', - 'action', - 'object', - 'from', - 'to', - 'userIp', - ]; + const fieldsToSend = [ + "parentId", + "page", + "size", + "search", + "sort", + "fields", + "action", + "object", + "from", + "to", + "userIp", + ]; - const { - parentId, - page, - size, - search, - sort, - fields, - action, - object, - from, - to, - userIp, - } = applyTransform(params, [ - sanitize(fieldsToSend), - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { + parentId, + page, + size, + search, + sort, + fields, + action, + object, + from, + to, + userIp, + } = applyTransform(params, [ + sanitize(fieldsToSend), + merge(getDefaultGetParams()), + starToSearch("search"), + ]); - try { - const response = await service.searchLogByUserId( - parentId, - page, - size, - search, - sort || '-date', - fields, - object, - action, - userIp, - from, - to, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await service.searchLogByUserId( + parentId, + page, + size, + search, + sort || "-date", + fields, + object, + action, + userIp, + from, + to, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const LogsAPI = { - getList, + getList, }; export default LogsAPI; diff --git a/src/modules/directory/modules/users/modules/logs/components/opened-user-logs.vue b/src/modules/directory/modules/users/modules/logs/components/opened-user-logs.vue index e09e0c4db..7ea874f8c 100644 --- a/src/modules/directory/modules/users/modules/logs/components/opened-user-logs.vue +++ b/src/modules/directory/modules/users/modules/logs/components/opened-user-logs.vue @@ -72,73 +72,73 @@ diff --git a/src/modules/directory/modules/users/modules/logs/modules/filters/components/opened-user-logs-filters.vue b/src/modules/directory/modules/users/modules/logs/modules/filters/components/opened-user-logs-filters.vue index ed2f053a2..fd3a02c0c 100644 --- a/src/modules/directory/modules/users/modules/logs/modules/filters/components/opened-user-logs-filters.vue +++ b/src/modules/directory/modules/users/modules/logs/modules/filters/components/opened-user-logs-filters.vue @@ -26,46 +26,46 @@ diff --git a/src/modules/directory/modules/users/modules/logs/modules/filters/store/filters.js b/src/modules/directory/modules/users/modules/logs/modules/filters/store/filters.js index 1dbf0faad..98536e96e 100644 --- a/src/modules/directory/modules/users/modules/logs/modules/filters/store/filters.js +++ b/src/modules/directory/modules/users/modules/logs/modules/filters/store/filters.js @@ -1,42 +1,41 @@ -import ApiFilterSchema - from '@webitel/ui-sdk/src/modules/QueryFilters/classes/ApiFilterSchema'; -import BaseFilterSchema - from '@webitel/ui-sdk/src/modules/QueryFilters/classes/BaseFilterSchema'; -import EnumFilterSchema - from '@webitel/ui-sdk/src/modules/QueryFilters/classes/EnumFilterSchema'; -import QueryFiltersStoreModule - from '@webitel/ui-sdk/src/modules/QueryFilters/store/QueryFiltersStoreModule'; -import { LoggerAction } from 'webitel-sdk'; -import ChangelogsAPI - from '../../../../../../../../system/modules/changelogs/api/changelogs'; +import ApiFilterSchema from "@webitel/ui-sdk/src/modules/QueryFilters/classes/ApiFilterSchema"; +import BaseFilterSchema from "@webitel/ui-sdk/src/modules/QueryFilters/classes/BaseFilterSchema"; +import EnumFilterSchema from "@webitel/ui-sdk/src/modules/QueryFilters/classes/EnumFilterSchema"; +import QueryFiltersStoreModule from "@webitel/ui-sdk/src/modules/QueryFilters/store/QueryFiltersStoreModule"; +import { LoggerAction } from "webitel-sdk"; +import ChangelogsAPI from "../../../../../../../../system/modules/changelogs/api/changelogs"; const state = { - search: new BaseFilterSchema(), - action: new EnumFilterSchema({ - locale: { label: ['objects.system.changelogs.logs.actions', 1] }, - options: Object.values(LoggerAction) - .filter((action) => action !== LoggerAction.DefaultNoAction && action !== - LoggerAction.Read) - .map((action) => ({ - value: action, - locale: `objects.system.changelogs.logs.actionType.${action}`, - })), - }), - object: new ApiFilterSchema({ - locale: { label: ['objects.system.changelogs.objects', 1] }, - API: (params) => ChangelogsAPI.getObjectsList({ - ...params, - includeExisting: true, - }), - }), - from: new BaseFilterSchema({ - value: new Date().setHours(0, 0, 0, 0), - defaultValue: new Date().setHours(0, 0, 0, 0), - }), - to: new BaseFilterSchema({ - value: new Date().setHours(23, 59, 59, 0), - defaultValue: new Date().setHours(23, 59, 59, 0), - }), + search: new BaseFilterSchema(), + action: new EnumFilterSchema({ + locale: { label: ["objects.system.changelogs.logs.actions", 1] }, + options: Object.values(LoggerAction) + .filter( + (action) => + action !== LoggerAction.DefaultNoAction && + action !== LoggerAction.Read, + ) + .map((action) => ({ + value: action, + locale: `objects.system.changelogs.logs.actionType.${action}`, + })), + }), + object: new ApiFilterSchema({ + locale: { label: ["objects.system.changelogs.objects", 1] }, + API: (params) => + ChangelogsAPI.getObjectsList({ + ...params, + includeExisting: true, + }), + }), + from: new BaseFilterSchema({ + value: new Date().setHours(0, 0, 0, 0), + defaultValue: new Date().setHours(0, 0, 0, 0), + }), + to: new BaseFilterSchema({ + value: new Date().setHours(23, 59, 59, 0), + defaultValue: new Date().setHours(23, 59, 59, 0), + }), }; export default new QueryFiltersStoreModule({ state }).getModule(); diff --git a/src/modules/directory/modules/users/modules/logs/store/_internals/headers.js b/src/modules/directory/modules/users/modules/logs/store/_internals/headers.js index 1bfa9c98e..ab692fd2d 100644 --- a/src/modules/directory/modules/users/modules/logs/store/_internals/headers.js +++ b/src/modules/directory/modules/users/modules/logs/store/_internals/headers.js @@ -1,34 +1,34 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'action', - locale: ['objects.system.changelogs.logs.actions', 1], - field: 'action', - sort: SortSymbols.NONE, - }, - { - value: 'date', - locale: 'reusable.modifiedAt', - field: 'date', - sort: SortSymbols.NONE, - }, - { - value: 'userIp', - locale: 'objects.directory.users.userIp', - field: 'user_ip', - sort: SortSymbols.NONE, - }, - { - value: 'object', - locale: ['objects.system.changelogs.objects', 1], - field: 'object', - sort: SortSymbols.NONE, - }, - { - value: 'record', - locale: ['objects.system.changelogs.logs.records', 1], - field: 'record', - sort: SortSymbols.NONE, - }, + { + value: "action", + locale: ["objects.system.changelogs.logs.actions", 1], + field: "action", + sort: SortSymbols.NONE, + }, + { + value: "date", + locale: "reusable.modifiedAt", + field: "date", + sort: SortSymbols.NONE, + }, + { + value: "userIp", + locale: "objects.directory.users.userIp", + field: "user_ip", + sort: SortSymbols.NONE, + }, + { + value: "object", + locale: ["objects.system.changelogs.objects", 1], + field: "object", + sort: SortSymbols.NONE, + }, + { + value: "record", + locale: ["objects.system.changelogs.logs.records", 1], + field: "record", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/directory/modules/users/modules/logs/store/logs.js b/src/modules/directory/modules/users/modules/logs/store/logs.js index e16bb0c95..1d2dc4b7a 100644 --- a/src/modules/directory/modules/users/modules/logs/store/logs.js +++ b/src/modules/directory/modules/users/modules/logs/store/logs.js @@ -1,13 +1,12 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import LogsAPI from '../api/logs'; -import filters from '../modules/filters/store/filters'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import LogsAPI from "../api/logs"; +import filters from "../modules/filters/store/filters"; +import headers from "./_internals/headers"; const logs = new NestedObjectStoreModule({ headers }) -.attachAPIModule(LogsAPI) -.generateAPIActions() -.setChildModules({ filters }) -.getModule(); + .attachAPIModule(LogsAPI) + .generateAPIActions() + .setChildModules({ filters }) + .getModule(); export default logs; diff --git a/src/modules/directory/modules/users/modules/tokens/api/userTokens.js b/src/modules/directory/modules/users/modules/tokens/api/userTokens.js index 84afe7c41..d9ca2ea30 100644 --- a/src/modules/directory/modules/users/modules/tokens/api/userTokens.js +++ b/src/modules/directory/modules/users/modules/tokens/api/userTokens.js @@ -1,88 +1,77 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - generateUrl, - log, - merge, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import instance from '../../../../../../../app/api/instance'; + camelToSnake, + generateUrl, + log, + merge, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import instance from "../../../../../../../app/api/instance"; -const baseUrl = '/users'; -const nestedUrl = 'tokens'; -const fieldsToSend = ['token', 'usage']; +const baseUrl = "/users"; +const nestedUrl = "tokens"; +const fieldsToSend = ["token", "usage"]; const getTokensList = async ({ parentId, ...rest }) => { - const fieldsToSend = ['page', 'size', 'q', 'fields', 'id']; + const fieldsToSend = ["page", "size", "q", "fields", "id"]; - const url = applyTransform(rest, [ - log, - merge(getDefaultGetParams()), - starToSearch('search'), - (params) => ({ ...params, q: params.search }), - sanitize(fieldsToSend), - camelToSnake(), - generateUrl(`${baseUrl}/${parentId}/${nestedUrl}`), - ]); - try { - const response = await instance.get(url); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const url = applyTransform(rest, [ + log, + merge(getDefaultGetParams()), + starToSearch("search"), + (params) => ({ ...params, q: params.search }), + sanitize(fieldsToSend), + camelToSnake(), + generateUrl(`${baseUrl}/${parentId}/${nestedUrl}`), + ]); + try { + const response = await instance.get(url); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addToken = async ({ itemInstance, parentId }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - const url = `${baseUrl}/${parentId}/${nestedUrl}`; - try { - const response = await instance.post(url, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + const url = `${baseUrl}/${parentId}/${nestedUrl}`; + try { + const response = await instance.post(url, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteToken = async ({ id, parentId }) => { - const url = `${baseUrl}/${parentId}/${nestedUrl}/${id}`; - console.info(url); - try { - const response = await instance.delete(url); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const url = `${baseUrl}/${parentId}/${nestedUrl}/${id}`; + console.info(url); + try { + const response = await instance.delete(url); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const UserTokensAPI = { - getList: getTokensList, - add: addToken, - delete: deleteToken, + getList: getTokensList, + add: addToken, + delete: deleteToken, }; export default UserTokensAPI; diff --git a/src/modules/directory/modules/users/modules/tokens/components/opened-user-token-created-popup.vue b/src/modules/directory/modules/users/modules/tokens/components/opened-user-token-created-popup.vue index 9da75196d..b472e6a05 100644 --- a/src/modules/directory/modules/users/modules/tokens/components/opened-user-token-created-popup.vue +++ b/src/modules/directory/modules/users/modules/tokens/components/opened-user-token-created-popup.vue @@ -32,36 +32,36 @@ diff --git a/src/modules/directory/modules/users/modules/tokens/components/opened-user-token-popup.vue b/src/modules/directory/modules/users/modules/tokens/components/opened-user-token-popup.vue index 16f6a66dd..b63313e18 100644 --- a/src/modules/directory/modules/users/modules/tokens/components/opened-user-token-popup.vue +++ b/src/modules/directory/modules/users/modules/tokens/components/opened-user-token-popup.vue @@ -30,31 +30,30 @@ diff --git a/src/modules/directory/modules/users/modules/tokens/components/opened-user-token.vue b/src/modules/directory/modules/users/modules/tokens/components/opened-user-token.vue index 689e042de..6dfbbb380 100644 --- a/src/modules/directory/modules/users/modules/tokens/components/opened-user-token.vue +++ b/src/modules/directory/modules/users/modules/tokens/components/opened-user-token.vue @@ -90,72 +90,70 @@ diff --git a/src/modules/directory/modules/users/modules/tokens/store/_internals/headers.js b/src/modules/directory/modules/users/modules/tokens/store/_internals/headers.js index f1c8b2db8..bb19e7b36 100644 --- a/src/modules/directory/modules/users/modules/tokens/store/_internals/headers.js +++ b/src/modules/directory/modules/users/modules/tokens/store/_internals/headers.js @@ -1,22 +1,22 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'usage', - locale: 'objects.directory.users.usage', - field: 'usage', - sort: SortSymbols.NONE, - }, - { - value: 'createdAt', - locale: 'objects.createdAt', - field: 'created_at', - sort: SortSymbols.NONE, - }, - { - value: 'createdBy', - locale: 'objects.createdBy', - field: 'created_by', - sort: SortSymbols.NONE, - }, + { + value: "usage", + locale: "objects.directory.users.usage", + field: "usage", + sort: SortSymbols.NONE, + }, + { + value: "createdAt", + locale: "objects.createdAt", + field: "created_at", + sort: SortSymbols.NONE, + }, + { + value: "createdBy", + locale: "objects.createdBy", + field: "created_by", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/directory/modules/users/modules/tokens/store/usersTokens.js b/src/modules/directory/modules/users/modules/tokens/store/usersTokens.js index 18aaaf6be..07809859b 100644 --- a/src/modules/directory/modules/users/modules/tokens/store/usersTokens.js +++ b/src/modules/directory/modules/users/modules/tokens/store/usersTokens.js @@ -1,36 +1,35 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import UserTokensAPI from '../api/userTokens'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import UserTokensAPI from "../api/userTokens"; +import headers from "./_internals/headers"; const resettableItemState = { - itemInstance: { - token: '', - usage: '', - }, + itemInstance: { + token: "", + usage: "", + }, }; const actions = { - ADD_TOKEN: async (context) => { - try { - const { token } = await context.dispatch('POST_ITEM'); - await context.dispatch('LOAD_DATA_LIST'); - context.commit('SET_TOKEN', token); - } catch (err) { - throw err; - } - }, + ADD_TOKEN: async (context) => { + try { + const { token } = await context.dispatch("POST_ITEM"); + await context.dispatch("LOAD_DATA_LIST"); + context.commit("SET_TOKEN", token); + } catch (err) { + throw err; + } + }, }; const mutations = { - SET_TOKEN: async (state, token) => { - state.itemInstance.token = token; - }, + SET_TOKEN: async (state, token) => { + state.itemInstance.token = token; + }, }; const userTokens = new NestedObjectStoreModule({ resettableItemState, headers }) -.attachAPIModule(UserTokensAPI) -.generateAPIActions() -.getModule({ actions, mutations }); + .attachAPIModule(UserTokensAPI) + .generateAPIActions() + .getModule({ actions, mutations }); export default userTokens; diff --git a/src/modules/directory/modules/users/store/_internals/headers.js b/src/modules/directory/modules/users/store/_internals/headers.js index 576d7c83f..741014603 100644 --- a/src/modules/directory/modules/users/store/_internals/headers.js +++ b/src/modules/directory/modules/users/store/_internals/headers.js @@ -1,36 +1,36 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'status', - locale: 'objects.directory.users.status', - width: 'minmax(320px, 1fr)', - field: 'presence.status', - sort: SortSymbols.NONE, - }, - { - value: 'username', - locale: 'objects.directory.users.login', - field: 'username', - sort: SortSymbols.NONE, - }, - { - value: 'extensions', - locale: 'objects.directory.users.extensions', - field: 'extension', - sort: SortSymbols.NONE, - }, - { - value: 'DnD', - locale: 'objects.directory.users.DnD', - width: '120px', - field: 'dnd', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "status", + locale: "objects.directory.users.status", + width: "minmax(320px, 1fr)", + field: "presence.status", + sort: SortSymbols.NONE, + }, + { + value: "username", + locale: "objects.directory.users.login", + field: "username", + sort: SortSymbols.NONE, + }, + { + value: "extensions", + locale: "objects.directory.users.extensions", + field: "extension", + sort: SortSymbols.NONE, + }, + { + value: "DnD", + locale: "objects.directory.users.DnD", + width: "120px", + field: "dnd", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/directory/modules/users/store/users.js b/src/modules/directory/modules/users/store/users.js index aa13d38a9..0b31bee5e 100644 --- a/src/modules/directory/modules/users/store/users.js +++ b/src/modules/directory/modules/users/store/users.js @@ -1,103 +1,97 @@ -import ObjectStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -import PermissionsStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule'; -import UsersAPI from '../api/users'; -import Users2faAPI from '../api/users-2fa.js'; -import logs from '../modules/logs/store/logs'; -import tokens from '../modules/tokens/store/usersTokens'; -import headers from './_internals/headers'; +import ObjectStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule"; +import PermissionsStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule"; +import UsersAPI from "../api/users"; +import Users2faAPI from "../api/users-2fa.js"; +import logs from "../modules/logs/store/logs"; +import tokens from "../modules/tokens/store/usersTokens"; +import headers from "./_internals/headers"; const resettableState = { - itemInstance: { - name: '', - email: '', - username: '', - password: '', - extension: '', - roles: [], - device: {}, - license: [], - devices: [], - presence: { - status: '', - note: '', - }, - variables: [], - totpUrl: '', - }, + itemInstance: { + name: "", + email: "", + username: "", + password: "", + extension: "", + roles: [], + device: {}, + license: [], + devices: [], + presence: { + status: "", + note: "", + }, + variables: [], + totpUrl: "", + }, }; const getters = { - IS_DISPLAY_QR_CODE: ( - state, - getters, - rootState, - rootGetters, - ) => rootGetters['userinfo/IS_CHANGE_USER_PASSWORD_ALLOW'] && - !!state.itemInstance.totpUrl, + IS_DISPLAY_QR_CODE: (state, getters, rootState, rootGetters) => + rootGetters["userinfo/IS_CHANGE_USER_PASSWORD_ALLOW"] && + !!state.itemInstance.totpUrl, }; const actions = { - ADD_VARIABLE_PAIR: (context) => { - const pair = { key: '', value: '' }; - context.commit('ADD_VARIABLE_PAIR', pair); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - SET_VARIABLE_PROP: (context, { index, prop, value }) => { - context.commit('SET_VARIABLE_PROP', { index, prop, value }); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - DELETE_VARIABLE_PAIR: (context, index) => { - context.commit('DELETE_VARIABLE_PAIR', index); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - SET_USER_DND: async (context, { item, value }) => { - const dnd = value ? 'dnd' : ''; - const changes = { status: dnd }; - try { - await UsersAPI.patchUserPresence({ id: item.id, changes }); - } catch (err) { - throw err; - } finally { - await context.dispatch('LOAD_DATA_LIST'); - } - }, - RESET_ITEM_STATE: (context) => { - context.commit('RESET_ITEM_STATE'); - context.dispatch('directory/users/tokens/RESET_STATE', {}, { root: true }); - }, - REGENERATE_2FA_URL: async (context) => { - try { - await Users2faAPI.generate({ id: context.state.itemId }); - await context.dispatch('LOAD_ITEM'); - } catch (err) { - throw err; - } - }, + ADD_VARIABLE_PAIR: (context) => { + const pair = { key: "", value: "" }; + context.commit("ADD_VARIABLE_PAIR", pair); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + SET_VARIABLE_PROP: (context, { index, prop, value }) => { + context.commit("SET_VARIABLE_PROP", { index, prop, value }); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + DELETE_VARIABLE_PAIR: (context, index) => { + context.commit("DELETE_VARIABLE_PAIR", index); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + SET_USER_DND: async (context, { item, value }) => { + const dnd = value ? "dnd" : ""; + const changes = { status: dnd }; + try { + await UsersAPI.patchUserPresence({ id: item.id, changes }); + } catch (err) { + throw err; + } finally { + await context.dispatch("LOAD_DATA_LIST"); + } + }, + RESET_ITEM_STATE: (context) => { + context.commit("RESET_ITEM_STATE"); + context.dispatch("directory/users/tokens/RESET_STATE", {}, { root: true }); + }, + REGENERATE_2FA_URL: async (context) => { + try { + await Users2faAPI.generate({ id: context.state.itemId }); + await context.dispatch("LOAD_ITEM"); + } catch (err) { + throw err; + } + }, }; const mutations = { - ADD_VARIABLE_PAIR: (state, pair) => { - state.itemInstance.variables.push(pair); - }, - SET_VARIABLE_PROP: (state, { index, prop, value }) => { - state.itemInstance.variables[index][prop] = value; - }, - DELETE_VARIABLE_PAIR: (state, index) => { - state.itemInstance.variables.splice(index, 1); - }, + ADD_VARIABLE_PAIR: (state, pair) => { + state.itemInstance.variables.push(pair); + }, + SET_VARIABLE_PROP: (state, { index, prop, value }) => { + state.itemInstance.variables[index][prop] = value; + }, + DELETE_VARIABLE_PAIR: (state, index) => { + state.itemInstance.variables.splice(index, 1); + }, }; -const PERMISSIONS_API_URL = '/users'; +const PERMISSIONS_API_URL = "/users"; const permissions = new PermissionsStoreModule() -.generateAPIActions(PERMISSIONS_API_URL) -.getModule(); + .generateAPIActions(PERMISSIONS_API_URL) + .getModule(); const users = new ObjectStoreModule({ resettableState, headers }) -.attachAPIModule(UsersAPI) -.generateAPIActions() -.setChildModules({ tokens, logs, permissions }) -.getModule({ getters, actions, mutations }); + .attachAPIModule(UsersAPI) + .generateAPIActions() + .setChildModules({ tokens, logs, permissions }) + .getModule({ getters, actions, mutations }); export default users; diff --git a/src/modules/directory/store/directory.js b/src/modules/directory/store/directory.js index 8fcd372c6..3de43335a 100644 --- a/src/modules/directory/store/directory.js +++ b/src/modules/directory/store/directory.js @@ -1,14 +1,14 @@ -import devices from '../modules/devices/store/devices'; -import license from '../modules/license/store/license'; -import users from '../modules/users/store/users'; +import devices from "../modules/devices/store/devices"; +import license from "../modules/license/store/license"; +import users from "../modules/users/store/users"; const modules = { - users, - license, - devices, + users, + license, + devices, }; export default { - namespaced: true, - modules, + namespaced: true, + modules, }; diff --git a/src/modules/error-pages/components/the-access-denied-component.vue b/src/modules/error-pages/components/the-access-denied-component.vue index 202e389bd..2d848d4d0 100644 --- a/src/modules/error-pages/components/the-access-denied-component.vue +++ b/src/modules/error-pages/components/the-access-denied-component.vue @@ -7,7 +7,7 @@ diff --git a/src/modules/error-pages/components/the-not-found-component.vue b/src/modules/error-pages/components/the-not-found-component.vue index fe295d637..db821735d 100644 --- a/src/modules/error-pages/components/the-not-found-component.vue +++ b/src/modules/error-pages/components/the-not-found-component.vue @@ -7,7 +7,7 @@ diff --git a/src/modules/integrations/modules/cognitive-profiles/api/cognitiveProfiles.js b/src/modules/integrations/modules/cognitive-profiles/api/cognitiveProfiles.js index cee1346c5..7bb51b4c3 100644 --- a/src/modules/integrations/modules/cognitive-profiles/api/cognitiveProfiles.js +++ b/src/modules/integrations/modules/cognitive-profiles/api/cognitiveProfiles.js @@ -1,208 +1,192 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { CognitiveProfileServiceApiFactory } from 'webitel-sdk'; -import { MicrosoftRegion } from 'webitel-sdk/esm2015/lookups'; -import instance from '../../../../../app/api/instance'; -import configuration from '../../../../../app/api/openAPIConfig'; -import CognitiveProfileServices - from '../lookups/CognitiveProfileServices.lookup'; - -const cognitiveProfilesService = new CognitiveProfileServiceApiFactory(configuration, '', instance); + camelToSnake, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { CognitiveProfileServiceApiFactory } from "webitel-sdk"; +import { MicrosoftRegion } from "webitel-sdk/esm2015/lookups"; +import instance from "../../../../../app/api/instance"; +import configuration from "../../../../../app/api/openAPIConfig"; +import CognitiveProfileServices from "../lookups/CognitiveProfileServices.lookup"; + +const cognitiveProfilesService = new CognitiveProfileServiceApiFactory( + configuration, + "", + instance, +); const fieldsToSend = [ - 'name', - 'default', - 'enabled', - 'provider', - 'service', - 'description', - 'properties', + "name", + "default", + "enabled", + "provider", + "service", + "description", + "properties", ]; const preRequestHandler = (item) => { - const result = { - ...item, - service: item.service.value, - properties: { ...item.properties }, - }; - if (result.properties.region) { - result.properties.region = item.properties.region.id; - } - return result; + const result = { + ...item, + service: item.service.value, + properties: { ...item.properties }, + }; + if (result.properties.region) { + result.properties.region = item.properties.region.id; + } + return result; }; const getList = async (params) => { - const defaultObject = { - default: false, - enabled: false, - }; - - const { - page, - size, - search, - sort, - fields, - id, - service, - enabled, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); - - try { - const response = await cognitiveProfilesService.searchCognitiveProfile( - page, - size, - search, - sort, - fields, - id, - service, - enabled, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const defaultObject = { + default: false, + enabled: false, + }; + + const { page, size, search, sort, fields, id, service, enabled } = + applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); + + try { + const response = await cognitiveProfilesService.searchCognitiveProfile( + page, + size, + search, + sort, + fields, + id, + service, + enabled, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const get = async ({ itemId: id }) => { - const defaultObject = { - properties: {}, - }; - - const responseHandler = (response) => { - const result = { - ...response, - service: CognitiveProfileServices - .find(({ value }) => value === response.service), - properties: { - ...response.properties, - }, - }; - if (result.properties.region) { - result.properties.region = MicrosoftRegion - .find(({ id }) => id === result.properties.region) || {}; - } - - return result; - }; - - try { - const response = await cognitiveProfilesService.readCognitiveProfile(id); - return applyTransform(response.data, [ - snakeToCamel(), - merge(defaultObject), - responseHandler, - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const defaultObject = { + properties: {}, + }; + + const responseHandler = (response) => { + const result = { + ...response, + service: CognitiveProfileServices.find( + ({ value }) => value === response.service, + ), + properties: { + ...response.properties, + }, + }; + if (result.properties.region) { + result.properties.region = + MicrosoftRegion.find(({ id }) => id === result.properties.region) || {}; + } + + return result; + }; + + try { + const response = await cognitiveProfilesService.readCognitiveProfile(id); + return applyTransform(response.data, [ + snakeToCamel(), + merge(defaultObject), + responseHandler, + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const add = async ({ itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await cognitiveProfilesService.createCognitiveProfile(item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = + await cognitiveProfilesService.createCognitiveProfile(item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patch = async ({ changes, id }) => { - const body = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await cognitiveProfilesService.patchCognitiveProfile(id, body); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const body = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await cognitiveProfilesService.patchCognitiveProfile( + id, + body, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const update = async ({ itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await cognitiveProfilesService.updateCognitiveProfile(id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await cognitiveProfilesService.updateCognitiveProfile( + id, + item, + ); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteItem = async ({ id }) => { - try { - const response = await cognitiveProfilesService.deleteCognitiveProfile(id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await cognitiveProfilesService.deleteCognitiveProfile(id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -const getLookup = (params) => getList({ - ...params, - fields: params.fields || ['id', 'name'], -}); +const getLookup = (params) => + getList({ + ...params, + fields: params.fields || ["id", "name"], + }); const CognitiveProfilesAPI = { - getList, - get, - add, - patch, - update, - delete: deleteItem, - getLookup, + getList, + get, + add, + patch, + update, + delete: deleteItem, + getLookup, }; export default CognitiveProfilesAPI; diff --git a/src/modules/integrations/modules/cognitive-profiles/components/__tests__/opened-cognitive-profile.spec.js b/src/modules/integrations/modules/cognitive-profiles/components/__tests__/opened-cognitive-profile.spec.js index c773defb0..b912f146c 100644 --- a/src/modules/integrations/modules/cognitive-profiles/components/__tests__/opened-cognitive-profile.spec.js +++ b/src/modules/integrations/modules/cognitive-profiles/components/__tests__/opened-cognitive-profile.spec.js @@ -1,19 +1,21 @@ -import { shallowMount } from '@vue/test-utils'; -import deepmerge from 'deepmerge'; -import openedObjectMixinMock - from '../../../../../../../tests/unit/mocks/mixinMocks/openedObjectMixin.mock'; -import OpenedCognitiveProfile from '../opened-cognitive-profile.vue'; +import { shallowMount } from "@vue/test-utils"; +import deepmerge from "deepmerge"; +import openedObjectMixinMock from "../../../../../../../tests/unit/mocks/mixinMocks/openedObjectMixin.mock"; +import OpenedCognitiveProfile from "../opened-cognitive-profile.vue"; -describe('OpenedCognitiveProfile', () => { - it('renders a component', () => { - const wrapper = shallowMount(OpenedCognitiveProfile, deepmerge.all([ - openedObjectMixinMock(), - { - // computed: { - // itemInstance: () => ({ provider: 'vi' }), - // }, - }, - ])); - expect(wrapper.exists()).toBe(true); - }); +describe("OpenedCognitiveProfile", () => { + it("renders a component", () => { + const wrapper = shallowMount( + OpenedCognitiveProfile, + deepmerge.all([ + openedObjectMixinMock(), + { + // computed: { + // itemInstance: () => ({ provider: 'vi' }), + // }, + }, + ]), + ); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/modules/integrations/modules/cognitive-profiles/components/__tests__/the-cognitive-profiles.spec.js b/src/modules/integrations/modules/cognitive-profiles/components/__tests__/the-cognitive-profiles.spec.js index 2914dc036..eb6f251e0 100644 --- a/src/modules/integrations/modules/cognitive-profiles/components/__tests__/the-cognitive-profiles.spec.js +++ b/src/modules/integrations/modules/cognitive-profiles/components/__tests__/the-cognitive-profiles.spec.js @@ -1,16 +1,17 @@ -import { shallowMount } from '@vue/test-utils'; -import { reactive } from 'vue'; -import tableComponentComputedMock - from '../../../../../../../tests/unit/mocks/tableComponentComputed.mock'; -import { useDummy } from '../../../../../../app/composables/useDummy'; -import TheCognitiveProfiles from '../the-cognitive-profiles.vue'; +import { shallowMount } from "@vue/test-utils"; +import { reactive } from "vue"; +import tableComponentComputedMock from "../../../../../../../tests/unit/mocks/tableComponentComputed.mock"; +import { useDummy } from "../../../../../../app/composables/useDummy"; +import TheCognitiveProfiles from "../the-cognitive-profiles.vue"; -vi.mock('../../../../../../app/composables/useDummy'); +vi.mock("../../../../../../app/composables/useDummy"); useDummy.mockImplementation(() => ({ store: reactive({}) })); -describe('TheCognitiveProfiles', () => { - it('renders a component', () => { - const wrapper = shallowMount(TheCognitiveProfiles, { computed: tableComponentComputedMock() }); - expect(wrapper.exists()).toBe(true); - }); +describe("TheCognitiveProfiles", () => { + it("renders a component", () => { + const wrapper = shallowMount(TheCognitiveProfiles, { + computed: tableComponentComputedMock(), + }); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/modules/integrations/modules/cognitive-profiles/components/create-cognitive-profile-popup.vue b/src/modules/integrations/modules/cognitive-profiles/components/create-cognitive-profile-popup.vue index 1005f6e3c..0f4eb67eb 100644 --- a/src/modules/integrations/modules/cognitive-profiles/components/create-cognitive-profile-popup.vue +++ b/src/modules/integrations/modules/cognitive-profiles/components/create-cognitive-profile-popup.vue @@ -13,52 +13,52 @@ diff --git a/src/modules/integrations/modules/cognitive-profiles/components/eleven-labs/opened-cognitive-profile-eleven-labs.vue b/src/modules/integrations/modules/cognitive-profiles/components/eleven-labs/opened-cognitive-profile-eleven-labs.vue index 240d7c725..91d67cf0f 100644 --- a/src/modules/integrations/modules/cognitive-profiles/components/eleven-labs/opened-cognitive-profile-eleven-labs.vue +++ b/src/modules/integrations/modules/cognitive-profiles/components/eleven-labs/opened-cognitive-profile-eleven-labs.vue @@ -56,16 +56,15 @@ diff --git a/src/modules/integrations/modules/cognitive-profiles/components/google/__tests__/opened-cognitive-profile-google.spec.js b/src/modules/integrations/modules/cognitive-profiles/components/google/__tests__/opened-cognitive-profile-google.spec.js index 0a7797bdc..5bf22e335 100644 --- a/src/modules/integrations/modules/cognitive-profiles/components/google/__tests__/opened-cognitive-profile-google.spec.js +++ b/src/modules/integrations/modules/cognitive-profiles/components/google/__tests__/opened-cognitive-profile-google.spec.js @@ -1,27 +1,28 @@ -import { shallowMount } from '@vue/test-utils'; -import deepmerge from 'deepmerge'; -import OpenedTabComponentMixinMock - from '../../../../../../../../tests/unit/mocks/mixinMocks/openedTabComponentMixin.mock'; -import OpenedCognitiveProfileGoogle - from '../opened-cognitive-profile-google.vue'; +import { shallowMount } from "@vue/test-utils"; +import deepmerge from "deepmerge"; +import OpenedTabComponentMixinMock from "../../../../../../../../tests/unit/mocks/mixinMocks/openedTabComponentMixin.mock"; +import OpenedCognitiveProfileGoogle from "../opened-cognitive-profile-google.vue"; -describe('OpenedCognitiveProfileGoogle', () => { - const computed = { - itemInstance: () => ({ - properties: {}, - }), - }; +describe("OpenedCognitiveProfileGoogle", () => { + const computed = { + itemInstance: () => ({ + properties: {}, + }), + }; - it('renders a component', () => { - const wrapper = shallowMount(OpenedCognitiveProfileGoogle, deepmerge.all([ - OpenedTabComponentMixinMock(), - { - props: { - v: { itemInstance: { properties: { key: { $error: false } } } }, - }, - computed, - }, - ])); - expect(wrapper.exists()).toBe(true); - }); + it("renders a component", () => { + const wrapper = shallowMount( + OpenedCognitiveProfileGoogle, + deepmerge.all([ + OpenedTabComponentMixinMock(), + { + props: { + v: { itemInstance: { properties: { key: { $error: false } } } }, + }, + computed, + }, + ]), + ); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/modules/integrations/modules/cognitive-profiles/components/google/opened-cognitive-profile-google.vue b/src/modules/integrations/modules/cognitive-profiles/components/google/opened-cognitive-profile-google.vue index 9173a189a..47a2882c5 100644 --- a/src/modules/integrations/modules/cognitive-profiles/components/google/opened-cognitive-profile-google.vue +++ b/src/modules/integrations/modules/cognitive-profiles/components/google/opened-cognitive-profile-google.vue @@ -92,52 +92,57 @@ diff --git a/src/modules/integrations/modules/cognitive-profiles/components/microsoft/__tests__/opened-cognitive-profile-microsoft.spec.js b/src/modules/integrations/modules/cognitive-profiles/components/microsoft/__tests__/opened-cognitive-profile-microsoft.spec.js index 968a2d00a..27956e1ec 100644 --- a/src/modules/integrations/modules/cognitive-profiles/components/microsoft/__tests__/opened-cognitive-profile-microsoft.spec.js +++ b/src/modules/integrations/modules/cognitive-profiles/components/microsoft/__tests__/opened-cognitive-profile-microsoft.spec.js @@ -1,27 +1,28 @@ -import { shallowMount } from '@vue/test-utils'; -import deepmerge from 'deepmerge'; -import OpenedTabComponentMixinMock - from '../../../../../../../../tests/unit/mocks/mixinMocks/openedTabComponentMixin.mock'; -import OpenedCognitiveProfileMicrosoft - from '../opened-cognitive-profile-microsoft.vue'; +import { shallowMount } from "@vue/test-utils"; +import deepmerge from "deepmerge"; +import OpenedTabComponentMixinMock from "../../../../../../../../tests/unit/mocks/mixinMocks/openedTabComponentMixin.mock"; +import OpenedCognitiveProfileMicrosoft from "../opened-cognitive-profile-microsoft.vue"; -describe('OpenedCognitiveProfileMicrosoft', () => { - const computed = { - itemInstance: () => ({ - properties: {}, - }), - }; +describe("OpenedCognitiveProfileMicrosoft", () => { + const computed = { + itemInstance: () => ({ + properties: {}, + }), + }; - it('renders a component', () => { - const wrapper = shallowMount(OpenedCognitiveProfileMicrosoft, deepmerge.all([ - OpenedTabComponentMixinMock(), - { - props: { - v: { itemInstance: { properties: {} } }, - }, - computed, - }, - ])); - expect(wrapper.exists()).toBe(true); - }); + it("renders a component", () => { + const wrapper = shallowMount( + OpenedCognitiveProfileMicrosoft, + deepmerge.all([ + OpenedTabComponentMixinMock(), + { + props: { + v: { itemInstance: { properties: {} } }, + }, + computed, + }, + ]), + ); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/modules/integrations/modules/cognitive-profiles/components/microsoft/opened-cognitive-profile-microsoft.vue b/src/modules/integrations/modules/cognitive-profiles/components/microsoft/opened-cognitive-profile-microsoft.vue index ae0c968b1..ab34e25e8 100644 --- a/src/modules/integrations/modules/cognitive-profiles/components/microsoft/opened-cognitive-profile-microsoft.vue +++ b/src/modules/integrations/modules/cognitive-profiles/components/microsoft/opened-cognitive-profile-microsoft.vue @@ -75,28 +75,27 @@ diff --git a/src/modules/integrations/modules/cognitive-profiles/components/opened-cognitive-profile.vue b/src/modules/integrations/modules/cognitive-profiles/components/opened-cognitive-profile.vue index d86f0f9d7..1b73d7902 100644 --- a/src/modules/integrations/modules/cognitive-profiles/components/opened-cognitive-profile.vue +++ b/src/modules/integrations/modules/cognitive-profiles/components/opened-cognitive-profile.vue @@ -39,119 +39,126 @@ diff --git a/src/modules/integrations/modules/cognitive-profiles/components/the-cognitive-profiles.vue b/src/modules/integrations/modules/cognitive-profiles/components/the-cognitive-profiles.vue index ba50a538a..6a67f554b 100644 --- a/src/modules/integrations/modules/cognitive-profiles/components/the-cognitive-profiles.vue +++ b/src/modules/integrations/modules/cognitive-profiles/components/the-cognitive-profiles.vue @@ -137,98 +137,108 @@ diff --git a/src/modules/integrations/modules/cognitive-profiles/lookups/CognitiveProfileServices.lookup.js b/src/modules/integrations/modules/cognitive-profiles/lookups/CognitiveProfileServices.lookup.js index ab47f187c..3e6ebbf7e 100644 --- a/src/modules/integrations/modules/cognitive-profiles/lookups/CognitiveProfileServices.lookup.js +++ b/src/modules/integrations/modules/cognitive-profiles/lookups/CognitiveProfileServices.lookup.js @@ -1,8 +1,8 @@ -import { StorageServiceType } from 'webitel-sdk'; +import { StorageServiceType } from "webitel-sdk"; const CognitiveProfileServices = Object.freeze([ - { locale: 'objects.tts', value: StorageServiceType.TTS }, - { locale: 'objects.stt', value: StorageServiceType.STT }, + { locale: "objects.tts", value: StorageServiceType.TTS }, + { locale: "objects.stt", value: StorageServiceType.STT }, ]); export default CognitiveProfileServices; diff --git a/src/modules/integrations/modules/cognitive-profiles/schemas/defaultCognitiveProfile.js b/src/modules/integrations/modules/cognitive-profiles/schemas/defaultCognitiveProfile.js index 40ef86fa3..96fec4f65 100644 --- a/src/modules/integrations/modules/cognitive-profiles/schemas/defaultCognitiveProfile.js +++ b/src/modules/integrations/modules/cognitive-profiles/schemas/defaultCognitiveProfile.js @@ -1,13 +1,12 @@ -import CognitiveProfileServices - from '../lookups/CognitiveProfileServices.lookup'; +import CognitiveProfileServices from "../lookups/CognitiveProfileServices.lookup"; const defaultCognitiveProfile = () => ({ - name: '', - default: false, - enabled: true, - provider: null, - service: CognitiveProfileServices[0], - description: '', + name: "", + default: false, + enabled: true, + provider: null, + service: CognitiveProfileServices[0], + description: "", }); export default defaultCognitiveProfile; diff --git a/src/modules/integrations/modules/cognitive-profiles/schemas/elevenLabsCognitiveProfile.js b/src/modules/integrations/modules/cognitive-profiles/schemas/elevenLabsCognitiveProfile.js index 16e2ae5a5..5129b3ce2 100644 --- a/src/modules/integrations/modules/cognitive-profiles/schemas/elevenLabsCognitiveProfile.js +++ b/src/modules/integrations/modules/cognitive-profiles/schemas/elevenLabsCognitiveProfile.js @@ -1,12 +1,12 @@ -import { StorageProviderType } from 'webitel-sdk'; -import defaultCognitiveProfile from './defaultCognitiveProfile'; +import { StorageProviderType } from "webitel-sdk"; +import defaultCognitiveProfile from "./defaultCognitiveProfile"; const elevenLabsCognitiveProfile = () => ({ - ...defaultCognitiveProfile(), - provider: StorageProviderType.ElevenLabs, - properties: { - key: '', - }, + ...defaultCognitiveProfile(), + provider: StorageProviderType.ElevenLabs, + properties: { + key: "", + }, }); export default elevenLabsCognitiveProfile; diff --git a/src/modules/integrations/modules/cognitive-profiles/schemas/googleCognitiveProfile.js b/src/modules/integrations/modules/cognitive-profiles/schemas/googleCognitiveProfile.js index cefa693f1..87238ac50 100644 --- a/src/modules/integrations/modules/cognitive-profiles/schemas/googleCognitiveProfile.js +++ b/src/modules/integrations/modules/cognitive-profiles/schemas/googleCognitiveProfile.js @@ -1,14 +1,14 @@ -import { StorageProviderType } from 'webitel-sdk'; -import { MicrosoftLanguage } from 'webitel-sdk/esm2015/enums'; -import defaultCognitiveProfile from './defaultCognitiveProfile'; +import { StorageProviderType } from "webitel-sdk"; +import { MicrosoftLanguage } from "webitel-sdk/esm2015/enums"; +import defaultCognitiveProfile from "./defaultCognitiveProfile"; const googleCognitiveProfile = () => ({ - ...defaultCognitiveProfile(), - provider: StorageProviderType.Google, - properties: { - key: '', - locale: MicrosoftLanguage['en-US'], - }, + ...defaultCognitiveProfile(), + provider: StorageProviderType.Google, + properties: { + key: "", + locale: MicrosoftLanguage["en-US"], + }, }); export default googleCognitiveProfile; diff --git a/src/modules/integrations/modules/cognitive-profiles/schemas/microsoftCognitiveProfile.js b/src/modules/integrations/modules/cognitive-profiles/schemas/microsoftCognitiveProfile.js index ea665834f..281640e03 100644 --- a/src/modules/integrations/modules/cognitive-profiles/schemas/microsoftCognitiveProfile.js +++ b/src/modules/integrations/modules/cognitive-profiles/schemas/microsoftCognitiveProfile.js @@ -1,16 +1,16 @@ -import { StorageProviderType } from 'webitel-sdk'; -import { MicrosoftLanguage } from 'webitel-sdk/esm2015/enums'; -import { MicrosoftRegion } from 'webitel-sdk/esm2015/lookups'; -import defaultCognitiveProfile from './defaultCognitiveProfile'; +import { StorageProviderType } from "webitel-sdk"; +import { MicrosoftLanguage } from "webitel-sdk/esm2015/enums"; +import { MicrosoftRegion } from "webitel-sdk/esm2015/lookups"; +import defaultCognitiveProfile from "./defaultCognitiveProfile"; const microsoftCognitiveProfile = () => ({ - ...defaultCognitiveProfile(), - provider: StorageProviderType.Microsoft, - properties: { - key: '', - region: MicrosoftRegion[0], - locale: MicrosoftLanguage['en-US'], - }, + ...defaultCognitiveProfile(), + provider: StorageProviderType.Microsoft, + properties: { + key: "", + region: MicrosoftRegion[0], + locale: MicrosoftLanguage["en-US"], + }, }); export default microsoftCognitiveProfile; diff --git a/src/modules/integrations/modules/cognitive-profiles/store/_internals/headers.js b/src/modules/integrations/modules/cognitive-profiles/store/_internals/headers.js index a400d4639..91aff2d7c 100644 --- a/src/modules/integrations/modules/cognitive-profiles/store/_internals/headers.js +++ b/src/modules/integrations/modules/cognitive-profiles/store/_internals/headers.js @@ -1,34 +1,34 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'provider', - locale: 'objects.provider', - field: 'provider', - sort: SortSymbols.NONE, - }, - { - value: 'service', - locale: 'objects.service', - field: 'service', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'reusable.state', - field: 'enabled', - sort: SortSymbols.NONE, - }, - { - value: 'default', - locale: 'objects.default', - field: 'default', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "provider", + locale: "objects.provider", + field: "provider", + sort: SortSymbols.NONE, + }, + { + value: "service", + locale: "objects.service", + field: "service", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "reusable.state", + field: "enabled", + sort: SortSymbols.NONE, + }, + { + value: "default", + locale: "objects.default", + field: "default", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/integrations/modules/cognitive-profiles/store/cognitive-profiles.js b/src/modules/integrations/modules/cognitive-profiles/store/cognitive-profiles.js index 103e16116..f23f9682f 100644 --- a/src/modules/integrations/modules/cognitive-profiles/store/cognitive-profiles.js +++ b/src/modules/integrations/modules/cognitive-profiles/store/cognitive-profiles.js @@ -1,60 +1,58 @@ -import deepMerge from 'deepmerge'; -import { StorageProviderType } from 'webitel-sdk'; -import ObjectStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -import PermissionsStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule'; -import CognitiveProfilesAPI from '../api/cognitiveProfiles'; -import defaultCognitiveProfile from '../schemas/defaultCognitiveProfile'; -import googleCognitiveProfile from '../schemas/googleCognitiveProfile'; -import microsoftCognitiveProfile from '../schemas/microsoftCognitiveProfile'; -import elevenLabsCognitiveProfile from '../schemas/elevenLabsCognitiveProfile'; -import headers from './_internals/headers'; +import deepMerge from "deepmerge"; +import { StorageProviderType } from "webitel-sdk"; +import ObjectStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule"; +import PermissionsStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule"; +import CognitiveProfilesAPI from "../api/cognitiveProfiles"; +import defaultCognitiveProfile from "../schemas/defaultCognitiveProfile"; +import elevenLabsCognitiveProfile from "../schemas/elevenLabsCognitiveProfile"; +import googleCognitiveProfile from "../schemas/googleCognitiveProfile"; +import microsoftCognitiveProfile from "../schemas/microsoftCognitiveProfile"; +import headers from "./_internals/headers"; const resettableState = { - itemInstance: { - ...defaultCognitiveProfile(), - }, + itemInstance: { + ...defaultCognitiveProfile(), + }, }; const stateMap = { - [StorageProviderType.Microsoft]: microsoftCognitiveProfile, - [StorageProviderType.Google]: googleCognitiveProfile, - [StorageProviderType.ElevenLabs]: elevenLabsCognitiveProfile, + [StorageProviderType.Microsoft]: microsoftCognitiveProfile, + [StorageProviderType.Google]: googleCognitiveProfile, + [StorageProviderType.ElevenLabs]: elevenLabsCognitiveProfile, }; const actions = { - LOAD_ITEM: async (context, type) => { - let typedItem; - if (context.state.itemId) { - const item = await context.dispatch('GET_ITEM'); - typedItem = deepMerge(stateMap[item.provider](), item); - } else { - typedItem = stateMap[type](); - } - context.commit('SET_ITEM', typedItem); - }, - SET_ITEM_PROPERTIES_PROP: (context, { prop, value }) => { - const properties = { - ...context.state.itemInstance.properties, - [prop]: value, - }; - return context.dispatch('SET_ITEM_PROPERTY', { - prop: 'properties', - value: properties, - }); - }, + LOAD_ITEM: async (context, type) => { + let typedItem; + if (context.state.itemId) { + const item = await context.dispatch("GET_ITEM"); + typedItem = deepMerge(stateMap[item.provider](), item); + } else { + typedItem = stateMap[type](); + } + context.commit("SET_ITEM", typedItem); + }, + SET_ITEM_PROPERTIES_PROP: (context, { prop, value }) => { + const properties = { + ...context.state.itemInstance.properties, + [prop]: value, + }; + return context.dispatch("SET_ITEM_PROPERTY", { + prop: "properties", + value: properties, + }); + }, }; -const PERMISSIONS_API_URL = '/storage/cognitive_profiles'; +const PERMISSIONS_API_URL = "/storage/cognitive_profiles"; const permissions = new PermissionsStoreModule() -.generateAPIActions(PERMISSIONS_API_URL) -.getModule(); + .generateAPIActions(PERMISSIONS_API_URL) + .getModule(); const skills = new ObjectStoreModule({ resettableState, headers }) -.attachAPIModule(CognitiveProfilesAPI) -.generateAPIActions() -.setChildModules({ permissions }) -.getModule({ actions }); + .attachAPIModule(CognitiveProfilesAPI) + .generateAPIActions() + .setChildModules({ permissions }) + .getModule({ actions }); export default skills; diff --git a/src/modules/integrations/modules/email-profiles/api/emailProfiles.js b/src/modules/integrations/modules/email-profiles/api/emailProfiles.js index 560b1df6a..7a13c1e6a 100644 --- a/src/modules/integrations/modules/email-profiles/api/emailProfiles.js +++ b/src/modules/integrations/modules/email-profiles/api/emailProfiles.js @@ -1,209 +1,184 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { EmailProfileServiceApiFactory } from 'webitel-sdk'; -import { EngineEmailAuthType } from 'webitel-sdk'; -import instance from '../../../../../app/api/instance'; -import configuration from '../../../../../app/api/openAPIConfig'; - -const emailProfilesService = new EmailProfileServiceApiFactory(configuration, '', instance); + camelToSnake, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { EmailProfileServiceApiFactory } from "webitel-sdk"; +import { EngineEmailAuthType } from "webitel-sdk"; +import instance from "../../../../../app/api/instance"; +import configuration from "../../../../../app/api/openAPIConfig"; + +const emailProfilesService = new EmailProfileServiceApiFactory( + configuration, + "", + instance, +); const fieldsToSend = [ - 'name', - 'description', - 'domainId', - 'enabled', - 'imapHost', - 'smtpHost', - 'fetchInterval', - 'imapPort', - 'login', - 'mailbox', - 'password', - 'schema', - 'smtpPort', - 'authType', - 'listen', - 'logged', - 'params', + "name", + "description", + "domainId", + "enabled", + "imapHost", + "smtpHost", + "fetchInterval", + "imapPort", + "login", + "mailbox", + "password", + "schema", + "smtpPort", + "authType", + "listen", + "logged", + "params", ]; const preRequestHandler = (item) => ({ - ...item, + ...item, }); const getList = async (params) => { - const defaultObject = { - enabled: false, - }; - - const { - page, - size, - search, - sort, - fields, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); - - try { - const response = await emailProfilesService.searchEmailProfile( - page, - size, - search, - sort, - fields, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const defaultObject = { + enabled: false, + }; + + const { page, size, search, sort, fields } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); + + try { + const response = await emailProfilesService.searchEmailProfile( + page, + size, + search, + sort, + fields, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const get = async ({ itemId: id }) => { - const defaultObject = { - imapPort: 0, - smtpPort: 0, - authType: EngineEmailAuthType.Plain, - }; - - try { - const response = await emailProfilesService.readEmailProfile(id); - return applyTransform(response.data, [ - snakeToCamel(), - merge(defaultObject), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const defaultObject = { + imapPort: 0, + smtpPort: 0, + authType: EngineEmailAuthType.Plain, + }; + + try { + const response = await emailProfilesService.readEmailProfile(id); + return applyTransform(response.data, [ + snakeToCamel(), + merge(defaultObject), + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const add = async ({ itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await emailProfilesService.createEmailProfile(item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await emailProfilesService.createEmailProfile(item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patch = async ({ changes, id }) => { - const body = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await emailProfilesService.patchEmailProfile(id, body); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const body = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await emailProfilesService.patchEmailProfile(id, body); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const update = async ({ itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await emailProfilesService.updateEmailProfile(id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await emailProfilesService.updateEmailProfile(id, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteItem = async ({ id }) => { - try { - const response = await emailProfilesService.deleteEmailProfile(id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await emailProfilesService.deleteEmailProfile(id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -const getLookup = (params) => getList({ - ...params, - fields: params.fields || ['id', 'name'], -}); +const getLookup = (params) => + getList({ + ...params, + fields: params.fields || ["id", "name"], + }); const login = async ({ id }) => { - try { - const response = await emailProfilesService.loginEmailProfile(id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } -} + try { + const response = await emailProfilesService.loginEmailProfile(id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } +}; const logout = async ({ id }) => { - try { - const response = await emailProfilesService.logoutEmailProfile(id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } -} + try { + const response = await emailProfilesService.logoutEmailProfile(id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } +}; const EmailProfilesAPI = { - getList, - get, - add, - patch, - update, - delete: deleteItem, - getLookup, - login, - logout, + getList, + get, + add, + patch, + update, + delete: deleteItem, + getLookup, + login, + logout, }; export default EmailProfilesAPI; diff --git a/src/modules/integrations/modules/email-profiles/components/__tests__/opened-email-profile-general.spec.js b/src/modules/integrations/modules/email-profiles/components/__tests__/opened-email-profile-general.spec.js index f6a4ebbac..27caa74be 100644 --- a/src/modules/integrations/modules/email-profiles/components/__tests__/opened-email-profile-general.spec.js +++ b/src/modules/integrations/modules/email-profiles/components/__tests__/opened-email-profile-general.spec.js @@ -1,24 +1,26 @@ -import { shallowMount } from '@vue/test-utils'; -import deepmerge from 'deepmerge'; -import OpenedTabComponentMixinMock - from '../../../../../../../tests/unit/mocks/mixinMocks/openedTabComponentMixin.mock'; -import OpenedEmailProfileGeneral from '../opened-email-profile-general.vue'; +import { shallowMount } from "@vue/test-utils"; +import deepmerge from "deepmerge"; +import OpenedTabComponentMixinMock from "../../../../../../../tests/unit/mocks/mixinMocks/openedTabComponentMixin.mock"; +import OpenedEmailProfileGeneral from "../opened-email-profile-general.vue"; -describe('OpenedEmailProfileGeneral', () => { - const computed = { - itemInstance: () => ({}), - }; +describe("OpenedEmailProfileGeneral", () => { + const computed = { + itemInstance: () => ({}), + }; - it('renders a component', () => { - const wrapper = shallowMount(OpenedEmailProfileGeneral, deepmerge.all([ - OpenedTabComponentMixinMock(), - { - props: { - v: { itemInstance: { properties: {} } }, - }, - computed, - }, - ])); - expect(wrapper.exists()).toBe(true); - }); + it("renders a component", () => { + const wrapper = shallowMount( + OpenedEmailProfileGeneral, + deepmerge.all([ + OpenedTabComponentMixinMock(), + { + props: { + v: { itemInstance: { properties: {} } }, + }, + computed, + }, + ]), + ); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/modules/integrations/modules/email-profiles/components/__tests__/opened-email-profile.spec.js b/src/modules/integrations/modules/email-profiles/components/__tests__/opened-email-profile.spec.js index 574cd3a3e..a7beca813 100644 --- a/src/modules/integrations/modules/email-profiles/components/__tests__/opened-email-profile.spec.js +++ b/src/modules/integrations/modules/email-profiles/components/__tests__/opened-email-profile.spec.js @@ -1,15 +1,14 @@ -import { shallowMount } from '@vue/test-utils'; -import deepmerge from 'deepmerge'; -import openedObjectMixinMock - from '../../../../../../../tests/unit/mocks/mixinMocks/openedObjectMixin.mock'; -import OpenedEmailProfile from '../opened-email-profile.vue'; +import { shallowMount } from "@vue/test-utils"; +import deepmerge from "deepmerge"; +import openedObjectMixinMock from "../../../../../../../tests/unit/mocks/mixinMocks/openedObjectMixin.mock"; +import OpenedEmailProfile from "../opened-email-profile.vue"; -describe('OpenedEmailProfile', () => { - it('renders a component', () => { - const wrapper = shallowMount(OpenedEmailProfile, deepmerge.all([ - openedObjectMixinMock(), - {}, - ])); - expect(wrapper.exists()).toBe(true); - }); +describe("OpenedEmailProfile", () => { + it("renders a component", () => { + const wrapper = shallowMount( + OpenedEmailProfile, + deepmerge.all([openedObjectMixinMock(), {}]), + ); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/modules/integrations/modules/email-profiles/components/__tests__/the-email-profiles.spec.js b/src/modules/integrations/modules/email-profiles/components/__tests__/the-email-profiles.spec.js index 01ab4b428..a14109eaa 100644 --- a/src/modules/integrations/modules/email-profiles/components/__tests__/the-email-profiles.spec.js +++ b/src/modules/integrations/modules/email-profiles/components/__tests__/the-email-profiles.spec.js @@ -1,16 +1,17 @@ -import { shallowMount } from '@vue/test-utils'; -import { reactive } from 'vue'; -import tableComponentComputedMock - from '../../../../../../../tests/unit/mocks/tableComponentComputed.mock'; -import { useDummy } from '../../../../../../app/composables/useDummy'; -import TheEmailProfiles from '../the-email-profiles.vue'; +import { shallowMount } from "@vue/test-utils"; +import { reactive } from "vue"; +import tableComponentComputedMock from "../../../../../../../tests/unit/mocks/tableComponentComputed.mock"; +import { useDummy } from "../../../../../../app/composables/useDummy"; +import TheEmailProfiles from "../the-email-profiles.vue"; -vi.mock('../../../../../../app/composables/useDummy'); +vi.mock("../../../../../../app/composables/useDummy"); useDummy.mockImplementation(() => ({ store: reactive({}) })); -describe('TheEmailProfiles', () => { - it('renders a component', () => { - const wrapper = shallowMount(TheEmailProfiles, { computed: tableComponentComputedMock() }); - expect(wrapper.exists()).toBe(true); - }); +describe("TheEmailProfiles", () => { + it("renders a component", () => { + const wrapper = shallowMount(TheEmailProfiles, { + computed: tableComponentComputedMock(), + }); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/modules/integrations/modules/email-profiles/components/opened-email-profile-general.vue b/src/modules/integrations/modules/email-profiles/components/opened-email-profile-general.vue index 9c1e6ee07..60a122761 100644 --- a/src/modules/integrations/modules/email-profiles/components/opened-email-profile-general.vue +++ b/src/modules/integrations/modules/email-profiles/components/opened-email-profile-general.vue @@ -162,102 +162,115 @@ diff --git a/src/modules/integrations/modules/email-profiles/components/opened-email-profile.vue b/src/modules/integrations/modules/email-profiles/components/opened-email-profile.vue index c63c0441c..9759982aa 100644 --- a/src/modules/integrations/modules/email-profiles/components/opened-email-profile.vue +++ b/src/modules/integrations/modules/email-profiles/components/opened-email-profile.vue @@ -36,74 +36,82 @@ diff --git a/src/modules/integrations/modules/email-profiles/components/the-email-profiles.vue b/src/modules/integrations/modules/email-profiles/components/the-email-profiles.vue index bd2c67d81..9b117b36b 100644 --- a/src/modules/integrations/modules/email-profiles/components/the-email-profiles.vue +++ b/src/modules/integrations/modules/email-profiles/components/the-email-profiles.vue @@ -131,80 +131,79 @@ diff --git a/src/modules/integrations/modules/email-profiles/store/_internals/headers.js b/src/modules/integrations/modules/email-profiles/store/_internals/headers.js index 795a09076..adc6eab11 100644 --- a/src/modules/integrations/modules/email-profiles/store/_internals/headers.js +++ b/src/modules/integrations/modules/email-profiles/store/_internals/headers.js @@ -1,34 +1,34 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'mailbox', - locale: 'objects.integrations.emailProfiles.mailbox', - field: 'mailbox', - sort: SortSymbols.NONE, - }, - { - value: 'flow', - locale: ['objects.routing.flow.flow', 1], - field: 'schema', - sort: SortSymbols.NONE, - }, - { - value: 'listen', - locale: 'objects.integrations.emailProfiles.listen', - field: 'listen', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'reusable.state', - field: 'enabled', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "mailbox", + locale: "objects.integrations.emailProfiles.mailbox", + field: "mailbox", + sort: SortSymbols.NONE, + }, + { + value: "flow", + locale: ["objects.routing.flow.flow", 1], + field: "schema", + sort: SortSymbols.NONE, + }, + { + value: "listen", + locale: "objects.integrations.emailProfiles.listen", + field: "listen", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "reusable.state", + field: "enabled", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/integrations/modules/email-profiles/store/email-profiles.js b/src/modules/integrations/modules/email-profiles/store/email-profiles.js index 7af917cd2..e3eb24f01 100644 --- a/src/modules/integrations/modules/email-profiles/store/email-profiles.js +++ b/src/modules/integrations/modules/email-profiles/store/email-profiles.js @@ -1,60 +1,60 @@ -import ObjectStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; +import { EngineEmailAuthType } from "webitel-sdk"; +import ObjectStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule"; // import PermissionsStoreModule // from '../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule'; -import EmailProfilesAPI from '../api/emailProfiles'; -import headers from './_internals/headers'; -import { EngineEmailAuthType } from 'webitel-sdk'; +import EmailProfilesAPI from "../api/emailProfiles"; +import headers from "./_internals/headers"; const resettableState = { - itemInstance: { - description: '', - domainId: '', - enabled: true, - imapHost: '', - smtpHost: '', - fetchInterval: 60, - imapPort: 993, - login: '', - mailbox: '', - name: '', - password: '', - schema: {}, - smtpPort: 587, - authType: EngineEmailAuthType.Plain, - listen: false, - logged: false, - params: { - oauth2: { - clientId: '', - clientSecret: '', - redirectUrl: '', - }, - }, - }, + itemInstance: { + description: "", + domainId: "", + enabled: true, + imapHost: "", + smtpHost: "", + fetchInterval: 60, + imapPort: 993, + login: "", + mailbox: "", + name: "", + password: "", + schema: {}, + smtpPort: 587, + authType: EngineEmailAuthType.Plain, + listen: false, + logged: false, + params: { + oauth2: { + clientId: "", + clientSecret: "", + redirectUrl: "", + }, + }, + }, }; const actions = { - AUTH: async(context) => { - const { itemInstance } = context.state; - if (itemInstance.logged) { - try { - await EmailProfilesAPI.logout({ id: itemInstance.id }); - await context.dispatch('LOAD_ITEM'); - } catch (err) { - throw err; - } - - } else { - try { - const { redirect_url } = await EmailProfilesAPI.login({ id: itemInstance.id }); - if (redirect_url) window.parent.location.replace(redirect_url); - } catch (err) { - throw err; - } - } - }, -} + AUTH: async (context) => { + const { itemInstance } = context.state; + if (itemInstance.logged) { + try { + await EmailProfilesAPI.logout({ id: itemInstance.id }); + await context.dispatch("LOAD_ITEM"); + } catch (err) { + throw err; + } + } else { + try { + const { redirect_url } = await EmailProfilesAPI.login({ + id: itemInstance.id, + }); + if (redirect_url) window.parent.location.replace(redirect_url); + } catch (err) { + throw err; + } + } + }, +}; // const PERMISSIONS_API_URL = '/storage/email_profiles'; // const permissions = new PermissionsStoreModule() @@ -62,9 +62,9 @@ const actions = { // .getModule(); const skills = new ObjectStoreModule({ resettableState, headers }) -.attachAPIModule(EmailProfilesAPI) -.generateAPIActions() -// .setChildModules({ permissions }) -.getModule({ actions }); + .attachAPIModule(EmailProfilesAPI) + .generateAPIActions() + // .setChildModules({ permissions }) + .getModule({ actions }); export default skills; diff --git a/src/modules/integrations/modules/import-csv/api/importCsv.js b/src/modules/integrations/modules/import-csv/api/importCsv.js index 5d5f8cfed..881893e8c 100644 --- a/src/modules/integrations/modules/import-csv/api/importCsv.js +++ b/src/modules/integrations/modules/import-csv/api/importCsv.js @@ -1,27 +1,31 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { ImportTemplateServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../app/api/instance'; -import configuration from '../../../../../app/api/openAPIConfig'; + camelToSnake, + merge, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { ImportTemplateServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../app/api/instance"; +import configuration from "../../../../../app/api/openAPIConfig"; -const importCsvService = new ImportTemplateServiceApiFactory(configuration, '', instance); +const importCsvService = new ImportTemplateServiceApiFactory( + configuration, + "", + instance, +); -const doNotConvertKeys = ['mappings']; +const doNotConvertKeys = ["mappings"]; /* -* We need to preserve fields order because we draw them dynamically so that -* we convert it to array before sending to backend and back -* */ + * We need to preserve fields order because we draw them dynamically so that + * we convert it to array before sending to backend and back + * */ // const itemResponseHandler = (response) => { // // eslint-disable-next-line no-param-reassign // response.parameters.mappings = response.parameters.mappings @@ -32,9 +36,9 @@ const doNotConvertKeys = ['mappings']; // }; /* -* We need to preserve fields order because we draw them dynamically so that -* we convert it to array before sending to backend and back -* */ + * We need to preserve fields order because we draw them dynamically so that + * we convert it to array before sending to backend and back + * */ // const preRequestHandler = (item) => { // const mappings = Object.entries(item.parameters.mappings) // .map(([name, value]) => ({ name, ...value })); @@ -44,138 +48,112 @@ const doNotConvertKeys = ['mappings']; // }; const getList = async (params) => { - const { - page, - size, - search, - sort, - fields, - id, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { page, size, search, sort, fields, id } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); - try { - const response = await importCsvService.searchImportTemplate( - page, - size, - search, - sort, - fields, - id, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await importCsvService.searchImportTemplate( + page, + size, + search, + sort, + fields, + id, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(doNotConvertKeys), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const get = async ({ itemId: id }) => { - try { - const response = await importCsvService.readImportTemplate(id); - return applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await importCsvService.readImportTemplate(id); + return applyTransform(response.data, [snakeToCamel(doNotConvertKeys)]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const fieldsToSend = [ - 'description', - 'name', - 'parameters', - 'source', - 'sourceType', + "description", + "name", + "parameters", + "source", + "sourceType", ]; const add = async ({ itemInstance }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(doNotConvertKeys), - ]); - try { - const response = await importCsvService.createImportTemplate(item); - return applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(doNotConvertKeys), + ]); + try { + const response = await importCsvService.createImportTemplate(item); + return applyTransform(response.data, [snakeToCamel(doNotConvertKeys)]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patch = async ({ changes, id }) => { - const body = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(doNotConvertKeys), - ]); - try { - const response = await importCsvService.updateImportTemplate(id, body); - return applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const body = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(doNotConvertKeys), + ]); + try { + const response = await importCsvService.updateImportTemplate(id, body); + return applyTransform(response.data, [snakeToCamel(doNotConvertKeys)]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const update = async ({ itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(doNotConvertKeys), - ]); - try { - const response = await importCsvService.updateImportTemplate(id, item); - return applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(doNotConvertKeys), + ]); + try { + const response = await importCsvService.updateImportTemplate(id, item); + return applyTransform(response.data, [snakeToCamel(doNotConvertKeys)]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteItem = async ({ id }) => { - try { - const response = await importCsvService.deleteImportTemplate(id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await importCsvService.deleteImportTemplate(id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -const getLookup = (params) => getList({ - ...params, - fields: params.fields || ['id', 'name'], -}); +const getLookup = (params) => + getList({ + ...params, + fields: params.fields || ["id", "name"], + }); const ImportCsvAPI = { - getList, - get, - add, - patch, - update, - delete: deleteItem, - getLookup, + getList, + get, + add, + patch, + update, + delete: deleteItem, + getLookup, }; export default ImportCsvAPI; diff --git a/src/modules/integrations/modules/import-csv/components/import-csv-upload-action.vue b/src/modules/integrations/modules/import-csv/components/import-csv-upload-action.vue index c529b6fbd..3a0165a87 100644 --- a/src/modules/integrations/modules/import-csv/components/import-csv-upload-action.vue +++ b/src/modules/integrations/modules/import-csv/components/import-csv-upload-action.vue @@ -19,50 +19,50 @@ diff --git a/src/modules/integrations/modules/import-csv/components/opened-import-csv-general.vue b/src/modules/integrations/modules/import-csv/components/opened-import-csv-general.vue index c7af657a4..e386055de 100644 --- a/src/modules/integrations/modules/import-csv/components/opened-import-csv-general.vue +++ b/src/modules/integrations/modules/import-csv/components/opened-import-csv-general.vue @@ -35,24 +35,28 @@ diff --git a/src/modules/integrations/modules/import-csv/components/opened-import-csv-settings.vue b/src/modules/integrations/modules/import-csv/components/opened-import-csv-settings.vue index 0490639e3..11d394db2 100644 --- a/src/modules/integrations/modules/import-csv/components/opened-import-csv-settings.vue +++ b/src/modules/integrations/modules/import-csv/components/opened-import-csv-settings.vue @@ -58,43 +58,44 @@ diff --git a/src/modules/integrations/modules/import-csv/components/opened-import-csv.vue b/src/modules/integrations/modules/import-csv/components/opened-import-csv.vue index 4e912b1d8..f6f7cbcb8 100644 --- a/src/modules/integrations/modules/import-csv/components/opened-import-csv.vue +++ b/src/modules/integrations/modules/import-csv/components/opened-import-csv.vue @@ -36,71 +36,75 @@ diff --git a/src/modules/integrations/modules/import-csv/components/the-import-csv.vue b/src/modules/integrations/modules/import-csv/components/the-import-csv.vue index c3f548387..b0ffaf111 100644 --- a/src/modules/integrations/modules/import-csv/components/the-import-csv.vue +++ b/src/modules/integrations/modules/import-csv/components/the-import-csv.vue @@ -120,61 +120,60 @@ diff --git a/src/modules/integrations/modules/import-csv/lookups/ImportCsvMemberMappings.lookup.js b/src/modules/integrations/modules/import-csv/lookups/ImportCsvMemberMappings.lookup.js index d422dac25..2177cdd75 100644 --- a/src/modules/integrations/modules/import-csv/lookups/ImportCsvMemberMappings.lookup.js +++ b/src/modules/integrations/modules/import-csv/lookups/ImportCsvMemberMappings.lookup.js @@ -1,82 +1,82 @@ const ImportCsvMemberMappings = { - name: { - locale: 'reusable.name', - required: true, - csv: '', - }, - timezoneId: { - locale: 'objects.lookups.calendars.timezone', - required: false, - csv: '', - }, - priority: { - locale: 'vocabulary.priority', - required: false, - csv: '', - }, - expireAt: { - locale: 'objects.ccenter.queues.expire', - required: false, - csv: '', - }, - bucketId: { - locale: ['objects.lookups.buckets.buckets', 1], - required: false, - csv: '', - }, - agentId: { - locale: ['objects.ccenter.agents.agents', 1], - required: false, - csv: '', - }, - variables: { - locale: ['vocabulary.variables', 2], - required: false, - multiple: true, - csv: [], - }, - destination: { - locale: [ - ['objects.lookups.communications.communications', 1], - 'objects.ccenter.members.destination', - ], - required: true, - multiple: true, - csv: [], - }, - commPriority: { - locale: [ - ['objects.lookups.communications.communications', 1], - 'vocabulary.priority', - ], - required: false, - multiple: true, - csv: [], - }, - code: { - locale: [ - ['objects.lookups.communications.communications', 1], - 'objects.lookups.communications.code', - ], - required: true, - multiple: true, - csv: [], - }, - description: { - locale: [ - ['objects.lookups.communications.communications', 1], - 'objects.description', - ], - required: false, - multiple: true, - csv: [], - }, - dtmf: { - locale: ['objects.ccenter.members.dtmf', 1], - required: false, - multiple: true, - csv: [], - }, + name: { + locale: "reusable.name", + required: true, + csv: "", + }, + timezoneId: { + locale: "objects.lookups.calendars.timezone", + required: false, + csv: "", + }, + priority: { + locale: "vocabulary.priority", + required: false, + csv: "", + }, + expireAt: { + locale: "objects.ccenter.queues.expire", + required: false, + csv: "", + }, + bucketId: { + locale: ["objects.lookups.buckets.buckets", 1], + required: false, + csv: "", + }, + agentId: { + locale: ["objects.ccenter.agents.agents", 1], + required: false, + csv: "", + }, + variables: { + locale: ["vocabulary.variables", 2], + required: false, + multiple: true, + csv: [], + }, + destination: { + locale: [ + ["objects.lookups.communications.communications", 1], + "objects.ccenter.members.destination", + ], + required: true, + multiple: true, + csv: [], + }, + commPriority: { + locale: [ + ["objects.lookups.communications.communications", 1], + "vocabulary.priority", + ], + required: false, + multiple: true, + csv: [], + }, + code: { + locale: [ + ["objects.lookups.communications.communications", 1], + "objects.lookups.communications.code", + ], + required: true, + multiple: true, + csv: [], + }, + description: { + locale: [ + ["objects.lookups.communications.communications", 1], + "objects.description", + ], + required: false, + multiple: true, + csv: [], + }, + dtmf: { + locale: ["objects.ccenter.members.dtmf", 1], + required: false, + multiple: true, + csv: [], + }, }; export default ImportCsvMemberMappings; diff --git a/src/modules/integrations/modules/import-csv/store/_internals/headers.js b/src/modules/integrations/modules/import-csv/store/_internals/headers.js index b9a80b841..4ce63462e 100644 --- a/src/modules/integrations/modules/import-csv/store/_internals/headers.js +++ b/src/modules/integrations/modules/import-csv/store/_internals/headers.js @@ -1,16 +1,16 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'source', - locale: 'objects.integrations.importCsv.source', - field: 'source', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "source", + locale: "objects.integrations.importCsv.source", + field: "source", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/integrations/modules/import-csv/store/import-csv.js b/src/modules/integrations/modules/import-csv/store/import-csv.js index 20195f533..a526a054b 100644 --- a/src/modules/integrations/modules/import-csv/store/import-csv.js +++ b/src/modules/integrations/modules/import-csv/store/import-csv.js @@ -1,56 +1,54 @@ -import { StorageImportSourceType } from 'webitel-sdk'; -import ObjectStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -import PermissionsStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule'; -import ImportCsvAPI from '../api/importCsv'; -import ImportCsvMemberMappings from '../lookups/ImportCsvMemberMappings.lookup'; -import headers from './_internals/headers'; +import { StorageImportSourceType } from "webitel-sdk"; +import ObjectStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule"; +import PermissionsStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/PermissionsStoreModule/PermissionsStoreModule"; +import ImportCsvAPI from "../api/importCsv"; +import ImportCsvMemberMappings from "../lookups/ImportCsvMemberMappings.lookup"; +import headers from "./_internals/headers"; const resettableState = { - itemInstance: { - description: '', - name: '', - source: {}, - sourceType: StorageImportSourceType.Dialer, - parameters: { - charset: { name: 'UTF-8', value: 'utf-8' }, - separator: ',', - skipHeaders: true, - clearMembers: false, - mappings: Object.entries(ImportCsvMemberMappings) - .reduce((mappings, [name, { csv }]) => ( - { - ...mappings, - [name]: csv, - } - ), {}), - }, - }, + itemInstance: { + description: "", + name: "", + source: {}, + sourceType: StorageImportSourceType.Dialer, + parameters: { + charset: { name: "UTF-8", value: "utf-8" }, + separator: ",", + skipHeaders: true, + clearMembers: false, + mappings: Object.entries(ImportCsvMemberMappings).reduce( + (mappings, [name, { csv }]) => ({ + ...mappings, + [name]: csv, + }), + {}, + ), + }, + }, }; const actions = { - SET_ITEM_PARAMETERS_PROP: (context, { prop, value }) => { - const parameters = { - ...context.state.itemInstance.parameters, - [prop]: value, - }; - return context.dispatch('SET_ITEM_PROPERTY', { - prop: 'parameters', - value: parameters, - }); - }, + SET_ITEM_PARAMETERS_PROP: (context, { prop, value }) => { + const parameters = { + ...context.state.itemInstance.parameters, + [prop]: value, + }; + return context.dispatch("SET_ITEM_PROPERTY", { + prop: "parameters", + value: parameters, + }); + }, }; -const PERMISSIONS_API_URL = '/storage/import_templates'; +const PERMISSIONS_API_URL = "/storage/import_templates"; const permissions = new PermissionsStoreModule() -.generateAPIActions(PERMISSIONS_API_URL) -.getModule(); + .generateAPIActions(PERMISSIONS_API_URL) + .getModule(); const importCsv = new ObjectStoreModule({ resettableState, headers }) -.attachAPIModule(ImportCsvAPI) -.generateAPIActions() -.setChildModules({ permissions }) -.getModule({ actions }); + .attachAPIModule(ImportCsvAPI) + .generateAPIActions() + .setChildModules({ permissions }) + .getModule({ actions }); export default importCsv; diff --git a/src/modules/integrations/modules/single-sign-on/api/singleSignOn.js b/src/modules/integrations/modules/single-sign-on/api/singleSignOn.js index 7b02013cb..a8a1816e3 100644 --- a/src/modules/integrations/modules/single-sign-on/api/singleSignOn.js +++ b/src/modules/integrations/modules/single-sign-on/api/singleSignOn.js @@ -1,172 +1,153 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - generateUrl, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import instance from '../../../../../app/api/instance'; + camelToSnake, + generateUrl, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import instance from "../../../../../app/api/instance"; -const baseUrl = '/oauth/apps'; +const baseUrl = "/oauth/apps"; const getSingleSignOnList = async (params) => { - const fieldsToSend = ['page', 'size', 'q', 'sort', 'fields', 'id']; + const fieldsToSend = ["page", "size", "q", "sort", "fields", "id"]; - const defaultObject = { - name: '', - type: '', - enabled: false, - }; + const defaultObject = { + name: "", + type: "", + enabled: false, + }; - const url = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - (params) => ({ ...params, q: params.search }), - sanitize(fieldsToSend), - camelToSnake(), - generateUrl(baseUrl), - ]); - try { - const response = await instance.get(url); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const url = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + (params) => ({ ...params, q: params.search }), + sanitize(fieldsToSend), + camelToSnake(), + generateUrl(baseUrl), + ]); + try { + const response = await instance.get(url); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getSingleSignOn = async ({ itemId: id }) => { - const defaultObject = { - name: '', - type: '', - clientId: '', - clientSecret: '', - discoveryUrl: '', - enabled: false, - scopes: [], - }; + const defaultObject = { + name: "", + type: "", + clientId: "", + clientSecret: "", + discoveryUrl: "", + enabled: false, + scopes: [], + }; - const url = `${baseUrl}/${id}`; + const url = `${baseUrl}/${id}`; - try { - const response = await instance.get(url); - return applyTransform(response.data, [ - snakeToCamel(), - merge(defaultObject), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await instance.get(url); + return applyTransform(response.data, [ + snakeToCamel(), + merge(defaultObject), + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const fieldsToSend = [ - 'name', - 'type', - 'id', - 'clientId', - 'clientSecret', - 'discoveryUrl', - 'enabled', - 'scopes', + "name", + "type", + "id", + "clientId", + "clientSecret", + "discoveryUrl", + "enabled", + "scopes", ]; const addSingleSignOn = async ({ itemInstance }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await instance.post(baseUrl, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await instance.post(baseUrl, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateSingleSignOn = async ({ itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); - const url = `${baseUrl}/${id}`; - try { - const response = await instance.put(url, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const url = `${baseUrl}/${id}`; + try { + const response = await instance.put(url, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patchSingleSignOn = async ({ changes, id }) => { - const body = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - const url = `${baseUrl}/${id}`; - try { - const response = await instance.patch(url, body); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const body = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + const url = `${baseUrl}/${id}`; + try { + const response = await instance.patch(url, body); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteSingleSignOn = async ({ id }) => { - const url = `${baseUrl}/${id}`; - try { - const response = await instance.delete(url); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const url = `${baseUrl}/${id}`; + try { + const response = await instance.delete(url); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -const getSingleSignOnsLookup = (params) => getSingleSignOnList({ - ...params, - fields: params.fields || ['id', 'name', 'type'], -}); +const getSingleSignOnsLookup = (params) => + getSingleSignOnList({ + ...params, + fields: params.fields || ["id", "name", "type"], + }); const SingleSignOnAPI = { - getList: getSingleSignOnList, - get: getSingleSignOn, - add: addSingleSignOn, - patch: patchSingleSignOn, - update: updateSingleSignOn, - delete: deleteSingleSignOn, - getLookup: getSingleSignOnsLookup, + getList: getSingleSignOnList, + get: getSingleSignOn, + add: addSingleSignOn, + patch: patchSingleSignOn, + update: updateSingleSignOn, + delete: deleteSingleSignOn, + getLookup: getSingleSignOnsLookup, }; export default SingleSignOnAPI; diff --git a/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on-general.vue b/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on-general.vue index 291cef9c2..0bb27cd54 100644 --- a/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on-general.vue +++ b/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on-general.vue @@ -45,18 +45,17 @@ diff --git a/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue b/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue index 83cebb407..5cf106fc2 100644 --- a/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue +++ b/src/modules/integrations/modules/single-sign-on/components/opened-single-sign-on.vue @@ -36,55 +36,58 @@ diff --git a/src/modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue b/src/modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue index ac3968ce8..457bbb0ce 100644 --- a/src/modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue +++ b/src/modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue @@ -104,51 +104,50 @@ diff --git a/src/modules/integrations/modules/single-sign-on/store/_internals/headers.js b/src/modules/integrations/modules/single-sign-on/store/_internals/headers.js index 710ee3830..cc13027f2 100644 --- a/src/modules/integrations/modules/single-sign-on/store/_internals/headers.js +++ b/src/modules/integrations/modules/single-sign-on/store/_internals/headers.js @@ -1,16 +1,16 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'reusable.state', - field: 'enabled', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "reusable.state", + field: "enabled", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/integrations/modules/single-sign-on/store/single-sign-on.js b/src/modules/integrations/modules/single-sign-on/store/single-sign-on.js index 964123e20..9a8c6839b 100644 --- a/src/modules/integrations/modules/single-sign-on/store/single-sign-on.js +++ b/src/modules/integrations/modules/single-sign-on/store/single-sign-on.js @@ -1,23 +1,22 @@ -import ObjectStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -import SingleSignOnAPI from '../api/singleSignOn'; -import headers from './_internals/headers'; +import ObjectStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule"; +import SingleSignOnAPI from "../api/singleSignOn"; +import headers from "./_internals/headers"; const resettableState = { - itemInstance: { - name: '', - type: '', - clientId: '', - clientSecret: '', - discoveryUrl: '', - enabled: true, - scopes: [], - }, + itemInstance: { + name: "", + type: "", + clientId: "", + clientSecret: "", + discoveryUrl: "", + enabled: true, + scopes: [], + }, }; const singleSignOn = new ObjectStoreModule({ resettableState, headers }) -.attachAPIModule(SingleSignOnAPI) -.generateAPIActions() -.getModule({}); + .attachAPIModule(SingleSignOnAPI) + .generateAPIActions() + .getModule({}); export default singleSignOn; diff --git a/src/modules/integrations/modules/storage/api/storage.js b/src/modules/integrations/modules/storage/api/storage.js index f1f6912ea..1222619ea 100644 --- a/src/modules/integrations/modules/storage/api/storage.js +++ b/src/modules/integrations/modules/storage/api/storage.js @@ -1,214 +1,193 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import deepCopy from 'deep-copy'; -import { BackendProfileServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../app/api/instance'; -import configuration from '../../../../../app/api/openAPIConfig'; -import AWSRegions from '../store/_internals/lookups/AWSRegions.lookup'; -import DigitalOceanRegions - from '../store/_internals/lookups/DigitalOceanRegions.lookup'; -import StorageTypeAdapter - from '../store/_internals/scripts/backendStorageTypeAdapters'; - -const storageService = new BackendProfileServiceApiFactory(configuration, '', instance); + camelToSnake, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import deepCopy from "deep-copy"; +import { BackendProfileServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../app/api/instance"; +import configuration from "../../../../../app/api/openAPIConfig"; +import AWSRegions from "../store/_internals/lookups/AWSRegions.lookup"; +import DigitalOceanRegions from "../store/_internals/lookups/DigitalOceanRegions.lookup"; +import StorageTypeAdapter from "../store/_internals/scripts/backendStorageTypeAdapters"; + +const storageService = new BackendProfileServiceApiFactory( + configuration, + "", + instance, +); const fieldsToSend = [ - 'name', - 'maxSize', - 'priority', - 'properties', - 'expireDays', - 'type', - 'disabled', + "name", + "maxSize", + "priority", + "properties", + "expireDays", + "type", + "disabled", ]; const preRequestHandler = (item) => { - const copy = deepCopy(item); - if (copy.properties.region && copy.properties.region.value) { - copy.properties.region = copy.properties.region.value; - } - copy.type = StorageTypeAdapter.enumToBackend(copy.type); - return copy; + const copy = deepCopy(item); + if (copy.properties.region?.value) { + copy.properties.region = copy.properties.region.value; + } + copy.type = StorageTypeAdapter.enumToBackend(copy.type); + return copy; }; const getStorageList = async (params) => { - const defaultObject = { - disabled: false, - maxSize: 0, - expireDays: 0, - priority: 0, - }; - - const responseHandler = (response) => { - const items = response.items.map((item) => ( - { ...item, type: StorageTypeAdapter.backendToEnum(item.type) } - )); - return { ...response, items }; - }; - - const { - page, - size, - search, - sort, - fields, - id, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); - - try { - const response = await storageService.searchBackendProfile( - page, - size, - search, - sort, - fields, - id, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - responseHandler, - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const defaultObject = { + disabled: false, + maxSize: 0, + expireDays: 0, + priority: 0, + }; + + const responseHandler = (response) => { + const items = response.items.map((item) => ({ + ...item, + type: StorageTypeAdapter.backendToEnum(item.type), + })); + return { ...response, items }; + }; + + const { page, size, search, sort, fields, id } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); + + try { + const response = await storageService.searchBackendProfile( + page, + size, + search, + sort, + fields, + id, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + responseHandler, + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getStorage = async ({ itemId: id }) => { - const defaultObject = { - maxSize: 0, - expireDays: 0, - priority: 0, - }; - - const responseHandler = (response) => { - const copy = deepCopy(response); - if (copy.properties.region) { - if (copy.properties.endpoint.includes('aws')) { - copy.properties.region = AWSRegions - .find((item) => item.value === copy.properties.region); - } else if (copy.properties.endpoint.includes('digitalocean')) { - copy.properties.region = DigitalOceanRegions - .find((item) => item.value === copy.properties.region); - } - } - - return { ...copy, type: StorageTypeAdapter.backendToEnum(copy.type) }; - }; - - try { - const response = await storageService.readBackendProfile(id); - return applyTransform(response.data, [ - snakeToCamel(), - merge(defaultObject), - responseHandler, - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const defaultObject = { + maxSize: 0, + expireDays: 0, + priority: 0, + }; + + const responseHandler = (response) => { + const copy = deepCopy(response); + if (copy.properties.region) { + if (copy.properties.endpoint.includes("aws")) { + copy.properties.region = AWSRegions.find( + (item) => item.value === copy.properties.region, + ); + } else if (copy.properties.endpoint.includes("digitalocean")) { + copy.properties.region = DigitalOceanRegions.find( + (item) => item.value === copy.properties.region, + ); + } + } + + return { ...copy, type: StorageTypeAdapter.backendToEnum(copy.type) }; + }; + + try { + const response = await storageService.readBackendProfile(id); + return applyTransform(response.data, [ + snakeToCamel(), + merge(defaultObject), + responseHandler, + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const addStorage = async ({ itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await storageService.createBackendProfile(item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await storageService.createBackendProfile(item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateStorage = async ({ itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await storageService.updateBackendProfile(id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await storageService.updateBackendProfile(id, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patchStorage = async ({ changes, id }) => { - const body = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await storageService.patchBackendProfile(id, body); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + const body = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await storageService.patchBackendProfile(id, body); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteStorage = async ({ id }) => { - try { - const response = await storageService.deleteBackendProfile(id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await storageService.deleteBackendProfile(id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -const getLookup = (params) => getStorageList({ - ...params, - fields: params.fields || ['id', 'name'], -}); +const getLookup = (params) => + getStorageList({ + ...params, + fields: params.fields || ["id", "name"], + }); const StorageAPI = { - getList: getStorageList, - get: getStorage, - add: addStorage, - patch: patchStorage, - update: updateStorage, - delete: deleteStorage, - getLookup, + getList: getStorageList, + get: getStorage, + add: addStorage, + patch: patchStorage, + update: updateStorage, + delete: deleteStorage, + getLookup, }; export default StorageAPI; diff --git a/src/modules/integrations/modules/storage/components/_unused/create-storage-popup.vue b/src/modules/integrations/modules/storage/components/_unused/create-storage-popup.vue index 388577858..0a68135f1 100644 --- a/src/modules/integrations/modules/storage/components/_unused/create-storage-popup.vue +++ b/src/modules/integrations/modules/storage/components/_unused/create-storage-popup.vue @@ -62,36 +62,35 @@ diff --git a/src/modules/integrations/modules/storage/components/_unused/opened-storage-backblaze.vue b/src/modules/integrations/modules/storage/components/_unused/opened-storage-backblaze.vue index c85c0e3b6..777f0cd8b 100644 --- a/src/modules/integrations/modules/storage/components/_unused/opened-storage-backblaze.vue +++ b/src/modules/integrations/modules/storage/components/_unused/opened-storage-backblaze.vue @@ -35,38 +35,53 @@ diff --git a/src/modules/integrations/modules/storage/components/_unused/opened-storage-digital-ocean.vue b/src/modules/integrations/modules/storage/components/_unused/opened-storage-digital-ocean.vue index f378a2146..39b67bddd 100644 --- a/src/modules/integrations/modules/storage/components/_unused/opened-storage-digital-ocean.vue +++ b/src/modules/integrations/modules/storage/components/_unused/opened-storage-digital-ocean.vue @@ -36,44 +36,63 @@ diff --git a/src/modules/integrations/modules/storage/components/_unused/opened-storage-drive.vue b/src/modules/integrations/modules/storage/components/_unused/opened-storage-drive.vue index baef9778e..4ecdeaf72 100644 --- a/src/modules/integrations/modules/storage/components/_unused/opened-storage-drive.vue +++ b/src/modules/integrations/modules/storage/components/_unused/opened-storage-drive.vue @@ -29,34 +29,48 @@ diff --git a/src/modules/integrations/modules/storage/components/_unused/opened-storage-dropbox.vue b/src/modules/integrations/modules/storage/components/_unused/opened-storage-dropbox.vue index 7167629dd..6bab39214 100644 --- a/src/modules/integrations/modules/storage/components/_unused/opened-storage-dropbox.vue +++ b/src/modules/integrations/modules/storage/components/_unused/opened-storage-dropbox.vue @@ -17,26 +17,30 @@ diff --git a/src/modules/integrations/modules/storage/components/_unused/opened-storage-local.vue b/src/modules/integrations/modules/storage/components/_unused/opened-storage-local.vue index 02264520a..96ad0f8d2 100644 --- a/src/modules/integrations/modules/storage/components/_unused/opened-storage-local.vue +++ b/src/modules/integrations/modules/storage/components/_unused/opened-storage-local.vue @@ -15,26 +15,30 @@ diff --git a/src/modules/integrations/modules/storage/components/opened-storage-general.vue b/src/modules/integrations/modules/storage/components/opened-storage-general.vue index 6e5f74589..d03857b79 100644 --- a/src/modules/integrations/modules/storage/components/opened-storage-general.vue +++ b/src/modules/integrations/modules/storage/components/opened-storage-general.vue @@ -46,12 +46,11 @@ diff --git a/src/modules/integrations/modules/storage/components/opened-storage-s3.vue b/src/modules/integrations/modules/storage/components/opened-storage-s3.vue index 229d44933..f520cad89 100644 --- a/src/modules/integrations/modules/storage/components/opened-storage-s3.vue +++ b/src/modules/integrations/modules/storage/components/opened-storage-s3.vue @@ -80,61 +80,63 @@ diff --git a/src/modules/integrations/modules/storage/components/opened-storage.vue b/src/modules/integrations/modules/storage/components/opened-storage.vue index 7e98cb676..19f19bbc5 100644 --- a/src/modules/integrations/modules/storage/components/opened-storage.vue +++ b/src/modules/integrations/modules/storage/components/opened-storage.vue @@ -36,157 +36,177 @@ diff --git a/src/modules/integrations/modules/storage/components/the-storage.vue b/src/modules/integrations/modules/storage/components/the-storage.vue index efa9995a7..ef18000be 100644 --- a/src/modules/integrations/modules/storage/components/the-storage.vue +++ b/src/modules/integrations/modules/storage/components/the-storage.vue @@ -127,103 +127,108 @@ diff --git a/src/modules/integrations/modules/storage/mixins/storageMixin.js b/src/modules/integrations/modules/storage/mixins/storageMixin.js index 6d5729e37..8e5cade9a 100644 --- a/src/modules/integrations/modules/storage/mixins/storageMixin.js +++ b/src/modules/integrations/modules/storage/mixins/storageMixin.js @@ -1,19 +1,19 @@ -import Service from '../store/_internals/lookups/Service.lookup'; +import Service from "../store/_internals/lookups/Service.lookup"; export default { - computed: { - endpoint() { - return this.itemInstance?.properties?.endpoint; - }, + computed: { + endpoint() { + return this.itemInstance?.properties?.endpoint; + }, - service() { - if (this.endpoint === Service.AWS.endpoint) { - return Service.AWS; - } - if (this.endpoint === Service.DO.endpoint) { - return Service.DO; - } - return Service.CUSTOM; - }, - }, + service() { + if (this.endpoint === Service.AWS.endpoint) { + return Service.AWS; + } + if (this.endpoint === Service.DO.endpoint) { + return Service.DO; + } + return Service.CUSTOM; + }, + }, }; diff --git a/src/modules/integrations/modules/storage/store/_internals/enums/Storage.enum.js b/src/modules/integrations/modules/storage/store/_internals/enums/Storage.enum.js index 414bc55c2..99a074914 100644 --- a/src/modules/integrations/modules/storage/store/_internals/enums/Storage.enum.js +++ b/src/modules/integrations/modules/storage/store/_internals/enums/Storage.enum.js @@ -1,7 +1,7 @@ export default Object.freeze({ - LOCAL: 'local', - S3: 's3', - BACKBLAZE: 'backblaze', - DROPBOX: 'dropbox', - DRIVE: 'drive', + LOCAL: "local", + S3: "s3", + BACKBLAZE: "backblaze", + DROPBOX: "dropbox", + DRIVE: "drive", }); diff --git a/src/modules/integrations/modules/storage/store/_internals/headers.js b/src/modules/integrations/modules/storage/store/_internals/headers.js index a4fb2483a..01c64d19c 100644 --- a/src/modules/integrations/modules/storage/store/_internals/headers.js +++ b/src/modules/integrations/modules/storage/store/_internals/headers.js @@ -1,35 +1,35 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'type', - locale: 'objects.integrations.storage.type', - field: 'type', - sort: SortSymbols.NONE, - }, - { - value: 'maxSize', - locale: 'objects.integrations.storage.maxSize', - field: 'max_size', - sort: SortSymbols.NONE, - }, - { - value: 'expireDays', - locale: 'objects.integrations.storage.expireDays', - field: 'expire_days', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'reusable.state', - width: '120px', - field: 'disabled', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "type", + locale: "objects.integrations.storage.type", + field: "type", + sort: SortSymbols.NONE, + }, + { + value: "maxSize", + locale: "objects.integrations.storage.maxSize", + field: "max_size", + sort: SortSymbols.NONE, + }, + { + value: "expireDays", + locale: "objects.integrations.storage.expireDays", + field: "expire_days", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "reusable.state", + width: "120px", + field: "disabled", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/integrations/modules/storage/store/_internals/lookups/AWSRegions.lookup.js b/src/modules/integrations/modules/storage/store/_internals/lookups/AWSRegions.lookup.js index bd788df08..a4d847e0e 100644 --- a/src/modules/integrations/modules/storage/store/_internals/lookups/AWSRegions.lookup.js +++ b/src/modules/integrations/modules/storage/store/_internals/lookups/AWSRegions.lookup.js @@ -1,26 +1,26 @@ const AWSRegions = Object.freeze([ - { name: 'EU (Frankfurt)', value: 'eu-central-1' }, - { name: 'EU (Ireland)', value: 'eu-west-1' }, - { name: 'EU (London)', value: 'eu-west-2' }, - { name: 'EU (Paris)', value: 'eu-west-3' }, - { name: 'EU (Stockholm)', value: 'eu-north-1' }, - { name: 'Asia Pacific (Hong Kong)', value: 'ap-east-1' }, - { name: 'Asia Pacific (Mumbai)', value: 'ap-south-1' }, - { name: 'Asia Pacific (Osaka-Local)', value: 'ap-northeast-3' }, - { name: 'Asia Pacific (Seoul)', value: 'ap-northeast-2' }, - { name: 'Asia Pacific (Singapore)', value: 'ap-southeast-1' }, - { name: 'Asia Pacific (Sydney)', value: 'ap-southeast-2' }, - { name: 'Asia Pacific (Tokyo)', value: 'ap-northeast-1' }, - { name: 'US East (Ohio)', value: 'us-east-2' }, - { name: 'US East (N. Virginia)', value: 'us-east-1' }, - { name: 'US West (N. California)', value: 'us-west-1' }, - { name: 'US West (Oregon)', value: 'us-west-2' }, - { name: 'Canada (Central)', value: 'cn-north-1' }, - { name: 'China (Ningxia)', value: 'cn-northwest-1' }, - { name: 'Middle East (Bahrain)', value: 'me-south-1' }, - { name: 'South America (Sao Paulo)', value: 'sa-east-1' }, - { name: 'AWS GovCloud (US-East)', value: 'us-gov-east-1' }, - { name: 'AWS GovCloud (US-West)', value: 'us-gov-west-1' }, + { name: "EU (Frankfurt)", value: "eu-central-1" }, + { name: "EU (Ireland)", value: "eu-west-1" }, + { name: "EU (London)", value: "eu-west-2" }, + { name: "EU (Paris)", value: "eu-west-3" }, + { name: "EU (Stockholm)", value: "eu-north-1" }, + { name: "Asia Pacific (Hong Kong)", value: "ap-east-1" }, + { name: "Asia Pacific (Mumbai)", value: "ap-south-1" }, + { name: "Asia Pacific (Osaka-Local)", value: "ap-northeast-3" }, + { name: "Asia Pacific (Seoul)", value: "ap-northeast-2" }, + { name: "Asia Pacific (Singapore)", value: "ap-southeast-1" }, + { name: "Asia Pacific (Sydney)", value: "ap-southeast-2" }, + { name: "Asia Pacific (Tokyo)", value: "ap-northeast-1" }, + { name: "US East (Ohio)", value: "us-east-2" }, + { name: "US East (N. Virginia)", value: "us-east-1" }, + { name: "US West (N. California)", value: "us-west-1" }, + { name: "US West (Oregon)", value: "us-west-2" }, + { name: "Canada (Central)", value: "cn-north-1" }, + { name: "China (Ningxia)", value: "cn-northwest-1" }, + { name: "Middle East (Bahrain)", value: "me-south-1" }, + { name: "South America (Sao Paulo)", value: "sa-east-1" }, + { name: "AWS GovCloud (US-East)", value: "us-gov-east-1" }, + { name: "AWS GovCloud (US-West)", value: "us-gov-west-1" }, ]); export default AWSRegions; diff --git a/src/modules/integrations/modules/storage/store/_internals/lookups/DigitalOceanRegions.lookup.js b/src/modules/integrations/modules/storage/store/_internals/lookups/DigitalOceanRegions.lookup.js index 4929d8340..4e9e092dc 100644 --- a/src/modules/integrations/modules/storage/store/_internals/lookups/DigitalOceanRegions.lookup.js +++ b/src/modules/integrations/modules/storage/store/_internals/lookups/DigitalOceanRegions.lookup.js @@ -1,16 +1,16 @@ const DigitalOceanRegions = Object.freeze([ - { name: 'New York City, United States (NYC1)', value: 'NYC1' }, - { name: 'New York City, United States (NYC2)', value: 'NYC2' }, - { name: 'New York City, United States (NYC3)', value: 'NYC3' }, - { name: 'Amsterdam, the Netherlands 9 (AMS1)', value: 'AMS1' }, - { name: 'Amsterdam, the Netherlands 9 (AMS2)', value: 'AMS2' }, - { name: 'San Francisco, United States (SFO1)', value: 'SFO1' }, - { name: 'San Francisco, United States (SFO2)', value: 'SFO2' }, - { name: 'Singapore (SGP1)', value: 'SGP1' }, - { name: 'London, United Kingdom (LON1)', value: 'LON1' }, - { name: 'Frankfurt, Germany (FRA1)', value: 'FRA1' }, - { name: 'Toronto, Canada (TOR1)', value: 'TOR1' }, - { name: 'Bangalore, India (BLR1)', value: 'BLR1' }, + { name: "New York City, United States (NYC1)", value: "NYC1" }, + { name: "New York City, United States (NYC2)", value: "NYC2" }, + { name: "New York City, United States (NYC3)", value: "NYC3" }, + { name: "Amsterdam, the Netherlands 9 (AMS1)", value: "AMS1" }, + { name: "Amsterdam, the Netherlands 9 (AMS2)", value: "AMS2" }, + { name: "San Francisco, United States (SFO1)", value: "SFO1" }, + { name: "San Francisco, United States (SFO2)", value: "SFO2" }, + { name: "Singapore (SGP1)", value: "SGP1" }, + { name: "London, United Kingdom (LON1)", value: "LON1" }, + { name: "Frankfurt, Germany (FRA1)", value: "FRA1" }, + { name: "Toronto, Canada (TOR1)", value: "TOR1" }, + { name: "Bangalore, India (BLR1)", value: "BLR1" }, ]); export default DigitalOceanRegions; diff --git a/src/modules/integrations/modules/storage/store/_internals/lookups/Service.lookup.js b/src/modules/integrations/modules/storage/store/_internals/lookups/Service.lookup.js index 9e36c3fe1..082c57748 100644 --- a/src/modules/integrations/modules/storage/store/_internals/lookups/Service.lookup.js +++ b/src/modules/integrations/modules/storage/store/_internals/lookups/Service.lookup.js @@ -1,19 +1,19 @@ const StorageServiceOptions = Object.freeze({ - AWS: { - name: 'AWS S3 Bucket', - value: 'aws', - endpoint: 'amazonaws.com', - }, - DO: { - name: 'Digital Ocean Spaces', - value: 'do', - endpoint: 'digitaloceanspaces.com', - }, - CUSTOM: { - name: 'Custom', - value: 'custom', - endpoint: '', - }, + AWS: { + name: "AWS S3 Bucket", + value: "aws", + endpoint: "amazonaws.com", + }, + DO: { + name: "Digital Ocean Spaces", + value: "do", + endpoint: "digitaloceanspaces.com", + }, + CUSTOM: { + name: "Custom", + value: "custom", + endpoint: "", + }, }); export default StorageServiceOptions; diff --git a/src/modules/integrations/modules/storage/store/_internals/scripts/backendStorageTypeAdapters.js b/src/modules/integrations/modules/storage/store/_internals/scripts/backendStorageTypeAdapters.js index 80262699c..262c45661 100644 --- a/src/modules/integrations/modules/storage/store/_internals/scripts/backendStorageTypeAdapters.js +++ b/src/modules/integrations/modules/storage/store/_internals/scripts/backendStorageTypeAdapters.js @@ -1,19 +1,18 @@ -import Storage from '../enums/Storage.enum'; +import Storage from "../enums/Storage.enum"; const storageTypes = { - [Storage.LOCAL]: 'local', - [Storage.S3]: 's3', - [Storage.DROPBOX]: 'dropbox', - [Storage.DRIVE]: 'drive', + [Storage.LOCAL]: "local", + [Storage.S3]: "s3", + [Storage.DROPBOX]: "dropbox", + [Storage.DRIVE]: "drive", }; export const enumToBackendAdapter = (enumType) => storageTypes[enumType]; -export const backendToEnumAdapter = (backendType) => ( - Object.keys(storageTypes).find((key) => storageTypes[key] === backendType) -); +export const backendToEnumAdapter = (backendType) => + Object.keys(storageTypes).find((key) => storageTypes[key] === backendType); export default { - backendToEnum: backendToEnumAdapter, - enumToBackend: enumToBackendAdapter, + backendToEnum: backendToEnumAdapter, + enumToBackend: enumToBackendAdapter, }; diff --git a/src/modules/integrations/modules/storage/store/_internals/storageSchema/backblazeStorage.js b/src/modules/integrations/modules/storage/store/_internals/storageSchema/backblazeStorage.js index 5d4a29340..bac180353 100644 --- a/src/modules/integrations/modules/storage/store/_internals/storageSchema/backblazeStorage.js +++ b/src/modules/integrations/modules/storage/store/_internals/storageSchema/backblazeStorage.js @@ -1,14 +1,14 @@ -import Storage from '../enums/Storage.enum'; -import defaultStorage from './defaults/defaultStorage'; +import Storage from "../enums/Storage.enum"; +import defaultStorage from "./defaults/defaultStorage"; const backblazeStorage = () => ({ - ...defaultStorage(), - type: Storage.BACKBLAZE, - properties: { - directory: '', - email: '', - privateKey: '', - }, + ...defaultStorage(), + type: Storage.BACKBLAZE, + properties: { + directory: "", + email: "", + privateKey: "", + }, }); export default backblazeStorage; diff --git a/src/modules/integrations/modules/storage/store/_internals/storageSchema/defaults/defaultStorage.js b/src/modules/integrations/modules/storage/store/_internals/storageSchema/defaults/defaultStorage.js index c6d652ca1..22f2a2895 100644 --- a/src/modules/integrations/modules/storage/store/_internals/storageSchema/defaults/defaultStorage.js +++ b/src/modules/integrations/modules/storage/store/_internals/storageSchema/defaults/defaultStorage.js @@ -1,8 +1,8 @@ const defaultStorage = () => ({ - name: '', - maxSize: 0, - expireDays: 0, - priority: 0, + name: "", + maxSize: 0, + expireDays: 0, + priority: 0, }); export default defaultStorage; diff --git a/src/modules/integrations/modules/storage/store/_internals/storageSchema/driveStorage.js b/src/modules/integrations/modules/storage/store/_internals/storageSchema/driveStorage.js index a811d9a58..417520492 100644 --- a/src/modules/integrations/modules/storage/store/_internals/storageSchema/driveStorage.js +++ b/src/modules/integrations/modules/storage/store/_internals/storageSchema/driveStorage.js @@ -1,12 +1,12 @@ -import Storage from '../enums/Storage.enum'; -import defaultStorage from './defaults/defaultStorage'; +import Storage from "../enums/Storage.enum"; +import defaultStorage from "./defaults/defaultStorage"; const driveStorage = () => ({ - ...defaultStorage(), - type: Storage.DRIVE, - properties: { - properties: {}, - }, + ...defaultStorage(), + type: Storage.DRIVE, + properties: { + properties: {}, + }, }); export default driveStorage; diff --git a/src/modules/integrations/modules/storage/store/_internals/storageSchema/dropboxStorage.js b/src/modules/integrations/modules/storage/store/_internals/storageSchema/dropboxStorage.js index 3236bfb6a..aefe000bd 100644 --- a/src/modules/integrations/modules/storage/store/_internals/storageSchema/dropboxStorage.js +++ b/src/modules/integrations/modules/storage/store/_internals/storageSchema/dropboxStorage.js @@ -1,12 +1,12 @@ -import Storage from '../enums/Storage.enum'; -import defaultStorage from './defaults/defaultStorage'; +import Storage from "../enums/Storage.enum"; +import defaultStorage from "./defaults/defaultStorage"; const dropboxStorage = () => ({ - ...defaultStorage(), - type: Storage.DROPBOX, - properties: { - token: '', - }, + ...defaultStorage(), + type: Storage.DROPBOX, + properties: { + token: "", + }, }); export default dropboxStorage; diff --git a/src/modules/integrations/modules/storage/store/_internals/storageSchema/localStorage.js b/src/modules/integrations/modules/storage/store/_internals/storageSchema/localStorage.js index 9413478b2..837d340a5 100644 --- a/src/modules/integrations/modules/storage/store/_internals/storageSchema/localStorage.js +++ b/src/modules/integrations/modules/storage/store/_internals/storageSchema/localStorage.js @@ -1,12 +1,12 @@ -import Storage from '../enums/Storage.enum'; -import defaultStorage from './defaults/defaultStorage'; +import Storage from "../enums/Storage.enum"; +import defaultStorage from "./defaults/defaultStorage"; const localStorageProfile = () => ({ - ...defaultStorage(), - type: Storage.LOCAL, - properties: { - directory: '', - }, + ...defaultStorage(), + type: Storage.LOCAL, + properties: { + directory: "", + }, }); export default localStorageProfile; diff --git a/src/modules/integrations/modules/storage/store/_internals/storageSchema/s3Storage.js b/src/modules/integrations/modules/storage/store/_internals/storageSchema/s3Storage.js index 5cf306ef7..b2d6dec0b 100644 --- a/src/modules/integrations/modules/storage/store/_internals/storageSchema/s3Storage.js +++ b/src/modules/integrations/modules/storage/store/_internals/storageSchema/s3Storage.js @@ -1,18 +1,18 @@ -import Storage from '../enums/Storage.enum'; -import Service from '../lookups/Service.lookup'; -import defaultStorage from './defaults/defaultStorage'; +import Storage from "../enums/Storage.enum"; +import Service from "../lookups/Service.lookup"; +import defaultStorage from "./defaults/defaultStorage"; const s3Storage = () => ({ - ...defaultStorage(), - type: Storage.S3, - properties: { - keyId: '', - accessKey: '', - bucketName: '', - region: {}, - endpoint: Service.AWS.endpoint, - pathPattern: '$DOMAIN/$Y/$M/$D', - }, + ...defaultStorage(), + type: Storage.S3, + properties: { + keyId: "", + accessKey: "", + bucketName: "", + region: {}, + endpoint: Service.AWS.endpoint, + pathPattern: "$DOMAIN/$Y/$M/$D", + }, }); export default s3Storage; diff --git a/src/modules/integrations/modules/storage/store/storage.js b/src/modules/integrations/modules/storage/store/storage.js index 2b2a959c9..68613f77f 100644 --- a/src/modules/integrations/modules/storage/store/storage.js +++ b/src/modules/integrations/modules/storage/store/storage.js @@ -1,67 +1,63 @@ -import deepMerge from 'deepmerge'; -import ObjectStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -import StorageAPI from '../api/storage'; -import Storage from './_internals/enums/Storage.enum'; -import headers from './_internals/headers'; -import defaultBackblazeStorageState - from './_internals/storageSchema/backblazeStorage'; -import defaultStorageState - from './_internals/storageSchema/defaults/defaultStorage'; -import defaultDriveStorageState from './_internals/storageSchema/driveStorage'; -import defaultDropboxStorageState - from './_internals/storageSchema/dropboxStorage'; -import defaultLocalStorageState from './_internals/storageSchema/localStorage'; -import defaultS3StorageState from './_internals/storageSchema/s3Storage'; +import deepMerge from "deepmerge"; +import ObjectStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule"; +import StorageAPI from "../api/storage"; +import Storage from "./_internals/enums/Storage.enum"; +import headers from "./_internals/headers"; +import defaultBackblazeStorageState from "./_internals/storageSchema/backblazeStorage"; +import defaultStorageState from "./_internals/storageSchema/defaults/defaultStorage"; +import defaultDriveStorageState from "./_internals/storageSchema/driveStorage"; +import defaultDropboxStorageState from "./_internals/storageSchema/dropboxStorage"; +import defaultLocalStorageState from "./_internals/storageSchema/localStorage"; +import defaultS3StorageState from "./_internals/storageSchema/s3Storage"; const resettableState = { - itemInstance: defaultStorageState(), + itemInstance: defaultStorageState(), }; const actions = { - LOAD_ITEM: async (context, type) => { - if (context.state.itemId) { - const item = await context.dispatch('GET_ITEM'); - context.dispatch('SET_TYPED_ITEM', { item, type: item.type }); - } else { - context.dispatch('SET_TYPED_ITEM', { type }); - } - }, - SET_TYPED_ITEM: (context, { type, item = {} }) => { - switch (type) { - case Storage.LOCAL: - item = deepMerge(defaultLocalStorageState(), item); - break; - case Storage.S3: - item = deepMerge(defaultS3StorageState(), item); - break; - case Storage.BACKBLAZE: - item = deepMerge(defaultBackblazeStorageState(), item); - break; - case Storage.DROPBOX: - item = deepMerge(defaultDropboxStorageState(), item); - break; - case Storage.DRIVE: - item = deepMerge(defaultDriveStorageState(), item); - break; - } - context.commit('SET_ITEM', item); - }, - SET_ITEM_PROPERTIES_PROPERTY: (context, payload) => { - context.commit('SET_ITEM_PROPERTIES_PROPERTY', payload); - context.dispatch('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, + LOAD_ITEM: async (context, type) => { + if (context.state.itemId) { + const item = await context.dispatch("GET_ITEM"); + context.dispatch("SET_TYPED_ITEM", { item, type: item.type }); + } else { + context.dispatch("SET_TYPED_ITEM", { type }); + } + }, + SET_TYPED_ITEM: (context, { type, item = {} }) => { + switch (type) { + case Storage.LOCAL: + item = deepMerge(defaultLocalStorageState(), item); + break; + case Storage.S3: + item = deepMerge(defaultS3StorageState(), item); + break; + case Storage.BACKBLAZE: + item = deepMerge(defaultBackblazeStorageState(), item); + break; + case Storage.DROPBOX: + item = deepMerge(defaultDropboxStorageState(), item); + break; + case Storage.DRIVE: + item = deepMerge(defaultDriveStorageState(), item); + break; + } + context.commit("SET_ITEM", item); + }, + SET_ITEM_PROPERTIES_PROPERTY: (context, payload) => { + context.commit("SET_ITEM_PROPERTIES_PROPERTY", payload); + context.dispatch("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, }; const mutations = { - SET_ITEM_PROPERTIES_PROPERTY: (state, { prop, value }) => { - state.itemInstance.properties[prop] = value; - }, + SET_ITEM_PROPERTIES_PROPERTY: (state, { prop, value }) => { + state.itemInstance.properties[prop] = value; + }, }; const storage = new ObjectStoreModule({ resettableState, headers }) -.attachAPIModule(StorageAPI) -.generateAPIActions() -.getModule({ actions, mutations }); + .attachAPIModule(StorageAPI) + .generateAPIActions() + .getModule({ actions, mutations }); export default storage; diff --git a/src/modules/integrations/modules/triggers/api/triggers.js b/src/modules/integrations/modules/triggers/api/triggers.js index cbee3df31..0e9854391 100644 --- a/src/modules/integrations/modules/triggers/api/triggers.js +++ b/src/modules/integrations/modules/triggers/api/triggers.js @@ -1,247 +1,217 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import deepCopy from 'deep-copy'; -import { TriggerServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../app/api/instance'; -import configuration from '../../../../../app/api/openAPIConfig'; -import TriggerTypes from '../lookups/TriggerTypes.lookup'; - -const triggersService = new TriggerServiceApiFactory(configuration, '', instance); - -const doNotConvertKeys = ['variables']; + camelToSnake, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import deepCopy from "deep-copy"; +import { TriggerServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../app/api/instance"; +import configuration from "../../../../../app/api/openAPIConfig"; +import TriggerTypes from "../lookups/TriggerTypes.lookup"; + +const triggersService = new TriggerServiceApiFactory( + configuration, + "", + instance, +); + +const doNotConvertKeys = ["variables"]; const fieldsToSend = [ - 'description', - 'enabled', - 'id', - 'name', - 'schema', - 'timeout', - 'timezone', - 'type', - 'variables', - 'expression', + "description", + "enabled", + "id", + "name", + "schema", + "timeout", + "timezone", + "type", + "variables", + "expression", ]; const preRequestHandler = (item) => { - const copy = deepCopy(item); - copy.variables = copy.variables.reduce((variables, variable) => { - if (!variable.key) return variables; - return { ...variables, [variable.key]: variable.value }; - }, {}); - return { - ...copy, - type: copy.type.value, - }; + const copy = deepCopy(item); + copy.variables = copy.variables.reduce((variables, variable) => { + if (!variable.key) return variables; + return { ...variables, [variable.key]: variable.value }; + }, {}); + return { + ...copy, + type: copy.type.value, + }; }; const getList = async (params) => { - const fieldsToSend = [ - 'page', - 'size', - 'search', - 'sort', - 'fields', - 'id', - 'schemaId', - ]; - const defaultObject = { - enabled: false, - }; - - const { - page, - size, - search, - sort, - fields, - id, - schemaId, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - sanitize(fieldsToSend), - ]); - - try { - const response = await triggersService.searchTrigger( - page, - size, - search, - sort, - fields, - id, - schemaId, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const fieldsToSend = [ + "page", + "size", + "search", + "sort", + "fields", + "id", + "schemaId", + ]; + const defaultObject = { + enabled: false, + }; + + const { page, size, search, sort, fields, id, schemaId } = applyTransform( + params, + [ + merge(getDefaultGetParams()), + starToSearch("search"), + sanitize(fieldsToSend), + ], + ); + + try { + const response = await triggersService.searchTrigger( + page, + size, + search, + sort, + fields, + id, + schemaId, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(doNotConvertKeys), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const get = async ({ itemId: id }) => { - const defaultObject = { - timeout: 0, - variables: {}, - }; - - const responseHandler = (response) => { - const copy = deepCopy(response); - if (response.variables) { - copy.variables = Object.keys(copy.variables) - .map((key) => ({ - key, - value: copy.variables[key], - })); - } - return { - ...copy, - type: TriggerTypes.find(({ value }) => value === copy.type), - }; - }; - - try { - const response = await triggersService.readTrigger(id); - return applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - merge(defaultObject), - responseHandler, - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const defaultObject = { + timeout: 0, + variables: {}, + }; + + const responseHandler = (response) => { + const copy = deepCopy(response); + if (response.variables) { + copy.variables = Object.keys(copy.variables).map((key) => ({ + key, + value: copy.variables[key], + })); + } + return { + ...copy, + type: TriggerTypes.find(({ value }) => value === copy.type), + }; + }; + + try { + const response = await triggersService.readTrigger(id); + return applyTransform(response.data, [ + snakeToCamel(doNotConvertKeys), + merge(defaultObject), + responseHandler, + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const add = async ({ itemInstance }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(doNotConvertKeys), - ]); - try { - const response = await triggersService.createTrigger(item); - return applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(doNotConvertKeys), + ]); + try { + const response = await triggersService.createTrigger(item); + return applyTransform(response.data, [snakeToCamel(doNotConvertKeys)]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patch = async ({ changes, id }) => { - const body = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(doNotConvertKeys), - ]); - try { - const response = await triggersService.patchTrigger(id, body); - return applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const body = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(doNotConvertKeys), + ]); + try { + const response = await triggersService.patchTrigger(id, body); + return applyTransform(response.data, [snakeToCamel(doNotConvertKeys)]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const update = async ({ itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - preRequestHandler, - sanitize(fieldsToSend), - camelToSnake(doNotConvertKeys), - ]); - try { - const response = await triggersService.updateTrigger(id, item); - return applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + preRequestHandler, + sanitize(fieldsToSend), + camelToSnake(doNotConvertKeys), + ]); + try { + const response = await triggersService.updateTrigger(id, item); + return applyTransform(response.data, [snakeToCamel(doNotConvertKeys)]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteItem = async ({ id }) => { - try { - const response = await triggersService.deleteTrigger(id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await triggersService.deleteTrigger(id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -const getLookup = (params) => getList({ - ...params, - fields: params.fields || ['id', 'name'], -}); +const getLookup = (params) => + getList({ + ...params, + fields: params.fields || ["id", "name"], + }); const startTrigger = async (params, item) => { - const url = `/trigger/${item.id}/job`; - - const body = applyTransform(item, [ - camelToSnake(doNotConvertKeys), - ]); - try { - const response = await instance.post(url, body); - return applyTransform(response.data, [ - snakeToCamel(doNotConvertKeys), - notify(({ callback }) => callback({ - type: 'info', - text: 'Successfully ran', - })), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const url = `/trigger/${item.id}/job`; + + const body = applyTransform(item, [camelToSnake(doNotConvertKeys)]); + try { + const response = await instance.post(url, body); + return applyTransform(response.data, [ + snakeToCamel(doNotConvertKeys), + notify(({ callback }) => + callback({ + type: "info", + text: "Successfully ran", + }), + ), + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const TriggersAPI = { - getList, - get, - add, - patch, - update, - delete: deleteItem, - getLookup, - start: startTrigger, + getList, + get, + add, + patch, + update, + delete: deleteItem, + getLookup, + start: startTrigger, }; export default TriggersAPI; diff --git a/src/modules/integrations/modules/triggers/components/__tests__/opened-trigger-general.spec.js b/src/modules/integrations/modules/triggers/components/__tests__/opened-trigger-general.spec.js index 1b30bdb51..72e701d15 100644 --- a/src/modules/integrations/modules/triggers/components/__tests__/opened-trigger-general.spec.js +++ b/src/modules/integrations/modules/triggers/components/__tests__/opened-trigger-general.spec.js @@ -1,29 +1,31 @@ -import { shallowMount } from '@vue/test-utils'; -import deepmerge from 'deepmerge'; -import OpenedTabComponentMixinMock - from '../../../../../../../tests/unit/mocks/mixinMocks/openedTabComponentMixin.mock'; -import OpenedTriggerGeneral from '../opened-trigger-general.vue'; +import { shallowMount } from "@vue/test-utils"; +import deepmerge from "deepmerge"; +import OpenedTabComponentMixinMock from "../../../../../../../tests/unit/mocks/mixinMocks/openedTabComponentMixin.mock"; +import OpenedTriggerGeneral from "../opened-trigger-general.vue"; -describe('OpenedTriggerGeneral', () => { - const computed = { - itemInstance: () => ({}), - }; +describe("OpenedTriggerGeneral", () => { + const computed = { + itemInstance: () => ({}), + }; - it('renders a component', () => { - const wrapper = shallowMount(OpenedTriggerGeneral, deepmerge.all([ - OpenedTabComponentMixinMock(), - { - i18n: {}, - props: { - v: { - itemInstance: { - expression: {}, - }, - }, - }, - computed, - }, - ])); - expect(wrapper.exists()).toBe(true); - }); + it("renders a component", () => { + const wrapper = shallowMount( + OpenedTriggerGeneral, + deepmerge.all([ + OpenedTabComponentMixinMock(), + { + i18n: {}, + props: { + v: { + itemInstance: { + expression: {}, + }, + }, + }, + computed, + }, + ]), + ); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/modules/integrations/modules/triggers/components/__tests__/opened-trigger-variables.spec.js b/src/modules/integrations/modules/triggers/components/__tests__/opened-trigger-variables.spec.js index 9867b8d4b..aa0c7a38c 100644 --- a/src/modules/integrations/modules/triggers/components/__tests__/opened-trigger-variables.spec.js +++ b/src/modules/integrations/modules/triggers/components/__tests__/opened-trigger-variables.spec.js @@ -1,24 +1,26 @@ -import { shallowMount } from '@vue/test-utils'; -import deepmerge from 'deepmerge'; -import OpenedTabComponentMixinMock - from '../../../../../../../tests/unit/mocks/mixinMocks/openedTabComponentMixin.mock'; -import OpenedTriggerVariables from '../opened-trigger-variables.vue'; +import { shallowMount } from "@vue/test-utils"; +import deepmerge from "deepmerge"; +import OpenedTabComponentMixinMock from "../../../../../../../tests/unit/mocks/mixinMocks/openedTabComponentMixin.mock"; +import OpenedTriggerVariables from "../opened-trigger-variables.vue"; -describe('OpenedTriggerVariables', () => { - const computed = { - itemInstance: () => ({}), - }; +describe("OpenedTriggerVariables", () => { + const computed = { + itemInstance: () => ({}), + }; - it('renders a component', () => { - const wrapper = shallowMount(OpenedTriggerVariables, deepmerge.all([ - OpenedTabComponentMixinMock(), - { - props: { - v: { itemInstance: {} }, - }, - computed, - }, - ])); - expect(wrapper.exists()).toBe(true); - }); + it("renders a component", () => { + const wrapper = shallowMount( + OpenedTriggerVariables, + deepmerge.all([ + OpenedTabComponentMixinMock(), + { + props: { + v: { itemInstance: {} }, + }, + computed, + }, + ]), + ); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/modules/integrations/modules/triggers/components/__tests__/opened-trigger.spec.js b/src/modules/integrations/modules/triggers/components/__tests__/opened-trigger.spec.js index 0c76eb7db..d4d515058 100644 --- a/src/modules/integrations/modules/triggers/components/__tests__/opened-trigger.spec.js +++ b/src/modules/integrations/modules/triggers/components/__tests__/opened-trigger.spec.js @@ -1,15 +1,14 @@ -import { shallowMount } from '@vue/test-utils'; -import deepmerge from 'deepmerge'; -import openedObjectMixinMock - from '../../../../../../../tests/unit/mocks/mixinMocks/openedObjectMixin.mock'; -import OpenedTriggerProfile from '../opened-trigger.vue'; +import { shallowMount } from "@vue/test-utils"; +import deepmerge from "deepmerge"; +import openedObjectMixinMock from "../../../../../../../tests/unit/mocks/mixinMocks/openedObjectMixin.mock"; +import OpenedTriggerProfile from "../opened-trigger.vue"; -describe('OpenedTriggerProfile', () => { - it('renders a component', () => { - const wrapper = shallowMount(OpenedTriggerProfile, deepmerge.all([ - openedObjectMixinMock(), - {}, - ])); - expect(wrapper.exists()).toBe(true); - }); +describe("OpenedTriggerProfile", () => { + it("renders a component", () => { + const wrapper = shallowMount( + OpenedTriggerProfile, + deepmerge.all([openedObjectMixinMock(), {}]), + ); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/modules/integrations/modules/triggers/components/__tests__/the-triggers.spec.js b/src/modules/integrations/modules/triggers/components/__tests__/the-triggers.spec.js index 316fd2867..852c56f8a 100644 --- a/src/modules/integrations/modules/triggers/components/__tests__/the-triggers.spec.js +++ b/src/modules/integrations/modules/triggers/components/__tests__/the-triggers.spec.js @@ -1,16 +1,17 @@ -import { shallowMount } from '@vue/test-utils'; -import { reactive } from 'vue'; -import tableComponentComputedMock - from '../../../../../../../tests/unit/mocks/tableComponentComputed.mock'; -import { useDummy } from '../../../../../../app/composables/useDummy'; -import TheTriggers from '../the-triggers.vue'; +import { shallowMount } from "@vue/test-utils"; +import { reactive } from "vue"; +import tableComponentComputedMock from "../../../../../../../tests/unit/mocks/tableComponentComputed.mock"; +import { useDummy } from "../../../../../../app/composables/useDummy"; +import TheTriggers from "../the-triggers.vue"; -vi.mock('../../../../../../app/composables/useDummy'); +vi.mock("../../../../../../app/composables/useDummy"); useDummy.mockImplementation(() => ({ store: reactive({}) })); -describe('TheTriggers', () => { - it('renders a component', () => { - const wrapper = shallowMount(TheTriggers, { computed: tableComponentComputedMock() }); - expect(wrapper.exists()).toBe(true); - }); +describe("TheTriggers", () => { + it("renders a component", () => { + const wrapper = shallowMount(TheTriggers, { + computed: tableComponentComputedMock(), + }); + expect(wrapper.exists()).toBe(true); + }); }); diff --git a/src/modules/integrations/modules/triggers/components/opened-trigger-general.vue b/src/modules/integrations/modules/triggers/components/opened-trigger-general.vue index 5b5616fa5..f61f733e9 100644 --- a/src/modules/integrations/modules/triggers/components/opened-trigger-general.vue +++ b/src/modules/integrations/modules/triggers/components/opened-trigger-general.vue @@ -81,44 +81,46 @@ diff --git a/src/modules/integrations/modules/triggers/components/opened-trigger-variables.vue b/src/modules/integrations/modules/triggers/components/opened-trigger-variables.vue index 8e4b28965..b9138bd2b 100644 --- a/src/modules/integrations/modules/triggers/components/opened-trigger-variables.vue +++ b/src/modules/integrations/modules/triggers/components/opened-trigger-variables.vue @@ -42,14 +42,13 @@ diff --git a/src/modules/integrations/modules/triggers/components/opened-trigger.vue b/src/modules/integrations/modules/triggers/components/opened-trigger.vue index c10e8e552..c5dd82bf5 100644 --- a/src/modules/integrations/modules/triggers/components/opened-trigger.vue +++ b/src/modules/integrations/modules/triggers/components/opened-trigger.vue @@ -43,84 +43,84 @@ diff --git a/src/modules/integrations/modules/triggers/components/the-triggers.vue b/src/modules/integrations/modules/triggers/components/the-triggers.vue index 7543ed4d8..2bd6a8871 100644 --- a/src/modules/integrations/modules/triggers/components/the-triggers.vue +++ b/src/modules/integrations/modules/triggers/components/the-triggers.vue @@ -136,70 +136,72 @@ diff --git a/src/modules/integrations/modules/triggers/lookups/TriggerTypes.lookup.js b/src/modules/integrations/modules/triggers/lookups/TriggerTypes.lookup.js index 7c56c79e4..2394e398d 100644 --- a/src/modules/integrations/modules/triggers/lookups/TriggerTypes.lookup.js +++ b/src/modules/integrations/modules/triggers/lookups/TriggerTypes.lookup.js @@ -1,10 +1,10 @@ -import { EngineTriggerType } from 'webitel-sdk'; +import { EngineTriggerType } from "webitel-sdk"; const TriggerTypes = Object.freeze([ - { - locale: 'objects.integrations.triggers.cron', - value: EngineTriggerType.Cron, - }, + { + locale: "objects.integrations.triggers.cron", + value: EngineTriggerType.Cron, + }, ]); export default TriggerTypes; diff --git a/src/modules/integrations/modules/triggers/modules/logs/api/triggersLogs.js b/src/modules/integrations/modules/triggers/modules/logs/api/triggersLogs.js index 6cf91fd2c..37324ef44 100644 --- a/src/modules/integrations/modules/triggers/modules/logs/api/triggersLogs.js +++ b/src/modules/integrations/modules/triggers/modules/logs/api/triggersLogs.js @@ -1,70 +1,72 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - merge, - notify, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { TriggerServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; + merge, + notify, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { TriggerServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; -const triggerLogsService = new TriggerServiceApiFactory(configuration, '', instance); +const triggerLogsService = new TriggerServiceApiFactory( + configuration, + "", + instance, +); const getList = async (params) => { - const { - parentId, - page, - size, - q, - sort, - fields, - startedAtFrom, - startedAtTo, - durationFrom, - durationTo, - result, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); + const { + parentId, + page, + size, + q, + sort, + fields, + startedAtFrom, + startedAtTo, + durationFrom, + durationTo, + result, + } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); - try { - const response = await triggerLogsService.searchTriggerJob( - parentId, - page, - size, - q, - sort, - fields, - undefined, - undefined, - startedAtFrom, - startedAtTo, - durationFrom, - durationTo, - result, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - notify, - ]); - } + try { + const response = await triggerLogsService.searchTriggerJob( + parentId, + page, + size, + q, + sort, + fields, + undefined, + undefined, + startedAtFrom, + startedAtTo, + durationFrom, + durationTo, + result, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const TriggersLogAPI = { - getList, + getList, }; export default TriggersLogAPI; diff --git a/src/modules/integrations/modules/triggers/modules/logs/components/opened-trigger-logs.vue b/src/modules/integrations/modules/triggers/modules/logs/components/opened-trigger-logs.vue index 78a1011b6..b0849e9cf 100644 --- a/src/modules/integrations/modules/triggers/modules/logs/components/opened-trigger-logs.vue +++ b/src/modules/integrations/modules/triggers/modules/logs/components/opened-trigger-logs.vue @@ -44,38 +44,37 @@ diff --git a/src/modules/integrations/modules/triggers/modules/logs/modules/filters/components/the-triggers-logs-filters.vue b/src/modules/integrations/modules/triggers/modules/logs/modules/filters/components/the-triggers-logs-filters.vue index 866b72648..c31d352e2 100644 --- a/src/modules/integrations/modules/triggers/modules/logs/modules/filters/components/the-triggers-logs-filters.vue +++ b/src/modules/integrations/modules/triggers/modules/logs/modules/filters/components/the-triggers-logs-filters.vue @@ -27,45 +27,43 @@ diff --git a/src/modules/integrations/modules/triggers/modules/logs/modules/filters/store/filters.js b/src/modules/integrations/modules/triggers/modules/logs/modules/filters/store/filters.js index 584fcffac..16587eccb 100644 --- a/src/modules/integrations/modules/triggers/modules/logs/modules/filters/store/filters.js +++ b/src/modules/integrations/modules/triggers/modules/logs/modules/filters/store/filters.js @@ -1,32 +1,28 @@ -import BaseFilterSchema - from '@webitel/ui-sdk/src/modules/QueryFilters/classes/BaseFilterSchema'; -import EnumFilterSchema - from '@webitel/ui-sdk/src/modules/QueryFilters/classes/EnumFilterSchema'; -import QueryFiltersStoreModule - from '@webitel/ui-sdk/src/modules/QueryFilters/store/QueryFiltersStoreModule'; -import { EngineTriggerJobState } from 'webitel-sdk'; +import BaseFilterSchema from "@webitel/ui-sdk/src/modules/QueryFilters/classes/BaseFilterSchema"; +import EnumFilterSchema from "@webitel/ui-sdk/src/modules/QueryFilters/classes/EnumFilterSchema"; +import QueryFiltersStoreModule from "@webitel/ui-sdk/src/modules/QueryFilters/store/QueryFiltersStoreModule"; +import { EngineTriggerJobState } from "webitel-sdk"; const state = { - startedAtFrom: new BaseFilterSchema({ - value: new Date().setHours(0, 0, 0, 0), - defaultValue: new Date().setHours(0, 0, 0, 0), - }), - startedAtTo: new BaseFilterSchema({ - value: new Date().setHours(23, 59, 59, 0), - defaultValue: new Date().setHours(23, 59, 59, 0), - }), - result: new EnumFilterSchema({ - options: Object.values(EngineTriggerJobState) - .map((value) => ({ - value, - locale: `objects.integrations.triggers.logs.resultName.${value}`, - })), - locale: { label: 'objects.integrations.triggers.logs.result' }, - }), - duration: new BaseFilterSchema({ - value: { from: 0, to: undefined }, - defaultValue: { from: 0, to: undefined }, - }), + startedAtFrom: new BaseFilterSchema({ + value: new Date().setHours(0, 0, 0, 0), + defaultValue: new Date().setHours(0, 0, 0, 0), + }), + startedAtTo: new BaseFilterSchema({ + value: new Date().setHours(23, 59, 59, 0), + defaultValue: new Date().setHours(23, 59, 59, 0), + }), + result: new EnumFilterSchema({ + options: Object.values(EngineTriggerJobState).map((value) => ({ + value, + locale: `objects.integrations.triggers.logs.resultName.${value}`, + })), + locale: { label: "objects.integrations.triggers.logs.result" }, + }), + duration: new BaseFilterSchema({ + value: { from: 0, to: undefined }, + defaultValue: { from: 0, to: undefined }, + }), }; export default new QueryFiltersStoreModule({ state }).getModule(); diff --git a/src/modules/integrations/modules/triggers/modules/logs/scripts/convertDurationWithMilliseconds.js b/src/modules/integrations/modules/triggers/modules/logs/scripts/convertDurationWithMilliseconds.js index bea233c09..3ba38f27c 100644 --- a/src/modules/integrations/modules/triggers/modules/logs/scripts/convertDurationWithMilliseconds.js +++ b/src/modules/integrations/modules/triggers/modules/logs/scripts/convertDurationWithMilliseconds.js @@ -1,18 +1,18 @@ const convertDurationWithMilliseconds = (duration) => { - if (!duration) return '00:00:00.000'; + if (!duration) return "00:00:00.000"; - let hour = `${Math.floor(duration / 1000 / 3600)}`; - // eslint-disable-next-line no-mixed-operators - let min = `${Math.floor((duration / 1000 % 3600) / 60)}`; - // eslint-disable-next-line no-mixed-operators - let sec = `${Math.floor((duration / 1000 % 3600) % 60)}`; - let millisec = `${duration}`.slice(-3); + let hour = `${Math.floor(duration / 1000 / 3600)}`; + // eslint-disable-next-line no-mixed-operators + let min = `${Math.floor(((duration / 1000) % 3600) / 60)}`; + // eslint-disable-next-line no-mixed-operators + let sec = `${Math.floor(((duration / 1000) % 3600) % 60)}`; + const millisec = `${duration}`.slice(-3); - if (hour.length === 1) hour = `0${hour}`; - if (min.length === 1) min = `0${min}`; - if (sec.length === 1) sec = `0${sec}`; + if (hour.length === 1) hour = `0${hour}`; + if (min.length === 1) min = `0${min}`; + if (sec.length === 1) sec = `0${sec}`; - return `${hour}:${min}:${sec}.${millisec}`; + return `${hour}:${min}:${sec}.${millisec}`; }; export default convertDurationWithMilliseconds; diff --git a/src/modules/integrations/modules/triggers/modules/logs/store/_internals/headers.js b/src/modules/integrations/modules/triggers/modules/logs/store/_internals/headers.js index 3612f5158..c56e76537 100644 --- a/src/modules/integrations/modules/triggers/modules/logs/store/_internals/headers.js +++ b/src/modules/integrations/modules/triggers/modules/logs/store/_internals/headers.js @@ -1,20 +1,20 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'startedAt', - locale: 'objects.integrations.triggers.logs.startedAt', - field: 'started_at', - sort: SortSymbols.NONE, - }, - { - value: 'duration', - locale: 'vocabulary.duration', - }, - { - value: 'state', - locale: 'objects.integrations.triggers.logs.result', - field: 'state', - sort: SortSymbols.NONE, - }, + { + value: "startedAt", + locale: "objects.integrations.triggers.logs.startedAt", + field: "started_at", + sort: SortSymbols.NONE, + }, + { + value: "duration", + locale: "vocabulary.duration", + }, + { + value: "state", + locale: "objects.integrations.triggers.logs.result", + field: "state", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/integrations/modules/triggers/modules/logs/store/trigger-logs.js b/src/modules/integrations/modules/triggers/modules/logs/store/trigger-logs.js index 9e7e5948b..326cd5857 100644 --- a/src/modules/integrations/modules/triggers/modules/logs/store/trigger-logs.js +++ b/src/modules/integrations/modules/triggers/modules/logs/store/trigger-logs.js @@ -1,13 +1,12 @@ -import NestedObjectStoreModule - from '../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule'; -import TriggersLogAPI from '../api/triggersLogs'; -import filters from '../modules/filters/store/filters'; -import headers from './_internals/headers'; +import NestedObjectStoreModule from "../../../../../../../app/store/BaseStoreModules/StoreModules/NestedObjectStoreModule"; +import TriggersLogAPI from "../api/triggersLogs"; +import filters from "../modules/filters/store/filters"; +import headers from "./_internals/headers"; const triggerLogs = new NestedObjectStoreModule({ headers }) -.attachAPIModule(TriggersLogAPI) -.generateAPIActions() -.setChildModules({ filters }) -.getModule(); + .attachAPIModule(TriggersLogAPI) + .generateAPIActions() + .setChildModules({ filters }) + .getModule(); export default triggerLogs; diff --git a/src/modules/integrations/modules/triggers/store/_internals/headers.js b/src/modules/integrations/modules/triggers/store/_internals/headers.js index df2c93372..104c77dea 100644 --- a/src/modules/integrations/modules/triggers/store/_internals/headers.js +++ b/src/modules/integrations/modules/triggers/store/_internals/headers.js @@ -1,28 +1,28 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'type', - locale: 'objects.integrations.triggers.type', - field: 'type', - sort: SortSymbols.NONE, - }, - { - value: 'schema', - locale: 'objects.integrations.triggers.schema', - field: 'schema', - sort: SortSymbols.NONE, - }, - { - value: 'state', - locale: 'reusable.state', - field: 'enabled', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "type", + locale: "objects.integrations.triggers.type", + field: "type", + sort: SortSymbols.NONE, + }, + { + value: "schema", + locale: "objects.integrations.triggers.schema", + field: "schema", + sort: SortSymbols.NONE, + }, + { + value: "state", + locale: "reusable.state", + field: "enabled", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/integrations/modules/triggers/store/triggers.js b/src/modules/integrations/modules/triggers/store/triggers.js index 5015d6374..2c4b9f5b8 100644 --- a/src/modules/integrations/modules/triggers/store/triggers.js +++ b/src/modules/integrations/modules/triggers/store/triggers.js @@ -1,58 +1,57 @@ -import ObjectStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -import TriggersAPI from '../api/triggers'; -import TriggerTypes from '../lookups/TriggerTypes.lookup'; -import log from '../modules/logs/store/trigger-logs'; -import headers from './_internals/headers'; +import ObjectStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule"; +import TriggersAPI from "../api/triggers"; +import TriggerTypes from "../lookups/TriggerTypes.lookup"; +import log from "../modules/logs/store/trigger-logs"; +import headers from "./_internals/headers"; const resettableState = { - itemInstance: { - id: 0, - description: '', - enabled: true, - name: '', - schema: {}, - timeout: 60, - timezone: {}, - type: TriggerTypes[0], - variables: [], - expression: '0 */1 12 * * *', - }, + itemInstance: { + id: 0, + description: "", + enabled: true, + name: "", + schema: {}, + timeout: 60, + timezone: {}, + type: TriggerTypes[0], + variables: [], + expression: "0 */1 12 * * *", + }, }; const actions = { - ADD_VARIABLE_PAIR: (context) => { - const pair = { key: '', value: '' }; - context.commit('ADD_VARIABLE_PAIR', pair); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - SET_VARIABLE_PROP: (context, { index, prop, value }) => { - context.commit('SET_VARIABLE_PROP', { index, prop, value }); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - DELETE_VARIABLE_PAIR: (context, index) => { - context.commit('DELETE_VARIABLE_PAIR', index); - context.commit('SET_ITEM_PROPERTY', { prop: '_dirty', value: true }); - }, - START_TRIGGER: async (context, item) => TriggersAPI.start(context, item), + ADD_VARIABLE_PAIR: (context) => { + const pair = { key: "", value: "" }; + context.commit("ADD_VARIABLE_PAIR", pair); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + SET_VARIABLE_PROP: (context, { index, prop, value }) => { + context.commit("SET_VARIABLE_PROP", { index, prop, value }); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + DELETE_VARIABLE_PAIR: (context, index) => { + context.commit("DELETE_VARIABLE_PAIR", index); + context.commit("SET_ITEM_PROPERTY", { prop: "_dirty", value: true }); + }, + START_TRIGGER: async (context, item) => TriggersAPI.start(context, item), }; const mutations = { - ADD_VARIABLE_PAIR: (state, pair) => { - state.itemInstance.variables.push(pair); - }, - SET_VARIABLE_PROP: (state, { index, prop, value }) => { - state.itemInstance.variables[index][prop] = value; - }, - DELETE_VARIABLE_PAIR: (state, index) => { - state.itemInstance.variables.splice(index, 1); - }, + ADD_VARIABLE_PAIR: (state, pair) => { + state.itemInstance.variables.push(pair); + }, + SET_VARIABLE_PROP: (state, { index, prop, value }) => { + state.itemInstance.variables[index][prop] = value; + }, + DELETE_VARIABLE_PAIR: (state, index) => { + state.itemInstance.variables.splice(index, 1); + }, }; const triggers = new ObjectStoreModule({ resettableState, headers }) -.attachAPIModule(TriggersAPI) -.generateAPIActions() -.setChildModules({ log }) -.getModule({ actions, mutations }); + .attachAPIModule(TriggersAPI) + .generateAPIActions() + .setChildModules({ log }) + .getModule({ actions, mutations }); export default triggers; diff --git a/src/modules/integrations/store/integrations.js b/src/modules/integrations/store/integrations.js index 9654f1e49..4989a1a7a 100644 --- a/src/modules/integrations/store/integrations.js +++ b/src/modules/integrations/store/integrations.js @@ -1,21 +1,20 @@ -import cognitiveProfiles - from '../modules/cognitive-profiles/store/cognitive-profiles'; -import emailProfiles from '../modules/email-profiles/store/email-profiles'; -import importCsv from '../modules/import-csv/store/import-csv'; -import storage from '../modules/storage/store/storage'; -import triggers from '../modules/triggers/store/triggers'; -import singleSignOn from '../modules/single-sign-on/store/single-sign-on'; +import cognitiveProfiles from "../modules/cognitive-profiles/store/cognitive-profiles"; +import emailProfiles from "../modules/email-profiles/store/email-profiles"; +import importCsv from "../modules/import-csv/store/import-csv"; +import singleSignOn from "../modules/single-sign-on/store/single-sign-on"; +import storage from "../modules/storage/store/storage"; +import triggers from "../modules/triggers/store/triggers"; const modules = { - storage, - cognitiveProfiles, - emailProfiles, - importCsv, - triggers, - singleSignOn, + storage, + cognitiveProfiles, + emailProfiles, + importCsv, + triggers, + singleSignOn, }; export default { - namespaced: true, - modules, + namespaced: true, + modules, }; diff --git a/src/modules/lookups/modules/agent-pause-cause/api/agentPauseCause.js b/src/modules/lookups/modules/agent-pause-cause/api/agentPauseCause.js index 7b29c755f..8f386924a 100644 --- a/src/modules/lookups/modules/agent-pause-cause/api/agentPauseCause.js +++ b/src/modules/lookups/modules/agent-pause-cause/api/agentPauseCause.js @@ -1,175 +1,146 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { AgentPauseCauseServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../app/api/instance'; -import configuration from '../../../../../app/api/openAPIConfig'; - -const pauseCauseService = new AgentPauseCauseServiceApiFactory(configuration, '', instance); + camelToSnake, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { AgentPauseCauseServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../app/api/instance"; +import configuration from "../../../../../app/api/openAPIConfig"; + +const pauseCauseService = new AgentPauseCauseServiceApiFactory( + configuration, + "", + instance, +); const getPauseCauseList = async (params) => { - const defaultObject = { - name: '', - limitMin: 0, - allowAdmin: false, - allowSupervisor: false, - allowAgent: false, - }; - - const { - page, - size, - search, - sort, - fields, - id, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - camelToSnake(), - ]); - - try { - const response = await pauseCauseService.searchAgentPauseCause( - page, - size, - search, - sort, - fields, - id, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - }; - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const defaultObject = { + name: "", + limitMin: 0, + allowAdmin: false, + allowSupervisor: false, + allowAgent: false, + }; + + const { page, size, search, sort, fields, id } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + camelToSnake(), + ]); + + try { + const response = await pauseCauseService.searchAgentPauseCause( + page, + size, + search, + sort, + fields, + id, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getPauseCause = async ({ itemId: id }) => { - const defaultObject = { - name: '', - limitMin: 0, - allowAdmin: false, - allowSupervisor: false, - allowAgent: false, - }; - - try { - const response = await pauseCauseService.readAgentPauseCause(id); - return applyTransform(response.data, [ - snakeToCamel(), - merge(defaultObject), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const defaultObject = { + name: "", + limitMin: 0, + allowAdmin: false, + allowSupervisor: false, + allowAgent: false, + }; + + try { + const response = await pauseCauseService.readAgentPauseCause(id); + return applyTransform(response.data, [ + snakeToCamel(), + merge(defaultObject), + ]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const fieldsToSend = [ - 'name', - 'limitMin', - 'allowAdmin', - 'allowSupervisor', - 'allowAgent', - 'description', + "name", + "limitMin", + "allowAdmin", + "allowSupervisor", + "allowAgent", + "description", ]; const addPauseCause = async ({ itemInstance }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await pauseCauseService.createAgentPauseCause(item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await pauseCauseService.createAgentPauseCause(item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patchPauseCause = async ({ id, changes }) => { - const body = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await pauseCauseService.patchAgentPauseCause(id, body); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const body = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await pauseCauseService.patchAgentPauseCause(id, body); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updatePauseCause = async ({ itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await pauseCauseService.updateAgentPauseCause(id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await pauseCauseService.updateAgentPauseCause(id, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deletePauseCause = async ({ id }) => { - try { - const response = await pauseCauseService.deleteAgentPauseCause(id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await pauseCauseService.deleteAgentPauseCause(id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const AgentPauseCauseAPI = { - getList: getPauseCauseList, - get: getPauseCause, - add: addPauseCause, - patch: patchPauseCause, - update: updatePauseCause, - delete: deletePauseCause, + getList: getPauseCauseList, + get: getPauseCause, + add: addPauseCause, + patch: patchPauseCause, + update: updatePauseCause, + delete: deletePauseCause, }; export default AgentPauseCauseAPI; diff --git a/src/modules/lookups/modules/agent-pause-cause/components/opened-agent-pause-cause-general.vue b/src/modules/lookups/modules/agent-pause-cause/components/opened-agent-pause-cause-general.vue index 03425dcba..6a7b43ec2 100644 --- a/src/modules/lookups/modules/agent-pause-cause/components/opened-agent-pause-cause-general.vue +++ b/src/modules/lookups/modules/agent-pause-cause/components/opened-agent-pause-cause-general.vue @@ -52,12 +52,11 @@ diff --git a/src/modules/lookups/modules/agent-pause-cause/components/opened-agent-pause-cause.vue b/src/modules/lookups/modules/agent-pause-cause/components/opened-agent-pause-cause.vue index f57dfcec2..404d034f2 100644 --- a/src/modules/lookups/modules/agent-pause-cause/components/opened-agent-pause-cause.vue +++ b/src/modules/lookups/modules/agent-pause-cause/components/opened-agent-pause-cause.vue @@ -36,51 +36,54 @@ diff --git a/src/modules/lookups/modules/agent-pause-cause/components/the-agent-pause-cause.vue b/src/modules/lookups/modules/agent-pause-cause/components/the-agent-pause-cause.vue index a82525000..50d17fed6 100644 --- a/src/modules/lookups/modules/agent-pause-cause/components/the-agent-pause-cause.vue +++ b/src/modules/lookups/modules/agent-pause-cause/components/the-agent-pause-cause.vue @@ -131,71 +131,76 @@ diff --git a/src/modules/lookups/modules/agent-pause-cause/store/_internals/headers.js b/src/modules/lookups/modules/agent-pause-cause/store/_internals/headers.js index fbbefe771..49a9a5b96 100644 --- a/src/modules/lookups/modules/agent-pause-cause/store/_internals/headers.js +++ b/src/modules/lookups/modules/agent-pause-cause/store/_internals/headers.js @@ -1,34 +1,34 @@ -import { SortSymbols } from '@webitel/ui-sdk/src/scripts/sortQueryAdapters'; +import { SortSymbols } from "@webitel/ui-sdk/src/scripts/sortQueryAdapters"; export default [ - { - value: 'name', - locale: 'objects.name', - field: 'name', - sort: SortSymbols.NONE, - }, - { - value: 'limit', - locale: 'objects.lookups.pauseCause.limit', - field: 'limit_min', - sort: SortSymbols.NONE, - }, - { - value: 'allowAdmin', - locale: 'objects.lookups.pauseCause.allowAdmin', - field: 'allow_admin', - sort: SortSymbols.NONE, - }, - { - value: 'allowSupervisor', - locale: 'objects.lookups.pauseCause.allowSupervisor', - field: 'allow_supervisor', - sort: SortSymbols.NONE, - }, - { - value: 'allowAgent', - locale: 'objects.lookups.pauseCause.allowAgent', - field: 'allow_agent', - sort: SortSymbols.NONE, - }, + { + value: "name", + locale: "objects.name", + field: "name", + sort: SortSymbols.NONE, + }, + { + value: "limit", + locale: "objects.lookups.pauseCause.limit", + field: "limit_min", + sort: SortSymbols.NONE, + }, + { + value: "allowAdmin", + locale: "objects.lookups.pauseCause.allowAdmin", + field: "allow_admin", + sort: SortSymbols.NONE, + }, + { + value: "allowSupervisor", + locale: "objects.lookups.pauseCause.allowSupervisor", + field: "allow_supervisor", + sort: SortSymbols.NONE, + }, + { + value: "allowAgent", + locale: "objects.lookups.pauseCause.allowAgent", + field: "allow_agent", + sort: SortSymbols.NONE, + }, ]; diff --git a/src/modules/lookups/modules/agent-pause-cause/store/agent-pause-cause.js b/src/modules/lookups/modules/agent-pause-cause/store/agent-pause-cause.js index 11d71a711..a6803e9f3 100644 --- a/src/modules/lookups/modules/agent-pause-cause/store/agent-pause-cause.js +++ b/src/modules/lookups/modules/agent-pause-cause/store/agent-pause-cause.js @@ -1,37 +1,33 @@ -import ObjectStoreModule - from '../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule'; -import PauseCauseAPI from '../api/agentPauseCause'; -import headers from './_internals/headers'; +import ObjectStoreModule from "../../../../../app/store/BaseStoreModules/StoreModules/ObjectStoreModule"; +import PauseCauseAPI from "../api/agentPauseCause"; +import headers from "./_internals/headers"; const resettableState = { - itemInstance: { - name: '', - limitMin: 60, - allowAdmin: true, - allowSupervisor: true, - allowAgent: true, - description: '', - }, + itemInstance: { + name: "", + limitMin: 60, + allowAdmin: true, + allowSupervisor: true, + allowAgent: true, + description: "", + }, }; const actions = { - CHANGE_ADMIN_PERMISSIONS: ( - context, - payload, - ) => context.dispatch('PATCH_ITEM_PROPERTY', { prop: 'allowAdmin', ...payload }), - CHANGE_SUPERVISOR_PERMISSIONS: ( - context, - payload, - ) => context.dispatch('PATCH_ITEM_PROPERTY', { prop: 'allowSupervisor', ...payload }), - CHANGE_AGENT_PERMISSIONS: ( - context, - payload, - ) => context.dispatch('PATCH_ITEM_PROPERTY', { prop: 'allowAgent', ...payload }), + CHANGE_ADMIN_PERMISSIONS: (context, payload) => + context.dispatch("PATCH_ITEM_PROPERTY", { prop: "allowAdmin", ...payload }), + CHANGE_SUPERVISOR_PERMISSIONS: (context, payload) => + context.dispatch("PATCH_ITEM_PROPERTY", { + prop: "allowSupervisor", + ...payload, + }), + CHANGE_AGENT_PERMISSIONS: (context, payload) => + context.dispatch("PATCH_ITEM_PROPERTY", { prop: "allowAgent", ...payload }), }; const pauseCause = new ObjectStoreModule({ resettableState, headers }) -.attachAPIModule(PauseCauseAPI) -.generateAPIActions() -.getModule({ actions }); + .attachAPIModule(PauseCauseAPI) + .generateAPIActions() + .getModule({ actions }); export default pauseCause; diff --git a/src/modules/lookups/modules/agent-skills/api/__tests__/agentSkills.spec.js b/src/modules/lookups/modules/agent-skills/api/__tests__/agentSkills.spec.js index 00a947a3a..08ddf8498 100644 --- a/src/modules/lookups/modules/agent-skills/api/__tests__/agentSkills.spec.js +++ b/src/modules/lookups/modules/agent-skills/api/__tests__/agentSkills.spec.js @@ -1,174 +1,189 @@ -import axios from 'axios'; -import AgentSkillsAPI from '../agentSkills'; +import axios from "axios"; +import AgentSkillsAPI from "../agentSkills"; // axios mock should be copy-pasted :( // https://stackoverflow.com/questions/65554910/jest-referenceerror-cannot-access-before-initialization -vi.mock('axios', () => { - return { - default: { - post: vi.fn(), - get: vi.fn(), - delete: vi.fn(), - put: vi.fn(), - patch: vi.fn(), - request: vi.fn(), - create: vi.fn().mockReturnThis(), - interceptors: { - request: { - use: vi.fn(), eject: vi.fn(), - }, response: { - use: vi.fn(), eject: vi.fn(), - }, - }, - }, - }; +vi.mock("axios", () => { + return { + default: { + post: vi.fn(), + get: vi.fn(), + delete: vi.fn(), + put: vi.fn(), + patch: vi.fn(), + request: vi.fn(), + create: vi.fn().mockReturnThis(), + interceptors: { + request: { + use: vi.fn(), + eject: vi.fn(), + }, + response: { + use: vi.fn(), + eject: vi.fn(), + }, + }, + }, + }; }); -describe('AgentSkillsAPI', () => { - beforeEach(() => { - axios.request.mockClear(); - }); - - it('correctly computes "getList" method api call', async () => { - const inputParams = { - fields: ['id', 'name', 'vitest'], - }; - const url = '/call_center/skills?page=1&size=10&fields=id&fields=name&fields=vitest'; - const mock = axios.request.mockImplementationOnce(() => Promise.resolve({ - data: {}, - })); - await AgentSkillsAPI.getList(inputParams); - // https://stackoverflow.com/a/41939921 - expect(mock.mock.calls[0][0].url).toBe(url); - }); - - it('correctly computes "getList" method output', async () => { - const output = { - items: [ - { - id: 1, - shouldCaseConvert: '', - }, - ], next: true, - }; - - const response = { - data: { - items: [ - { id: 1, should_case_convert: '' }, - ], next: true, - }, - }; - axios.request.mockImplementationOnce(() => Promise.resolve(response)); - expect(await AgentSkillsAPI.getList({})).toEqual(output); - }); - - it('correctly computes "get" method api call', async () => { - const inputParams = { - itemId: 1, - }; - const url = '/call_center/skills/1'; - const mock = axios.request.mockImplementationOnce(() => Promise.resolve({ - data: {}, - })); - await AgentSkillsAPI.get(inputParams); - expect(mock.mock.calls[0][0].url).toBe(url); - }); - - it('correctly computes "get" method output', async () => { - const output = { - id: 1, - }; - - const response = { - data: { - id: 1, - }, - }; - axios.request.mockImplementationOnce(() => Promise.resolve(response)); - expect(await AgentSkillsAPI.get({ itemId: 1 })).toEqual(output); - }); - - it('correctly computes "add" method api call', async () => { - const input = { - itemInstance: { - name: 'test', - }, - }; - - const body = { - name: 'test', - }; - - const mock = axios.request.mockImplementationOnce(() => Promise.resolve({ - data: {}, - })); - await AgentSkillsAPI.add(input); - expect(mock.mock.calls[0][0].data).toBe(JSON.stringify(body)); - }); - - it('correctly computes "add" method output', async () => { - const output = { - id: 1, - checkCase: '', - }; - - const response = { - data: { - id: 1, - check_case: '', - }, - }; - axios.request.mockImplementationOnce(() => Promise.resolve(response)); - expect(await AgentSkillsAPI.add({ itemInstance: {} })).toEqual(output); - }); - - it('correctly computes "update" method api call', async () => { - const input = { - itemInstance: { - name: 'test', - }, - itemId: 1, - }; - - const body = { - name: 'test', - }; - - const mock = axios.request.mockImplementationOnce(() => Promise.resolve({ - data: {}, - })); - await AgentSkillsAPI.update(input); - expect(mock.mock.calls[0][0].data).toBe(JSON.stringify(body)); - }); - - it('correctly computes "update" method output', async () => { - const output = { - id: 1, - checkCase: '', - }; - - const response = { - data: { - id: 1, - check_case: '', - }, - }; - axios.request.mockImplementationOnce(() => Promise.resolve(response)); - expect(await AgentSkillsAPI.update({ itemInstance: {}, itemId: 1 })) - .toEqual(output); - }); - - it('correctly computes "delete" method api call', async () => { - const input = { - id: 1, - }; - - const url = '/call_center/skills/1'; - const mock = axios.request.mockImplementationOnce(() => Promise.resolve({ - data: {}, - })); - await AgentSkillsAPI.delete(input); - expect(mock.mock.calls[0][0].url).toBe(url); - }); +describe("AgentSkillsAPI", () => { + beforeEach(() => { + axios.request.mockClear(); + }); + + it('correctly computes "getList" method api call', async () => { + const inputParams = { + fields: ["id", "name", "vitest"], + }; + const url = + "/call_center/skills?page=1&size=10&fields=id&fields=name&fields=vitest"; + const mock = axios.request.mockImplementationOnce(() => + Promise.resolve({ + data: {}, + }), + ); + await AgentSkillsAPI.getList(inputParams); + // https://stackoverflow.com/a/41939921 + expect(mock.mock.calls[0][0].url).toBe(url); + }); + + it('correctly computes "getList" method output', async () => { + const output = { + items: [ + { + id: 1, + shouldCaseConvert: "", + }, + ], + next: true, + }; + + const response = { + data: { + items: [{ id: 1, should_case_convert: "" }], + next: true, + }, + }; + axios.request.mockImplementationOnce(() => Promise.resolve(response)); + expect(await AgentSkillsAPI.getList({})).toEqual(output); + }); + + it('correctly computes "get" method api call', async () => { + const inputParams = { + itemId: 1, + }; + const url = "/call_center/skills/1"; + const mock = axios.request.mockImplementationOnce(() => + Promise.resolve({ + data: {}, + }), + ); + await AgentSkillsAPI.get(inputParams); + expect(mock.mock.calls[0][0].url).toBe(url); + }); + + it('correctly computes "get" method output', async () => { + const output = { + id: 1, + }; + + const response = { + data: { + id: 1, + }, + }; + axios.request.mockImplementationOnce(() => Promise.resolve(response)); + expect(await AgentSkillsAPI.get({ itemId: 1 })).toEqual(output); + }); + + it('correctly computes "add" method api call', async () => { + const input = { + itemInstance: { + name: "test", + }, + }; + + const body = { + name: "test", + }; + + const mock = axios.request.mockImplementationOnce(() => + Promise.resolve({ + data: {}, + }), + ); + await AgentSkillsAPI.add(input); + expect(mock.mock.calls[0][0].data).toBe(JSON.stringify(body)); + }); + + it('correctly computes "add" method output', async () => { + const output = { + id: 1, + checkCase: "", + }; + + const response = { + data: { + id: 1, + check_case: "", + }, + }; + axios.request.mockImplementationOnce(() => Promise.resolve(response)); + expect(await AgentSkillsAPI.add({ itemInstance: {} })).toEqual(output); + }); + + it('correctly computes "update" method api call', async () => { + const input = { + itemInstance: { + name: "test", + }, + itemId: 1, + }; + + const body = { + name: "test", + }; + + const mock = axios.request.mockImplementationOnce(() => + Promise.resolve({ + data: {}, + }), + ); + await AgentSkillsAPI.update(input); + expect(mock.mock.calls[0][0].data).toBe(JSON.stringify(body)); + }); + + it('correctly computes "update" method output', async () => { + const output = { + id: 1, + checkCase: "", + }; + + const response = { + data: { + id: 1, + check_case: "", + }, + }; + axios.request.mockImplementationOnce(() => Promise.resolve(response)); + expect( + await AgentSkillsAPI.update({ itemInstance: {}, itemId: 1 }), + ).toEqual(output); + }); + + it('correctly computes "delete" method api call', async () => { + const input = { + id: 1, + }; + + const url = "/call_center/skills/1"; + const mock = axios.request.mockImplementationOnce(() => + Promise.resolve({ + data: {}, + }), + ); + await AgentSkillsAPI.delete(input); + expect(mock.mock.calls[0][0].url).toBe(url); + }); }); diff --git a/src/modules/lookups/modules/agent-skills/api/agentSkills.js b/src/modules/lookups/modules/agent-skills/api/agentSkills.js index 66ea527c0..1b903cfbe 100644 --- a/src/modules/lookups/modules/agent-skills/api/agentSkills.js +++ b/src/modules/lookups/modules/agent-skills/api/agentSkills.js @@ -1,135 +1,108 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { SkillServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../app/api/instance'; -import configuration from '../../../../../app/api/openAPIConfig'; - -const skillService = new SkillServiceApiFactory(configuration, '', instance); + camelToSnake, + merge, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { SkillServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../app/api/instance"; +import configuration from "../../../../../app/api/openAPIConfig"; + +const skillService = new SkillServiceApiFactory(configuration, "", instance); const getSkillsList = async (params) => { - const { - page, - size, - search, - sort, - fields, - id, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); - - try { - const response = await skillService.searchSkill( - page, - size, - search, - sort, - fields, - id, - ); - const { items, next } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items, - next, - }; - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const { page, size, search, sort, fields, id } = applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); + + try { + const response = await skillService.searchSkill( + page, + size, + search, + sort, + fields, + id, + ); + const { items, next } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items, + next, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getSkill = async ({ itemId: id }) => { - try { - const response = await skillService.readSkill(id); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await skillService.readSkill(id); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -const fieldsToSend = ['name', 'description']; +const fieldsToSend = ["name", "description"]; const addSkill = async ({ itemInstance }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await skillService.createSkill(item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await skillService.createSkill(item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateSkill = async ({ itemInstance, itemId: id }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await skillService.updateSkill(id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await skillService.updateSkill(id, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteSkill = async ({ id }) => { - try { - const response = await skillService.deleteSkill(id); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await skillService.deleteSkill(id); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -const getSkillsLookup = (params) => getSkillsList({ - ...params, - fields: params.fields || ['id', 'name'], -}); +const getSkillsLookup = (params) => + getSkillsList({ + ...params, + fields: params.fields || ["id", "name"], + }); const SkillsAPI = { - getList: getSkillsList, - get: getSkill, - add: addSkill, - update: updateSkill, - delete: deleteSkill, - getLookup: getSkillsLookup, + getList: getSkillsList, + get: getSkill, + add: addSkill, + update: updateSkill, + delete: deleteSkill, + getLookup: getSkillsLookup, }; export default SkillsAPI; diff --git a/src/modules/lookups/modules/agent-skills/components/opened-agent-skill-general.vue b/src/modules/lookups/modules/agent-skills/components/opened-agent-skill-general.vue index d44d7a9e1..2244f2919 100644 --- a/src/modules/lookups/modules/agent-skills/components/opened-agent-skill-general.vue +++ b/src/modules/lookups/modules/agent-skills/components/opened-agent-skill-general.vue @@ -25,12 +25,11 @@ diff --git a/src/modules/lookups/modules/agent-skills/components/opened-agent-skill.vue b/src/modules/lookups/modules/agent-skills/components/opened-agent-skill.vue index 368210488..d3bc5f57c 100644 --- a/src/modules/lookups/modules/agent-skills/components/opened-agent-skill.vue +++ b/src/modules/lookups/modules/agent-skills/components/opened-agent-skill.vue @@ -36,57 +36,60 @@ diff --git a/src/modules/lookups/modules/agent-skills/components/the-agent-skills.vue b/src/modules/lookups/modules/agent-skills/components/the-agent-skills.vue index 2f50da7ad..291dff4a6 100644 --- a/src/modules/lookups/modules/agent-skills/components/the-agent-skills.vue +++ b/src/modules/lookups/modules/agent-skills/components/the-agent-skills.vue @@ -132,64 +132,65 @@ diff --git a/src/modules/lookups/modules/agent-skills/modules/agents/api/skillAgents.js b/src/modules/lookups/modules/agent-skills/modules/agents/api/skillAgents.js index 83c6525ca..4d9bc91d9 100644 --- a/src/modules/lookups/modules/agent-skills/modules/agents/api/skillAgents.js +++ b/src/modules/lookups/modules/agent-skills/modules/agents/api/skillAgents.js @@ -1,171 +1,132 @@ import { - getDefaultGetListResponse, - getDefaultGetParams, -} from '@webitel/ui-sdk/src/api/defaults'; + getDefaultGetListResponse, + getDefaultGetParams, +} from "@webitel/ui-sdk/src/api/defaults"; import applyTransform, { - camelToSnake, - merge, - mergeEach, - notify, - sanitize, - snakeToCamel, - starToSearch, -} from '@webitel/ui-sdk/src/api/transformers'; -import { SkillServiceApiFactory } from 'webitel-sdk'; -import instance from '../../../../../../../app/api/instance'; -import configuration from '../../../../../../../app/api/openAPIConfig'; - -const skillService = new SkillServiceApiFactory(configuration, '', instance); + camelToSnake, + merge, + mergeEach, + notify, + sanitize, + snakeToCamel, + starToSearch, +} from "@webitel/ui-sdk/src/api/transformers"; +import { SkillServiceApiFactory } from "webitel-sdk"; +import instance from "../../../../../../../app/api/instance"; +import configuration from "../../../../../../../app/api/openAPIConfig"; + +const skillService = new SkillServiceApiFactory(configuration, "", instance); const defaultObject = { - agent: {}, - skill: {}, - team: {}, - capacity: 10, - enabled: false, + agent: {}, + skill: {}, + team: {}, + capacity: 10, + enabled: false, }; const getAgentSkillsList = async (params) => { - const { - parentId, - page, - size, - search, - sort, - fields, - id, - agentId, - } = applyTransform(params, [ - merge(getDefaultGetParams()), - starToSearch('search'), - ]); - - try { - const response = await skillService.searchSkillAgent( - parentId, - page, - size, - search, - sort, - fields, - id, - agentId, - ); - const { items, next, aggs } = applyTransform(response.data, [ - snakeToCamel(), - merge(getDefaultGetListResponse()), - ]); - return { - items: applyTransform(items, [ - mergeEach(defaultObject), - ]), - next, - aggs, - }; - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const { parentId, page, size, search, sort, fields, id, agentId } = + applyTransform(params, [ + merge(getDefaultGetParams()), + starToSearch("search"), + ]); + + try { + const response = await skillService.searchSkillAgent( + parentId, + page, + size, + search, + sort, + fields, + id, + agentId, + ); + const { items, next, aggs } = applyTransform(response.data, [ + snakeToCamel(), + merge(getDefaultGetListResponse()), + ]); + return { + items: applyTransform(items, [mergeEach(defaultObject)]), + next, + aggs, + }; + } catch (err) { + throw applyTransform(err, [notify]); + } }; const getAgentSkill = async ({ parentId, itemId: id }) => { - try { - const response = await skillService.readSkill(id, parentId); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + try { + const response = await skillService.readSkill(id, parentId); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; -const fieldsToSend = ['capacity', 'skill', 'team', 'enabled', 'agent', 'user']; +const fieldsToSend = ["capacity", "skill", "team", "enabled", "agent", "user"]; const addAgentSkill = async ({ parentId, itemInstance }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await skillService.createSkillAgent(parentId, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await skillService.createSkillAgent(parentId, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const patchAgentSkill = async ({ parentId, changes, id }) => { - const sanitizedChanges = applyTransform(changes, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await skillService.patchSkillAgent( - parentId, - { ...sanitizedChanges, id }, - ); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const sanitizedChanges = applyTransform(changes, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await skillService.patchSkillAgent(parentId, { + ...sanitizedChanges, + id, + }); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const updateAgentSkill = async ({ id, itemInstance }) => { - const item = applyTransform(itemInstance, [ - sanitize(fieldsToSend), - camelToSnake(), - ]); - try { - const response = await skillService.updateSkill(id, item); - return applyTransform(response.data, [ - snakeToCamel(), - ]); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const item = applyTransform(itemInstance, [ + sanitize(fieldsToSend), + camelToSnake(), + ]); + try { + const response = await skillService.updateSkill(id, item); + return applyTransform(response.data, [snakeToCamel()]); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const deleteAgentSkill = async ({ parentId, id }) => { - const itemId = { id: [id] }; - try { - const response = await skillService.deleteSkillAgent( - parentId, - itemId, - ); - return applyTransform(response.data, []); - } catch (err) { - throw applyTransform(err, [ - - notify, - ]); - } + const itemId = { id: [id] }; + try { + const response = await skillService.deleteSkillAgent(parentId, itemId); + return applyTransform(response.data, []); + } catch (err) { + throw applyTransform(err, [notify]); + } }; const AgentSkillsAPI = { - getList: getAgentSkillsList, - get: getAgentSkill, - add: addAgentSkill, - patch: patchAgentSkill, - update: updateAgentSkill, - delete: deleteAgentSkill, + getList: getAgentSkillsList, + get: getAgentSkill, + add: addAgentSkill, + patch: patchAgentSkill, + update: updateAgentSkill, + delete: deleteAgentSkill, }; export default AgentSkillsAPI; diff --git a/src/modules/lookups/modules/agent-skills/modules/agents/components/add-skill-to-agent-popup/add-skill-to-agent-popup.vue b/src/modules/lookups/modules/agent-skills/modules/agents/components/add-skill-to-agent-popup/add-skill-to-agent-popup.vue index 55bce8181..c1cca464c 100644 --- a/src/modules/lookups/modules/agent-skills/modules/agents/components/add-skill-to-agent-popup/add-skill-to-agent-popup.vue +++ b/src/modules/lookups/modules/agent-skills/modules/agents/components/add-skill-to-agent-popup/add-skill-to-agent-popup.vue @@ -16,66 +16,67 @@ diff --git a/src/modules/lookups/modules/agent-skills/modules/agents/components/add-skill-to-agent-popup/config-agent-skill-popup.vue b/src/modules/lookups/modules/agent-skills/modules/agents/components/add-skill-to-agent-popup/config-agent-skill-popup.vue index c598798b8..ae1670513 100644 --- a/src/modules/lookups/modules/agent-skills/modules/agents/components/add-skill-to-agent-popup/config-agent-skill-popup.vue +++ b/src/modules/lookups/modules/agent-skills/modules/agents/components/add-skill-to-agent-popup/config-agent-skill-popup.vue @@ -38,26 +38,22 @@ From 90a419f85926aba8b3d78575a6468585f892c27e Mon Sep 17 00:00:00 2001 From: Sviatoslav Bar Date: Mon, 1 Jul 2024 10:54:12 +0300 Subject: [PATCH 46/96] Fix: remove delete button from language select --> settings --> language [WTEL-4674] --- src/modules/settings/components/the-settings.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/settings/components/the-settings.vue b/src/modules/settings/components/the-settings.vue index ed28a17e7..2a976ac81 100644 --- a/src/modules/settings/components/the-settings.vue +++ b/src/modules/settings/components/the-settings.vue @@ -53,6 +53,7 @@ :value="language" class="language-list" @input="changeLanguage" + :clearable="false" /> From 8161a2b54dc94d894f7105d6dab5916eb7745074 Mon Sep 17 00:00:00 2001 From: liza-pohranichna Date: Mon, 1 Jul 2024 12:28:25 +0300 Subject: [PATCH 47/96] feature: added restore call end sound [WTEL-4668] --- src/modules/settings/components/the-settings.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/settings/components/the-settings.vue b/src/modules/settings/components/the-settings.vue index 1b635ce4d..6a795a2a2 100644 --- a/src/modules/settings/components/the-settings.vue +++ b/src/modules/settings/components/the-settings.vue @@ -164,6 +164,7 @@ export default { created() { this.restoreLanguage(); + this.callEndSound = !!localStorage.getItem('callEndSound'); }, computed: { From 296051b352b86021b8e2ef7afd7b9cf18d17f317 Mon Sep 17 00:00:00 2001 From: liza-pohranichna Date: Mon, 1 Jul 2024 14:52:20 +0300 Subject: [PATCH 48/96] feature: in progress [WTEL-4668] --- src/main.js | 1 + src/modules/settings/api/settings.js | 28 +++++++++++++++++++ .../settings/components/the-settings.vue | 3 +- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 1caba7c7b..9c687c1d7 100755 --- a/src/main.js +++ b/src/main.js @@ -21,6 +21,7 @@ import store from './app/store/store'; const fetchConfig = async () => { const response = await fetch(`${import.meta.env.BASE_URL}config.json`); + console.log('import.meta.env.BASE_URL', import.meta.env.BASE_URL); return response.json(); }; diff --git a/src/modules/settings/api/settings.js b/src/modules/settings/api/settings.js index e2c69a92d..e58d2017b 100644 --- a/src/modules/settings/api/settings.js +++ b/src/modules/settings/api/settings.js @@ -1,3 +1,4 @@ +import { generateUrl } from '@webitel/ui-sdk/src/api/transformers/index.js'; import instance from '../../../app/api/instance'; import applyTransform, { camelToSnake, @@ -46,6 +47,32 @@ export const changeWebPhone = async (changes) => { } }; +export const getRingtones = async (params) => { + + const baseUrl = '/ringtones/index.json'; + + let url = applyTransform(params, [ + (params) => ({ + ...params, + access_token: instance.defaults.headers['X-Webitel-Access'], + }), + camelToSnake(), + generateUrl(baseUrl), + ]); + + try { + const response = await fetch(url); + console.log('response', response.data, 'response.blob():', response.blob()); + return applyTransform(response.data, [ + snakeToCamel(), + ]); + } catch (err) { + throw applyTransform(err, [ + notify, + ]); + } +}; + const patchItem = async ({ changes, id }) => { const body = applyTransform(changes, [ camelToSnake(), @@ -73,4 +100,5 @@ export default { changePassword, changeWebPhone, getWebPhone, + getRingtones, }; diff --git a/src/modules/settings/components/the-settings.vue b/src/modules/settings/components/the-settings.vue index ed28a17e7..cf54bc8b7 100644 --- a/src/modules/settings/components/the-settings.vue +++ b/src/modules/settings/components/the-settings.vue @@ -92,7 +92,7 @@ import { useVuelidate } from '@vuelidate/core'; import { required, sameAs } from '@vuelidate/validators'; import getNamespacedState from '@webitel/ui-sdk/src/store/helpers/getNamespacedState'; import { mapState } from 'vuex'; -import { changePassword, changeWebPhone, getWebPhone } from '../api/settings'; +import { changePassword, changeWebPhone, getWebPhone, getRingtones } from '../api/settings'; export default { name: 'TheSettings', @@ -163,6 +163,7 @@ export default { async mounted() { try { const response = await getWebPhone(); + await getRingtones(); this.webrtc = response.webrtc; this.stun = response.stun; } catch (error) { From 3fbfad42718f60ee94fcd0eca31f4e2b34ef5106 Mon Sep 17 00:00:00 2001 From: Sviatoslav Bar Date: Tue, 2 Jul 2024 09:55:09 +0300 Subject: [PATCH 49/96] Fix: show "import destination". integration --> imports of CSV from file. [WTEL-4580] --- .../import-csv/components/the-import-csv.vue | 124 +++++++++--------- 1 file changed, 65 insertions(+), 59 deletions(-) diff --git a/src/modules/integrations/modules/import-csv/components/the-import-csv.vue b/src/modules/integrations/modules/import-csv/components/the-import-csv.vue index 23c1340a8..b9f88f1e1 100644 --- a/src/modules/integrations/modules/import-csv/components/the-import-csv.vue +++ b/src/modules/integrations/modules/import-csv/components/the-import-csv.vue @@ -74,13 +74,18 @@ diff --git a/src/modules/settings/components/the-settings.vue b/src/modules/settings/components/the-settings.vue index 1d33d1caa..14fbfc2a7 100644 --- a/src/modules/settings/components/the-settings.vue +++ b/src/modules/settings/components/the-settings.vue @@ -82,6 +82,7 @@ + @@ -93,9 +94,11 @@ import { required, sameAs } from '@vuelidate/validators'; import getNamespacedState from '@webitel/ui-sdk/src/store/helpers/getNamespacedState'; import { mapState } from 'vuex'; import { changePassword, changeWebPhone, getWebPhone, getRingtonesList } from '../api/settings'; +import TheRingtone from './the-ringtone.vue'; export default { name: 'TheSettings', + components: { TheRingtone }, inject: ['$eventBus'], setup: () => ({ @@ -163,7 +166,6 @@ export default { async mounted() { try { const response = await getWebPhone(); - await getRingtonesList(); this.webrtc = response.webrtc; this.stun = response.stun; } catch (error) { @@ -227,12 +229,25 @@ export default { From e529f79d5f0f11a5510c834fa39d1f2f0fc2ccef Mon Sep 17 00:00:00 2001 From: lizacoma Date: Wed, 3 Jul 2024 20:04:42 +0300 Subject: [PATCH 64/96] feature: change player style [WTEL-4348] --- src/modules/settings/components/the-ringtone.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/modules/settings/components/the-ringtone.vue b/src/modules/settings/components/the-ringtone.vue index 5a1c154ec..9e80e52d6 100644 --- a/src/modules/settings/components/the-ringtone.vue +++ b/src/modules/settings/components/the-ringtone.vue @@ -21,6 +21,12 @@ option-label="label" track-by="label" /> + @@ -28,13 +34,6 @@ - From b53a6f427f3648a276d7df7634651cdf54f38d60 Mon Sep 17 00:00:00 2001 From: lizacoma Date: Wed, 3 Jul 2024 20:07:28 +0300 Subject: [PATCH 65/96] feature: change api ringtone url [WTEL-4348] --- src/modules/settings/api/settings.js | 7 ++----- src/modules/settings/components/the-ringtone.vue | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/modules/settings/api/settings.js b/src/modules/settings/api/settings.js index 11618788c..db55124ea 100644 --- a/src/modules/settings/api/settings.js +++ b/src/modules/settings/api/settings.js @@ -48,12 +48,9 @@ export const changeWebPhone = async (changes) => { } }; -export const getRingtonesList = async (params) => { - const localUrl = 'https://dev.webitel.com/ringtones/index.json'; - +export const getRingtonesList = async () => { try { - // const ringtones = await fetch(`${import.meta.env.VITE_RINGTONES_URL}/index.json`) - const ringtones = await fetch(localUrl) + const ringtones = await fetch(`${import.meta.env.VITE_RINGTONES_URL}/index.json`) .then((res) => res.json()); return ringtones.ringtones; } catch (err) { diff --git a/src/modules/settings/components/the-ringtone.vue b/src/modules/settings/components/the-ringtone.vue index 9e80e52d6..2e4e4d693 100644 --- a/src/modules/settings/components/the-ringtone.vue +++ b/src/modules/settings/components/the-ringtone.vue @@ -62,7 +62,7 @@ export default { }, audioLink() { return this.currentRingtone.name && this.isCustomRingtone ? - `https://dev.webitel.com/ringtones/${this.currentRingtone.name}` + `${import.meta.env.VITE_RINGTONES_URL}${this.currentRingtone.name}` : ''; }, }, From 6e1082bfe1f5d4ab5f175e31e689886795b6c51e Mon Sep 17 00:00:00 2001 From: lizacoma Date: Wed, 3 Jul 2024 20:10:10 +0300 Subject: [PATCH 66/96] feature: style changes [WTEL-4348] --- src/modules/settings/components/the-settings.vue | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/modules/settings/components/the-settings.vue b/src/modules/settings/components/the-settings.vue index 14fbfc2a7..8d1683a8d 100644 --- a/src/modules/settings/components/the-settings.vue +++ b/src/modules/settings/components/the-settings.vue @@ -229,25 +229,12 @@ export default { + diff --git a/src/modules/settings/components/the-ringtone.vue b/src/modules/settings/components/the-ringtone.vue deleted file mode 100644 index d8e7f9892..000000000 --- a/src/modules/settings/components/the-ringtone.vue +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - diff --git a/src/modules/settings/components/the-settings.vue b/src/modules/settings/components/the-settings.vue index ddbb4b921..79e29b3ac 100644 --- a/src/modules/settings/components/the-settings.vue +++ b/src/modules/settings/components/the-settings.vue @@ -99,7 +99,7 @@ - + @@ -111,11 +111,11 @@ import { required, sameAs } from '@vuelidate/validators'; import getNamespacedState from '@webitel/ui-sdk/src/store/helpers/getNamespacedState'; import { mapState } from 'vuex'; import { changePassword, changeWebPhone, getWebPhone } from '../api/settings'; -import TheRingtone from './the-ringtone.vue'; +import CustomRingtone from './custom-ringtone.vue'; export default { name: 'TheSettings', - components: { TheRingtone }, + components: { CustomRingtone }, inject: ['$eventBus'], setup: () => ({ @@ -262,12 +262,9 @@ export default { diff --git a/src/app/mixins/baseMixins/openedObjectValidationMixin/openedObjectValidationMixin.js b/src/app/mixins/baseMixins/openedObjectValidationMixin/openedObjectValidationMixin.js index 88b11b0c1..66dcc333e 100644 --- a/src/app/mixins/baseMixins/openedObjectValidationMixin/openedObjectValidationMixin.js +++ b/src/app/mixins/baseMixins/openedObjectValidationMixin/openedObjectValidationMixin.js @@ -9,11 +9,11 @@ export default { }, methods: { - checkValidations(validatedInstance = 'itemInstance') { + checkValidations() { const v = this.v$ ? this.v$ : this.v; - v[validatedInstance].$touch(); + v.$touch(); // if its still pending or an error is returned do not submit - return v[validatedInstance].$pending || v[validatedInstance].$error; + return v.$pending || v.$error; }, }, }; diff --git a/src/modules/directory/modules/users/components/opened-user-general.vue b/src/modules/directory/modules/users/components/opened-user-general.vue index 2563d0c1c..1e5f9083f 100644 --- a/src/modules/directory/modules/users/components/opened-user-general.vue +++ b/src/modules/directory/modules/users/components/opened-user-general.vue @@ -36,12 +36,11 @@ @input="setItemProp({ prop: 'email', value: $event })" /> - import { mapGetters } from 'vuex'; -import PasswordInput from '../../../../../app/components/utils/generate-password-input.vue'; +import UserPasswordInput from '../../../../../app/components/utils/user-password-input.vue'; import openedTabComponentMixin from '../../../../../app/mixins/objectPagesMixins/openedObjectTabMixin/openedTabComponentMixin'; import Qrcode from './_internals/qrcode-two-factor-auth.vue'; export default { name: 'OpenedUserGeneral', - components: { PasswordInput, Qrcode }, + components: { UserPasswordInput, Qrcode }, mixins: [openedTabComponentMixin], computed: { ...mapGetters('directory/users', { diff --git a/src/modules/directory/modules/users/components/opened-user.vue b/src/modules/directory/modules/users/components/opened-user.vue index 879c0dcdc..71a9ebfc1 100644 --- a/src/modules/directory/modules/users/components/opened-user.vue +++ b/src/modules/directory/modules/users/components/opened-user.vue @@ -46,9 +46,11 @@ diff --git a/src/modules/settings/components/change-password.vue b/src/modules/settings/components/change-password.vue new file mode 100644 index 000000000..85f68e785 --- /dev/null +++ b/src/modules/settings/components/change-password.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/src/modules/settings/components/the-settings.vue b/src/modules/settings/components/the-settings.vue index f67cf98b6..874222065 100644 --- a/src/modules/settings/components/the-settings.vue +++ b/src/modules/settings/components/the-settings.vue @@ -10,35 +10,7 @@ in a column and give them half the width of the screen-->
-
-

- {{ $t('settings.changePassword') }} -

-
-
- - - - {{ $t('objects.save') }} - - +
@@ -106,21 +78,20 @@