@webitel/ui-sdk 24.12.29 → 24.12.34
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/CHANGELOG.md +271 -131
- package/README.md +6 -0
- package/dist/img/sprite/index.js +8 -2
- package/dist/img/sprite/tree-collapse.svg +4 -0
- package/dist/img/sprite/tree-cross.svg +5 -0
- package/dist/img/sprite/tree-line.svg +10 -0
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +7736 -7442
- package/dist/ui-sdk.umd.cjs +17 -17
- package/package.json +13 -6
- package/src/api/axios/generateInstance.js +6 -2
- package/src/api/clients/agents/agentChats.js +18 -19
- package/src/api/clients/agents/agents.js +29 -7
- package/src/api/clients/buckets/buckets.js +16 -3
- package/src/api/clients/calendars/calendars.js +21 -3
- package/src/api/clients/catalog/catalog.js +1 -3
- package/src/api/clients/chatGateways/chatGateways.js +41 -12
- package/src/api/clients/communications/communications.js +25 -6
- package/src/api/clients/configurations/configurations.js +13 -3
- package/src/api/clients/flows/flow.js +20 -9
- package/src/api/clients/gateways/gateways.js +12 -3
- package/src/api/clients/lists/blacklists.js +16 -3
- package/src/api/clients/media/media.js +16 -3
- package/src/api/clients/queues/queues.js +16 -6
- package/src/api/clients/roles/roles.js +3 -1
- package/src/api/clients/skills/skills.js +16 -3
- package/src/api/clients/teams/teams.js +17 -7
- package/src/api/clients/users/__tests__/users.spec.js +3 -1
- package/src/api/clients/users/users.js +8 -2
- package/src/api/clients//321/201ontacts/contactChatMessagesHistory.js +21 -13
- package/src/api/clients//321/201ontacts/contacts.js +38 -15
- package/src/api/history/transcript/callTranscript.js +10 -2
- package/src/api/interceptors/request/updateToken.interceptor.js +2 -1
- package/src/api/transformers/applyTransform.js +5 -1
- package/src/api/transformers/camelToSnake/camelToSnake.transformer.js +2 -1
- package/src/api/transformers/snakeToCamel/snakeToCamel.transformer.js +2 -1
- package/src/assets/icons/sprite/index.js +8 -2
- package/src/assets/icons/sprite/tree-collapse.svg +4 -0
- package/src/assets/icons/sprite/tree-cross.svg +5 -0
- package/src/assets/icons/sprite/tree-line.svg +10 -0
- package/src/components/index.js +8 -12
- package/src/components/on-demand/wt-navigation-menu/components/_internals/nav-menu-lvl-1.vue +4 -2
- package/src/components/on-demand/wt-navigation-menu/components/_internals/nav-menu-lvl-2.vue +3 -4
- package/src/components/on-demand/wt-navigation-menu/components/wt-navigation-menu.vue +6 -6
- package/src/components/on-demand/wt-route-transition/wt-route-transition.vue +12 -12
- package/src/components/on-demand/wt-save-failed-popup/wt-save-failed-popup.vue +1 -3
- package/src/components/on-demand/wt-selection-popup/wt-selection-popup.vue +3 -3
- package/src/components/on-demand/wt-start-page/components/start-page-card.vue +4 -2
- package/src/components/on-demand/wt-start-page/components/start-page-logo.vue +1 -1
- package/src/components/on-demand/wt-start-page/components/wt-start-page.vue +2 -3
- package/src/components/on-demand/wt-table-transition/wt-table-transition.vue +7 -7
- package/src/components/wt-action-bar/wt-action-bar.vue +16 -12
- package/src/components/wt-app-header/__tests__/WtHeaderActions.spec.js +3 -1
- package/src/components/wt-app-header/_variables.scss +0 -1
- package/src/components/wt-app-header/wt-app-header.vue +4 -4
- package/src/components/wt-app-header/wt-app-navigator.vue +6 -7
- package/src/components/wt-app-header/wt-header-actions.vue +6 -8
- package/src/components/wt-avatar/wt-avatar.vue +4 -3
- package/src/components/wt-badge/wt-badge.vue +1 -2
- package/src/components/wt-button/wt-button.vue +3 -5
- package/src/components/wt-button-select/__tests__/WtButtonSelect.spec.js +6 -2
- package/src/components/wt-button-select/wt-button-select.vue +3 -4
- package/src/components/wt-checkbox/_variables.scss +1 -2
- package/src/components/wt-checkbox/wt-checkbox.vue +1 -2
- package/src/components/wt-chip/_variables.scss +0 -1
- package/src/components/wt-confirm-dialog/wt-confirm-dialog.vue +15 -5
- package/src/components/wt-context-menu/_variables.scss +3 -1
- package/src/components/wt-context-menu/wt-context-menu.vue +1 -3
- package/src/components/wt-copy-action/wt-copy-action.vue +1 -2
- package/src/components/wt-datepicker/_variables.scss +17 -5
- package/src/components/wt-datepicker/wt-datepicker.vue +2 -7
- package/src/components/wt-divider/_variables.scss +0 -1
- package/src/components/wt-divider/wt-divider.vue +5 -3
- package/src/components/wt-dual-panel/__tests__/WtDualPanel.js +2 -2
- package/src/components/wt-dual-panel/wt-dual-panel.vue +6 -5
- package/src/components/wt-dummy/_variables.scss +0 -1
- package/src/components/wt-dummy/wt-dummy.vue +1 -1
- package/src/components/wt-empty/wt-empty.vue +42 -34
- package/src/components/wt-error-page/_variables.scss +0 -1
- package/src/components/wt-error-page/wt-error-page.vue +2 -4
- package/src/components/wt-expansion-panel/_variables.scss +0 -1
- package/src/components/wt-expansion-panel/wt-expansion-panel.vue +3 -8
- package/src/components/wt-filters-panel-wrapper/__tests__/WtFiltersPanelWrapper.spec.js +12 -4
- package/src/components/wt-filters-panel-wrapper/wt-filters-panel-wrapper.vue +8 -7
- package/src/components/wt-headline/_variables.scss +0 -1
- package/src/components/wt-headline-nav/_variables.scss +0 -1
- package/src/components/wt-headline-nav/wt-headline-nav.vue +2 -1
- package/src/components/wt-hint/wt-hint.vue +1 -3
- package/src/components/wt-icon/_variables.scss +0 -1
- package/src/components/wt-icon-action/wt-icon-action.vue +13 -12
- package/src/components/wt-icon-btn/_variables.scss +0 -2
- package/src/components/wt-icon-btn/wt-icon-btn.vue +4 -6
- package/src/components/wt-image/wt-image.vue +14 -13
- package/src/components/wt-indicator/wt-indicator.vue +2 -7
- package/src/components/wt-input/_variables.scss +1 -2
- package/src/components/wt-input/wt-input.vue +13 -10
- package/src/components/wt-input-info/_variables.scss +0 -1
- package/src/components/wt-intersection-observer/__tests__/WtIntersectionObserver.spec.js +1 -1
- package/src/components/wt-intersection-observer/wt-intersection-observer.vue +9 -8
- package/src/components/wt-item-link/_variables.scss +0 -1
- package/src/components/wt-label/_variables.scss +0 -1
- package/src/components/wt-label/wt-label.vue +1 -4
- package/src/components/wt-load-bar/_variables.scss +0 -1
- package/src/components/wt-load-bar/wt-load-bar.vue +0 -1
- package/src/components/wt-loader/_variables.scss +0 -2
- package/src/components/wt-loader/wt-loader.vue +1 -3
- package/src/components/wt-logo/wt-logo.vue +1 -1
- package/src/components/wt-navigation-bar/__tests__/WtNavigationBar.spec.js +9 -3
- package/src/components/wt-navigation-bar/_variables.scss +9 -3
- package/src/components/wt-navigation-bar/wt-navigation-bar.vue +27 -11
- package/src/components/wt-notification/_variables.scss +0 -1
- package/src/components/wt-notifications-bar/__tests__/WtNotificationsBar.spec.js +1 -1
- package/src/components/wt-notifications-bar/_variables.scss +1 -2
- package/src/components/wt-notifications-bar/wt-notifications-bar.vue +4 -2
- package/src/components/wt-page-header/wt-page-header.vue +3 -2
- package/src/components/wt-page-wrapper/__tests__/WtPageWrapper.spec.js +3 -1
- package/src/components/wt-page-wrapper/_variables.scss +0 -1
- package/src/components/wt-page-wrapper/wt-page-wrapper.vue +0 -2
- package/src/components/wt-pagination/_variables.scss +1 -2
- package/src/components/wt-pagination/wt-pagination.vue +2 -1
- package/src/components/wt-player/_variables.scss +6 -2
- package/src/components/wt-player/wt-player.vue +52 -53
- package/src/components/wt-popup/_variables.scss +0 -1
- package/src/components/wt-popup/wt-popup.vue +2 -8
- package/src/components/wt-progress-bar/_variables.scss +0 -1
- package/src/components/wt-progress-bar/wt-progress-bar.vue +7 -6
- package/src/components/wt-radio/_variables.scss +1 -2
- package/src/components/wt-radio/wt-radio.vue +1 -2
- package/src/components/wt-rounded-action/_variables.scss +3 -1
- package/src/components/wt-search-bar/_variables.scss +4 -2
- package/src/components/wt-search-bar/wt-search-bar.vue +10 -4
- package/src/components/wt-select/_multiselect.scss +9 -15
- package/src/components/wt-select/_variables.scss +3 -2
- package/src/components/wt-select/mixins/multiselectMixin.js +2 -1
- package/src/components/wt-select/wt-select.vue +25 -26
- package/src/components/wt-slider/_variables.scss +0 -1
- package/src/components/wt-slider/wt-slider.vue +3 -3
- package/src/components/wt-status-select/_variables.scss +8 -4
- package/src/components/wt-stepper/_variables.scss +0 -1
- package/src/components/wt-stepper/wt-stepper.vue +5 -5
- package/src/components/wt-switcher/_variables.scss +0 -1
- package/src/components/wt-switcher/wt-switcher.vue +2 -3
- package/src/components/wt-table/__tests__/WtTable.spec.js +8 -2
- package/src/components/wt-table/_variables.scss +0 -1
- package/src/components/wt-table/types/table-header.ts +8 -0
- package/src/components/wt-table/wt-table.vue +111 -109
- package/src/components/wt-table-actions/_variables.scss +1 -2
- package/src/components/wt-table-actions/wt-table-actions.vue +1 -2
- package/src/components/wt-table-column-select/wt-table-column-select.vue +11 -8
- package/src/components/wt-tabs/_variables.scss +0 -1
- package/src/components/wt-tabs/wt-tabs.vue +6 -6
- package/src/components/wt-tags-input/__tests__/WtTagsInput.spec.js +6 -6
- package/src/components/wt-tags-input/mixin/taggableMixin.js +3 -1
- package/src/components/wt-tags-input/wt-tags-input.vue +8 -10
- package/src/components/wt-textarea/__tests__/WtTextarea.spec.js +6 -2
- package/src/components/wt-textarea/_variables.scss +0 -1
- package/src/components/wt-textarea/wt-textarea.vue +6 -7
- package/src/components/wt-time-input/wt-time-input.vue +1 -2
- package/src/components/wt-timepicker/_variables.scss +1 -2
- package/src/components/wt-timepicker/wt-timepicker.vue +10 -8
- package/src/components/wt-tooltip/_internals/useTooltipTriggerSubscriptions.js +6 -1
- package/src/components/wt-tooltip/_internals/wt-tooltip-floating.vue +1 -3
- package/src/components/wt-tooltip/_variables.scss +0 -1
- package/src/components/wt-tooltip/wt-tooltip.vue +13 -2
- package/src/components/wt-tree-table/_variables.scss +19 -0
- package/src/components/wt-tree-table/wt-tree-table.vue +323 -0
- package/src/components/wt-tree-table-row/wt-tree-table-row.vue +171 -0
- package/src/composables/useAccessControl/useAccessControl.js +12 -4
- package/src/composables/useCachedInterval/useCachedInterval.js +6 -2
- package/src/composables/useCachedItemInstanceName/useCachedItemInstanceName.js +4 -1
- package/src/composables/useCard/useCardComponent.js +10 -9
- package/src/composables/useCard/useCardTabs.js +6 -3
- package/src/composables/useRepresentableAgentPauseCause/__tests__/useRepresentableAgentPauseCause.spec.js +20 -10
- package/src/composables/useValidate/useValidate.js +1 -1
- package/src/composables/useWtTable/useWtTable.ts +25 -0
- package/src/css/main.scss +7 -1
- package/src/css/pages/table-page.scss +1 -2
- package/src/css/styleguide/border-radius/_border-radius.scss +1 -1
- package/src/css/styleguide/colors/_deprecated.scss +83 -24
- package/src/css/styleguide/colors/_palette.scss +1340 -251
- package/src/css/styleguide/colors/reusable/_text-field.scss +6 -2
- package/src/css/styleguide/fonts/_fonts.scss +36 -18
- package/src/css/styleguide/spacings/_spacings.scss +1 -1
- package/src/css/styleguide/transitions/_transitions.scss +1 -1
- package/src/css/styleguide/transitions/fade/_fade.scss +5 -4
- package/src/css/styleguide/viewport-breakpoints/_viewport-breakpoints.scss +0 -1
- package/src/enums/WebitelApplications/WebitelApplications.enum.js +7 -7
- package/src/enums/index.js +5 -10
- package/src/locale/en/en.js +5 -2
- package/src/locale/ru/ru.js +7 -3
- package/src/locale/ua/ua.js +7 -3
- package/src/mixins/dataFilterMixins/__tests__/apiFilterMixin.spec.js +2 -1
- package/src/mixins/dataFilterMixins/apiFilterMixin.js +3 -1
- package/src/mixins/dataFilterMixins/baseFilterMixin/baseFilterMixin.js +2 -1
- package/src/mixins/dataFilterMixins/enumFilterMixin.js +2 -1
- package/src/mixins/dataFilterMixins/paginationFilterMixin.js +4 -1
- package/src/mixins/dataFilterMixins/sortFilterMixin.js +2 -1
- package/src/mixins/validationMixin/useValidation.js +17 -7
- package/src/mixins/validationMixin/validationMixin.js +16 -8
- package/src/modules/AgentStatusSelect/api/pause-cause.js +4 -1
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-agent-status-select.spec.js +18 -6
- package/src/modules/AgentStatusSelect/components/_internals/wt-cc-pause-cause-popup.vue +3 -2
- package/src/modules/AgentStatusSelect/components/wt-cc-agent-status-select.vue +5 -2
- package/src/modules/Appearance/components/__tests__/wt-dark-mode-switcher.spec.js +6 -2
- package/src/modules/AuditForm/components/__tests__/audit-form-question-write-wrapper.spec.js +12 -4
- package/src/modules/AuditForm/components/__tests__/audit-form.spec.js +18 -5
- package/src/modules/AuditForm/components/audit-form-question-read-wrapper.vue +4 -2
- package/src/modules/AuditForm/components/audit-form-question-write-wrapper.vue +15 -5
- package/src/modules/AuditForm/components/audit-form-question.vue +10 -4
- package/src/modules/AuditForm/components/audit-form.vue +24 -7
- package/src/modules/AuditForm/components/questions/options/__tests__/audit-form-question-options.spec.js +6 -2
- package/src/modules/AuditForm/components/questions/options/audit-form-question-options.vue +5 -5
- package/src/modules/AuditForm/components/questions/score/audit-form-question-score.vue +9 -4
- package/src/modules/CSVExport/CSVExport.js +5 -2
- package/src/modules/CSVExport/XLSExport.js +7 -7
- package/src/modules/CSVExport/__tests__/CSVExport.spec.js +4 -1
- package/src/modules/CSVExport/mixins/exportCSVMixin.js +3 -1
- package/src/modules/CSVExport/mixins/exportXLSMixin.js +3 -1
- package/src/modules/CardStoreModule/composables/useCardStore.js +6 -2
- package/src/modules/DeleteConfirmationPopup/__tests__/delete-confirmation-popup.spec.js +3 -3
- package/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue +6 -3
- package/src/modules/FilesExport/__tests__/FilesExport.spec.js +6 -2
- package/src/modules/FilesExport/mixins/exportFilesMixin.js +6 -2
- package/src/modules/FilesExport/scripts/generateMediaURL.js +2 -1
- package/src/modules/Filters/classes/BaseFilterSchema.js +15 -6
- package/src/modules/Filters/components/filter-datetime.vue +7 -5
- package/src/modules/Filters/components/filter-pagination.vue +7 -5
- package/src/modules/Filters/components/filter-search.vue +4 -4
- package/src/modules/Filters/components/filter-select.vue +33 -24
- package/src/modules/Filters/components/filter-table-fields.vue +1 -3
- package/src/modules/Filters/composables/useTableFilters.js +3 -1
- package/src/modules/Filters/scripts/getters/localStorageGetter.js +6 -2
- package/src/modules/Filters/scripts/getters/queryGetter.js +2 -1
- package/src/modules/Filters/scripts/setters/localStorageSetter.js +6 -2
- package/src/modules/Filters/scripts/setters/querySetter.js +2 -1
- package/src/modules/Filters/scripts/utils/changeRouteQuery.js +2 -1
- package/src/modules/Filters/store/FiltersStoreModule.js +3 -3
- package/src/modules/Notifications/store/NotificationsStoreModule.js +14 -5
- package/src/modules/Notifications/store/__tests__/NotificationsStoreModule.actions.spec.js +10 -3
- package/src/modules/ObjectPermissions/_internals/components/permissions-role-row.vue +1 -3
- package/src/modules/ObjectPermissions/_internals/components/permissions-role-select.vue +1 -3
- package/src/modules/ObjectPermissions/_internals/components/permissions-tab-role-popup.vue +8 -5
- package/src/modules/ObjectPermissions/_internals/modules/filters/store/filters.store.js +3 -4
- package/src/modules/ObjectPermissions/_internals/store/helpers/createObjectPermissionsStoreModule.js +1 -2
- package/src/modules/ObjectPermissions/_internals/store/modules/objectPermissionsStoreModule.js +10 -14
- package/src/modules/ObjectPermissions/components/permissions-tab.vue +12 -12
- package/src/modules/ObjectPermissions/store/index.js +2 -6
- package/src/modules/QueryFilters/components/__tests__/filter-datetime.spec.js +3 -1
- package/src/modules/QueryFilters/components/__tests__/filter-from-to.spec.js +6 -2
- package/src/modules/QueryFilters/components/__tests__/filter-search.spec.js +7 -2
- package/src/modules/QueryFilters/components/abstract-api-filter.vue +15 -5
- package/src/modules/QueryFilters/components/abstract-enum-filter.vue +15 -5
- package/src/modules/QueryFilters/components/filter-datetime.vue +1 -3
- package/src/modules/QueryFilters/components/filter-from-to.vue +1 -1
- package/src/modules/QueryFilters/components/filter-search.vue +1 -3
- package/src/modules/QueryFilters/components/filter-table-fields.vue +1 -3
- package/src/modules/QueryFilters/mixins/__tests__/enumFilterMixin.spec.js +4 -1
- package/src/modules/QueryFilters/mixins/baseFilterMixin/baseFilterMixin.js +9 -3
- package/src/modules/QueryFilters/mixins/enumFilterMixin.js +10 -3
- package/src/modules/QueryFilters/mixins/paginationFilterMixin.js +4 -2
- package/src/modules/QueryFilters/mixins/sortFilterMixin.js +2 -1
- package/src/modules/QueryFilters/store/QueryFiltersStoreModule.js +2 -1
- package/src/modules/QueryFilters/store/__tests__/QueryFiltersStoreModule.spec.js +10 -3
- package/src/modules/TableComponentModule/composables/useTableEmpty.js +13 -4
- package/src/modules/TableStoreModule/composables/useTableStore.js +18 -6
- package/src/modules/TableStoreModule/store/TableStoreModule.js +36 -21
- package/src/modules/TableStoreModule/store/__tests__/TableStoreModule.spec.js +7 -2
- package/src/modules/Userinfo/api/userinfo.js +4 -1
- package/src/modules/Userinfo/classes/ApplicationsAccess.js +3 -1
- package/src/modules/Userinfo/store/UserinfoStoreModule.js +25 -9
- package/src/plugins/breakpoint/breakpoint.plugin.js +2 -1
- package/src/scripts/__tests__/caseConverters.spec.js +4 -1
- package/src/scripts/__tests__/updateObject.spec.js +6 -2
- package/src/scripts/caseConverters.js +37 -29
- package/src/scripts/compareSize.ts +9 -6
- package/src/scripts/debounce.js +2 -1
- package/src/scripts/index.js +2 -8
- package/src/scripts/logger.js +4 -4
- package/src/scripts/preventHiddenPageCallsDecorator.js +6 -2
- package/src/scripts/saveAsJSON.js +3 -1
- package/src/scripts/sortQueryAdapters.js +11 -0
- package/src/store/BaseStoreModules/ApiStoreModule.js +26 -7
- package/src/store/BaseStoreModules/BaseStoreModule.js +2 -1
- package/src/store/BaseStoreModules/__tests__/BaseStoreModule.spec.js +28 -7
- package/src/store/helpers/getNamespacedState.js +3 -1
- package/src/store/new/modules/apiStoreModule/apiStoreModule.js +19 -14
- package/src/store/new/modules/cardStoreModule/useCardStore.js +6 -2
- package/src/store/new/modules/tableStoreModule/__tests__/tableStoreModule.spec.js +6 -8
- package/src/store/new/modules/tableStoreModule/tableStoreModule.js +31 -28
- package/src/store/new/modules/tableStoreModule/useTableStore.js +18 -6
- package/src/validators/variableSearchValidator/__tests__/variableSearchValidator.spec.js +2 -1
- package/src/validators/websocketValidator/__tests__/websocketValidator.spec.js +3 -1
- package/src/components/wt-table/_internals/getSortOrder.js +0 -12
- /package/dist/img/sprite/{plus.svg → tree-expand.svg} +0 -0
- /package/src/assets/icons/sprite/{plus.svg → tree-expand.svg} +0 -0
|
@@ -19,8 +19,12 @@ describe('WtDarkModeSwitcher', () => {
|
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
it('toggles dark mode class', async () => {
|
|
22
|
-
expect(
|
|
22
|
+
expect(
|
|
23
|
+
window.document.documentElement.classList.contains('theme--dark'),
|
|
24
|
+
).toBe(false);
|
|
23
25
|
await wrapper.findComponent({ name: 'wt-switcher' }).trigger('change');
|
|
24
|
-
expect(
|
|
26
|
+
expect(
|
|
27
|
+
window.document.documentElement.classList.contains('theme--dark'),
|
|
28
|
+
).toBe(true);
|
|
25
29
|
});
|
|
26
30
|
});
|
package/src/modules/AuditForm/components/__tests__/audit-form-question-write-wrapper.spec.js
CHANGED
|
@@ -25,8 +25,12 @@ describe('AuditFormQuestionWriteWrapper', () => {
|
|
|
25
25
|
v,
|
|
26
26
|
},
|
|
27
27
|
});
|
|
28
|
-
wrapper
|
|
29
|
-
|
|
28
|
+
wrapper
|
|
29
|
+
.findComponent({ name: 'wt-switcher' })
|
|
30
|
+
.vm.$emit('change', !question.required);
|
|
31
|
+
expect(wrapper.emitted()['change:question'][0][0].required).toBe(
|
|
32
|
+
!question.required,
|
|
33
|
+
);
|
|
30
34
|
});
|
|
31
35
|
it('correctly changes question type to Score', () => {
|
|
32
36
|
const question = {};
|
|
@@ -40,7 +44,9 @@ describe('AuditFormQuestionWriteWrapper', () => {
|
|
|
40
44
|
.find('.audit-form-question-write-content-question')
|
|
41
45
|
.findComponent({ name: 'wt-select' })
|
|
42
46
|
.vm.$emit('input', { value: EngineAuditQuestionType.Score });
|
|
43
|
-
expect(wrapper.emitted()['change:question'][0][0]).toEqual(
|
|
47
|
+
expect(wrapper.emitted()['change:question'][0][0]).toEqual(
|
|
48
|
+
generateQuestionScoreSchema(),
|
|
49
|
+
);
|
|
44
50
|
});
|
|
45
51
|
it('correctly changes question type to Options', () => {
|
|
46
52
|
const question = {};
|
|
@@ -54,6 +60,8 @@ describe('AuditFormQuestionWriteWrapper', () => {
|
|
|
54
60
|
.find('.audit-form-question-write-content-question')
|
|
55
61
|
.findComponent({ name: 'wt-select' })
|
|
56
62
|
.vm.$emit('input', { value: EngineAuditQuestionType.Option });
|
|
57
|
-
expect(wrapper.emitted()['change:question'][0][0]).toEqual(
|
|
63
|
+
expect(wrapper.emitted()['change:question'][0][0]).toEqual(
|
|
64
|
+
generateQuestionOptionsSchema(),
|
|
65
|
+
);
|
|
58
66
|
});
|
|
59
67
|
});
|
|
@@ -4,9 +4,13 @@ import { useDestroyableSortable } from '../../../../composables/useDestroyableSo
|
|
|
4
4
|
import { generateQuestionSchema } from '../../schemas/AuditFormQuestionSchema.js';
|
|
5
5
|
import AuditForm from '../audit-form.vue';
|
|
6
6
|
|
|
7
|
-
vi.mock(
|
|
7
|
+
vi.mock(
|
|
8
|
+
'../../../../composables/useDestroyableSortable/useDestroyableSortable.js',
|
|
9
|
+
);
|
|
8
10
|
|
|
9
|
-
useDestroyableSortable.mockImplementation(() => ({
|
|
11
|
+
useDestroyableSortable.mockImplementation(() => ({
|
|
12
|
+
reloadSortable: ref(false),
|
|
13
|
+
}));
|
|
10
14
|
|
|
11
15
|
describe('AuditForm', () => {
|
|
12
16
|
it('renders a component', async () => {
|
|
@@ -41,7 +45,9 @@ describe('AuditForm', () => {
|
|
|
41
45
|
questions: [generateQuestionSchema()],
|
|
42
46
|
},
|
|
43
47
|
});
|
|
44
|
-
await wrapper
|
|
48
|
+
await wrapper
|
|
49
|
+
.findComponent({ name: 'audit-form-question' })
|
|
50
|
+
.vm.$emit('delete', { key: 0 });
|
|
45
51
|
expect(wrapper.emitted()['update:questions'][0][0]).toEqual([]);
|
|
46
52
|
});
|
|
47
53
|
it('copy event from child question emits update with duplicated questions', async () => {
|
|
@@ -55,13 +61,20 @@ describe('AuditForm', () => {
|
|
|
55
61
|
await wrapper
|
|
56
62
|
.findComponent({ name: 'audit-form-question' })
|
|
57
63
|
.vm.$emit('copy', { question, key: 0 });
|
|
58
|
-
expect(wrapper.emitted()['update:questions'][0][0]).toEqual([
|
|
64
|
+
expect(wrapper.emitted()['update:questions'][0][0]).toEqual([
|
|
65
|
+
question,
|
|
66
|
+
question,
|
|
67
|
+
]);
|
|
59
68
|
});
|
|
60
69
|
it('initializes result depending on passed questions', () => {
|
|
61
70
|
const wrapper = mount(AuditForm, {
|
|
62
71
|
props: {
|
|
63
72
|
mode: 'fill',
|
|
64
|
-
questions: [
|
|
73
|
+
questions: [
|
|
74
|
+
generateQuestionSchema(),
|
|
75
|
+
generateQuestionSchema(),
|
|
76
|
+
generateQuestionSchema(),
|
|
77
|
+
],
|
|
65
78
|
},
|
|
66
79
|
});
|
|
67
80
|
expect(wrapper.emitted()['update:result'][0][0]).toEqual([{}, {}, {}]);
|
|
@@ -76,8 +76,10 @@ const props = defineProps({
|
|
|
76
76
|
const emit = defineEmits(['change:result', 'activate']);
|
|
77
77
|
|
|
78
78
|
const QuestionTypeComponent = computed(() => {
|
|
79
|
-
if (props.question.type === EngineAuditQuestionType.Option)
|
|
80
|
-
|
|
79
|
+
if (props.question.type === EngineAuditQuestionType.Option)
|
|
80
|
+
return AuditFormQuestionOptions;
|
|
81
|
+
if (props.question.type === EngineAuditQuestionType.Score)
|
|
82
|
+
return AuditFormQuestionScore;
|
|
81
83
|
return null;
|
|
82
84
|
});
|
|
83
85
|
|
|
@@ -92,8 +92,14 @@ const props = defineProps({
|
|
|
92
92
|
const emit = defineEmits(['change:question', 'copy', 'delete']);
|
|
93
93
|
|
|
94
94
|
const QuestionType = [
|
|
95
|
-
{
|
|
96
|
-
|
|
95
|
+
{
|
|
96
|
+
value: EngineAuditQuestionType.Option,
|
|
97
|
+
locale: 'webitelUI.auditForm.type.options',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
value: EngineAuditQuestionType.Score,
|
|
101
|
+
locale: 'webitelUI.auditForm.type.score',
|
|
102
|
+
},
|
|
97
103
|
];
|
|
98
104
|
|
|
99
105
|
const prettifiedQuestionType = computed(() =>
|
|
@@ -101,8 +107,10 @@ const prettifiedQuestionType = computed(() =>
|
|
|
101
107
|
);
|
|
102
108
|
|
|
103
109
|
const QuestionTypeComponent = computed(() => {
|
|
104
|
-
if (props.question.type === EngineAuditQuestionType.Option)
|
|
105
|
-
|
|
110
|
+
if (props.question.type === EngineAuditQuestionType.Option)
|
|
111
|
+
return AuditFormQuestionOptions;
|
|
112
|
+
if (props.question.type === EngineAuditQuestionType.Score)
|
|
113
|
+
return AuditFormQuestionScore;
|
|
106
114
|
return null;
|
|
107
115
|
});
|
|
108
116
|
|
|
@@ -143,7 +151,9 @@ function handleQuestionTypeChange(type) {
|
|
|
143
151
|
|
|
144
152
|
.audit-form-question-write-content-question {
|
|
145
153
|
display: grid;
|
|
146
|
-
margin-right: calc(
|
|
154
|
+
margin-right: calc(
|
|
155
|
+
24px + var(--spacing-sm)
|
|
156
|
+
); // delete icon action for type "options"
|
|
147
157
|
margin-bottom: var(--spacing-sm);
|
|
148
158
|
grid-template-columns: 3fr 1fr;
|
|
149
159
|
gap: var(--spacing-sm);
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
'audit-form-question--answered': isResult,
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
|
-
'audit-form-question--sort-ignore': first && mode === 'fill'
|
|
12
|
-
}
|
|
11
|
+
'audit-form-question--sort-ignore': first && mode === 'fill',
|
|
12
|
+
},
|
|
13
13
|
]"
|
|
14
14
|
:disable-dragging="mode === 'fill'"
|
|
15
15
|
:first="first"
|
|
@@ -56,7 +56,12 @@ const props = defineProps({
|
|
|
56
56
|
},
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
const emits = defineEmits([
|
|
59
|
+
const emits = defineEmits([
|
|
60
|
+
'copy',
|
|
61
|
+
'delete',
|
|
62
|
+
'update:question',
|
|
63
|
+
'update:result',
|
|
64
|
+
]);
|
|
60
65
|
|
|
61
66
|
const QuestionState = {
|
|
62
67
|
SAVED: 'saved',
|
|
@@ -78,7 +83,8 @@ const v$ = useVuelidate(
|
|
|
78
83
|
}
|
|
79
84
|
: {
|
|
80
85
|
result: {
|
|
81
|
-
required: (value) =>
|
|
86
|
+
required: (value) =>
|
|
87
|
+
question.value.required ? !isEmpty(value) : true,
|
|
82
88
|
},
|
|
83
89
|
},
|
|
84
90
|
),
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
:mode="mode"
|
|
14
14
|
:question="question"
|
|
15
15
|
:readonly="readonly"
|
|
16
|
-
:result="
|
|
16
|
+
:result="result && result[key] ? result[key] : null"
|
|
17
17
|
@copy="copyQuestion({ question, key })"
|
|
18
|
-
@delete="deleteQuestion({ question, key})"
|
|
18
|
+
@delete="deleteQuestion({ question, key })"
|
|
19
19
|
@update:question="handleQuestionUpdate({ key, value: $event })"
|
|
20
20
|
@update:result="handleResultUpdate({ key, value: $event })"
|
|
21
21
|
/>
|
|
@@ -34,7 +34,15 @@
|
|
|
34
34
|
<script setup>
|
|
35
35
|
import { useVuelidate } from '@vuelidate/core';
|
|
36
36
|
import cloneDeep from 'lodash/cloneDeep.js';
|
|
37
|
-
import {
|
|
37
|
+
import {
|
|
38
|
+
computed,
|
|
39
|
+
nextTick,
|
|
40
|
+
onMounted,
|
|
41
|
+
reactive,
|
|
42
|
+
ref,
|
|
43
|
+
watch,
|
|
44
|
+
watchEffect,
|
|
45
|
+
} from 'vue';
|
|
38
46
|
import WtButton from '../../../components/wt-button/wt-button.vue';
|
|
39
47
|
import { useDestroyableSortable } from '../../../composables/useDestroyableSortable/useDestroyableSortable.js';
|
|
40
48
|
import { generateQuestionSchema } from '../schemas/AuditFormQuestionSchema.js';
|
|
@@ -61,7 +69,11 @@ const props = defineProps({
|
|
|
61
69
|
},
|
|
62
70
|
});
|
|
63
71
|
|
|
64
|
-
const emit = defineEmits([
|
|
72
|
+
const emit = defineEmits([
|
|
73
|
+
'update:questions',
|
|
74
|
+
'update:result',
|
|
75
|
+
'update:validation',
|
|
76
|
+
]);
|
|
65
77
|
|
|
66
78
|
const v$ = useVuelidate();
|
|
67
79
|
|
|
@@ -119,7 +131,8 @@ function initResult() {
|
|
|
119
131
|
function initQuestions() {
|
|
120
132
|
if (props.mode === 'create' && !props.questions.length) {
|
|
121
133
|
addQuestion({ question: generateQuestionSchema({ required: true }) });
|
|
122
|
-
} else if (props.questions.length)
|
|
134
|
+
} else if (props.questions.length)
|
|
135
|
+
auditQuestions.value.at(0).activateQuestion();
|
|
123
136
|
}
|
|
124
137
|
|
|
125
138
|
// https://my.webitel.com/browse/WTEL-3451, https://my.webitel.com/browse/WTEL-3436
|
|
@@ -128,7 +141,9 @@ async function atQuestionAdded() {
|
|
|
128
141
|
// wait for new question to render
|
|
129
142
|
await nextTick();
|
|
130
143
|
const index =
|
|
131
|
-
isQuestionAdded.index && isQuestionAdded.index === 'last'
|
|
144
|
+
isQuestionAdded.index && isQuestionAdded.index === 'last'
|
|
145
|
+
? -1
|
|
146
|
+
: isQuestionAdded.index;
|
|
132
147
|
auditQuestions.value.at(index).activateQuestion();
|
|
133
148
|
|
|
134
149
|
isQuestionAdded.value = false;
|
|
@@ -147,7 +162,9 @@ const { reloadSortable } = useDestroyableSortable(sortableWrapper, {
|
|
|
147
162
|
},
|
|
148
163
|
});
|
|
149
164
|
|
|
150
|
-
watch(v$, () =>
|
|
165
|
+
watch(v$, () =>
|
|
166
|
+
emit('update:validation', { invalid: isInvalidForm.value, v$: v$.value }),
|
|
167
|
+
);
|
|
151
168
|
watchEffect(initResult);
|
|
152
169
|
watch(
|
|
153
170
|
() => props.questions,
|
|
@@ -17,7 +17,9 @@ describe('AuditFormQuestionOptions', () => {
|
|
|
17
17
|
mode: 'write',
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
|
-
wrapper
|
|
20
|
+
wrapper
|
|
21
|
+
.findComponent('.audit-form-question-options-write__add-button')
|
|
22
|
+
.vm.$emit('click');
|
|
21
23
|
expect(wrapper.emitted()['change:question'][0][0].options.length).toBe(2);
|
|
22
24
|
});
|
|
23
25
|
it('deletes existing question option at "delete" icon-btn click', () => {
|
|
@@ -27,7 +29,9 @@ describe('AuditFormQuestionOptions', () => {
|
|
|
27
29
|
mode: 'write',
|
|
28
30
|
},
|
|
29
31
|
});
|
|
30
|
-
const writeRow = wrapper.findComponent({
|
|
32
|
+
const writeRow = wrapper.findComponent({
|
|
33
|
+
name: 'audit-form-question-options-write-row',
|
|
34
|
+
});
|
|
31
35
|
writeRow.vm.$emit('delete');
|
|
32
36
|
expect(wrapper.emitted()['change:question'][0][0].options.length).toBe(0);
|
|
33
37
|
});
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
:first="key === 0"
|
|
11
11
|
:option="option"
|
|
12
12
|
@delete="deleteQuestionOption({ key })"
|
|
13
|
-
@update:option="
|
|
13
|
+
@update:option="
|
|
14
|
+
updateQuestion({ path: `options[${key}]`, value: $event })
|
|
15
|
+
"
|
|
14
16
|
/>
|
|
15
17
|
<wt-button
|
|
16
18
|
class="audit-form-question-options-write__add-button"
|
|
@@ -25,16 +27,14 @@
|
|
|
25
27
|
>
|
|
26
28
|
<wt-radio
|
|
27
29
|
v-for="opt of question.options"
|
|
28
|
-
:key="opt.score+opt.name"
|
|
30
|
+
:key="opt.score + opt.name"
|
|
29
31
|
:label="opt.name"
|
|
30
32
|
:selected="result"
|
|
31
33
|
:value="opt"
|
|
32
34
|
@input="emit('change:result', $event)"
|
|
33
35
|
/>
|
|
34
36
|
</div>
|
|
35
|
-
<div v-else>
|
|
36
|
-
Unknown mode: {{ mode }}
|
|
37
|
-
</div>
|
|
37
|
+
<div v-else>Unknown mode: {{ mode }}</div>
|
|
38
38
|
</article>
|
|
39
39
|
</template>
|
|
40
40
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<article class="audit-form-question-score">
|
|
3
|
-
<div
|
|
3
|
+
<div
|
|
4
|
+
v-if="mode === 'write'"
|
|
5
|
+
class="audit-form-question-score-write"
|
|
6
|
+
>
|
|
4
7
|
<wt-input
|
|
5
8
|
:label="$t('reusable.from')"
|
|
6
9
|
:number-max="9"
|
|
@@ -24,12 +27,14 @@
|
|
|
24
27
|
</div>
|
|
25
28
|
<div
|
|
26
29
|
v-else-if="mode === 'read'"
|
|
27
|
-
class="audit-form-question-score-read"
|
|
30
|
+
class="audit-form-question-score-read"
|
|
31
|
+
>
|
|
28
32
|
<wt-radio
|
|
29
|
-
v-for="
|
|
33
|
+
v-for="value of scoreRange"
|
|
30
34
|
:key="value"
|
|
31
35
|
:label="`${value}`"
|
|
32
|
-
:selected="isResult ? result.score : null"
|
|
36
|
+
:selected="isResult ? result.score : null"
|
|
37
|
+
:value="value"
|
|
33
38
|
@input="emit('change:result', { score: value })"
|
|
34
39
|
/>
|
|
35
40
|
</div>
|
|
@@ -33,7 +33,8 @@ export default class CSVExport {
|
|
|
33
33
|
header: true,
|
|
34
34
|
delimiter,
|
|
35
35
|
};
|
|
36
|
-
const localStorageOptions =
|
|
36
|
+
const localStorageOptions =
|
|
37
|
+
JSON.parse(localStorage.getItem('csv-export-options')) || {};
|
|
37
38
|
return {
|
|
38
39
|
...defaultOptions,
|
|
39
40
|
...localStorageOptions,
|
|
@@ -60,7 +61,9 @@ export default class CSVExport {
|
|
|
60
61
|
let csv = '';
|
|
61
62
|
let isNext = false;
|
|
62
63
|
// why _columns? https://webitel.atlassian.net/browse/DEV-3797
|
|
63
|
-
let columns =
|
|
64
|
+
let columns =
|
|
65
|
+
params._columns ||
|
|
66
|
+
(params?.fields ? objSnakeToCamel(params?.fields) : []);
|
|
64
67
|
let page = 1;
|
|
65
68
|
|
|
66
69
|
do {
|
|
@@ -40,21 +40,20 @@ export default class XLSExport {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
save(data, columns) {
|
|
43
|
-
const transformedData = data.map(({
|
|
44
|
-
variables,
|
|
45
|
-
...item
|
|
46
|
-
}) => {
|
|
43
|
+
const transformedData = data.map(({ variables, ...item }) => {
|
|
47
44
|
const flatVariables = flatten({ variables });
|
|
48
45
|
|
|
49
46
|
return columns.reduce((acc, column) => {
|
|
50
47
|
return {
|
|
51
48
|
...acc,
|
|
52
|
-
[column]:
|
|
49
|
+
[column]:
|
|
50
|
+
this.extractNameFromObject(item[column]) ||
|
|
51
|
+
flatVariables[column] ||
|
|
52
|
+
'',
|
|
53
53
|
};
|
|
54
54
|
}, {});
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
|
|
58
57
|
const ws = XLSX.utils.json_to_sheet(transformedData);
|
|
59
58
|
const columnWidths = this.calculateColumnWidths(transformedData, columns);
|
|
60
59
|
ws['!cols'] = columnWidths;
|
|
@@ -69,7 +68,8 @@ export default class XLSExport {
|
|
|
69
68
|
let data = [];
|
|
70
69
|
let isNext = false;
|
|
71
70
|
let page = 1;
|
|
72
|
-
const columns =
|
|
71
|
+
const columns =
|
|
72
|
+
params._columns ||
|
|
73
73
|
(params?.fields ? objSnakeToCamel(params?.fields) : []);
|
|
74
74
|
|
|
75
75
|
do {
|
|
@@ -58,7 +58,10 @@ describe('CSV Export', () => {
|
|
|
58
58
|
header: false,
|
|
59
59
|
delimiter: ';',
|
|
60
60
|
};
|
|
61
|
-
localStorage.setItem(
|
|
61
|
+
localStorage.setItem(
|
|
62
|
+
'csv-export-options',
|
|
63
|
+
JSON.stringify(csvExportOptions),
|
|
64
|
+
);
|
|
62
65
|
await wrapper.vm.exportCSV();
|
|
63
66
|
expect(stringify.mock.calls.pop()[1]).toMatchObject(csvExportOptions);
|
|
64
67
|
});
|
|
@@ -14,7 +14,9 @@ export default {
|
|
|
14
14
|
return this.CSVExport ? this.CSVExport.downloadProgress.count : 0;
|
|
15
15
|
},
|
|
16
16
|
selectedIds() {
|
|
17
|
-
return this.dataList
|
|
17
|
+
return this.dataList
|
|
18
|
+
.filter((item) => item._isSelected)
|
|
19
|
+
.map((item) => item.id);
|
|
18
20
|
},
|
|
19
21
|
isAnySelected() {
|
|
20
22
|
return !!this.selectedIds.length;
|
|
@@ -14,7 +14,9 @@ export default {
|
|
|
14
14
|
return this.XLSExport ? this.XLSExport.downloadProgress.count : 0;
|
|
15
15
|
},
|
|
16
16
|
selectedIds() {
|
|
17
|
-
return this.dataList
|
|
17
|
+
return this.dataList
|
|
18
|
+
.filter((item) => item._isSelected)
|
|
19
|
+
.map((item) => item.id);
|
|
18
20
|
},
|
|
19
21
|
isAnySelected() {
|
|
20
22
|
return !!this.selectedIds.length;
|
|
@@ -8,8 +8,12 @@ export const useCardStore = (namespace) => {
|
|
|
8
8
|
|
|
9
9
|
const cardNamespace = `${namespace}/card`;
|
|
10
10
|
|
|
11
|
-
const id = computed(
|
|
12
|
-
|
|
11
|
+
const id = computed(
|
|
12
|
+
() => getNamespacedState(store.state, cardNamespace).itemId,
|
|
13
|
+
);
|
|
14
|
+
const itemInstance = computed(
|
|
15
|
+
() => getNamespacedState(store.state, cardNamespace).itemInstance,
|
|
16
|
+
);
|
|
13
17
|
|
|
14
18
|
function loadItem(payload) {
|
|
15
19
|
return store.dispatch(`${cardNamespace}/LOAD_ITEM`, payload);
|
|
@@ -47,9 +47,9 @@ describe('DeleteConfirmationPopup', () => {
|
|
|
47
47
|
callback: vi.fn(),
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
|
-
expect(
|
|
51
|
-
|
|
52
|
-
);
|
|
50
|
+
expect(
|
|
51
|
+
wrapper.find('.delete-confirmation-popup__content').text(),
|
|
52
|
+
).toContain(deleteCount.toString());
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
it('yes button emitted close', async () => {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
</p>
|
|
18
18
|
</div>
|
|
19
19
|
</template>
|
|
20
|
-
<template #actions="{ isDeleting, close, confirm}">
|
|
20
|
+
<template #actions="{ isDeleting, close, confirm }">
|
|
21
21
|
<wt-button
|
|
22
22
|
:loading="isDeleting"
|
|
23
23
|
@click="confirm"
|
|
@@ -62,7 +62,11 @@ const deleteMessage = computed(() => {
|
|
|
62
62
|
count: t('webitelUI.deleteConfirmationPopup.deleteAll'),
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
return t(
|
|
65
|
+
return t(
|
|
66
|
+
'webitelUI.deleteConfirmationPopup.tableAskingAlert',
|
|
67
|
+
{ count: props.deleteCount },
|
|
68
|
+
null,
|
|
69
|
+
);
|
|
66
70
|
});
|
|
67
71
|
</script>
|
|
68
72
|
|
|
@@ -77,5 +81,4 @@ const deleteMessage = computed(() => {
|
|
|
77
81
|
.delete-confirmation-popup__message {
|
|
78
82
|
text-align: center;
|
|
79
83
|
}
|
|
80
|
-
|
|
81
84
|
</style>
|
|
@@ -11,7 +11,9 @@ vi.mock('file-saver-es', () => ({
|
|
|
11
11
|
saveAs: vi.fn(),
|
|
12
12
|
}));
|
|
13
13
|
|
|
14
|
-
const dataList = [
|
|
14
|
+
const dataList = [
|
|
15
|
+
{ files: [{ name: 'jest', id: '1', mimeType: 'mime/type' }] },
|
|
16
|
+
];
|
|
15
17
|
const selectedDataList = [
|
|
16
18
|
{
|
|
17
19
|
_isSelected: true,
|
|
@@ -24,7 +26,9 @@ const selectedDataList = [
|
|
|
24
26
|
];
|
|
25
27
|
|
|
26
28
|
describe('File Export', () => {
|
|
27
|
-
jszipUtils.getBinaryContent.mockImplementation((url, callback) =>
|
|
29
|
+
jszipUtils.getBinaryContent.mockImplementation((url, callback) =>
|
|
30
|
+
callback(null, {}),
|
|
31
|
+
);
|
|
28
32
|
let wrapper;
|
|
29
33
|
const Component = {
|
|
30
34
|
render() {},
|
|
@@ -15,7 +15,9 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
|
|
17
17
|
filesZippingProgress() {
|
|
18
|
-
return this.FilesExport
|
|
18
|
+
return this.FilesExport
|
|
19
|
+
? Math.floor(this.FilesExport.zippingProgress.percent)
|
|
20
|
+
: 0;
|
|
19
21
|
},
|
|
20
22
|
},
|
|
21
23
|
|
|
@@ -29,7 +31,9 @@ export default {
|
|
|
29
31
|
if (this.selectedItems?.length) {
|
|
30
32
|
files = this.selectedItems.reduce(
|
|
31
33
|
(filesAccumulator, next) =>
|
|
32
|
-
next.files
|
|
34
|
+
next.files
|
|
35
|
+
? [...filesAccumulator, ...next.files]
|
|
36
|
+
: filesAccumulator,
|
|
33
37
|
[],
|
|
34
38
|
);
|
|
35
39
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const generateMediaURL = (id) => {
|
|
2
2
|
const token = localStorage.getItem('access-token');
|
|
3
|
-
const BASE_URL =
|
|
3
|
+
const BASE_URL =
|
|
4
|
+
process?.env?.VUE_APP_API_URL || import.meta.env.VITE_API_URL;
|
|
4
5
|
return `${BASE_URL}/storage/recordings/${id}/stream?access_token=${token}`;
|
|
5
6
|
};
|
|
6
7
|
|
|
@@ -17,7 +17,8 @@ const convertGetterArray = (context) => (getters) => {
|
|
|
17
17
|
const availableGetters = ['value', 'query', 'localStorage'];
|
|
18
18
|
|
|
19
19
|
getters.forEach((getter) => {
|
|
20
|
-
if (!availableGetters.includes(getter))
|
|
20
|
+
if (!availableGetters.includes(getter))
|
|
21
|
+
throw new Error(`Unknown getter: ${getter}`);
|
|
21
22
|
});
|
|
22
23
|
|
|
23
24
|
const getter = ({ router }) => {
|
|
@@ -45,7 +46,8 @@ const convertGetterArray = (context) => (getters) => {
|
|
|
45
46
|
const convertSetterArray = (context) => (setters) => {
|
|
46
47
|
const availableSetters = ['value', 'query', 'localStorage'];
|
|
47
48
|
setters.forEach((setter) => {
|
|
48
|
-
if (!availableSetters.includes(setter))
|
|
49
|
+
if (!availableSetters.includes(setter))
|
|
50
|
+
throw new Error(`Unknown setter: ${setter}`);
|
|
49
51
|
});
|
|
50
52
|
|
|
51
53
|
const setter = async (value, { router }) => {
|
|
@@ -63,7 +65,8 @@ const convertRestoreArray = (context) => (restores) => {
|
|
|
63
65
|
const availableRestores = ['query', 'localStorage'];
|
|
64
66
|
|
|
65
67
|
restores.forEach((restore) => {
|
|
66
|
-
if (!availableRestores.includes(restore))
|
|
68
|
+
if (!availableRestores.includes(restore))
|
|
69
|
+
throw new Error(`Unknown restore: ${restore}`);
|
|
67
70
|
});
|
|
68
71
|
|
|
69
72
|
const restore = ({ router }) => {
|
|
@@ -120,7 +123,9 @@ export default class BaseFilterSchema {
|
|
|
120
123
|
} else if (typeof getters === 'function') {
|
|
121
124
|
getter = getters(this);
|
|
122
125
|
} else {
|
|
123
|
-
throw new Error(
|
|
126
|
+
throw new Error(
|
|
127
|
+
'Getter should be a function or an array of available getters',
|
|
128
|
+
);
|
|
124
129
|
}
|
|
125
130
|
|
|
126
131
|
this.get = getter;
|
|
@@ -136,7 +141,9 @@ export default class BaseFilterSchema {
|
|
|
136
141
|
} else if (typeof setters === 'function') {
|
|
137
142
|
setter = setters(this);
|
|
138
143
|
} else {
|
|
139
|
-
throw new Error(
|
|
144
|
+
throw new Error(
|
|
145
|
+
'Setter should be a function or an array of available setters',
|
|
146
|
+
);
|
|
140
147
|
}
|
|
141
148
|
|
|
142
149
|
this.set = setter;
|
|
@@ -152,7 +159,9 @@ export default class BaseFilterSchema {
|
|
|
152
159
|
} else if (typeof restores === 'function') {
|
|
153
160
|
restore = restores(this);
|
|
154
161
|
} else {
|
|
155
|
-
throw new Error(
|
|
162
|
+
throw new Error(
|
|
163
|
+
'Restore should be a function or an array of available restores',
|
|
164
|
+
);
|
|
156
165
|
}
|
|
157
166
|
|
|
158
167
|
this.restore = restore;
|
|
@@ -25,9 +25,13 @@ const props = defineProps({
|
|
|
25
25
|
|
|
26
26
|
const store = useStore();
|
|
27
27
|
|
|
28
|
-
const filterSchema = computed(
|
|
28
|
+
const filterSchema = computed(
|
|
29
|
+
() => getNamespacedState(store.state, props.namespace)[props.filterQuery],
|
|
30
|
+
);
|
|
29
31
|
|
|
30
|
-
const value = computed(
|
|
32
|
+
const value = computed(
|
|
33
|
+
() => store.getters[`${props.namespace}/FILTER_${props.filterQuery}`],
|
|
34
|
+
);
|
|
31
35
|
|
|
32
36
|
const setValue = (value) => {
|
|
33
37
|
const payload = { value, name: props.filterQuery };
|
|
@@ -35,6 +39,4 @@ const setValue = (value) => {
|
|
|
35
39
|
};
|
|
36
40
|
</script>
|
|
37
41
|
|
|
38
|
-
<style scoped>
|
|
39
|
-
|
|
40
|
-
</style>
|
|
42
|
+
<style scoped></style>
|
|
@@ -33,8 +33,12 @@ const store = useStore();
|
|
|
33
33
|
|
|
34
34
|
const localSize = ref(0);
|
|
35
35
|
|
|
36
|
-
const page = computed(() =>
|
|
37
|
-
|
|
36
|
+
const page = computed(() =>
|
|
37
|
+
store.getters[`${props.namespace}/GET_FILTER`](pageFilterName),
|
|
38
|
+
);
|
|
39
|
+
const size = computed(() =>
|
|
40
|
+
store.getters[`${props.namespace}/GET_FILTER`](sizeFilterName),
|
|
41
|
+
);
|
|
38
42
|
|
|
39
43
|
function setFilter(payload) {
|
|
40
44
|
return store.dispatch(`${props.namespace}/SET_FILTER`, payload);
|
|
@@ -58,6 +62,4 @@ watch(
|
|
|
58
62
|
);
|
|
59
63
|
</script>
|
|
60
64
|
|
|
61
|
-
<style lang="scss" scoped>
|
|
62
|
-
|
|
63
|
-
</style>
|
|
65
|
+
<style lang="scss" scoped></style>
|