@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
|
@@ -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
|
});
|
|
@@ -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
|