@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
|
@@ -23,7 +23,8 @@ describe('WtIndicator', () => {
|
|
|
23
23
|
color: 'primary',
|
|
24
24
|
},
|
|
25
25
|
});
|
|
26
|
-
expect(wrapper.find('.wt-indicator__indicator').classes())
|
|
27
|
-
|
|
26
|
+
expect(wrapper.find('.wt-indicator__indicator').classes()).toContain(
|
|
27
|
+
'wt-indicator__indicator--primary',
|
|
28
|
+
);
|
|
28
29
|
});
|
|
29
30
|
});
|
|
@@ -27,7 +27,16 @@ export default {
|
|
|
27
27
|
color: {
|
|
28
28
|
type: String,
|
|
29
29
|
default: 'secondary',
|
|
30
|
-
options: [
|
|
30
|
+
options: [
|
|
31
|
+
'primary',
|
|
32
|
+
'secondary',
|
|
33
|
+
'disabled',
|
|
34
|
+
'success',
|
|
35
|
+
'error',
|
|
36
|
+
'transfer',
|
|
37
|
+
'break-out',
|
|
38
|
+
'info',
|
|
39
|
+
],
|
|
31
40
|
},
|
|
32
41
|
text: {
|
|
33
42
|
type: [String, Number],
|
|
@@ -76,9 +76,9 @@ import { computed, onMounted, ref, toRefs, useSlots } from 'vue';
|
|
|
76
76
|
import { useValidation } from '../../mixins/validationMixin/useValidation.js';
|
|
77
77
|
|
|
78
78
|
/*
|
|
79
|
-
* IMPORTANT: WT-INPUT SHOULD SUPPORT VUE 3 AND VUE 2 V-MODEL INTERFACES SO THAT THERE'S
|
|
80
|
-
* TWO PROPS: VALUE AND MODELVALUE, AND 2 EVENTS: @UPDATE:MODELVALUE AND @INPUT
|
|
81
|
-
* */
|
|
79
|
+
* IMPORTANT: WT-INPUT SHOULD SUPPORT VUE 3 AND VUE 2 V-MODEL INTERFACES SO THAT THERE'S
|
|
80
|
+
* TWO PROPS: VALUE AND MODELVALUE, AND 2 EVENTS: @UPDATE:MODELVALUE AND @INPUT
|
|
81
|
+
* */
|
|
82
82
|
const props = defineProps({
|
|
83
83
|
value: {
|
|
84
84
|
type: [String, Number],
|
|
@@ -182,11 +182,7 @@ const slots = useSlots();
|
|
|
182
182
|
// https://stackoverflow.com/questions/72408463/use-props-in-composables-vue3
|
|
183
183
|
const { v, customValidators } = toRefs(props);
|
|
184
184
|
|
|
185
|
-
const {
|
|
186
|
-
isValidation,
|
|
187
|
-
invalid,
|
|
188
|
-
validationText,
|
|
189
|
-
} = useValidation({ v, customValidators });
|
|
185
|
+
const { isValidation, invalid, validationText } = useValidation({ v, customValidators });
|
|
190
186
|
|
|
191
187
|
// toggles password <-> text at showPassword
|
|
192
188
|
const inputType = ref('');
|
|
@@ -256,8 +252,9 @@ function updateInputPaddings() {
|
|
|
256
252
|
// cant test this thing cause vue test utils doesnt render elements width :/
|
|
257
253
|
const afterWrapperWidth = AfterWrapper.value.offsetWidth;
|
|
258
254
|
const inputEl = WtInput.value;
|
|
259
|
-
const defaultInputPadding = getComputedStyle(document.documentElement)
|
|
260
|
-
|
|
255
|
+
const defaultInputPadding = getComputedStyle(document.documentElement).getPropertyValue(
|
|
256
|
+
'--input-padding',
|
|
257
|
+
);
|
|
261
258
|
if (afterWrapperWidth >= inputEl.offsetWidth) return; // fixes https://my.webitel.com/browse/WTEL-2635
|
|
262
259
|
inputEl.style.paddingRight = `calc(${defaultInputPadding} * 2 + ${afterWrapperWidth}px)`;
|
|
263
260
|
}
|
|
@@ -60,10 +60,13 @@ const props = defineProps({
|
|
|
60
60
|
},
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
-
const to = computed(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
63
|
+
const to = computed(
|
|
64
|
+
() =>
|
|
65
|
+
props.link || {
|
|
66
|
+
name: `${props.routeName}-edit`,
|
|
67
|
+
params: { id: props.id },
|
|
68
|
+
},
|
|
69
|
+
);
|
|
67
70
|
</script>
|
|
68
71
|
|
|
69
72
|
<style lang="scss">
|
|
@@ -7,9 +7,7 @@ const nav = [
|
|
|
7
7
|
{
|
|
8
8
|
value: '2',
|
|
9
9
|
route: '/2',
|
|
10
|
-
subNav: [
|
|
11
|
-
{ value: '3', route: '3' },
|
|
12
|
-
],
|
|
10
|
+
subNav: [{ value: '3', route: '3' }],
|
|
13
11
|
},
|
|
14
12
|
];
|
|
15
13
|
|
|
@@ -32,8 +30,7 @@ describe('WtNavigationBar', () => {
|
|
|
32
30
|
props: { nav },
|
|
33
31
|
});
|
|
34
32
|
const navLinksLen = nav.filter((nav) => !nav.subNav).length;
|
|
35
|
-
expect(wrapper.findAll('.wt-navigation-bar__nav-item-link').length)
|
|
36
|
-
.toBe(navLinksLen);
|
|
33
|
+
expect(wrapper.findAll('.wt-navigation-bar__nav-item-link').length).toBe(navLinksLen);
|
|
37
34
|
});
|
|
38
35
|
|
|
39
36
|
it('renders navigation expansions with subNav inside it', async () => {
|
|
@@ -45,13 +42,8 @@ describe('WtNavigationBar', () => {
|
|
|
45
42
|
});
|
|
46
43
|
wrapper.find('.wt-navigation-bar__nav-expansion').trigger('click');
|
|
47
44
|
await wrapper.vm.$nextTick();
|
|
48
|
-
const navExpansion = nav
|
|
49
|
-
.
|
|
50
|
-
.subNav.length;
|
|
51
|
-
expect(wrapper
|
|
52
|
-
.findAll('.wt-navigation-bar__nav-item-link--subnav')
|
|
53
|
-
.length)
|
|
54
|
-
.toBe(navExpansion);
|
|
45
|
+
const navExpansion = nav.find((nav) => nav.subNav).subNav.length;
|
|
46
|
+
expect(wrapper.findAll('.wt-navigation-bar__nav-item-link--subnav').length).toBe(navExpansion);
|
|
55
47
|
});
|
|
56
48
|
|
|
57
49
|
it('correctly computes subNav nested routes', async () => {
|
|
@@ -63,8 +55,8 @@ describe('WtNavigationBar', () => {
|
|
|
63
55
|
});
|
|
64
56
|
await wrapper.find('.wt-navigation-bar__nav-expansion').trigger('click');
|
|
65
57
|
await wrapper.vm.$nextTick();
|
|
66
|
-
expect(
|
|
67
|
-
|
|
68
|
-
.toBe('/2/3');
|
|
58
|
+
expect(
|
|
59
|
+
wrapper.findComponent('.wt-navigation-bar__nav-item-link--subnav').attributes('href'),
|
|
60
|
+
).toBe('/2/3');
|
|
69
61
|
});
|
|
70
62
|
});
|
|
@@ -161,14 +161,14 @@ export default {
|
|
|
161
161
|
currentNav() {
|
|
162
162
|
const path = this.$route.fullPath;
|
|
163
163
|
const currentNav = this.nav
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
.reduce((flatNav, currentNavItem) => {
|
|
165
|
+
if (currentNavItem.subNav) return flatNav.concat(currentNavItem.subNav);
|
|
166
|
+
return [...flatNav, currentNavItem];
|
|
167
|
+
}, [])
|
|
168
|
+
.find((navItem) => path.includes(navItem.route));
|
|
169
169
|
const currentExpansion = this.nav
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
.filter((nav) => nav.subNav)
|
|
171
|
+
.find((nav) => nav.subNav.indexOf(currentNav) !== -1);
|
|
172
172
|
return {
|
|
173
173
|
nav: currentNav?.value,
|
|
174
174
|
expansion: currentExpansion?.value,
|
|
@@ -16,7 +16,8 @@ describe('WtNotificationsBar', () => {
|
|
|
16
16
|
global: { provide: { $eventBus: eventBus } },
|
|
17
17
|
});
|
|
18
18
|
wrapper.vm.$eventBus.$emit('notification', {
|
|
19
|
-
type: 'error',
|
|
19
|
+
type: 'error',
|
|
20
|
+
text: 'error',
|
|
20
21
|
});
|
|
21
22
|
await wrapper.vm.$nextTick();
|
|
22
23
|
expect(wrapper.findAllComponents(WtNotification).length).toBe(1);
|
|
@@ -27,7 +28,8 @@ describe('WtNotificationsBar', () => {
|
|
|
27
28
|
global: { provide: { $eventBus: eventBus } },
|
|
28
29
|
});
|
|
29
30
|
wrapper.vm.$eventBus.$emit('notification', {
|
|
30
|
-
type: 'error',
|
|
31
|
+
type: 'error',
|
|
32
|
+
text: 'error',
|
|
31
33
|
});
|
|
32
34
|
await wrapper.vm.$nextTick();
|
|
33
35
|
wrapper.findComponent(WtNotification).vm.$emit('close');
|
|
@@ -41,7 +43,8 @@ describe('WtNotificationsBar', () => {
|
|
|
41
43
|
data: () => ({ notificationDuration: 100 }),
|
|
42
44
|
});
|
|
43
45
|
wrapper.vm.$eventBus.$emit('notification', {
|
|
44
|
-
type: 'error',
|
|
46
|
+
type: 'error',
|
|
47
|
+
text: 'error',
|
|
45
48
|
});
|
|
46
49
|
setTimeout(() => {
|
|
47
50
|
expect(wrapper.findAllComponents(WtNotification).length).toBe(0);
|
|
@@ -37,7 +37,10 @@ export default {
|
|
|
37
37
|
methods: {
|
|
38
38
|
showNotification(notification) {
|
|
39
39
|
this.notifications.unshift(notification);
|
|
40
|
-
|
|
40
|
+
setTimeout(
|
|
41
|
+
() => this.closeNotification(notification),
|
|
42
|
+
notification.timeout * 1000 || this.notificationDuration,
|
|
43
|
+
);
|
|
41
44
|
},
|
|
42
45
|
closeNotification(notification) {
|
|
43
46
|
const index = this.notifications.indexOf(notification);
|
|
@@ -20,8 +20,7 @@ describe('WtPageWrapper', () => {
|
|
|
20
20
|
const wrapper = shallowMount(WtPageWrapper, {
|
|
21
21
|
slots: { 'actions-panel': content },
|
|
22
22
|
});
|
|
23
|
-
expect(wrapper.find('.wt-page-wrapper__actions-panel').text())
|
|
24
|
-
.toBe(content);
|
|
23
|
+
expect(wrapper.find('.wt-page-wrapper__actions-panel').text()).toBe(content);
|
|
25
24
|
});
|
|
26
25
|
|
|
27
26
|
it('renders page wrapper main content via main slot', () => {
|
|
@@ -88,9 +88,7 @@ export default {
|
|
|
88
88
|
|
|
89
89
|
methods: {
|
|
90
90
|
inputHandler(value) {
|
|
91
|
-
const size =
|
|
92
|
-
? value
|
|
93
|
-
: this.defaultSize;
|
|
91
|
+
const size = value >= 0 && value <= 1000 ? value : this.defaultSize;
|
|
94
92
|
this.$emit('input', size);
|
|
95
93
|
this.changeSize(size);
|
|
96
94
|
},
|
|
@@ -4,28 +4,24 @@ describe('createPlyrURL', () => {
|
|
|
4
4
|
it('baseURL equals to "/"', () => {
|
|
5
5
|
const baseURL = '/';
|
|
6
6
|
const iconURL = '/img/plyr.svg';
|
|
7
|
-
expect(createPlyrURL(baseURL))
|
|
8
|
-
.toBe(iconURL);
|
|
7
|
+
expect(createPlyrURL(baseURL)).toBe(iconURL);
|
|
9
8
|
});
|
|
10
9
|
|
|
11
10
|
it('baseURL starts with "/"', () => {
|
|
12
11
|
const baseURL = '/workspace';
|
|
13
12
|
const iconURL = '/workspace/img/plyr.svg';
|
|
14
|
-
expect(createPlyrURL(baseURL))
|
|
15
|
-
.toBe(iconURL);
|
|
13
|
+
expect(createPlyrURL(baseURL)).toBe(iconURL);
|
|
16
14
|
});
|
|
17
15
|
|
|
18
16
|
it('baseURL starts and ends with "/"', () => {
|
|
19
17
|
const baseURL = '/workspace/';
|
|
20
18
|
const iconURL = '/workspace/img/plyr.svg';
|
|
21
|
-
expect(createPlyrURL(baseURL))
|
|
22
|
-
.toBe(iconURL);
|
|
19
|
+
expect(createPlyrURL(baseURL)).toBe(iconURL);
|
|
23
20
|
});
|
|
24
21
|
|
|
25
22
|
it('Empty baseURL', () => {
|
|
26
23
|
const baseURL = '';
|
|
27
24
|
const iconURL = '/img/plyr.svg';
|
|
28
|
-
expect(createPlyrURL(baseURL))
|
|
29
|
-
.toBe(iconURL);
|
|
25
|
+
expect(createPlyrURL(baseURL)).toBe(iconURL);
|
|
30
26
|
});
|
|
31
27
|
});
|
|
@@ -113,13 +113,22 @@ export default {
|
|
|
113
113
|
if (this.player) this.player.destroy();
|
|
114
114
|
|
|
115
115
|
const defaultControls = [
|
|
116
|
-
'play-large',
|
|
117
|
-
'
|
|
118
|
-
'
|
|
116
|
+
'play-large',
|
|
117
|
+
'play',
|
|
118
|
+
'progress',
|
|
119
|
+
'current-time',
|
|
120
|
+
'duration',
|
|
121
|
+
'mute',
|
|
122
|
+
'volume',
|
|
123
|
+
'captions',
|
|
124
|
+
'settings',
|
|
125
|
+
'pip',
|
|
126
|
+
'airplay',
|
|
127
|
+
'fullscreen',
|
|
119
128
|
];
|
|
120
129
|
|
|
121
130
|
const controls = this.hideDuration
|
|
122
|
-
? defaultControls.filter(control => control !== 'duration')
|
|
131
|
+
? defaultControls.filter((control) => control !== 'duration')
|
|
123
132
|
: defaultControls;
|
|
124
133
|
|
|
125
134
|
if (this.download) controls.push('download');
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import VueMultiselect from 'vue-multiselect';
|
|
2
2
|
import { ObserveVisibility } from 'vue-observe-visibility';
|
|
3
|
-
import validationMixin
|
|
4
|
-
from '../../../mixins/validationMixin/validationMixin.js';
|
|
3
|
+
import validationMixin from '../../../mixins/validationMixin/validationMixin.js';
|
|
5
4
|
import debounce from '../../../scripts/debounce.js';
|
|
6
5
|
import isEmpty from '../../../scripts/isEmpty.js';
|
|
7
6
|
import labelUsageMixin from '../../wt-label/mixins/labelUsageMixin.js';
|
|
@@ -133,9 +132,7 @@ export default {
|
|
|
133
132
|
async fetchOptions({ search, page } = this.searchParams) {
|
|
134
133
|
if (!this.isApiMode) return;
|
|
135
134
|
const { items, next } = await this.searchMethod({ search, page });
|
|
136
|
-
this.apiOptions = this.searchParams.page === 1
|
|
137
|
-
? items
|
|
138
|
-
: this.apiOptions.concat(items);
|
|
135
|
+
this.apiOptions = this.searchParams.page === 1 ? items : this.apiOptions.concat(items);
|
|
139
136
|
this.searchHasNext = next;
|
|
140
137
|
this.isLoading = false;
|
|
141
138
|
},
|
|
@@ -195,9 +195,13 @@ export default {
|
|
|
195
195
|
}),
|
|
196
196
|
computed: {
|
|
197
197
|
// for taggableMixin
|
|
198
|
-
taggable() {
|
|
198
|
+
taggable() {
|
|
199
|
+
return this.allowCustomValues;
|
|
200
|
+
},
|
|
199
201
|
// for taggableMixin
|
|
200
|
-
manualTagging() {
|
|
202
|
+
manualTagging() {
|
|
203
|
+
return this.handleCustomValuesAdditionManually;
|
|
204
|
+
},
|
|
201
205
|
optionsWithCustomValues() {
|
|
202
206
|
// https://webitel.atlassian.net/browse/WTEL-3181
|
|
203
207
|
if (!this.allowCustomValues) return this.selectOptions;
|
|
@@ -210,10 +214,11 @@ export default {
|
|
|
210
214
|
but current filters logic restores value at filter component, but options value are pre-defined at store state
|
|
211
215
|
*/
|
|
212
216
|
|
|
213
|
-
const customValuesToOptions =
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
+
const customValuesToOptions = Array.isArray(this.value)
|
|
218
|
+
? this.value
|
|
219
|
+
: isEmpty(this.value)
|
|
220
|
+
? []
|
|
221
|
+
: [this.value]; //do not add empty values
|
|
217
222
|
const optionsWithoutValues = this.selectOptions.filter((opt) => {
|
|
218
223
|
const optKey = this.trackBy ? opt[this.trackBy] : opt;
|
|
219
224
|
return !customValuesToOptions.some((customValue) => {
|
|
@@ -221,14 +226,10 @@ export default {
|
|
|
221
226
|
return customValueKey === optKey;
|
|
222
227
|
});
|
|
223
228
|
});
|
|
224
|
-
return [
|
|
225
|
-
...customValuesToOptions,
|
|
226
|
-
...optionsWithoutValues,
|
|
227
|
-
];
|
|
229
|
+
return [...customValuesToOptions, ...optionsWithoutValues];
|
|
228
230
|
},
|
|
229
231
|
},
|
|
230
232
|
methods: {
|
|
231
|
-
|
|
232
233
|
// for taggableMixin functionality
|
|
233
234
|
async handleCustomValue(value) {
|
|
234
235
|
// https://webitel.atlassian.net/browse/WTEL-3181
|
|
@@ -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
|
});
|