@webitel/ui-sdk 24.10.3 → 24.10.5
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/contacts.js +235 -0
- package/src/api/crm/enums/ContactsSearchMode.js +9 -0
- package/src/api/crm/index.js +2 -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 -25
- 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 +2 -3
- 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
|
@@ -79,11 +79,13 @@ export default {
|
|
|
79
79
|
},
|
|
80
80
|
emits: ['input'],
|
|
81
81
|
computed: {
|
|
82
|
-
progressStyle() {
|
|
82
|
+
progressStyle() {
|
|
83
|
+
// To achieve the correct color styling:
|
|
83
84
|
const progressPercent = ((this.value - this.min) / (this.max - this.min)) * 100;
|
|
84
85
|
return `linear-gradient(to right, var(--wt-slider-background-completed-color) ${progressPercent}%, var(--wt-slider-background-color) 0%)`;
|
|
85
86
|
},
|
|
86
|
-
verticalHeight() {
|
|
87
|
+
verticalHeight() {
|
|
88
|
+
// in order to have correct parent height after slider rotation
|
|
87
89
|
return this.vertical ? `${this.height}px` : '100%';
|
|
88
90
|
},
|
|
89
91
|
},
|
|
@@ -59,17 +59,21 @@ export default {
|
|
|
59
59
|
return this.statusOptions.find((option) => option.value === this.status);
|
|
60
60
|
},
|
|
61
61
|
statusOptions() {
|
|
62
|
-
return this.options
|
|
62
|
+
return this.options
|
|
63
|
+
? this.options
|
|
63
64
|
: StatusOptions.map((opt) => ({
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
...opt,
|
|
66
|
+
text: this.$t(opt.locale),
|
|
67
|
+
}));
|
|
67
68
|
},
|
|
68
69
|
availableOptions() {
|
|
69
70
|
return this.statusOptions.reduce((options, opt) => {
|
|
70
71
|
// PAUSE option is always passed
|
|
71
|
-
if (
|
|
72
|
-
|
|
72
|
+
if (
|
|
73
|
+
(this.status === opt.value && opt.value !== AgentStatus.PAUSE) ||
|
|
74
|
+
opt.value === AgentStatus.BREAK_OUT
|
|
75
|
+
) {
|
|
76
|
+
// skip breakout option
|
|
73
77
|
return options;
|
|
74
78
|
}
|
|
75
79
|
return [...options, opt];
|
|
@@ -47,10 +47,12 @@ const props = defineProps({
|
|
|
47
47
|
|
|
48
48
|
const description = computed(() => props.steps[props.activeStep - 1].description);
|
|
49
49
|
|
|
50
|
-
const stepWithCompleted = computed(() =>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
const stepWithCompleted = computed(() =>
|
|
51
|
+
props.steps.map((item, idx) => ({
|
|
52
|
+
...item,
|
|
53
|
+
completed: props.activeStep > idx,
|
|
54
|
+
})),
|
|
55
|
+
);
|
|
54
56
|
</script>
|
|
55
57
|
|
|
56
58
|
<style lang="scss">
|
|
@@ -69,8 +69,7 @@ describe('WtTable', () => {
|
|
|
69
69
|
gridActions: false,
|
|
70
70
|
},
|
|
71
71
|
});
|
|
72
|
-
expect(wrapper.findAll('.wt-table__tr__head th').length)
|
|
73
|
-
.toBe(headers.length);
|
|
72
|
+
expect(wrapper.findAll('.wt-table__tr__head th').length).toBe(headers.length);
|
|
74
73
|
});
|
|
75
74
|
|
|
76
75
|
it('do not renders table footer by default', () => {
|
|
@@ -117,9 +116,7 @@ describe('WtTable', () => {
|
|
|
117
116
|
sortable: true,
|
|
118
117
|
},
|
|
119
118
|
});
|
|
120
|
-
expect(wrapper
|
|
121
|
-
.find('.wt-table__th--sortable .wt-table__th__sort-arrow')
|
|
122
|
-
.exists()).toBe(true);
|
|
119
|
+
expect(wrapper.find('.wt-table__th--sortable .wt-table__th__sort-arrow').exists()).toBe(true);
|
|
123
120
|
});
|
|
124
121
|
|
|
125
122
|
it('selects all rows at header checkbox click', async () => {
|
|
@@ -156,10 +156,7 @@ export default {
|
|
|
156
156
|
default: true,
|
|
157
157
|
},
|
|
158
158
|
},
|
|
159
|
-
emits: [
|
|
160
|
-
'sort',
|
|
161
|
-
'update:selected',
|
|
162
|
-
],
|
|
159
|
+
emits: ['sort', 'update:selected'],
|
|
163
160
|
|
|
164
161
|
data: () => ({}),
|
|
165
162
|
|
|
@@ -175,16 +172,19 @@ export default {
|
|
|
175
172
|
|
|
176
173
|
dataHeaders() {
|
|
177
174
|
return this.headers
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
175
|
+
.filter((header) => header.show === undefined || header.show)
|
|
176
|
+
.map((header) => {
|
|
177
|
+
if (!header.text && header.locale) {
|
|
178
|
+
return {
|
|
179
|
+
...header,
|
|
180
|
+
text:
|
|
181
|
+
typeof header.locale === 'string'
|
|
182
|
+
? this.$t(header.locale)
|
|
183
|
+
: this.$t(...header.locale),
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
return header;
|
|
187
|
+
});
|
|
188
188
|
},
|
|
189
189
|
|
|
190
190
|
columnsStyle() {
|
|
@@ -248,7 +248,10 @@ export default {
|
|
|
248
248
|
if (select) {
|
|
249
249
|
this.$emit('update:selected', [...this._selected, row]);
|
|
250
250
|
} else {
|
|
251
|
-
this.$emit(
|
|
251
|
+
this.$emit(
|
|
252
|
+
'update:selected',
|
|
253
|
+
this._selected.filter((item) => item !== row),
|
|
254
|
+
);
|
|
252
255
|
}
|
|
253
256
|
} else {
|
|
254
257
|
// for backwards compatibility
|
|
@@ -256,7 +259,6 @@ export default {
|
|
|
256
259
|
}
|
|
257
260
|
},
|
|
258
261
|
},
|
|
259
|
-
|
|
260
262
|
};
|
|
261
263
|
</script>
|
|
262
264
|
|
|
@@ -74,7 +74,8 @@ export default {
|
|
|
74
74
|
headers: {
|
|
75
75
|
type: Array,
|
|
76
76
|
required: true,
|
|
77
|
-
description:
|
|
77
|
+
description:
|
|
78
|
+
'Each header should have following schema: { value: String, show: Boolean, text: String }',
|
|
78
79
|
},
|
|
79
80
|
staticHeaders: {
|
|
80
81
|
type: Array,
|
|
@@ -82,19 +83,19 @@ export default {
|
|
|
82
83
|
description: 'Header values to exclude from selection',
|
|
83
84
|
},
|
|
84
85
|
},
|
|
85
|
-
emits: [
|
|
86
|
-
'change',
|
|
87
|
-
],
|
|
86
|
+
emits: ['change'],
|
|
88
87
|
data: () => ({
|
|
89
88
|
draft: [], // headers draft
|
|
90
89
|
isColumnSelectPopup: false,
|
|
91
90
|
}),
|
|
92
91
|
computed: {
|
|
93
92
|
changeableDraft() {
|
|
94
|
-
return this.draft
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
return this.draft
|
|
94
|
+
.filter((header) => !this.staticHeaders.includes(header.value))
|
|
95
|
+
.sort((a, b) => {
|
|
96
|
+
return this.shownColLabel(a).localeCompare(this.shownColLabel(b));
|
|
97
|
+
// sorting headers for alphabet just in popup
|
|
98
|
+
});
|
|
98
99
|
},
|
|
99
100
|
},
|
|
100
101
|
|
|
@@ -6,17 +6,18 @@ export default {
|
|
|
6
6
|
tag(searchQuery, id) {
|
|
7
7
|
this.emitTagEvent(searchQuery, id);
|
|
8
8
|
|
|
9
|
-
const tag = this.trackBy
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const tag = this.trackBy
|
|
10
|
+
? {
|
|
11
|
+
[this.optionLabel || 'name']: searchQuery,
|
|
12
|
+
[this.trackBy]: id || searchQuery,
|
|
13
|
+
}
|
|
14
|
+
: searchQuery;
|
|
13
15
|
|
|
14
16
|
const isTagExist = (newTag) => {
|
|
15
17
|
if (typeof newTag === 'string') {
|
|
16
18
|
return this.options.some((elem) => elem === newTag);
|
|
17
19
|
}
|
|
18
|
-
return this.options.some((elem) => elem[this.trackBy] ===
|
|
19
|
-
newTag[this.trackBy]);
|
|
20
|
+
return this.options.some((elem) => elem[this.trackBy] === newTag[this.trackBy]);
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
if (isTagExist(tag)) return;
|
|
@@ -33,4 +34,3 @@ export default {
|
|
|
33
34
|
},
|
|
34
35
|
},
|
|
35
36
|
};
|
|
36
|
-
|
|
@@ -30,8 +30,7 @@ describe('WtTextarea', () => {
|
|
|
30
30
|
},
|
|
31
31
|
props: { chatMode: true },
|
|
32
32
|
});
|
|
33
|
-
wrapper.find('.wt-textarea__textarea')
|
|
34
|
-
.trigger('keypress', { key: 'Enter' });
|
|
33
|
+
wrapper.find('.wt-textarea__textarea').trigger('keypress', { key: 'Enter' });
|
|
35
34
|
expect(wrapper.emitted().enter).toBeTruthy();
|
|
36
35
|
});
|
|
37
36
|
|
|
@@ -41,8 +40,7 @@ describe('WtTextarea', () => {
|
|
|
41
40
|
WtLabel,
|
|
42
41
|
},
|
|
43
42
|
});
|
|
44
|
-
wrapper.find('.wt-textarea__textarea')
|
|
45
|
-
.trigger('keypress', { key: 'Enter' });
|
|
43
|
+
wrapper.find('.wt-textarea__textarea').trigger('keypress', { key: 'Enter' });
|
|
46
44
|
expect(wrapper.emitted().enter).toBeFalsy();
|
|
47
45
|
});
|
|
48
46
|
});
|
|
@@ -136,8 +136,9 @@ export default {
|
|
|
136
136
|
// cant test this thing cause vue test utils doesnt render elements width :/
|
|
137
137
|
const afterWrapperWidth = this.$refs['after-wrapper'].offsetWidth;
|
|
138
138
|
const inputEl = this.$refs['wt-textarea'];
|
|
139
|
-
const defaultInputPadding = getComputedStyle(document.documentElement)
|
|
140
|
-
|
|
139
|
+
const defaultInputPadding = getComputedStyle(document.documentElement).getPropertyValue(
|
|
140
|
+
'--textarea-padding',
|
|
141
|
+
);
|
|
141
142
|
inputEl.style.paddingRight = `calc(${defaultInputPadding} * 2 + ${afterWrapperWidth}px)`;
|
|
142
143
|
},
|
|
143
144
|
},
|
|
@@ -129,9 +129,7 @@ export default {
|
|
|
129
129
|
},
|
|
130
130
|
sec: {
|
|
131
131
|
get() {
|
|
132
|
-
return this.dateMode
|
|
133
|
-
? new Date(+this.value).getSeconds()
|
|
134
|
-
: Math.floor(this.value % 60);
|
|
132
|
+
return this.dateMode ? new Date(+this.value).getSeconds() : Math.floor(this.value % 60);
|
|
135
133
|
},
|
|
136
134
|
set(value) {
|
|
137
135
|
const newValue = this.dateMode
|
|
@@ -19,9 +19,7 @@ const HIDE_EVENT_MAP = {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
// eslint-disable-next-line import/prefer-default-export
|
|
22
|
-
export const useTooltipTriggerSubscriptions = ({
|
|
23
|
-
target, triggers, show, hide,
|
|
24
|
-
}) => {
|
|
22
|
+
export const useTooltipTriggerSubscriptions = ({ target, triggers, show, hide }) => {
|
|
25
23
|
const subscribeTriggers = () => {
|
|
26
24
|
const setEventListeners = (target, triggers) => {
|
|
27
25
|
triggers.forEach((trigger) => {
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
|
|
10
10
|
<script setup>
|
|
11
11
|
/*
|
|
12
|
-
* We need to create separate floating component so that we could set
|
|
13
|
-
* eventListeners on it at mount
|
|
14
|
-
*
|
|
15
|
-
* wt-tooltip itself can't do it, because floating is rendered conditionally
|
|
16
|
-
* through v-if so that there's no way to attach eventListeners to floating
|
|
17
|
-
* on tooltip mount
|
|
18
|
-
* */
|
|
12
|
+
* We need to create separate floating component so that we could set
|
|
13
|
+
* eventListeners on it at mount
|
|
14
|
+
*
|
|
15
|
+
* wt-tooltip itself can't do it, because floating is rendered conditionally
|
|
16
|
+
* through v-if so that there's no way to attach eventListeners to floating
|
|
17
|
+
* on tooltip mount
|
|
18
|
+
* */
|
|
19
19
|
|
|
20
20
|
import { ref } from 'vue';
|
|
21
21
|
import { useTooltipTriggerSubscriptions } from './useTooltipTriggerSubscriptions.js';
|
|
@@ -27,10 +27,7 @@ const props = defineProps({
|
|
|
27
27
|
},
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
const emit = defineEmits([
|
|
31
|
-
'show',
|
|
32
|
-
'hide',
|
|
33
|
-
]);
|
|
30
|
+
const emit = defineEmits(['show', 'hide']);
|
|
34
31
|
|
|
35
32
|
const floating = ref(null);
|
|
36
33
|
|
|
@@ -40,7 +37,6 @@ useTooltipTriggerSubscriptions({
|
|
|
40
37
|
show: () => emit('show'),
|
|
41
38
|
hide: () => emit('hide'),
|
|
42
39
|
});
|
|
43
|
-
|
|
44
40
|
</script>
|
|
45
41
|
|
|
46
42
|
<style lang="scss" scoped>
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
|
|
30
30
|
<script setup>
|
|
31
31
|
import { autoPlacement, autoUpdate, flip, offset, shift, useFloating } from '@floating-ui/vue';
|
|
32
|
-
import {
|
|
32
|
+
import { onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
|
33
|
+
import debounce from '../../scripts/debounce.js';
|
|
33
34
|
import { useTooltipTriggerSubscriptions } from './_internals/useTooltipTriggerSubscriptions.js';
|
|
34
35
|
import WtTooltipFloating from './_internals/wt-tooltip-floating.vue';
|
|
35
|
-
import debounce from '../../scripts/debounce.js';
|
|
36
36
|
|
|
37
37
|
const props = defineProps({
|
|
38
38
|
visible: {
|
|
@@ -103,10 +103,7 @@ const { floatingStyles } = useFloating(activator, floating, {
|
|
|
103
103
|
TOGGLE BECAUSE OF PERFORMANCE ISSUES, RELATED TO USAGE OF AUTO_UPDATE OF POSITIONS
|
|
104
104
|
*/
|
|
105
105
|
whileElementsMounted: autoUpdate, // https://floating-ui.com/docs/vue#anchoring
|
|
106
|
-
middleware: [
|
|
107
|
-
shift(), offset(4),
|
|
108
|
-
props.placement === 'auto' ? autoPlacement() : flip(),
|
|
109
|
-
],
|
|
106
|
+
middleware: [shift(), offset(4), props.placement === 'auto' ? autoPlacement() : flip()],
|
|
110
107
|
});
|
|
111
108
|
|
|
112
109
|
useTooltipTriggerSubscriptions({
|
|
@@ -116,18 +113,21 @@ useTooltipTriggerSubscriptions({
|
|
|
116
113
|
hide: hideTooltip,
|
|
117
114
|
});
|
|
118
115
|
|
|
119
|
-
watch(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
116
|
+
watch(
|
|
117
|
+
() => props.visible,
|
|
118
|
+
(value) => {
|
|
119
|
+
if (value) showTooltip();
|
|
120
|
+
else hideTooltip();
|
|
121
|
+
},
|
|
122
|
+
);
|
|
123
123
|
|
|
124
124
|
onMounted(() => {
|
|
125
125
|
if (props.visible) showTooltip();
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
-
onBeforeUnmount(
|
|
129
|
-
removeScrollListener()
|
|
130
|
-
})
|
|
128
|
+
onBeforeUnmount(() => {
|
|
129
|
+
removeScrollListener();
|
|
130
|
+
});
|
|
131
131
|
</script>
|
|
132
132
|
|
|
133
133
|
<style lang="scss">
|
|
@@ -6,9 +6,11 @@ describe('useCachedInterval', () => {
|
|
|
6
6
|
const { subscribe } = useCachedInterval({ timeout: 10 });
|
|
7
7
|
subscribe(callback);
|
|
8
8
|
expect(callback).toHaveBeenCalledTimes(1);
|
|
9
|
-
return await new Promise((resolve, reject) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
return await new Promise((resolve, reject) =>
|
|
10
|
+
setTimeout(() => {
|
|
11
|
+
expect(callback).toHaveBeenCalledTimes(2);
|
|
12
|
+
resolve();
|
|
13
|
+
}, 10),
|
|
14
|
+
);
|
|
13
15
|
});
|
|
14
16
|
});
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { onBeforeUnmount } from 'vue';
|
|
2
|
-
import preventHiddenPageCallsDecorator
|
|
3
|
-
from '../../scripts/preventHiddenPageCallsDecorator.js';
|
|
2
|
+
import preventHiddenPageCallsDecorator from '../../scripts/preventHiddenPageCallsDecorator.js';
|
|
4
3
|
|
|
5
4
|
// eslint-disable-next-line import/prefer-default-export
|
|
6
|
-
export const useCachedInterval = ({
|
|
7
|
-
timeout,
|
|
8
|
-
localStorageKey = 'auto-refresh',
|
|
9
|
-
}) => {
|
|
5
|
+
export const useCachedInterval = ({ timeout, localStorageKey = 'auto-refresh' }) => {
|
|
10
6
|
let interval = null;
|
|
11
7
|
|
|
12
8
|
onBeforeUnmount(() => {
|
|
13
9
|
if (interval) clearInterval(interval);
|
|
14
10
|
});
|
|
15
11
|
const subscribe = (callback) => {
|
|
16
|
-
const _timeout = timeout || +localStorage.getItem(localStorageKey) || 5 *
|
|
17
|
-
60 * 1000;
|
|
12
|
+
const _timeout = timeout || +localStorage.getItem(localStorageKey) || 5 * 60 * 1000;
|
|
18
13
|
callback();
|
|
19
14
|
interval = setInterval(preventHiddenPageCallsDecorator(callback), _timeout);
|
|
20
15
|
};
|
|
@@ -1,82 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useRepresentableAgentPauseCause,
|
|
3
|
-
} from '../useRepresentableAgentPauseCause.js';
|
|
1
|
+
import { useRepresentableAgentPauseCause } from '../useRepresentableAgentPauseCause.js';
|
|
4
2
|
|
|
5
3
|
describe('useRepresentableAgentPauseCause', () => {
|
|
6
4
|
it('correctly computes duration', () => {
|
|
7
5
|
const pauseCauses = { value: [{ durationMin: 10, limitMin: 12 }] };
|
|
8
|
-
const {
|
|
9
|
-
representablePauseCause,
|
|
10
|
-
} = useRepresentableAgentPauseCause(pauseCauses);
|
|
6
|
+
const { representablePauseCause } = useRepresentableAgentPauseCause(pauseCauses);
|
|
11
7
|
expect(representablePauseCause.value[0].duration).toBe('00:10');
|
|
12
8
|
});
|
|
13
9
|
it('isOverflow with limit = 0 returns false', () => {
|
|
14
10
|
const pauseCauses = { value: [{ durationMin: 10, limitMin: 0 }] };
|
|
15
|
-
const {
|
|
16
|
-
representablePauseCause,
|
|
17
|
-
} = useRepresentableAgentPauseCause(pauseCauses);
|
|
11
|
+
const { representablePauseCause } = useRepresentableAgentPauseCause(pauseCauses);
|
|
18
12
|
expect(representablePauseCause.value[0].isOverflow).toBe(false);
|
|
19
13
|
});
|
|
20
14
|
it('isOverflow with duration < limit returns false', () => {
|
|
21
15
|
const pauseCauses = { value: [{ durationMin: 10, limitMin: 12 }] };
|
|
22
|
-
const {
|
|
23
|
-
representablePauseCause,
|
|
24
|
-
} = useRepresentableAgentPauseCause(pauseCauses);
|
|
16
|
+
const { representablePauseCause } = useRepresentableAgentPauseCause(pauseCauses);
|
|
25
17
|
expect(representablePauseCause.value[0].isOverflow).toBe(false);
|
|
26
18
|
});
|
|
27
19
|
it('isOverflow with duration > limit returns true', () => {
|
|
28
20
|
const pauseCauses = { value: [{ durationMin: 14, limitMin: 12 }] };
|
|
29
|
-
const {
|
|
30
|
-
representablePauseCause,
|
|
31
|
-
} = useRepresentableAgentPauseCause(pauseCauses);
|
|
21
|
+
const { representablePauseCause } = useRepresentableAgentPauseCause(pauseCauses);
|
|
32
22
|
expect(representablePauseCause.value[0].isOverflow).toBe(true);
|
|
33
23
|
});
|
|
34
24
|
|
|
35
25
|
it('isOverflow with duration = limit returns false', () => {
|
|
36
26
|
const pauseCauses = { value: [{ durationMin: 12, limitMin: 12 }] };
|
|
37
|
-
const {
|
|
38
|
-
representablePauseCause,
|
|
39
|
-
} = useRepresentableAgentPauseCause(pauseCauses);
|
|
27
|
+
const { representablePauseCause } = useRepresentableAgentPauseCause(pauseCauses);
|
|
40
28
|
expect(representablePauseCause.value[0].isOverflow).toBe(false);
|
|
41
29
|
});
|
|
42
30
|
|
|
43
31
|
it('correctly computes progressColor', () => {
|
|
44
32
|
const pauseCauses = { value: [{ durationMin: 10, limitMin: 12 }] };
|
|
45
|
-
const {
|
|
46
|
-
representablePauseCause,
|
|
47
|
-
} = useRepresentableAgentPauseCause(pauseCauses);
|
|
33
|
+
const { representablePauseCause } = useRepresentableAgentPauseCause(pauseCauses);
|
|
48
34
|
expect(representablePauseCause.value[0].progressColor).toBe('primary');
|
|
49
35
|
});
|
|
50
36
|
|
|
51
37
|
it('correctly computes progressColor with duration > limit', () => {
|
|
52
38
|
const pauseCauses = { value: [{ durationMin: 14, limitMin: 12 }] };
|
|
53
|
-
const {
|
|
54
|
-
representablePauseCause,
|
|
55
|
-
} = useRepresentableAgentPauseCause(pauseCauses);
|
|
39
|
+
const { representablePauseCause } = useRepresentableAgentPauseCause(pauseCauses);
|
|
56
40
|
expect(representablePauseCause.value[0].progressColor).toBe('error');
|
|
57
41
|
});
|
|
58
42
|
|
|
59
43
|
it('correctly computes progressColor with duration < limit', () => {
|
|
60
44
|
const pauseCauses = { value: [{ durationMin: 3, limitMin: 12 }] };
|
|
61
|
-
const {
|
|
62
|
-
representablePauseCause,
|
|
63
|
-
} = useRepresentableAgentPauseCause(pauseCauses);
|
|
45
|
+
const { representablePauseCause } = useRepresentableAgentPauseCause(pauseCauses);
|
|
64
46
|
expect(representablePauseCause.value[0].progressColor).toBe('success');
|
|
65
47
|
});
|
|
66
48
|
|
|
67
49
|
it('correctly computes progressColor with duration = limit', () => {
|
|
68
50
|
const pauseCauses = { value: [{ durationMin: 12, limitMin: 12 }] };
|
|
69
|
-
const {
|
|
70
|
-
representablePauseCause,
|
|
71
|
-
} = useRepresentableAgentPauseCause(pauseCauses);
|
|
51
|
+
const { representablePauseCause } = useRepresentableAgentPauseCause(pauseCauses);
|
|
72
52
|
expect(representablePauseCause.value[0].progressColor).toBe('primary');
|
|
73
53
|
});
|
|
74
54
|
|
|
75
55
|
it('correctly computes limit', () => {
|
|
76
56
|
const pauseCauses = { value: [{ durationMin: 12, limitMin: 12 }] };
|
|
77
|
-
const {
|
|
78
|
-
representablePauseCause,
|
|
79
|
-
} = useRepresentableAgentPauseCause(pauseCauses);
|
|
57
|
+
const { representablePauseCause } = useRepresentableAgentPauseCause(pauseCauses);
|
|
80
58
|
expect(representablePauseCause.value[0].limit).toBe('00:12');
|
|
81
59
|
});
|
|
82
60
|
});
|
|
@@ -8,7 +8,7 @@ const prettifyPauseCauseDuration = (min) => {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
const isDurationOverflow = ({ durationMin, limitMin }) => {
|
|
11
|
-
return
|
|
11
|
+
return durationMin > limitMin && limitMin !== 0;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
const duration = ({ durationMin, limitMin }) => {
|
|
@@ -19,19 +19,21 @@ const duration = ({ durationMin, limitMin }) => {
|
|
|
19
19
|
|
|
20
20
|
const pauseCauseProgressColor = ({ durationMin, limitMin }) => {
|
|
21
21
|
if (isDurationOverflow({ durationMin, limitMin })) return 'error';
|
|
22
|
-
if (durationMin <=
|
|
22
|
+
if (durationMin <= limitMin * 0.75) return 'success';
|
|
23
23
|
return 'primary';
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
// eslint-disable-next-line import/prefer-default-export
|
|
27
27
|
export const useRepresentableAgentPauseCause = (pauseCauses) => {
|
|
28
|
-
const representablePauseCause = computed(() =>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
const representablePauseCause = computed(() =>
|
|
29
|
+
pauseCauses.value.map((pauseCause) => ({
|
|
30
|
+
...pauseCause,
|
|
31
|
+
duration: duration(pauseCause),
|
|
32
|
+
progressColor: pauseCauseProgressColor(pauseCause),
|
|
33
|
+
isOverflow: isDurationOverflow(pauseCause),
|
|
34
|
+
limit: prettifyPauseCauseDuration(pauseCause.limitMin),
|
|
35
|
+
})),
|
|
36
|
+
);
|
|
35
37
|
|
|
36
38
|
return { representablePauseCause };
|
|
37
39
|
};
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
const AdminSections = Object.freeze({
|
|
2
2
|
// DIRECTORY
|
|
3
|
-
LICENSE: 'license',
|
|
4
|
-
USERS: 'users',
|
|
5
|
-
DEVICES: 'devices',
|
|
3
|
+
LICENSE: 'license', // permissions: add
|
|
4
|
+
USERS: 'users', // scope: users
|
|
5
|
+
DEVICES: 'devices', // scope: devices
|
|
6
6
|
|
|
7
7
|
// ROUTING
|
|
8
|
-
FLOW: 'flow',
|
|
9
|
-
DIALPLAN: 'dialplan',
|
|
10
|
-
GATEWAYS: 'gateways',
|
|
11
|
-
CHATPLAN: 'chatplan',
|
|
12
|
-
CHAT_GATEWAYS: 'chat-gateways',
|
|
8
|
+
FLOW: 'flow', // scope: flow
|
|
9
|
+
DIALPLAN: 'dialplan', // scope: acr_routing
|
|
10
|
+
GATEWAYS: 'gateways', // scope: gateways
|
|
11
|
+
CHATPLAN: 'chatplan', // scope: acr_routing
|
|
12
|
+
CHAT_GATEWAYS: 'chat-gateways', // scope: chats
|
|
13
13
|
|
|
14
14
|
// LOOKUPS
|
|
15
|
-
BLACKLIST: 'blacklist',
|
|
16
|
-
REGIONS: 'regions',
|
|
17
|
-
CALENDARS: 'calendars',
|
|
18
|
-
COMMUNICATIONS: 'communications',
|
|
19
|
-
PAUSE_CAUSE: 'pause-cause',
|
|
20
|
-
MEDIA: 'media',
|
|
15
|
+
BLACKLIST: 'blacklist', // scope: cc_list
|
|
16
|
+
REGIONS: 'regions', // scope: lookups
|
|
17
|
+
CALENDARS: 'calendars', // scope: calendars
|
|
18
|
+
COMMUNICATIONS: 'communications', // scope: lookups
|
|
19
|
+
PAUSE_CAUSE: 'pause-cause', // scope: lookups
|
|
20
|
+
MEDIA: 'media', // scope: media_file
|
|
21
21
|
|
|
22
22
|
// CONTACT CENTER
|
|
23
|
-
SKILLS: 'skills',
|
|
24
|
-
AGENTS: 'agents',
|
|
25
|
-
BUCKETS: 'buckets',
|
|
26
|
-
QUEUES: 'queues',
|
|
27
|
-
MEMBERS: 'members',
|
|
28
|
-
RESOURCE_GROUPS: 'resource-groups',
|
|
29
|
-
RESOURCES: 'resources',
|
|
30
|
-
TEAMS: 'teams',
|
|
23
|
+
SKILLS: 'skills', // scope: lookups
|
|
24
|
+
AGENTS: 'agents', // scope: cc_agent
|
|
25
|
+
BUCKETS: 'buckets', // scope: cc_bucket
|
|
26
|
+
QUEUES: 'queues', // scope: cc_queue
|
|
27
|
+
MEMBERS: 'members', // scope: cc_queue
|
|
28
|
+
RESOURCE_GROUPS: 'resource-groups', // scope: cc_resource_group
|
|
29
|
+
RESOURCES: 'resources', // scope: cc_resource
|
|
30
|
+
TEAMS: 'teams', // scope: cc_team
|
|
31
31
|
|
|
32
32
|
// INTEGRATIONS
|
|
33
|
-
STORAGE: 'storage',
|
|
34
|
-
COGNITIVE_PROFILES: 'cognitive-profiles',
|
|
35
|
-
EMAIL_PROFILES: 'email-profiles',
|
|
36
|
-
SINGLE_SIGN_ON: 'single-sign-on',
|
|
33
|
+
STORAGE: 'storage', // scope: storage_profile
|
|
34
|
+
COGNITIVE_PROFILES: 'cognitive-profiles', // scope: cognitive_profile
|
|
35
|
+
EMAIL_PROFILES: 'email-profiles', // scope: email_profile
|
|
36
|
+
SINGLE_SIGN_ON: 'single-sign-on', // scope: single-sign-on
|
|
37
37
|
IMPORT_CSV: 'import-csv',
|
|
38
38
|
TRIGGERS: 'triggers',
|
|
39
39
|
|
|
40
40
|
// PERMISSIONS
|
|
41
|
-
OBJECTS: 'objects',
|
|
42
|
-
ROLES: 'roles',
|
|
41
|
+
OBJECTS: 'objects', // permissions: add
|
|
42
|
+
ROLES: 'roles', // scope: roles
|
|
43
43
|
|
|
44
44
|
// SYSTEM
|
|
45
45
|
CHANGELOGS: 'changelogs',
|