@webitel/ui-sdk 24.10.2 → 24.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +111 -114
- package/dist/ui-sdk.umd.cjs +8 -8
- package/package.json +6 -4
- package/src/api/axios/generateInstance.js +1 -4
- package/src/api/clients/agents/agents.js +31 -78
- package/src/api/clients/buckets/buckets.js +17 -57
- package/src/api/clients/calendars/calendars.js +18 -71
- package/src/api/clients/chatGateways/chatGateways.js +23 -61
- package/src/api/clients/chatGateways/defaults/webChatGateway.js +6 -8
- package/src/api/clients/chatGateways/enums/WebchatAlternativeChannel.enum.js +3 -3
- package/src/api/clients/communications/communications.js +20 -62
- package/src/api/clients/configurations/configurations.js +18 -3
- package/src/api/clients/flows/flow.js +17 -60
- package/src/api/clients/gateways/gateways.js +20 -59
- package/src/api/clients/index.js +1 -1
- package/src/api/clients/lists/blacklists.js +18 -60
- package/src/api/clients/media/media.js +13 -43
- package/src/api/clients/queues/defaults/processing.js +10 -6
- package/src/api/clients/queues/queues.js +21 -69
- package/src/api/clients/roles/roles.js +15 -33
- package/src/api/clients/users/__tests__/users.spec.js +43 -26
- package/src/api/clients/users/users.js +21 -56
- package/src/api/crm/contactChatMessagesHistory.js +8 -23
- package/src/api/crm/index.js +1 -3
- package/src/api/defaults/getDefaultGetParams/getDefaultGetParams.js +1 -4
- package/src/api/defaults/getDefaultInstance/getDefaultInstance.js +10 -11
- package/src/api/defaults/getDefaultOpenAPIConfig/getDefaultOpenAPIConfig.js +6 -5
- package/src/api/defaults/index.js +2 -4
- package/src/api/history/index.js +1 -3
- package/src/api/history/transcript/callTranscript.js +10 -30
- package/src/api/interceptors/request/updateToken.interceptor.js +1 -2
- package/src/api/transformers/merge/merge.transformer.js +4 -1
- package/src/api/transformers/mergeEach/mergeEach.transformer.js +4 -4
- package/src/api/transformers/notify/notify.transformer.js +9 -6
- package/src/api/transformers/starToSearch/starToSearch.transformer.js +8 -6
- package/src/components/index.js +3 -6
- package/src/components/on-demand/wt-cc-agent-status-timers/__tests__/wt-cc-agent-status-timers.spec.js +2 -4
- package/src/components/transitions/wt-expand-transition.vue +2 -3
- package/src/components/wt-app-header/__tests__/WtAppNavigator.spec.js +1 -2
- package/src/components/wt-app-header/__tests__/WtHeaderActions.spec.js +1 -2
- package/src/components/wt-app-header/wt-app-navigator.vue +15 -9
- package/src/components/wt-avatar/wt-avatar.vue +8 -3
- package/src/components/wt-button/wt-button.vue +0 -1
- package/src/components/wt-button-select/__tests__/WtButtonSelect.spec.js +4 -5
- package/src/components/wt-button-select/wt-button-select.vue +0 -1
- package/src/components/wt-context-menu/wt-context-menu.vue +32 -35
- package/src/components/wt-dummy/wt-dummy.vue +2 -5
- package/src/components/wt-expansion-panel/wt-expansion-panel.vue +10 -7
- package/src/components/wt-filters-panel-wrapper/__tests__/WtFiltersPanelWrapper.spec.js +4 -8
- package/src/components/wt-icon/wt-icon.vue +0 -1
- package/src/components/wt-indicator/__tests__/WtIndicator.spec.js +3 -2
- package/src/components/wt-indicator/wt-indicator.vue +10 -1
- package/src/components/wt-input/wt-input.vue +7 -10
- package/src/components/wt-item-link/wt-item-link.vue +7 -4
- package/src/components/wt-navigation-bar/__tests__/WtNavigationBar.spec.js +7 -15
- package/src/components/wt-navigation-bar/wt-navigation-bar.vue +7 -7
- package/src/components/wt-notification/wt-notification.vue +1 -2
- package/src/components/wt-notifications-bar/__tests__/WtNotificationsBar.spec.js +6 -3
- package/src/components/wt-notifications-bar/wt-notifications-bar.vue +4 -1
- package/src/components/wt-page-wrapper/__tests__/WtPageWrapper.spec.js +1 -2
- package/src/components/wt-pagination/wt-pagination.vue +1 -3
- package/src/components/wt-player/scripts/__tests__/createPlyrURL.spec.js +4 -8
- package/src/components/wt-player/wt-player.vue +13 -4
- package/src/components/wt-popup/wt-popup.vue +2 -1
- package/src/components/wt-search-bar/wt-search-bar.vue +1 -1
- package/src/components/wt-select/mixins/multiselectMixin.js +2 -5
- package/src/components/wt-select/wt-select.vue +12 -11
- package/src/components/wt-slider/wt-slider.vue +4 -2
- package/src/components/wt-status-select/wt-status-select.vue +10 -6
- package/src/components/wt-stepper/wt-stepper.vue +6 -4
- package/src/components/wt-switcher/wt-switcher.vue +1 -3
- package/src/components/wt-table/__tests__/WtTable.spec.js +2 -5
- package/src/components/wt-table/wt-table.vue +18 -16
- package/src/components/wt-table-column-select/wt-table-column-select.vue +9 -8
- package/src/components/wt-tabs/wt-tabs.vue +1 -3
- package/src/components/wt-tags-input/mixin/taggableMixin.js +7 -7
- package/src/components/wt-textarea/__tests__/WtTextarea.spec.js +2 -4
- package/src/components/wt-textarea/wt-textarea.vue +3 -2
- package/src/components/wt-timepicker/wt-timepicker.vue +1 -3
- package/src/components/wt-tooltip/_internals/useTooltipTriggerSubscriptions.js +1 -3
- package/src/components/wt-tooltip/_internals/wt-tooltip-floating.vue +8 -12
- package/src/components/wt-tooltip/wt-tooltip.vue +13 -13
- package/src/composables/useCachedInterval/__tests__/useCachedInterval.spec.js +6 -4
- package/src/composables/useCachedInterval/useCachedInterval.js +3 -8
- package/src/composables/useRepresentableAgentPauseCause/__tests__/useRepresentableAgentPauseCause.spec.js +11 -33
- package/src/composables/useRepresentableAgentPauseCause/useRepresentableAgentPauseCause.js +11 -9
- package/src/enums/WebitelApplications/AdminSections.enum.js +28 -28
- package/src/enums/WebitelApplications/CrmSections.enum.js +1 -1
- package/src/locale/en/en.js +12 -15
- package/src/locale/es/es.js +4 -8
- package/src/locale/kz/kz.js +5 -7
- package/src/locale/ru/ru.js +7 -11
- package/src/locale/ua/ua.js +13 -17
- package/src/mixins/dataFilterMixins/__tests__/enumFilterMixin.spec.js +1 -2
- package/src/mixins/dataFilterMixins/__tests__/sortFilterMixin.spec.js +4 -2
- package/src/mixins/dataFilterMixins/__tests__/urlControllerMixin.spec.js +4 -1
- package/src/mixins/dataFilterMixins/_urlControllerMixin/_urlControllerMixin.js +1 -1
- package/src/mixins/dataFilterMixins/apiFilterMixin.js +1 -2
- package/src/mixins/dataFilterMixins/baseFilterMixin/baseFilterMixin.js +1 -2
- package/src/mixins/dataFilterMixins/enumFilterMixin.js +5 -6
- package/src/mixins/dataFilterMixins/paginationFilterMixin.js +1 -2
- package/src/mixins/dataFilterMixins/sortFilterMixin.js +1 -4
- package/src/mixins/validationMixin/__tests__/validationMixin.spec.js +1 -2
- package/src/mixins/validationMixin/useValidation.js +25 -19
- package/src/mixins/validationMixin/validationMixin.js +22 -10
- package/src/modules/AgentStatusSelect/api/pause-cause.js +3 -11
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-agent-status-select.spec.js +16 -18
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-pause-cause-popup.spec.js +1 -2
- package/src/modules/AgentStatusSelect/components/_internals/wt-cc-pause-cause-popup.vue +12 -12
- package/src/modules/AgentStatusSelect/components/_internals/wt-cc-status-select-error-popup.vue +0 -1
- package/src/modules/AgentStatusSelect/components/wt-cc-agent-status-select.vue +20 -7
- package/src/modules/Appearance/components/__tests__/wt-dark-mode-switcher.spec.js +2 -4
- package/src/modules/Appearance/components/wt-dark-mode-switcher.vue +0 -1
- package/src/modules/AuditForm/components/__tests__/audit-form-question-read-wrapper.spec.js +1 -2
- package/src/modules/AuditForm/components/__tests__/audit-form-question-write-wrapper.spec.js +15 -25
- package/src/modules/AuditForm/components/__tests__/audit-form.spec.js +11 -20
- package/src/modules/AuditForm/components/audit-form-question-read-wrapper.vue +1 -4
- package/src/modules/AuditForm/components/audit-form-question-write-wrapper.vue +4 -7
- package/src/modules/AuditForm/components/audit-form-question.vue +18 -17
- package/src/modules/AuditForm/components/audit-form.vue +12 -14
- package/src/modules/AuditForm/components/questions/options/__tests__/audit-form-question-options-write-row.spec.js +1 -2
- package/src/modules/AuditForm/components/questions/options/__tests__/audit-form-question-options.spec.js +1 -3
- package/src/modules/AuditForm/components/questions/options/audit-form-question-options-write-row.vue +11 -15
- package/src/modules/AuditForm/components/questions/options/audit-form-question-options.vue +1 -4
- package/src/modules/AuditForm/components/questions/score/audit-form-question-score.vue +16 -20
- package/src/modules/AuditForm/schemas/AuditFormQuestionOptionsSchema.js +1 -3
- package/src/modules/CSVExport/CSVExport.js +3 -7
- package/src/modules/CSVExport/XLSExport.js +6 -7
- package/src/modules/CSVExport/__tests__/CSVExport.spec.js +1 -2
- package/src/modules/CSVExport/mixins/exportCSVMixin.js +2 -5
- package/src/modules/CSVExport/mixins/exportXLSMixin.js +2 -4
- package/src/modules/CardStoreModule/store/CardStoreModule.js +2 -6
- package/src/modules/DeleteConfirmationPopup/__tests__/delete-confirmation-popup.spec.js +13 -10
- package/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue +5 -14
- package/src/modules/FilesExport/FilesExport.js +4 -3
- package/src/modules/FilesExport/__tests__/FilesExport.spec.js +12 -12
- package/src/modules/FilesExport/mixins/exportFilesMixin.js +6 -7
- package/src/modules/FilesExport/scripts/generateMediaURL.js +1 -2
- package/src/modules/Filters/classes/BaseFilterSchema.js +21 -23
- package/src/modules/Filters/components/filter-pagination.vue +7 -3
- package/src/modules/Filters/components/filter-search.vue +21 -12
- package/src/modules/Filters/components/filter-table-fields.vue +1 -3
- package/src/modules/Filters/scripts/getters/index.js +1 -5
- package/src/modules/Filters/scripts/getters/queryGetter.js +8 -3
- package/src/modules/Filters/scripts/getters/valueGetter.js +1 -2
- package/src/modules/Filters/scripts/restores/index.js +1 -4
- package/src/modules/Filters/scripts/setters/index.js +1 -5
- package/src/modules/Filters/scripts/setters/querySetter.js +24 -22
- package/src/modules/Filters/scripts/utils/changeRouteQuery.js +16 -15
- package/src/modules/Filters/store/FiltersStoreModule.js +51 -45
- package/src/modules/Filters/store/__tests__/FiltersStoreModule.spec.js +51 -45
- package/src/modules/Notifications/store/NotificationsStoreModule.js +41 -38
- package/src/modules/Notifications/store/__tests__/NotificationsStoreModule.actions.spec.js +6 -6
- package/src/modules/QueryFilters/api/defaults.js +2 -3
- package/src/modules/QueryFilters/classes/ApiFilterSchema.js +1 -4
- package/src/modules/QueryFilters/classes/EnumFilterSchema.js +1 -4
- package/src/modules/QueryFilters/components/__tests__/filter-datetime.spec.js +1 -2
- package/src/modules/QueryFilters/components/__tests__/filter-from-to.spec.js +2 -4
- package/src/modules/QueryFilters/components/__tests__/filter-search.spec.js +2 -4
- package/src/modules/QueryFilters/components/filter-table-fields.vue +1 -5
- package/src/modules/QueryFilters/mixins/__tests__/apiFilterMixin.spec.js +4 -3
- package/src/modules/QueryFilters/mixins/__tests__/enumFilterMixin.spec.js +2 -4
- package/src/modules/QueryFilters/mixins/__tests__/sortFilterMixin.spec.js +4 -2
- package/src/modules/QueryFilters/mixins/__tests__/urlControllerMixin.spec.js +4 -1
- package/src/modules/QueryFilters/mixins/_urlControllerMixin/_urlControllerMixin.js +1 -1
- package/src/modules/QueryFilters/mixins/apiFilterMixin.js +1 -1
- package/src/modules/QueryFilters/mixins/baseFilterMixin/baseFilterMixin.js +4 -2
- package/src/modules/QueryFilters/mixins/enumFilterMixin.js +9 -11
- package/src/modules/QueryFilters/mixins/paginationFilterMixin.js +2 -4
- package/src/modules/QueryFilters/mixins/sortFilterMixin.js +2 -5
- package/src/modules/QueryFilters/store/QueryFiltersStoreModule.js +13 -17
- package/src/modules/QueryFilters/store/__tests__/QueryFiltersStoreModule.spec.js +15 -16
- package/src/modules/TableStoreModule/store/TableStoreModule.js +14 -33
- package/src/modules/TableStoreModule/store/__tests__/TableStoreModule.spec.js +69 -83
- package/src/modules/Userinfo/api/userinfo.js +6 -19
- package/src/modules/Userinfo/classes/ApplicationsAccess.js +5 -12
- package/src/modules/Userinfo/store/UserinfoStoreModule.js +38 -41
- package/src/plugins/breakpoint/breakpoint.plugin.js +11 -16
- package/src/scripts/__tests__/caseConverters.spec.js +1 -4
- package/src/scripts/__tests__/debounce.spec.js +3 -1
- package/src/scripts/__tests__/prettifyFileSize.spec.js +2 -2
- package/src/scripts/__tests__/preventHiddenPageCallsDecorator.spec.js +7 -4
- package/src/scripts/__tests__/updateObject.spec.js +3 -5
- package/src/scripts/caseConverters.js +22 -38
- package/src/scripts/debounce.js +1 -5
- package/src/scripts/editProxy.js +8 -7
- package/src/scripts/prettifyFileSize.js +1 -1
- package/src/scripts/preventHiddenPageCallsDecorator.js +3 -6
- package/src/store/BaseStoreModules/ApiStoreModule.js +7 -33
- package/src/store/BaseStoreModules/BaseStoreModule.js +14 -23
- package/src/store/BaseStoreModules/__tests__/BaseStoreModule.spec.js +7 -28
- package/src/store/helpers/getNamespacedState.js +2 -4
- package/src/store/new/modules/apiStoreModule/apiStoreModule.js +7 -27
- package/src/store/new/modules/cardStoreModule/cardStoreModule.js +0 -1
- package/src/store/new/modules/tableStoreModule/__tests__/tableStoreModule.spec.js +64 -77
- package/src/store/new/modules/tableStoreModule/tableStoreModule.js +12 -29
- package/src/tests/mocks/axiosMock.js +25 -19
- package/src/validators/decimalValidator.js +5 -4
- package/src/validators/websocketValidator/__tests__/websocketValidator.spec.js +1 -2
- package/src/validators/websocketValidator/websocketValidator.js +1 -1
|
@@ -1,14 +1,10 @@
|
|
|
1
|
+
import { ContactsChatCatalogApiFactory } from 'webitel-sdk';
|
|
1
2
|
import {
|
|
3
|
+
getDefaultGetListResponse,
|
|
2
4
|
getDefaultInstance,
|
|
3
5
|
getDefaultOpenAPIConfig,
|
|
4
|
-
getDefaultGetListResponse,
|
|
5
6
|
} from '../defaults/index.js';
|
|
6
|
-
import applyTransform, {
|
|
7
|
-
notify,
|
|
8
|
-
snakeToCamel,
|
|
9
|
-
merge,
|
|
10
|
-
} from '../transformers/index.js';
|
|
11
|
-
import { ContactsChatCatalogApiFactory } from 'webitel-sdk';
|
|
7
|
+
import applyTransform, { notify, snakeToCamel, merge } from '../transformers/index.js';
|
|
12
8
|
|
|
13
9
|
const instance = getDefaultInstance();
|
|
14
10
|
const configuration = getDefaultOpenAPIConfig();
|
|
@@ -27,18 +23,12 @@ const getChat = async ({ contactId, chatId }) => {
|
|
|
27
23
|
|
|
28
24
|
try {
|
|
29
25
|
const response = await contactChatService.getContactChatHistory(contactId, chatId);
|
|
30
|
-
const { messages, peers } = applyTransform(response.data, [
|
|
31
|
-
snakeToCamel(),
|
|
32
|
-
]);
|
|
26
|
+
const { messages, peers } = applyTransform(response.data, [snakeToCamel()]);
|
|
33
27
|
return {
|
|
34
|
-
items: applyTransform({ messages, peers }, [
|
|
35
|
-
mergeChatMessagesData,
|
|
36
|
-
]).reverse(),
|
|
28
|
+
items: applyTransform({ messages, peers }, [mergeChatMessagesData]).reverse(),
|
|
37
29
|
};
|
|
38
30
|
} catch (err) {
|
|
39
|
-
throw applyTransform(err, [
|
|
40
|
-
notify,
|
|
41
|
-
]);
|
|
31
|
+
throw applyTransform(err, [notify]);
|
|
42
32
|
}
|
|
43
33
|
};
|
|
44
34
|
|
|
@@ -61,17 +51,12 @@ const getAllMessages = async ({ id }) => {
|
|
|
61
51
|
merge(getDefaultGetListResponse()),
|
|
62
52
|
]);
|
|
63
53
|
return {
|
|
64
|
-
items: applyTransform({ messages, peers, chats }, [
|
|
65
|
-
mergeMessagesData,
|
|
66
|
-
]).reverse(),
|
|
54
|
+
items: applyTransform({ messages, peers, chats }, [mergeMessagesData]).reverse(),
|
|
67
55
|
next,
|
|
68
56
|
};
|
|
69
57
|
} catch (err) {
|
|
70
|
-
throw applyTransform(err, [
|
|
71
|
-
notify,
|
|
72
|
-
]);
|
|
58
|
+
throw applyTransform(err, [notify]);
|
|
73
59
|
}
|
|
74
|
-
|
|
75
60
|
};
|
|
76
61
|
|
|
77
62
|
export default {
|
package/src/api/crm/index.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import generateInstance from '../../axios/generateInstance.js';
|
|
2
|
-
import updateTokenInterceptor
|
|
3
|
-
|
|
4
|
-
import handleUnauthorizedInterceptor
|
|
5
|
-
from '../../interceptors/response/handleUnauthorized.interceptor.js';
|
|
2
|
+
import updateTokenInterceptor from '../../interceptors/request/updateToken.interceptor.js';
|
|
3
|
+
import handleUnauthorizedInterceptor from '../../interceptors/response/handleUnauthorized.interceptor.js';
|
|
6
4
|
|
|
7
|
-
const getDefaultInstance = () =>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
const getDefaultInstance = () =>
|
|
6
|
+
generateInstance({
|
|
7
|
+
interceptors: {
|
|
8
|
+
request: [updateTokenInterceptor],
|
|
9
|
+
response: [handleUnauthorizedInterceptor],
|
|
10
|
+
},
|
|
11
|
+
baseURL: import.meta.env.VITE_API_URL,
|
|
12
|
+
});
|
|
14
13
|
|
|
15
14
|
export default getDefaultInstance;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Configuration } from 'webitel-sdk';
|
|
2
2
|
|
|
3
|
-
const getDefaultOpenAPIConfig = () =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
const getDefaultOpenAPIConfig = () =>
|
|
4
|
+
new Configuration({
|
|
5
|
+
basePath: import.meta.env.VITE_API_URL,
|
|
6
|
+
apiKey: localStorage.getItem('access-key') || '',
|
|
7
|
+
accessToken: localStorage.getItem('access-key') || '',
|
|
8
|
+
});
|
|
8
9
|
|
|
9
10
|
export default getDefaultOpenAPIConfig;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import getDefaultGetListResponse
|
|
2
|
-
from './getDefaultGetListResponse/getDefaultGetListResponse.js';
|
|
1
|
+
import getDefaultGetListResponse from './getDefaultGetListResponse/getDefaultGetListResponse.js';
|
|
3
2
|
import getDefaultGetParams from './getDefaultGetParams/getDefaultGetParams.js';
|
|
4
3
|
import getDefaultInstance from './getDefaultInstance/getDefaultInstance.js';
|
|
5
|
-
import getDefaultOpenAPIConfig
|
|
6
|
-
from './getDefaultOpenAPIConfig/getDefaultOpenAPIConfig.js';
|
|
4
|
+
import getDefaultOpenAPIConfig from './getDefaultOpenAPIConfig/getDefaultOpenAPIConfig.js';
|
|
7
5
|
|
|
8
6
|
export {
|
|
9
7
|
getDefaultGetParams,
|
package/src/api/history/index.js
CHANGED
|
@@ -16,11 +16,7 @@ const configuration = getDefaultOpenAPIConfig();
|
|
|
16
16
|
|
|
17
17
|
const transcriptService = new FileTranscriptServiceApiFactory(configuration, '', instance);
|
|
18
18
|
|
|
19
|
-
const getTranscript = async ({
|
|
20
|
-
id,
|
|
21
|
-
page = 1,
|
|
22
|
-
size = 10000,
|
|
23
|
-
}) => {
|
|
19
|
+
const getTranscript = async ({ id, page = 1, size = 10000 }) => {
|
|
24
20
|
try {
|
|
25
21
|
const response = await transcriptService.getFileTranscriptPhrases(id, page, size);
|
|
26
22
|
const { items } = applyTransform(response.data, [
|
|
@@ -29,32 +25,22 @@ const getTranscript = async ({
|
|
|
29
25
|
]);
|
|
30
26
|
return items;
|
|
31
27
|
} catch (err) {
|
|
32
|
-
throw applyTransform(err, [
|
|
33
|
-
notify,
|
|
34
|
-
]);
|
|
28
|
+
throw applyTransform(err, [notify]);
|
|
35
29
|
}
|
|
36
30
|
};
|
|
37
31
|
|
|
38
|
-
|
|
39
32
|
const createTranscript = async ({ callId }) => {
|
|
40
33
|
const preRequestHandler = (callId) => {
|
|
41
34
|
return Array.isArray(callId) ? callId : [callId];
|
|
42
|
-
}
|
|
35
|
+
};
|
|
43
36
|
|
|
44
|
-
const uuid = applyTransform(callId, [
|
|
45
|
-
preRequestHandler,
|
|
46
|
-
camelToSnake(),
|
|
47
|
-
]);
|
|
37
|
+
const uuid = applyTransform(callId, [preRequestHandler, camelToSnake()]);
|
|
48
38
|
|
|
49
39
|
try {
|
|
50
40
|
const response = await transcriptService.createFileTranscript({ uuid });
|
|
51
|
-
return applyTransform(response.data, [
|
|
52
|
-
snakeToCamel(),
|
|
53
|
-
]);
|
|
41
|
+
return applyTransform(response.data, [snakeToCamel()]);
|
|
54
42
|
} catch (err) {
|
|
55
|
-
throw applyTransform(err, [
|
|
56
|
-
notify,
|
|
57
|
-
]);
|
|
43
|
+
throw applyTransform(err, [notify]);
|
|
58
44
|
}
|
|
59
45
|
};
|
|
60
46
|
|
|
@@ -62,23 +48,17 @@ const deleteTranscript = async (item) => {
|
|
|
62
48
|
const preRequestHandler = ({ fileId, callId }) => {
|
|
63
49
|
if (fileId) {
|
|
64
50
|
return { id: Array.isArray(fileId) ? fileId : [fileId] };
|
|
65
|
-
} else {
|
|
66
|
-
return { uuid: Array.isArray(callId) ? callId : [callId] };
|
|
67
51
|
}
|
|
68
|
-
|
|
52
|
+
return { uuid: Array.isArray(callId) ? callId : [callId] };
|
|
53
|
+
};
|
|
69
54
|
|
|
70
|
-
const body = applyTransform(item, [
|
|
71
|
-
preRequestHandler,
|
|
72
|
-
camelToSnake(),
|
|
73
|
-
]);
|
|
55
|
+
const body = applyTransform(item, [preRequestHandler, camelToSnake()]);
|
|
74
56
|
|
|
75
57
|
try {
|
|
76
58
|
const response = await transcriptService.deleteFileTranscript(body);
|
|
77
59
|
return applyTransform(response.data, []);
|
|
78
60
|
} catch (err) {
|
|
79
|
-
throw applyTransform(err, [
|
|
80
|
-
notify,
|
|
81
|
-
]);
|
|
61
|
+
throw applyTransform(err, [notify]);
|
|
82
62
|
}
|
|
83
63
|
};
|
|
84
64
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const updateTokenInterceptor = [
|
|
2
2
|
(config) => {
|
|
3
|
-
config.headers['X-Webitel-Access'] = localStorage.getItem('access-token')
|
|
4
|
-
|| '';
|
|
3
|
+
config.headers['X-Webitel-Access'] = localStorage.getItem('access-token') || '';
|
|
5
4
|
return config;
|
|
6
5
|
},
|
|
7
6
|
(error) => Promise.reject(error),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import merge from 'deepmerge';
|
|
2
2
|
|
|
3
|
-
const mergeEachTransformer =
|
|
4
|
-
...args
|
|
5
|
-
|
|
6
|
-
]));
|
|
3
|
+
const mergeEachTransformer =
|
|
4
|
+
(...args) =>
|
|
5
|
+
(main) =>
|
|
6
|
+
main.map((item) => merge.all([...args, item]));
|
|
7
7
|
|
|
8
8
|
export default mergeEachTransformer;
|
|
@@ -9,10 +9,11 @@ const notifyTransformer = (notificationObject) => {
|
|
|
9
9
|
/*
|
|
10
10
|
so, create a callback which will send notification with params, passed to it
|
|
11
11
|
*/
|
|
12
|
-
const callback = ({ type, text }) =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const callback = ({ type, text }) =>
|
|
13
|
+
eventBus.$emit('notification', {
|
|
14
|
+
type,
|
|
15
|
+
text,
|
|
16
|
+
});
|
|
16
17
|
|
|
17
18
|
/*
|
|
18
19
|
and, then, return a function, which will be called in main applyTransform flow,
|
|
@@ -26,8 +27,10 @@ const notifyTransformer = (notificationObject) => {
|
|
|
26
27
|
if (notificationObject instanceof Error) {
|
|
27
28
|
eventBus.$emit('notification', {
|
|
28
29
|
type: 'error',
|
|
29
|
-
text:
|
|
30
|
-
notificationObject.response?.data?.
|
|
30
|
+
text:
|
|
31
|
+
notificationObject.response?.data?.detail ||
|
|
32
|
+
notificationObject.response?.data?.message ||
|
|
33
|
+
notificationObject,
|
|
31
34
|
});
|
|
32
35
|
}
|
|
33
36
|
return notificationObject;
|
|
@@ -2,11 +2,13 @@ import deepcopy from 'deep-copy';
|
|
|
2
2
|
import get from 'lodash/get.js';
|
|
3
3
|
import updateObject from '../../../scripts/updateObject.js';
|
|
4
4
|
|
|
5
|
-
const starToSearchTransformer =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
const starToSearchTransformer =
|
|
6
|
+
(path = 'search') =>
|
|
7
|
+
(params) => {
|
|
8
|
+
const copy = deepcopy(params);
|
|
9
|
+
const value = get(copy, path);
|
|
10
|
+
if (!value || value.slice(-1) === '*') return copy;
|
|
11
|
+
return updateObject({ obj: copy, path, value: `${value}*` });
|
|
12
|
+
};
|
|
11
13
|
|
|
12
14
|
export default starToSearchTransformer;
|
package/src/components/index.js
CHANGED
|
@@ -14,8 +14,7 @@ import WtDivider from './wt-divider/wt-divider.vue';
|
|
|
14
14
|
import WtDummy from './wt-dummy/wt-dummy.vue';
|
|
15
15
|
import WtErrorPage from './wt-error-page/wt-error-page.vue';
|
|
16
16
|
import WtExpansionPanel from './wt-expansion-panel/wt-expansion-panel.vue';
|
|
17
|
-
import WtFiltersPanelWrapper
|
|
18
|
-
from './wt-filters-panel-wrapper/wt-filters-panel-wrapper.vue';
|
|
17
|
+
import WtFiltersPanelWrapper from './wt-filters-panel-wrapper/wt-filters-panel-wrapper.vue';
|
|
19
18
|
import WtHeadlineNav from './wt-headline-nav/wt-headline-nav.vue';
|
|
20
19
|
import WtHeadline from './wt-headline/wt-headline.vue';
|
|
21
20
|
import WtHint from './wt-hint/wt-hint.vue';
|
|
@@ -32,8 +31,7 @@ import WtLoader from './wt-loader/wt-loader.vue';
|
|
|
32
31
|
import WtLogo from './wt-logo/wt-logo.vue';
|
|
33
32
|
import WtNavigationBar from './wt-navigation-bar/wt-navigation-bar.vue';
|
|
34
33
|
import WtNotification from './wt-notification/wt-notification.vue';
|
|
35
|
-
import WtNotificationsBar
|
|
36
|
-
from './wt-notifications-bar/wt-notifications-bar.vue';
|
|
34
|
+
import WtNotificationsBar from './wt-notifications-bar/wt-notifications-bar.vue';
|
|
37
35
|
import WtPageHeader from './wt-page-header/wt-page-header.vue';
|
|
38
36
|
import WtPageWrapper from './wt-page-wrapper/wt-page-wrapper.vue';
|
|
39
37
|
import WtPagination from './wt-pagination/wt-pagination.vue';
|
|
@@ -49,8 +47,7 @@ import WtStatusSelect from './wt-status-select/wt-status-select.vue';
|
|
|
49
47
|
import WtStepper from './wt-stepper/wt-stepper.vue';
|
|
50
48
|
import WtSwitcher from './wt-switcher/wt-switcher.vue';
|
|
51
49
|
import WtTableActions from './wt-table-actions/wt-table-actions.vue';
|
|
52
|
-
import WtTableColumnSelect
|
|
53
|
-
from './wt-table-column-select/wt-table-column-select.vue';
|
|
50
|
+
import WtTableColumnSelect from './wt-table-column-select/wt-table-column-select.vue';
|
|
54
51
|
import WtTable from './wt-table/wt-table.vue';
|
|
55
52
|
import WtTabs from './wt-tabs/wt-tabs.vue';
|
|
56
53
|
import WtTagsInput from './wt-tags-input/wt-tags-input.vue';
|
|
@@ -12,14 +12,12 @@ describe('WtCcAgentStatusTimers', () => {
|
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
|
-
expect(wrapper.exists())
|
|
16
|
-
.toBe(true);
|
|
15
|
+
expect(wrapper.exists()).toBe(true);
|
|
17
16
|
});
|
|
18
17
|
it('renders component with empty status prop', () => {
|
|
19
18
|
const wrapper = shallowMount(WtCcAgentStatusTimers, {
|
|
20
19
|
props: { status: {} },
|
|
21
20
|
});
|
|
22
|
-
expect(wrapper.exists())
|
|
23
|
-
.toBe(true);
|
|
21
|
+
expect(wrapper.exists()).toBe(true);
|
|
24
22
|
});
|
|
25
23
|
});
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
12
|
<script>
|
|
13
|
-
|
|
14
13
|
// https://markus.oberlehner.net/blog/transition-to-height-auto-with-vue/
|
|
15
14
|
export default {
|
|
16
15
|
name: 'WtExpandTransition',
|
|
@@ -36,7 +35,7 @@ export default {
|
|
|
36
35
|
|
|
37
36
|
getComputedStyle(element).height;
|
|
38
37
|
|
|
39
|
-
requestAnimationFrame(() => element.style.height = height);
|
|
38
|
+
requestAnimationFrame(() => (element.style.height = height));
|
|
40
39
|
},
|
|
41
40
|
leave(element) {
|
|
42
41
|
const { height } = getComputedStyle(element);
|
|
@@ -44,7 +43,7 @@ export default {
|
|
|
44
43
|
|
|
45
44
|
getComputedStyle(element).height;
|
|
46
45
|
|
|
47
|
-
requestAnimationFrame(() => element.style.height = 0);
|
|
46
|
+
requestAnimationFrame(() => (element.style.height = 0));
|
|
48
47
|
},
|
|
49
48
|
},
|
|
50
49
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import WebitelApplications
|
|
3
|
-
from '../../../enums/WebitelApplications/WebitelApplications.enum.js';
|
|
2
|
+
import WebitelApplications from '../../../enums/WebitelApplications/WebitelApplications.enum.js';
|
|
4
3
|
import WtAppNavigator from '../wt-app-navigator.vue';
|
|
5
4
|
|
|
6
5
|
const apps = [
|
|
@@ -16,7 +16,6 @@ describe('WtHeaderActions', () => {
|
|
|
16
16
|
props: { user },
|
|
17
17
|
});
|
|
18
18
|
expect(wrapper.find('.wt-header-actions__name').text()).toBe(user.name);
|
|
19
|
-
expect(wrapper.find('.wt-header-actions__account').text())
|
|
20
|
-
.toBe(user.account);
|
|
19
|
+
expect(wrapper.find('.wt-header-actions__account').text()).toBe(user.account);
|
|
21
20
|
});
|
|
22
21
|
});
|
|
@@ -130,19 +130,25 @@ const order = [
|
|
|
130
130
|
WebitelApplications.ANALYTICS,
|
|
131
131
|
];
|
|
132
132
|
|
|
133
|
-
const formattedApps = computed(() =>
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
133
|
+
const formattedApps = computed(() =>
|
|
134
|
+
props.apps
|
|
135
|
+
.reduce(
|
|
136
|
+
(apps, app) => [
|
|
137
|
+
...apps,
|
|
138
|
+
{
|
|
139
|
+
...app,
|
|
140
|
+
img: props.darkMode ? pics[app.name].dark : pics[app.name].light,
|
|
141
|
+
currentApp: props.currentApp === app.name,
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
[],
|
|
145
|
+
)
|
|
146
|
+
.sort((a, b) => order.indexOf(a.name) - order.indexOf(b.name)),
|
|
147
|
+
);
|
|
141
148
|
|
|
142
149
|
function close() {
|
|
143
150
|
isOpened.value = false;
|
|
144
151
|
}
|
|
145
|
-
|
|
146
152
|
</script>
|
|
147
153
|
|
|
148
154
|
<style lang="scss" scoped>
|
|
@@ -57,7 +57,10 @@ const isLetterAvatar = computed(() => !props.src && props.username);
|
|
|
57
57
|
|
|
58
58
|
const avatarLetters = computed(() => {
|
|
59
59
|
if (!props.username) return false;
|
|
60
|
-
const abbreviation = props.username
|
|
60
|
+
const abbreviation = props.username
|
|
61
|
+
.split(' ')
|
|
62
|
+
.map((word) => word.at(0).toUpperCase())
|
|
63
|
+
.join('');
|
|
61
64
|
return abbreviation.length > 2 ? abbreviation.at(0).concat(abbreviation.at(-1)) : abbreviation;
|
|
62
65
|
});
|
|
63
66
|
|
|
@@ -78,8 +81,10 @@ const avatarLettersBackground = computed(() => {
|
|
|
78
81
|
{ letters: 'WX'.concat(''), color: '--wt-avatar-letters-p12-color' },
|
|
79
82
|
{ letters: 'YZ'.concat(''), color: '--wt-avatar-letters-p13-color' },
|
|
80
83
|
];
|
|
81
|
-
const searchedLetter = letterList.find(({ letters }) =>
|
|
82
|
-
|
|
84
|
+
const searchedLetter = letterList.find(({ letters }) =>
|
|
85
|
+
letters.includes(avatarLetters.value.at(0).toUpperCase()),
|
|
86
|
+
);
|
|
87
|
+
return searchedLetter?.color || '--wt-avatar-letters-p1-color';
|
|
83
88
|
});
|
|
84
89
|
|
|
85
90
|
const imgSrc = computed(() => props.src || defaultAvatar);
|
|
@@ -30,13 +30,12 @@ describe('WtSelectButton', () => {
|
|
|
30
30
|
options: [],
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
|
-
const arrowBtn = wrapper
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
const arrowBtn = wrapper
|
|
34
|
+
.findAllComponents({ name: 'wt-button' })
|
|
35
|
+
.find((component) => component.classes().includes('wt-button-select__select-btn'));
|
|
36
36
|
arrowBtn.vm.$emit('click');
|
|
37
37
|
await wrapper.vm.$nextTick();
|
|
38
38
|
const wtIcon = wrapper.find('.wt-button-select__select-arrow');
|
|
39
|
-
expect(wtIcon.classes())
|
|
40
|
-
.toContain('wt-button-select__select-arrow--active');
|
|
39
|
+
expect(wtIcon.classes()).toContain('wt-button-select__select-arrow--active');
|
|
41
40
|
});
|
|
42
41
|
});
|
|
@@ -43,43 +43,40 @@
|
|
|
43
43
|
</template>
|
|
44
44
|
|
|
45
45
|
<script setup>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
46
|
+
const props = defineProps({
|
|
47
|
+
options: {
|
|
48
|
+
type: Array,
|
|
49
|
+
required: true,
|
|
50
|
+
description: '[{ text, disabled, ... anything you need }]',
|
|
51
|
+
},
|
|
52
|
+
visible: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false,
|
|
55
|
+
},
|
|
56
|
+
width: {
|
|
57
|
+
type: [String],
|
|
58
|
+
default: 'auto',
|
|
59
|
+
},
|
|
60
|
+
minWidth: {
|
|
61
|
+
type: [String],
|
|
62
|
+
default: '160px',
|
|
63
|
+
},
|
|
64
|
+
maxWidth: {
|
|
65
|
+
type: [String],
|
|
66
|
+
default: '300px',
|
|
67
|
+
},
|
|
68
|
+
disabled: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: false,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
'click',
|
|
76
|
-
'update:visible'
|
|
77
|
-
]);
|
|
74
|
+
const emit = defineEmits(['click', 'update:visible']);
|
|
78
75
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
function handleOptionClick({ option, index, hide }) {
|
|
77
|
+
emit('click', { option, index });
|
|
78
|
+
hide();
|
|
79
|
+
}
|
|
83
80
|
</script>
|
|
84
81
|
|
|
85
82
|
<style lang="scss">
|
|
@@ -56,12 +56,9 @@ const props = defineProps({
|
|
|
56
56
|
},
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
const emits = defineEmits([
|
|
60
|
-
'create',
|
|
61
|
-
]);
|
|
62
|
-
|
|
63
|
-
const dummy = computed(() => props.darkMode ? dummyDark : dummyLight);
|
|
59
|
+
const emits = defineEmits(['create']);
|
|
64
60
|
|
|
61
|
+
const dummy = computed(() => (props.darkMode ? dummyDark : dummyLight));
|
|
65
62
|
</script>
|
|
66
63
|
|
|
67
64
|
<style lang="scss">
|
|
@@ -70,13 +70,16 @@ function toggle() {
|
|
|
70
70
|
return opened.value ? close() : open();
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
watch(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
watch(
|
|
74
|
+
() => props.collapsed,
|
|
75
|
+
(newVal) => {
|
|
76
|
+
if (newVal) {
|
|
77
|
+
close();
|
|
78
|
+
} else {
|
|
79
|
+
open();
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
);
|
|
80
83
|
</script>
|
|
81
84
|
|
|
82
85
|
<style lang="scss">
|
|
@@ -8,19 +8,15 @@ describe('Filters Panel Wrapper', () => {
|
|
|
8
8
|
});
|
|
9
9
|
it('emits "reset" event at wt-table-actions "filterReset" event', () => {
|
|
10
10
|
const wrapper = shallowMount(FiltersPanelWrapper);
|
|
11
|
-
wrapper.findComponent({ name: 'wt-table-actions' })
|
|
12
|
-
.vm.$emit('input', 'filterReset');
|
|
11
|
+
wrapper.findComponent({ name: 'wt-table-actions' }).vm.$emit('input', 'filterReset');
|
|
13
12
|
expect(wrapper.emitted().reset).toBeTruthy();
|
|
14
13
|
});
|
|
15
14
|
it(`toggles "filters-panel-wrapper--opened" class at
|
|
16
15
|
wt-table-actions "settings" event`, async () => {
|
|
17
16
|
const wrapper = shallowMount(FiltersPanelWrapper);
|
|
18
|
-
expect(wrapper.classes().includes('filters-panel-wrapper--opened'))
|
|
19
|
-
.
|
|
20
|
-
wrapper.findComponent({ name: 'wt-table-actions' })
|
|
21
|
-
.vm.$emit('input', 'settings');
|
|
17
|
+
expect(wrapper.classes().includes('filters-panel-wrapper--opened')).toBe(false);
|
|
18
|
+
wrapper.findComponent({ name: 'wt-table-actions' }).vm.$emit('input', 'settings');
|
|
22
19
|
await wrapper.vm.$nextTick();
|
|
23
|
-
expect(wrapper.classes().includes('filters-panel-wrapper--opened'))
|
|
24
|
-
.toBe(true);
|
|
20
|
+
expect(wrapper.classes().includes('filters-panel-wrapper--opened')).toBe(true);
|
|
25
21
|
});
|
|
26
22
|
});
|