@webitel/ui-sdk 0.1.3-vue3 → 0.1.4-vite
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/README.md +1 -1
- package/dist/img/sprite/arrow-mix.svg +5 -0
- package/dist/img/sprite/azure.svg +19 -0
- package/dist/img/sprite/email.svg +3 -0
- package/dist/img/sprite/index.js +1 -1
- package/dist/img/sprite/meta.svg +17 -0
- package/dist/img/sprite/options.svg +5 -0
- package/dist/img/sprite/role.svg +3 -0
- package/dist/img/sprite/scorecard.svg +4 -0
- package/dist/img/sprite/user.svg +3 -0
- package/dist/ui-sdk.common.js +36397 -11631
- package/dist/ui-sdk.common.js.map +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.umd.js +36402 -11636
- package/dist/ui-sdk.umd.js.map +1 -1
- package/dist/ui-sdk.umd.min.js +27 -4
- package/dist/ui-sdk.umd.min.js.map +1 -1
- package/package.json +24 -8
- package/src/api/axios/generateInstance.js +25 -0
- package/src/api/defaults/getDefaultGetListResponse/getDefaultGetListResponse.js +6 -0
- package/src/api/defaults/getDefaultGetParams/getDefaultGetParams.js +9 -0
- package/src/api/defaults/index.js +7 -0
- package/src/api/interceptors/request/updateToken.interceptor.js +10 -0
- package/src/api/interceptors/response/handleUnauthorized.interceptor.js +12 -0
- package/src/api/transformers/applyTransform.js +8 -0
- package/src/api/transformers/camelToSnake/camelToSnake.transformer.js +4 -0
- package/src/api/transformers/generateUrl/generateUrl.transformer.js +13 -0
- package/src/api/transformers/index.js +23 -0
- package/src/api/transformers/log/log.transformer.js +6 -0
- package/src/api/transformers/merge/merge.transformer.js +5 -0
- package/src/api/transformers/mergeEach/mergeEach.transformer.js +8 -0
- package/src/api/transformers/notify/notify.transformer.js +32 -0
- package/src/api/transformers/sanitize/sanitize.transformer.js +12 -0
- package/src/api/transformers/snakeToCamel/snakeToCamel.transformer.js +4 -0
- package/src/api/transformers/starToSearch/starToSearch.transformer.js +12 -0
- package/src/components/index.js +63 -55
- package/src/components/on-demand/wt-cc-agent-status-timers/__tests__/wt-cc-agent-status-timers.spec.js +25 -0
- package/src/components/on-demand/wt-cc-agent-status-timers/wt-cc-agent-status-timers.vue +48 -0
- package/src/components/transitions/wt-expand-transition.vue +41 -39
- package/src/components/{organisms/wt-app-header → wt-app-header}/__tests__/WtAppNavigator.spec.js +2 -2
- package/src/components/{organisms/wt-app-header → wt-app-header}/__tests__/WtHeaderActions.spec.js +1 -1
- package/src/{css/components/organisms → components}/wt-app-header/_variables.scss +3 -2
- package/src/components/wt-app-header/wt-app-header.vue +29 -0
- package/src/components/{organisms/wt-app-header → wt-app-header}/wt-app-navigator.vue +69 -40
- package/src/components/wt-avatar/_variables.scss +32 -0
- package/src/components/wt-avatar/wt-avatar.vue +187 -0
- package/src/components/{atoms/wt-badge → wt-badge}/wt-badge.vue +20 -13
- package/src/components/wt-button/Readme.md +23 -0
- package/src/components/{atoms/wt-button → wt-button}/__tests__/WtButton.spec.js +1 -1
- package/src/components/wt-button/_variables.scss +41 -0
- package/src/components/wt-button/wt-button.vue +205 -0
- package/src/components/wt-button-select/Readme.md +13 -0
- package/src/components/{molecules/wt-button-select → wt-button-select}/__tests__/WtButtonSelect.spec.js +16 -5
- package/src/components/wt-button-select/_variables.scss +7 -0
- package/src/components/wt-button-select/wt-button-select.vue +130 -0
- package/src/components/{molecules/wt-checkbox → wt-checkbox}/__tests__/WtCheckbox.spec.js +6 -6
- package/src/components/wt-checkbox/wt-checkbox.vue +191 -0
- package/src/{css/components/atoms → components}/wt-chip/wt-chip.scss +1 -1
- package/src/components/wt-chip/wt-chip.vue +24 -0
- package/src/components/{atoms/wt-context-menu → wt-context-menu}/__tests__/WtContextMenu.spec.js +1 -1
- package/src/{css/components/atoms → components}/wt-context-menu/_variables.scss +2 -0
- package/src/components/{atoms/wt-context-menu → wt-context-menu}/wt-context-menu.vue +68 -42
- package/src/components/{molecules/wt-datepicker → wt-datepicker}/__tests__/WtDatepicker.spec.js +4 -4
- package/src/components/wt-datepicker/_variables.scss +56 -0
- package/src/components/wt-datepicker/wt-datepicker.vue +240 -0
- package/src/components/wt-divider/wt-divider.vue +30 -0
- package/src/components/wt-dummy/__tests__/WtDummy.spec.js +9 -0
- package/src/components/wt-dummy/wt-dummy.vue +73 -0
- package/src/components/{organisms/wt-error-page → wt-error-page}/__tests__/wt-error-page.spec.js +3 -3
- package/src/components/{organisms/wt-error-page → wt-error-page}/wt-error-page.vue +2 -2
- package/src/components/wt-expansion-panel/__tests__/WtExpansionPanel.spec.js +9 -0
- package/src/components/wt-expansion-panel/wt-expansion-panel.vue +67 -0
- package/src/components/{organisms/wt-filters-panel-wrapper → wt-filters-panel-wrapper}/wt-filters-panel-wrapper.vue +6 -6
- package/src/components/{organisms/wt-headline → wt-headline}/wt-headline.vue +5 -0
- package/src/components/wt-headline-nav/Readme.md +9 -0
- package/src/components/{organisms/wt-headline-nav → wt-headline-nav}/__tests__/wt-headline-nav.spec.js +1 -1
- package/src/components/wt-headline-nav/_variables.scss +8 -0
- package/src/components/{organisms/wt-headline-nav → wt-headline-nav}/wt-headline-nav.vue +41 -29
- package/src/components/{molecules/wt-hint → wt-hint}/wt-hint.vue +7 -1
- package/src/components/wt-icon/Readme.md +327 -0
- package/src/components/{atoms/wt-icon → wt-icon}/__tests__/WtIcon.spec.js +2 -2
- package/src/components/wt-icon/_variables.scss +31 -0
- package/src/components/wt-icon/docs/cleanup-svg-fill-none.png +0 -0
- package/src/components/wt-icon/docs/cleanup-svg-fill.png +0 -0
- package/src/components/wt-icon/docs/cleanup-svg-viewbox-correct.png +0 -0
- package/src/components/wt-icon/docs/cleanup-svg-viewbox-incorrect.png +0 -0
- package/src/components/wt-icon/docs/cleanup-svg-width-height.png +0 -0
- package/src/components/wt-icon/docs/svg-icon-code-example.png +0 -0
- package/src/components/wt-icon/docs/svg-sprite-in-dom.png +0 -0
- package/src/components/wt-icon/wt-icon.vue +172 -0
- package/src/components/wt-icon-action/__tests__/WtIconAction.spec.js +9 -0
- package/src/components/wt-icon-action/_internals/__tests__/WtAddIconAction.spec.js +9 -0
- package/src/components/wt-icon-action/_internals/__tests__/WtDeleteIconAction.spec.js +9 -0
- package/src/components/wt-icon-action/_internals/__tests__/WtDownloadIconAction.spec.js +9 -0
- package/src/components/wt-icon-action/_internals/__tests__/WtEditIconAction.spec.js +9 -0
- package/src/components/wt-icon-action/_internals/__tests__/WtHistoryIconAction.spec.js +9 -0
- package/src/components/wt-icon-action/_internals/__tests__/WtRefreshIconAction.spec.js +9 -0
- package/src/components/wt-icon-action/_internals/wt-add-icon-action.vue +27 -0
- package/src/components/wt-icon-action/_internals/wt-delete-icon-action.vue +27 -0
- package/src/components/wt-icon-action/_internals/wt-download-icon-action.vue +27 -0
- package/src/components/wt-icon-action/_internals/wt-edit-icon-action.vue +27 -0
- package/src/components/wt-icon-action/_internals/wt-history-icon-action.vue +27 -0
- package/src/components/wt-icon-action/_internals/wt-refresh-icon-action.vue +27 -0
- package/src/components/wt-icon-action/wt-icon-action.vue +54 -0
- package/src/components/wt-icon-btn/Readme.md +10 -0
- package/src/components/{molecules/wt-icon-btn → wt-icon-btn}/__tests__/WtIconBtn.spec.js +2 -2
- package/src/components/wt-icon-btn/_variables.scss +9 -0
- package/src/components/wt-icon-btn/wt-icon-btn.vue +47 -0
- package/src/components/{atoms/wt-indicator → wt-indicator}/__tests__/WtIndicator.spec.js +2 -2
- package/src/{css/components/atoms → components}/wt-indicator/_variables.scss +3 -3
- package/src/components/{atoms/wt-indicator → wt-indicator}/wt-indicator.vue +5 -0
- package/src/components/{molecules/wt-input → wt-input}/__tests__/WtInput.spec.js +3 -3
- package/src/components/{molecules/wt-input → wt-input}/wt-input.vue +40 -20
- package/src/{css/components/atoms → components}/wt-input-info/_variables.scss +2 -2
- package/src/components/wt-input-info/wt-input-info.vue +40 -0
- package/src/components/wt-item-link/__tests__/WtItemLink.spec.js +9 -0
- package/src/components/wt-item-link/wt-item-link.vue +57 -0
- package/src/components/{molecules/wt-label → wt-label}/wt-label.vue +5 -0
- package/src/components/{molecules/wt-load-bar → wt-load-bar}/wt-load-bar.vue +7 -2
- package/src/{css/components/atoms → components}/wt-loader/_variables.scss +2 -2
- package/src/components/{atoms/wt-loader → wt-loader}/wt-loader.vue +22 -17
- package/src/components/{organisms/wt-navigation-bar → wt-navigation-bar}/__tests__/WtNavigationBar.spec.js +22 -18
- package/src/components/{organisms/wt-navigation-bar → wt-navigation-bar}/wt-navigation-bar.vue +27 -16
- package/src/components/{molecules/wt-notification → wt-notification}/__tests__/WtNotification.spec.js +1 -1
- package/src/components/wt-notification/wt-notification.vue +86 -0
- package/src/components/{organisms/wt-notifications-bar → wt-notifications-bar}/__tests__/WtNotificationsBar.spec.js +6 -6
- package/src/components/wt-notifications-bar/wt-notifications-bar.vue +78 -0
- package/src/components/wt-page-header/__tests__/wt-page-header.spec.js +9 -0
- package/src/components/wt-page-header/wt-page-header.vue +83 -0
- package/src/components/{organisms/wt-page-wrapper → wt-page-wrapper}/wt-page-wrapper.vue +6 -0
- package/src/components/{organisms/wt-pagination → wt-pagination}/__tests__/WtPagination.spec.js +2 -1
- package/src/components/{organisms/wt-pagination → wt-pagination}/wt-pagination.vue +7 -1
- package/src/{css/components/organisms → components}/wt-player/_variables.scss +1 -1
- package/src/components/{organisms/wt-player → wt-player}/wt-player.vue +10 -5
- package/src/components/{molecules/wt-popup → wt-popup}/wt-popup.vue +5 -0
- package/src/components/{molecules/wt-progress-bar → wt-progress-bar}/__tests__/WtProgressBar.spec.js +2 -2
- package/src/{css/components/molecules → components}/wt-progress-bar/_variables.scss +2 -2
- package/src/components/{molecules/wt-progress-bar → wt-progress-bar}/wt-progress-bar.vue +13 -3
- package/src/components/{molecules/wt-radio → wt-radio}/__tests__/WtRadio.spec.js +6 -6
- package/src/components/wt-radio/wt-radio.vue +180 -0
- package/src/components/wt-rounded-action/Readme.md +68 -0
- package/src/components/{atoms/wt-rounded-action → wt-rounded-action}/__tests__/WtRoundedAction.spec.js +1 -1
- package/src/components/wt-rounded-action/_variables.scss +14 -0
- package/src/components/wt-rounded-action/wt-rounded-action.vue +139 -0
- package/src/components/{molecules/wt-search-bar → wt-search-bar}/__tests__/WtSearchBar.spec.js +9 -0
- package/src/components/wt-search-bar/wt-search-bar.vue +222 -0
- package/src/components/{molecules/wt-select → wt-select}/__tests__/WtSelect.spec.js +3 -3
- package/src/components/{molecules/wt-select → wt-select}/mixins/__tests__/multiselectMixin.spec.js +4 -4
- package/src/components/{molecules/wt-select → wt-select}/mixins/multiselectMixin.js +9 -4
- package/src/components/{molecules/wt-select → wt-select}/wt-select.vue +23 -9
- package/src/components/{molecules/wt-slider → wt-slider}/wt-slider.vue +8 -3
- package/src/components/{organisms/wt-status-select → wt-status-select}/__tests__/WtStatusSelect.spec.js +1 -1
- package/src/components/{organisms/wt-status-select → wt-status-select}/_internals/StatusOptions.lookup.js +1 -1
- package/src/components/{organisms/wt-status-select → wt-status-select}/wt-status-select.vue +27 -23
- package/src/components/wt-stepper/__tests__/WtStepper.spec.vue.js +18 -0
- package/src/components/wt-stepper/wt-stepper.vue +89 -0
- package/src/components/{molecules/wt-switcher → wt-switcher}/__tests__/WtSwitcher.spec.js +5 -5
- package/src/components/wt-switcher/wt-switcher.vue +191 -0
- package/src/components/{organisms/wt-table → wt-table}/__tests__/WtTable.spec.js +11 -11
- package/src/components/{organisms/wt-table → wt-table}/wt-table.vue +20 -3
- package/src/components/{organisms/wt-table-actions → wt-table-actions}/wt-table-actions.vue +5 -0
- package/src/components/{organisms/wt-table-column-select → wt-table-column-select}/__tests__/WtTableColumnSelect.spec.js +3 -3
- package/src/components/wt-table-column-select/wt-table-column-select.vue +178 -0
- package/src/components/{molecules/wt-tabs → wt-tabs}/__tests__/WtTabs.spec.js +3 -3
- package/src/{css/components/molecules → components}/wt-tabs/_variables.scss +1 -1
- package/src/components/{molecules/wt-tabs → wt-tabs}/wt-tabs.vue +9 -1
- package/src/components/{molecules/wt-tags-input → wt-tags-input}/__tests__/WtTagsInput.spec.js +7 -7
- package/src/components/{molecules/wt-tags-input → wt-tags-input}/wt-tags-input.vue +18 -7
- package/src/components/{molecules/wt-textarea → wt-textarea}/__tests__/WtTextarea.spec.js +4 -4
- package/src/components/wt-textarea/wt-textarea.vue +223 -0
- package/src/components/{molecules/wt-time-input → wt-time-input}/__tests__/WtTimeInput.spec.js +3 -3
- package/src/components/wt-time-input/wt-time-input.vue +187 -0
- package/src/components/{molecules/wt-timepicker → wt-timepicker}/__tests__/WtTimepicker.spec.js +13 -13
- package/src/components/{molecules/wt-timepicker → wt-timepicker}/wt-timepicker.vue +13 -5
- package/src/components/{atoms/wt-tooltip → wt-tooltip}/__tests__/WtTooltip.spec.js +1 -1
- package/src/components/wt-tooltip/_internals/useTooltipTriggerSubscriptions.js +68 -0
- package/src/components/wt-tooltip/_internals/wt-tooltip-floating.vue +48 -0
- package/src/components/wt-tooltip/_variables.scss +11 -0
- package/src/components/wt-tooltip/wt-tooltip.vue +150 -0
- package/src/composables/useCachedInterval/__tests__/useCachedInterval.spec.js +14 -0
- package/src/composables/useCachedInterval/useCachedInterval.js +21 -0
- package/src/composables/useDestroyableSortable/useDestroyableSortable.js +66 -0
- package/src/composables/useRepresentableAgentPauseCause/__tests__/useRepresentableAgentPauseCause.spec.js +83 -0
- package/src/composables/useRepresentableAgentPauseCause/useRepresentableAgentPauseCause.js +37 -0
- package/src/css/main.scss +0 -3
- package/src/css/styleguide/colors/_colors.scss +177 -147
- package/src/css/styleguide/colors/_deprecated.scss +151 -0
- package/src/css/styleguide/colors/_palette.scss +358 -0
- package/src/directives/clickaway/clickaway.js +3 -0
- package/src/directives/index.js +7 -0
- package/src/enums/WebitelApplications/AdminSections.enum.js +4 -0
- package/src/enums/WebitelApplications/AuditorSections.enum.js +5 -0
- package/src/enums/WebitelApplications/CrmSections.enum.js +5 -0
- package/src/enums/WebitelApplications/WebitelApplications.enum.js +1 -0
- package/src/locale/.DS_Store +0 -0
- package/src/locale/en/en.js +96 -13
- package/src/locale/es/es.js +282 -0
- package/src/locale/i18n.js +4 -0
- package/src/locale/ru/ru.js +97 -12
- package/src/locale/ua/ua.js +98 -13
- package/src/mixins/dataFilterMixins/__tests__/apiFilterMixin.spec.js +5 -7
- package/src/mixins/dataFilterMixins/__tests__/enumFilterMixin.spec.js +17 -13
- package/src/mixins/dataFilterMixins/__tests__/paginationFilterMixin.spec.js +23 -31
- package/src/mixins/dataFilterMixins/__tests__/sortFilterMixin.spec.js +12 -15
- package/src/mixins/dataFilterMixins/__tests__/urlControllerMixin.spec.js +12 -12
- package/src/mixins/dataFilterMixins/_urlControllerMixin/_urlControllerMixin.js +2 -2
- package/src/mixins/dataFilterMixins/paginationFilterMixin.js +3 -3
- package/src/mixins/dataFilterMixins/sortFilterMixin.js +2 -2
- package/src/mixins/validationMixin/__tests__/validationMixin.spec.js +5 -5
- package/src/mixins/validationMixin/useValidation.js +41 -0
- package/src/mixins/validationMixin/validationMixin.js +17 -12
- package/src/modules/AgentStatusSelect/api/agent-status.js +24 -0
- package/src/modules/AgentStatusSelect/api/pause-cause.js +47 -0
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-agent-status-select.spec.js +83 -0
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-pause-cause-popup.spec.js +18 -0
- package/src/modules/AgentStatusSelect/components/_internals/wt-cc-pause-cause-popup.vue +122 -0
- package/src/modules/AgentStatusSelect/components/_internals/wt-cc-status-select-error-popup.vue +55 -0
- package/src/modules/AgentStatusSelect/components/wt-cc-agent-status-select.vue +107 -0
- package/src/modules/AuditForm/components/__tests__/audit-form-question-read-wrapper.spec.js +14 -0
- package/src/modules/AuditForm/components/__tests__/audit-form-question-write-wrapper.spec.js +60 -0
- package/src/modules/AuditForm/components/__tests__/audit-form-question.spec.js +14 -0
- package/src/modules/AuditForm/components/__tests__/audit-form.spec.js +70 -0
- package/src/modules/AuditForm/components/audit-form-question-read-wrapper.vue +132 -0
- package/src/modules/AuditForm/components/audit-form-question-write-wrapper.vue +154 -0
- package/src/modules/AuditForm/components/audit-form-question.vue +136 -0
- package/src/modules/AuditForm/components/audit-form.vue +183 -0
- package/src/modules/AuditForm/components/questions/options/__tests__/audit-form-question-options-write-row.spec.js +24 -0
- package/src/modules/AuditForm/components/questions/options/__tests__/audit-form-question-options.spec.js +45 -0
- package/src/modules/AuditForm/components/questions/options/audit-form-question-options-write-row.vue +89 -0
- package/src/modules/AuditForm/components/questions/options/audit-form-question-options.vue +97 -0
- package/src/modules/AuditForm/components/questions/score/__tests__/audit-form-question-score.spec.js +30 -0
- package/src/modules/AuditForm/components/questions/score/audit-form-question-score.vue +132 -0
- package/src/modules/AuditForm/schemas/AuditFormQuestionOptionsSchema.js +13 -0
- package/src/modules/AuditForm/schemas/AuditFormQuestionSchema.js +8 -0
- package/src/modules/AuditForm/schemas/AuditFormQuestionScoreSchema.js +8 -0
- package/src/modules/CardStoreModule/composables/useCardStore.js +55 -0
- package/src/modules/CardStoreModule/store/CardStoreModule.js +84 -0
- package/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue +87 -0
- package/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup.js +28 -0
- package/src/modules/FilesExport/FilesExport.js +4 -1
- package/src/modules/FilesExport/scripts/generateMediaURL.js +1 -1
- package/src/modules/Filters/classes/BaseFilterSchema.js +13 -0
- package/src/modules/Filters/components/filter-pagination.vue +61 -0
- package/src/modules/Filters/components/filter-table-fields.vue +61 -0
- package/src/modules/Filters/composables/useTableFilters.js +17 -0
- package/src/modules/Filters/restores/filterFieldsRestore.js +9 -0
- package/src/modules/Filters/restores/readme.md +1 -0
- package/src/modules/Filters/store/FiltersStoreModule.js +181 -0
- package/src/modules/QueryFilters/components/__tests__/abstract-api-filter.spec.js +10 -12
- package/src/modules/QueryFilters/components/__tests__/abstract-enum-filter.spec.js +10 -12
- package/src/modules/QueryFilters/components/__tests__/filter-datetime.spec.js +12 -12
- package/src/modules/QueryFilters/components/__tests__/filter-from-to.spec.js +10 -12
- package/src/modules/QueryFilters/components/__tests__/filter-search.spec.js +10 -12
- package/src/modules/QueryFilters/components/abstract-api-filter.vue +1 -1
- package/src/modules/QueryFilters/components/abstract-enum-filter.vue +1 -1
- package/src/modules/QueryFilters/components/filter-datetime.vue +4 -3
- package/src/modules/QueryFilters/components/filter-from-to.vue +15 -8
- package/src/modules/QueryFilters/components/filter-table-fields.vue +101 -0
- package/src/modules/QueryFilters/mixins/__tests__/apiFilterMixin.spec.js +11 -11
- package/src/modules/QueryFilters/mixins/__tests__/enumFilterMixin.spec.js +11 -13
- package/src/modules/QueryFilters/mixins/__tests__/paginationFilterMixin.spec.js +18 -25
- package/src/modules/QueryFilters/mixins/__tests__/sortFilterMixin.spec.js +14 -9
- package/src/modules/QueryFilters/mixins/__tests__/urlControllerMixin.spec.js +12 -14
- package/src/modules/QueryFilters/mixins/_urlControllerMixin/_urlControllerMixin.js +2 -2
- package/src/modules/QueryFilters/mixins/paginationFilterMixin.js +4 -4
- package/src/modules/QueryFilters/store/QueryFiltersStoreModule.js +21 -8
- package/src/modules/TableStoreModule/composables/useTableStore.js +58 -0
- package/src/modules/TableStoreModule/store/TableStoreModule.js +207 -0
- package/src/modules/Userinfo/api/auth.js +6 -4
- package/src/modules/Userinfo/api/userinfo.js +16 -4
- package/src/modules/Userinfo/classes/ApplicationsAccess.js +27 -0
- package/src/modules/Userinfo/components/__tests__/auth.spec.js +11 -12
- package/src/modules/Userinfo/components/the-auth.vue +1 -1
- package/src/modules/Userinfo/enums/Permissions.enum.js +7 -0
- package/src/modules/Userinfo/store/UserinfoStoreModule.js +41 -1
- package/src/plugins/breakpoint/breakpoint.plugin.js +5 -4
- package/src/scripts/__tests__/updateObject.spec.js +19 -0
- package/src/scripts/caseConverters.js +2 -2
- package/src/scripts/debounce.js +3 -9
- package/src/scripts/eventBus.js +7 -3
- package/src/scripts/updateObject.js +6 -0
- package/src/store/BaseStoreModules/ApiStoreModule.js +93 -0
- package/src/store/ReactiveNowStoreModule/ReactiveNowStoreModule.js +27 -0
- package/src/validators/decimalValidator.js +9 -0
- package/src/validators/domainValidator.js +5 -0
- package/src/components/atoms/wt-avatar/wt-avatar.vue +0 -102
- package/src/components/atoms/wt-button/wt-button.vue +0 -288
- package/src/components/atoms/wt-chip/wt-chip.vue +0 -23
- package/src/components/atoms/wt-divider/wt-divider.vue +0 -25
- package/src/components/atoms/wt-icon/wt-icon.vue +0 -150
- package/src/components/atoms/wt-input-info/wt-input-info.vue +0 -35
- package/src/components/atoms/wt-rounded-action/wt-rounded-action.vue +0 -156
- package/src/components/atoms/wt-tooltip/wt-tooltip.vue +0 -48
- package/src/components/molecules/wt-button-select/wt-button-select.vue +0 -184
- package/src/components/molecules/wt-checkbox/wt-checkbox.vue +0 -179
- package/src/components/molecules/wt-datepicker/wt-datepicker.vue +0 -203
- package/src/components/molecules/wt-datetimepicker/__tests__/WtDatetimepicker.spec.js +0 -79
- package/src/components/molecules/wt-datetimepicker/wt-datetimepicker.vue +0 -300
- package/src/components/molecules/wt-icon-btn/wt-icon-btn.vue +0 -75
- package/src/components/molecules/wt-notification/wt-notification.vue +0 -75
- package/src/components/molecules/wt-radio/wt-radio.vue +0 -170
- package/src/components/molecules/wt-search-bar/wt-search-bar.vue +0 -194
- package/src/components/molecules/wt-switcher/wt-switcher.vue +0 -182
- package/src/components/molecules/wt-textarea/wt-textarea.vue +0 -215
- package/src/components/molecules/wt-time-input/wt-time-input.vue +0 -190
- package/src/components/organisms/wt-app-header/wt-app-header.vue +0 -24
- package/src/components/organisms/wt-notifications-bar/wt-notifications-bar.vue +0 -71
- package/src/components/organisms/wt-table/__tests__/WtTableDeleteAction.spec.js +0 -9
- package/src/components/organisms/wt-table/__tests__/WtTableEditAction.spec.js +0 -9
- package/src/components/organisms/wt-table/table-cells/wt-table-delete-action.vue +0 -21
- package/src/components/organisms/wt-table/table-cells/wt-table-edit-action.vue +0 -22
- package/src/components/organisms/wt-table-column-select/wt-table-column-select.vue +0 -120
- package/src/css/components/_components.scss +0 -45
- package/src/css/components/atoms/wt-avatar/_variables.scss +0 -14
- package/src/css/components/atoms/wt-button/_variables.scss +0 -47
- package/src/css/components/atoms/wt-icon/_variables.scss +0 -8
- package/src/css/components/atoms/wt-rounded-action/_variables.scss +0 -7
- package/src/css/components/atoms/wt-tooltip/_variables.scss +0 -29
- package/src/css/components/molecules/wt-button-select/_variables.scss +0 -18
- package/src/css/components/molecules/wt-datepicker/_variables.scss +0 -21
- package/src/css/components/molecules/wt-datepicker/datepicker-calendar.scss +0 -90
- package/src/css/components/molecules/wt-datetimepicker/_variables.scss +0 -11
- package/src/css/components/molecules/wt-icon-btn/_variables.scss +0 -3
- package/src/css/components/organisms/wt-headline-nav/_variables.scss +0 -5
- /package/src/components/{organisms/wt-app-header → wt-app-header}/__tests__/WtAppHeader.spec.js +0 -0
- /package/src/components/{organisms/wt-app-header → wt-app-header}/wt-header-actions.vue +0 -0
- /package/src/components/{atoms/wt-avatar → wt-avatar}/__tests__/wt-avatar.spec.js +0 -0
- /package/src/components/{atoms/wt-badge → wt-badge}/__tests__/wt-badge.spec.js +0 -0
- /package/src/{css/components/atoms → components}/wt-badge/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-checkbox/_variables.scss +0 -0
- /package/src/components/{atoms/wt-chip → wt-chip}/__tests__/WtChip.spec.js +0 -0
- /package/src/{css/components/atoms → components}/wt-chip/_variables.scss +0 -0
- /package/src/components/{molecules/wt-copy-action → wt-copy-action}/__tests__/WtCopyAction.spec.js +0 -0
- /package/src/components/{molecules/wt-copy-action → wt-copy-action}/wt-copy-action.vue +0 -0
- /package/src/components/{atoms/wt-divider → wt-divider}/__tests__/WtDivider.spec.js +0 -0
- /package/src/{css/components/atoms → components}/wt-divider/_variables.scss +0 -0
- /package/src/components/{organisms/wt-filters-panel-wrapper/__tests__/wt-filters-panel-wrapper.spec.js → wt-filters-panel-wrapper/__tests__/WtFiltersPanelWrapper.spec.js} +0 -0
- /package/src/components/{organisms/wt-headline → wt-headline}/__tests__/WtHeadline.spec.js +0 -0
- /package/src/{css/components/organisms → components}/wt-headline/_variables.scss +0 -0
- /package/src/components/{molecules/wt-hint → wt-hint}/__tests__/WtHint.spec.js +0 -0
- /package/src/{css/components/molecules → components}/wt-input/_variables.scss +0 -0
- /package/src/components/{atoms/wt-input-info → wt-input-info}/__tests__/WtInputInfo.spec.js +0 -0
- /package/src/components/{molecules/wt-label → wt-label}/__tests__/WtLabel.spec.js +0 -0
- /package/src/{css/components/atoms → components}/wt-label/_variables.scss +0 -0
- /package/src/components/{molecules/wt-label → wt-label}/mixins/labelUsageMixin.js +0 -0
- /package/src/components/{molecules/wt-load-bar → wt-load-bar}/__tests__/WtLoadBar.spec.js +0 -0
- /package/src/{css/components/molecules → components}/wt-load-bar/_variables.scss +0 -0
- /package/src/components/{atoms/wt-loader → wt-loader}/__tests__/WtLoader.spec.js +0 -0
- /package/src/components/{atoms/wt-loader → wt-loader}/_internals/wt-loader--md.vue +0 -0
- /package/src/components/{atoms/wt-loader → wt-loader}/_internals/wt-loader--sm.vue +0 -0
- /package/src/{css/components/organisms → components}/wt-navigation-bar/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-notification/_variables.scss +0 -0
- /package/src/{css/components/organisms → components}/wt-notifications-bar/_variables.scss +0 -0
- /package/src/components/{organisms/wt-page-wrapper → wt-page-wrapper}/__tests__/WtPageWrapper.spec.js +0 -0
- /package/src/{css/components/organisms → components}/wt-page-wrapper/_variables.scss +0 -0
- /package/src/{css/components/organisms → components}/wt-pagination/_variables.scss +0 -0
- /package/src/components/{organisms/wt-player → wt-player}/__tests__/WtPlayer.spec.js +0 -0
- /package/src/components/{molecules/wt-popup → wt-popup}/__tests__/WtPopup.spec.js +0 -0
- /package/src/{css/components/molecules → components}/wt-popup/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-radio/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-search-bar/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-select/_multiselect.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-select/_variables.scss +0 -0
- /package/src/components/{molecules/wt-slider → wt-slider}/__tests__/WtSlider.spec.js +0 -0
- /package/src/{css/components/molecules → components}/wt-slider/_variables.scss +0 -0
- /package/src/{css/components/organisms → components}/wt-status-select/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-switcher/_variables.scss +0 -0
- /package/src/components/{organisms/wt-table → wt-table}/_internals/getSortOrder.js +0 -0
- /package/src/{css/components/organisms → components}/wt-table/_variables.scss +0 -0
- /package/src/components/{organisms/wt-table-actions → wt-table-actions}/__tests__/WtTableActions.spec.js +0 -0
- /package/src/{css/components/organisms → components}/wt-table-actions/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-tags-input/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-textarea/_variables.scss +0 -0
- /package/src/{css/components/molecules → components}/wt-timepicker/_variables.scss +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { computed } from 'vue';
|
|
2
|
+
import { useI18n } from 'vue-i18n';
|
|
3
|
+
|
|
4
|
+
export function useValidation({ v, customValidators }) {
|
|
5
|
+
const { t } = useI18n();
|
|
6
|
+
const isValidation = computed(() => !!v.value && !!Object.keys(v.value).length);
|
|
7
|
+
const invalid = computed(() => isValidation.value && v.value.$error);
|
|
8
|
+
|
|
9
|
+
const validationText = computed(() => {
|
|
10
|
+
let validationText = '';
|
|
11
|
+
if (isValidation && invalid) {
|
|
12
|
+
if (v.value.required?.$invalid) validationText = t('validation.required');
|
|
13
|
+
else if (v.value.numeric?.$invalid) validationText = t('validation.numeric');
|
|
14
|
+
else if (v.value.email?.$invalid) validationText = t('validation.email');
|
|
15
|
+
else if (v.value.gatewayHostValidator?.$invalid) validationText = t('validation.gatewayHostValidator');
|
|
16
|
+
else if (v.value.ipValidator?.$invalid) validationText = t('validation.ipValidator');
|
|
17
|
+
else if (v.value.macValidator?.$invalid) validationText = t('validation.macValidator');
|
|
18
|
+
else if (v.value.minValue?.$invalid) validationText = `${t('validation.minValue')} ${v.value.minValue.$params.min}`;
|
|
19
|
+
else if (v.value.maxValue?.$invalid) validationText = `${t('validation.maxValue')} ${v.value.maxValue.$params.max}`;
|
|
20
|
+
else if (v.value.sipAccountValidator?.$invalid) validationText = t('validation.sipAccountValidator');
|
|
21
|
+
else if (v.value.minLength?.$invalid) validationText = `${t('validation.minLength')} ${v.value.minLength.$params.min}`;
|
|
22
|
+
else if (v.value.url?.$invalid) validationText = `${t('validation.url')}`;
|
|
23
|
+
else if (v.value.regExpValidator?.$invalid) validationText = `${t('validation.regExpValidator')}`;
|
|
24
|
+
else if (v.value.sameAs?.$invalid) validationText = `${t('validation.sameAs')}`;
|
|
25
|
+
else if (v.value.domainValidator?.$invalid) validationText = `${t('validation.domainValidator')}`;
|
|
26
|
+
else if (v.value.decimalValidator?.$invalid) validationText = `${t('validation.decimalValidator')} ${v.value.decimalValidator.$params.count}`;
|
|
27
|
+
else if (v.value.integer?.$invalid) validationText = `${t('validation.integer')}`;
|
|
28
|
+
}
|
|
29
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
30
|
+
for (const { name, text } of customValidators) {
|
|
31
|
+
if (v.value[name]?.$invalid) validationText = text;
|
|
32
|
+
}
|
|
33
|
+
return validationText;
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
isValidation,
|
|
38
|
+
invalid,
|
|
39
|
+
validationText,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -19,21 +19,26 @@ export default {
|
|
|
19
19
|
validationText() {
|
|
20
20
|
let validationText = '';
|
|
21
21
|
if (this.isValidation && this.invalid) {
|
|
22
|
-
if (this.v.required
|
|
23
|
-
else if (this.v.numeric
|
|
24
|
-
else if (this.v.email
|
|
25
|
-
else if (this.v.gatewayHostValidator
|
|
26
|
-
else if (this.v.ipValidator
|
|
27
|
-
else if (this.v.macValidator
|
|
28
|
-
else if (this.v.minValue
|
|
29
|
-
else if (this.v.maxValue
|
|
30
|
-
else if (this.v.sipAccountValidator
|
|
31
|
-
else if (this.v.minLength
|
|
32
|
-
else if (this.v.url
|
|
22
|
+
if (this.v.required?.$invalid) validationText = this.$t('validation.required');
|
|
23
|
+
else if (this.v.numeric?.$invalid) validationText = this.$t('validation.numeric');
|
|
24
|
+
else if (this.v.email?.$invalid) validationText = this.$t('validation.email');
|
|
25
|
+
else if (this.v.gatewayHostValidator?.$invalid) validationText = this.$t('validation.gatewayHostValidator');
|
|
26
|
+
else if (this.v.ipValidator?.$invalid) validationText = this.$t('validation.ipValidator');
|
|
27
|
+
else if (this.v.macValidator?.$invalid) validationText = this.$t('validation.macValidator');
|
|
28
|
+
else if (this.v.minValue?.$invalid) validationText = `${this.$t('validation.minValue')} ${this.v.minValue.$params.min}`;
|
|
29
|
+
else if (this.v.maxValue?.$invalid) validationText = `${this.$t('validation.maxValue')} ${this.v.maxValue.$params.max}`;
|
|
30
|
+
else if (this.v.sipAccountValidator?.$invalid) validationText = this.$t('validation.sipAccountValidator');
|
|
31
|
+
else if (this.v.minLength?.$invalid) validationText = `${this.$t('validation.minLength')} ${this.v.minLength.$params.min}`;
|
|
32
|
+
else if (this.v.url?.$invalid) validationText = `${this.$t('validation.url')}`;
|
|
33
|
+
else if (this.v.regExpValidator?.$invalid) validationText = `${this.$t('validation.regExpValidator')}`;
|
|
34
|
+
else if (this.v.sameAs?.$invalid) validationText = `${this.$t('validation.sameAs')}`;
|
|
35
|
+
else if (this.v.domainValidator?.$invalid) validationText = `${this.$t('validation.domainValidator')}`;
|
|
36
|
+
else if (this.v.decimalValidator?.$invalid) validationText = `${this.$t('validation.decimalValidator')} ${this.v.decimalValidator.$params.count}`;
|
|
37
|
+
else if (this.v.integer?.$invalid) validationText = `${this.$t('validation.integer')}`;
|
|
33
38
|
}
|
|
34
39
|
// eslint-disable-next-line no-restricted-syntax
|
|
35
40
|
for (const { name, text } of this.customValidators) {
|
|
36
|
-
if (this.v[name]
|
|
41
|
+
if (this.v[name]?.$invalid) validationText = text;
|
|
37
42
|
}
|
|
38
43
|
return validationText;
|
|
39
44
|
},
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AgentServiceApiFactory } from 'webitel-sdk';
|
|
2
|
+
|
|
3
|
+
const AgentStatusAPIFactory = ({ instance, OpenAPIConfig }) => {
|
|
4
|
+
const service = new AgentServiceApiFactory(OpenAPIConfig, '', instance);
|
|
5
|
+
|
|
6
|
+
const patchAgentStatus = async ({ agentId, status, pauseCause }) => {
|
|
7
|
+
try {
|
|
8
|
+
const res = await service.updateAgentStatus(agentId, {
|
|
9
|
+
status,
|
|
10
|
+
id: agentId,
|
|
11
|
+
payload: pauseCause,
|
|
12
|
+
});
|
|
13
|
+
return { success: !!res };
|
|
14
|
+
} catch (err) {
|
|
15
|
+
throw err;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
patch: patchAgentStatus,
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default AgentStatusAPIFactory;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AgentServiceApiFactory } from 'webitel-sdk';
|
|
2
|
+
import applyTransform, {
|
|
3
|
+
merge, mergeEach, notify,
|
|
4
|
+
snakeToCamel,
|
|
5
|
+
} from '../../../api/transformers';
|
|
6
|
+
import { getDefaultGetListResponse } from '../../../api/defaults';
|
|
7
|
+
|
|
8
|
+
const PauseCauseAPIFactory = ({ instance, OpenAPIConfig }) => {
|
|
9
|
+
|
|
10
|
+
const service = new AgentServiceApiFactory(OpenAPIConfig, '', instance);
|
|
11
|
+
|
|
12
|
+
const getList = async ({ agentId }) => {
|
|
13
|
+
const defaultObject = {
|
|
14
|
+
name: '',
|
|
15
|
+
durationMin: 0,
|
|
16
|
+
limitMin: 0,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const allowChange = true;
|
|
20
|
+
try {
|
|
21
|
+
const response = await service.searchPauseCauseForAgent(
|
|
22
|
+
agentId,
|
|
23
|
+
allowChange,
|
|
24
|
+
);
|
|
25
|
+
const { items, next } = applyTransform(response.data, [
|
|
26
|
+
snakeToCamel(),
|
|
27
|
+
merge(getDefaultGetListResponse()),
|
|
28
|
+
]);
|
|
29
|
+
return {
|
|
30
|
+
items: applyTransform(items, [
|
|
31
|
+
mergeEach(defaultObject),
|
|
32
|
+
]),
|
|
33
|
+
next,
|
|
34
|
+
};
|
|
35
|
+
} catch (err) {
|
|
36
|
+
throw applyTransform(err, [
|
|
37
|
+
notify,
|
|
38
|
+
]);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
getList,
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default PauseCauseAPIFactory;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { shallowMount, mount } from '@vue/test-utils';
|
|
2
|
+
import { createStore } from 'vuex';
|
|
3
|
+
import AgentStatus from '../../../../enums/AgentStatus/AgentStatus.enum';
|
|
4
|
+
import * as AgentStatusAPIFactory from '../../api/agent-status';
|
|
5
|
+
import * as PauseCauseAPIFactory from '../../api/pause-cause';
|
|
6
|
+
import WtCcAgentStatusSelect from '../wt-cc-agent-status-select.vue';
|
|
7
|
+
|
|
8
|
+
const pauseCauses = [{ name: 'jest1' }, { name: 'jest2' }];
|
|
9
|
+
const getAgentPauseCausesMock = jest.fn(() => ({ items: pauseCauses }));
|
|
10
|
+
// https://stackoverflow.com/a/63727813
|
|
11
|
+
jest.spyOn(PauseCauseAPIFactory, 'default').mockImplementation(() => ({ getList: getAgentPauseCausesMock }));
|
|
12
|
+
|
|
13
|
+
const agentStatusMock = jest.fn(() => {});
|
|
14
|
+
// https://stackoverflow.com/a/63727813
|
|
15
|
+
jest.spyOn(AgentStatusAPIFactory, 'default').mockImplementation(() => ({ patch: agentStatusMock }));
|
|
16
|
+
|
|
17
|
+
const agent = {
|
|
18
|
+
status: '',
|
|
19
|
+
agentId: 1,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const mountOptions = {
|
|
23
|
+
props: {
|
|
24
|
+
agentId: agent.agentId,
|
|
25
|
+
status: agent.status,
|
|
26
|
+
},
|
|
27
|
+
global: {
|
|
28
|
+
plugins: [createStore({})],
|
|
29
|
+
},
|
|
30
|
+
shallow: true,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
describe('Wt Cc Agent Status Select', () => {
|
|
34
|
+
beforeEach(() => {
|
|
35
|
+
getAgentPauseCausesMock.mockClear();
|
|
36
|
+
});
|
|
37
|
+
it('renders a component', () => {
|
|
38
|
+
const wrapper = shallowMount(WtCcAgentStatusSelect, mountOptions);
|
|
39
|
+
expect(wrapper.exists())
|
|
40
|
+
.toBe(true);
|
|
41
|
+
});
|
|
42
|
+
it(`at wt-status-select "change" to "online" event, triggers agent status patch
|
|
43
|
+
with "online" status`, () => {
|
|
44
|
+
const wrapper = shallowMount(WtCcAgentStatusSelect, mountOptions);
|
|
45
|
+
wrapper.findComponent({ name: 'wt-status-select' })
|
|
46
|
+
.vm.$emit('change', AgentStatus.ONLINE);
|
|
47
|
+
const reqPayload = {
|
|
48
|
+
status: AgentStatus.ONLINE, agentId: agent.agentId, payload: undefined,
|
|
49
|
+
};
|
|
50
|
+
expect(agentStatusMock).toHaveBeenCalledWith(reqPayload);
|
|
51
|
+
});
|
|
52
|
+
it('at wt-status-select "change" to "pause" event, pause causes are loaded', async () => {
|
|
53
|
+
const wrapper = shallowMount(WtCcAgentStatusSelect, mountOptions);
|
|
54
|
+
wrapper.findComponent({ name: 'wt-status-select' })
|
|
55
|
+
.vm.$emit('change', AgentStatus.PAUSE);
|
|
56
|
+
await wrapper.vm.$nextTick();
|
|
57
|
+
expect(getAgentPauseCausesMock).toHaveBeenCalled();
|
|
58
|
+
});
|
|
59
|
+
it(`at wt-status-select "change" to "pause" event and pause causes truthy response,
|
|
60
|
+
pause-cause-popup appears`, async () => {
|
|
61
|
+
const wrapper = mount(WtCcAgentStatusSelect, mountOptions);
|
|
62
|
+
wrapper.findComponent({ name: 'wt-status-select' })
|
|
63
|
+
.vm.$emit('change', AgentStatus.PAUSE);
|
|
64
|
+
await wrapper.vm.$nextTick(); // load pause causes
|
|
65
|
+
await wrapper.vm.$nextTick();
|
|
66
|
+
await wrapper.vm.$nextTick(); // render popup
|
|
67
|
+
expect(wrapper.findComponent({ name: 'pause-cause-popup' }).isVisible()).toBe(true);
|
|
68
|
+
});
|
|
69
|
+
it(`at pause-cause-popup "change" event, triggers patch agent status
|
|
70
|
+
with "pause" status and passed pauseCause`, async () => {
|
|
71
|
+
const pauseCause = 'jest';
|
|
72
|
+
const wrapper = mount(WtCcAgentStatusSelect, mountOptions);
|
|
73
|
+
wrapper.vm.openPauseCausePopup();
|
|
74
|
+
await wrapper.vm.$nextTick();
|
|
75
|
+
await wrapper.vm.$nextTick();
|
|
76
|
+
wrapper.findComponent({ name: 'pause-cause-popup' })
|
|
77
|
+
.vm.$emit('change', pauseCause);
|
|
78
|
+
const reqPayload = {
|
|
79
|
+
status: AgentStatus.PAUSE, agentId: agent.agentId, pauseCause,
|
|
80
|
+
};
|
|
81
|
+
expect(agentStatusMock).toHaveBeenCalledWith(reqPayload);
|
|
82
|
+
});
|
|
83
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { shallowMount, mount } from '@vue/test-utils';
|
|
2
|
+
import WtCcPauseCausePopup from '../_internals/wt-cc-pause-cause-popup.vue';
|
|
3
|
+
|
|
4
|
+
describe('Pause cause popup', () => {
|
|
5
|
+
it('renders a component', () => {
|
|
6
|
+
const wrapper = shallowMount(WtCcPauseCausePopup);
|
|
7
|
+
expect(wrapper.exists())
|
|
8
|
+
.toBe(true);
|
|
9
|
+
});
|
|
10
|
+
it('at option input event, sets "selected" its value', () => {
|
|
11
|
+
const value = 'jest';
|
|
12
|
+
const wrapper = mount(WtCcPauseCausePopup, {
|
|
13
|
+
props: { options: [{ value }] },
|
|
14
|
+
});
|
|
15
|
+
wrapper.findComponent({ name: 'wt-radio' }).vm.$emit('input');
|
|
16
|
+
expect(wrapper.vm.selected.value).toEqual(value);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wt-popup
|
|
3
|
+
class="wt-cc-pause-cause-popup"
|
|
4
|
+
min-width="480"
|
|
5
|
+
@close="close"
|
|
6
|
+
>
|
|
7
|
+
<template v-slot:title>
|
|
8
|
+
{{ $t('webitelUI.agentStatusSelect.pauseCausePopup.title') }}
|
|
9
|
+
</template>
|
|
10
|
+
<template v-slot:main>
|
|
11
|
+
<form @submit.prevent="setPause">
|
|
12
|
+
<ul>
|
|
13
|
+
<li
|
|
14
|
+
class="wt-cc-pause-cause-popup-option"
|
|
15
|
+
v-for="(option) of pauseCause"
|
|
16
|
+
:key="option.id"
|
|
17
|
+
>
|
|
18
|
+
<wt-radio
|
|
19
|
+
class="wt-cc-pause-cause-popup-option__radio"
|
|
20
|
+
:selected="selected.id"
|
|
21
|
+
:value="option.id"
|
|
22
|
+
:label="option.name"
|
|
23
|
+
@input="select(option)"
|
|
24
|
+
></wt-radio>
|
|
25
|
+
<div class="wt-cc-pause-cause-popup-option__limits-wrapper">
|
|
26
|
+
<span
|
|
27
|
+
:class="{
|
|
28
|
+
'wt-cc-pause-cause-popup-option__duration--overflow': option.isOverflow,
|
|
29
|
+
}"
|
|
30
|
+
>
|
|
31
|
+
{{ option.duration }}
|
|
32
|
+
</span>
|
|
33
|
+
/
|
|
34
|
+
<span>{{ option.limit }}</span>
|
|
35
|
+
</div>
|
|
36
|
+
</li>
|
|
37
|
+
</ul>
|
|
38
|
+
</form>
|
|
39
|
+
</template>
|
|
40
|
+
<template v-slot:actions>
|
|
41
|
+
<wt-button
|
|
42
|
+
:disabled="!selected"
|
|
43
|
+
@click="setPause"
|
|
44
|
+
>{{ $t('reusable.ok') }}
|
|
45
|
+
</wt-button>
|
|
46
|
+
<wt-button
|
|
47
|
+
color="secondary"
|
|
48
|
+
@click="close"
|
|
49
|
+
>{{ $t('reusable.cancel') }}
|
|
50
|
+
</wt-button>
|
|
51
|
+
</template>
|
|
52
|
+
</wt-popup>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script setup>
|
|
56
|
+
import { computed, ref, toRef } from 'vue';
|
|
57
|
+
import { useI18n } from 'vue-i18n';
|
|
58
|
+
import { useRepresentableAgentPauseCause } from '../../../../composables/useRepresentableAgentPauseCause/useRepresentableAgentPauseCause';
|
|
59
|
+
|
|
60
|
+
const props = defineProps({
|
|
61
|
+
options: {
|
|
62
|
+
type: Array,
|
|
63
|
+
default: () => [],
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const emit = defineEmits(['change', 'close']);
|
|
68
|
+
|
|
69
|
+
const options = toRef(props, 'options');
|
|
70
|
+
|
|
71
|
+
const selected = ref('');
|
|
72
|
+
|
|
73
|
+
const { t } = useI18n();
|
|
74
|
+
|
|
75
|
+
const { representablePauseCause } = useRepresentableAgentPauseCause(options);
|
|
76
|
+
|
|
77
|
+
const pauseCause = computed(() => representablePauseCause.value.map((cause) => ({
|
|
78
|
+
...cause,
|
|
79
|
+
duration: cause.isOverflow
|
|
80
|
+
? `-${cause.durationMin - cause.limitMin} ${t('webitelUI.agentStatusSelect.pauseCausePopup.min')}`
|
|
81
|
+
: `${cause.durationMin} ${t('webitelUI.agentStatusSelect.pauseCausePopup.min')}`,
|
|
82
|
+
limit: cause.limitMin
|
|
83
|
+
? `${cause.limitMin} ${t('webitelUI.agentStatusSelect.pauseCausePopup.min')}`
|
|
84
|
+
: t('webitelUI.agentStatusSelect.pauseCausePopup.unlimited'),
|
|
85
|
+
})));
|
|
86
|
+
|
|
87
|
+
function select(option) {
|
|
88
|
+
selected.value = option;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function close() {
|
|
92
|
+
emit('close');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function setPause() {
|
|
96
|
+
emit('change', selected.value.name);
|
|
97
|
+
close();
|
|
98
|
+
}
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
<style lang="scss" scoped>
|
|
102
|
+
.wt-cc-pause-cause-popup-option {
|
|
103
|
+
display: flex;
|
|
104
|
+
justify-content: space-between;
|
|
105
|
+
align-items: center;
|
|
106
|
+
|
|
107
|
+
&:not(:last-child) {
|
|
108
|
+
margin-bottom: var(--spacing-sm);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.wt-cc-pause-cause-popup-option__limits-wrapper {
|
|
113
|
+
& > span {
|
|
114
|
+
@extend %typo-caption;
|
|
115
|
+
padding: 6px 10px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.wt-cc-pause-cause-popup-option__duration--overflow {
|
|
119
|
+
color: var(--false-color);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
</style>
|
package/src/modules/AgentStatusSelect/components/_internals/wt-cc-status-select-error-popup.vue
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wt-popup
|
|
3
|
+
class="wt-cc-status-select-error-popup"
|
|
4
|
+
min-width="480"
|
|
5
|
+
@close="close"
|
|
6
|
+
>
|
|
7
|
+
<template v-slot:header>
|
|
8
|
+
{{ $t('webitelUI.agentStatusSelect.statusSelectErrorPopup.title') }}
|
|
9
|
+
</template>
|
|
10
|
+
<template v-slot:main>
|
|
11
|
+
<article class="wt-cc-status-select-error-popup__main-wrapper">
|
|
12
|
+
<wt-icon
|
|
13
|
+
icon="attention"
|
|
14
|
+
color="danger"
|
|
15
|
+
></wt-icon>
|
|
16
|
+
<p class="wt-cc-status-select-error-popup__message">
|
|
17
|
+
{{ $t('webitelUI.agentStatusSelect.statusSelectErrorPopup.message') }}
|
|
18
|
+
</p>
|
|
19
|
+
</article>
|
|
20
|
+
</template>
|
|
21
|
+
<template v-slot:actions>
|
|
22
|
+
<wt-button
|
|
23
|
+
color="secondary"
|
|
24
|
+
@click="close"
|
|
25
|
+
>{{ $t('reusable.ok') }}
|
|
26
|
+
</wt-button>
|
|
27
|
+
</template>
|
|
28
|
+
</wt-popup>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script setup>
|
|
32
|
+
const props = defineProps({
|
|
33
|
+
error: {
|
|
34
|
+
type: Object,
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const emit = defineEmits(['close']);
|
|
40
|
+
|
|
41
|
+
function close() {
|
|
42
|
+
emit('close');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<style lang="scss" scoped>
|
|
48
|
+
.wt-cc-status-select-error-popup__main-wrapper {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
align-items: center;
|
|
53
|
+
gap: var(--spacing-sm);
|
|
54
|
+
}
|
|
55
|
+
</style>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<article class="wt-cc-agent-status-select">
|
|
3
|
+
<wt-status-select
|
|
4
|
+
:status="status"
|
|
5
|
+
:status-duration="statusDuration"
|
|
6
|
+
@change="handleStatusSelectInput"
|
|
7
|
+
></wt-status-select>
|
|
8
|
+
<pause-cause-popup
|
|
9
|
+
v-if="isPauseCausePopup"
|
|
10
|
+
:options="pauseCauses"
|
|
11
|
+
@change="handlePauseCauseInput"
|
|
12
|
+
@close="closePauseCausePopup"
|
|
13
|
+
></pause-cause-popup>
|
|
14
|
+
<status-select-error-popup
|
|
15
|
+
v-if="error"
|
|
16
|
+
:error="error"
|
|
17
|
+
@close="error = null"
|
|
18
|
+
></status-select-error-popup>
|
|
19
|
+
</article>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script setup>
|
|
23
|
+
import { ref } from 'vue';
|
|
24
|
+
import { useStore } from 'vuex';
|
|
25
|
+
import { PauseNotAllowedError } from 'webitel-sdk';
|
|
26
|
+
import AgentStatus from '../../../enums/AgentStatus/AgentStatus.enum';
|
|
27
|
+
import AgentStatusAPIFactory from '../api/agent-status';
|
|
28
|
+
import PauseCauseAPIFactory from '../api/pause-cause';
|
|
29
|
+
import PauseCausePopup from './_internals/wt-cc-pause-cause-popup.vue';
|
|
30
|
+
import StatusSelectErrorPopup from './_internals/wt-cc-status-select-error-popup.vue';
|
|
31
|
+
|
|
32
|
+
const props = defineProps({
|
|
33
|
+
agentId: {
|
|
34
|
+
type: [String, Number],
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
status: {
|
|
38
|
+
// can be undefined, is agent wasn't loaded yet
|
|
39
|
+
default: AgentStatus.OFFLINE,
|
|
40
|
+
},
|
|
41
|
+
statusDuration: {
|
|
42
|
+
type: [Number, String],
|
|
43
|
+
default: 0,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const emit = defineEmits(['changed']);
|
|
48
|
+
|
|
49
|
+
const { api } = useStore().state;
|
|
50
|
+
const AgentStatusAPI = AgentStatusAPIFactory(api);
|
|
51
|
+
const PauseCauseAPI = PauseCauseAPIFactory(api);
|
|
52
|
+
|
|
53
|
+
const isPauseCausePopup = ref(false);
|
|
54
|
+
const pauseCauses = ref([]);
|
|
55
|
+
const error = ref(null);
|
|
56
|
+
|
|
57
|
+
function openPauseCausePopup() {
|
|
58
|
+
isPauseCausePopup.value = true;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function closePauseCausePopup() {
|
|
62
|
+
isPauseCausePopup.value = false;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function loadPauseCauses() {
|
|
66
|
+
const response = await PauseCauseAPI.getList({ agentId: props.agentId });
|
|
67
|
+
pauseCauses.value = response.items;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function updateStatus({ agentId, status, pauseCause }) {
|
|
71
|
+
return AgentStatusAPI.patch({ agentId, status, pauseCause });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async function changeStatus({ status, pauseCause }) {
|
|
75
|
+
try {
|
|
76
|
+
const statusPayload = { agentId: props.agentId, status, pauseCause };
|
|
77
|
+
await updateStatus(statusPayload);
|
|
78
|
+
emit('changed', statusPayload);
|
|
79
|
+
} catch (err) {
|
|
80
|
+
if (err.response.data.id === PauseNotAllowedError.id) error.value = err;
|
|
81
|
+
throw err;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async function handleStatusSelectInput(status) {
|
|
86
|
+
if (status === AgentStatus.PAUSE) {
|
|
87
|
+
await loadPauseCauses();
|
|
88
|
+
if (pauseCauses.value.length) {
|
|
89
|
+
openPauseCausePopup();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (status === props.status) return;
|
|
94
|
+
await changeStatus({ status });
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function handlePauseCauseInput(pauseCause) {
|
|
98
|
+
const status = AgentStatus.PAUSE;
|
|
99
|
+
return changeStatus({ status, pauseCause });
|
|
100
|
+
}
|
|
101
|
+
</script>
|
|
102
|
+
|
|
103
|
+
<style lang="scss" scoped>
|
|
104
|
+
.wt-cc-agent-status-select .wt-status-select {
|
|
105
|
+
width: 150px;
|
|
106
|
+
}
|
|
107
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import AuditFormQuestionReadWrapper from '../audit-form-question-read-wrapper.vue';
|
|
3
|
+
|
|
4
|
+
describe('AuditFormQuestionReadWrapper', () => {
|
|
5
|
+
it('renders a component', () => {
|
|
6
|
+
const wrapper = shallowMount(AuditFormQuestionReadWrapper, {
|
|
7
|
+
props: {
|
|
8
|
+
question: {},
|
|
9
|
+
result: {},
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
expect(wrapper.isVisible()).toBe(true);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { EngineAuditQuestionType } from 'webitel-sdk';
|
|
3
|
+
import {
|
|
4
|
+
generateQuestionOptionsSchema,
|
|
5
|
+
} from '../../schemas/AuditFormQuestionOptionsSchema';
|
|
6
|
+
import AuditFormQuestionWriteWrapper from '../audit-form-question-write-wrapper.vue';
|
|
7
|
+
import { generateQuestionSchema } from '../../schemas/AuditFormQuestionSchema';
|
|
8
|
+
import { generateQuestionScoreSchema } from '../../schemas/AuditFormQuestionScoreSchema';
|
|
9
|
+
|
|
10
|
+
const v = { question: {} };
|
|
11
|
+
|
|
12
|
+
describe('AuditFormQuestionWriteWrapper', () => {
|
|
13
|
+
it('renders a component', () => {
|
|
14
|
+
const wrapper = shallowMount(AuditFormQuestionWriteWrapper, {
|
|
15
|
+
props: {
|
|
16
|
+
question: {},
|
|
17
|
+
v,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
expect(wrapper.isVisible()).toBe(true);
|
|
21
|
+
});
|
|
22
|
+
it('correctly changes question', () => {
|
|
23
|
+
const question = generateQuestionSchema();
|
|
24
|
+
const wrapper = shallowMount(AuditFormQuestionWriteWrapper, {
|
|
25
|
+
props: {
|
|
26
|
+
question,
|
|
27
|
+
v,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
wrapper.findComponent({ name: 'wt-switcher' }).vm.$emit('change', !question.required);
|
|
31
|
+
expect(wrapper.emitted()['change:question'][0][0].required)
|
|
32
|
+
.toBe(!question.required);
|
|
33
|
+
});
|
|
34
|
+
it('correctly changes question type to Score', () => {
|
|
35
|
+
const question = {};
|
|
36
|
+
const wrapper = shallowMount(AuditFormQuestionWriteWrapper, {
|
|
37
|
+
props: {
|
|
38
|
+
question,
|
|
39
|
+
v,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
wrapper.find('.audit-form-question-write-content-question')
|
|
43
|
+
.findComponent({ name: 'wt-select' }).vm.$emit('input', { value: EngineAuditQuestionType.Score });
|
|
44
|
+
expect(wrapper.emitted()['change:question'][0][0])
|
|
45
|
+
.toEqual(generateQuestionScoreSchema());
|
|
46
|
+
});
|
|
47
|
+
it('correctly changes question type to Options', () => {
|
|
48
|
+
const question = {};
|
|
49
|
+
const wrapper = shallowMount(AuditFormQuestionWriteWrapper, {
|
|
50
|
+
props: {
|
|
51
|
+
question,
|
|
52
|
+
v,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
wrapper.find('.audit-form-question-write-content-question')
|
|
56
|
+
.findComponent({ name: 'wt-select' }).vm.$emit('input', { value: EngineAuditQuestionType.Option });
|
|
57
|
+
expect(wrapper.emitted()['change:question'][0][0])
|
|
58
|
+
.toEqual(generateQuestionOptionsSchema());
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import AuditFormQuestion from '../audit-form-question.vue';
|
|
3
|
+
|
|
4
|
+
describe('AuditFormQuestion', () => {
|
|
5
|
+
it('renders a component', () => {
|
|
6
|
+
const wrapper = shallowMount(AuditFormQuestion, {
|
|
7
|
+
props: {
|
|
8
|
+
question: {},
|
|
9
|
+
result: {},
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
expect(wrapper.isVisible()).toBe(true);
|
|
13
|
+
});
|
|
14
|
+
});
|