@webitel/ui-sdk 0.1.2 → 0.1.3-vue3
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 +9 -0
- package/README.md +29 -29
- package/dist/demo.html +1 -10
- package/dist/img/plyr.svg +68 -0
- package/dist/img/sprite/account.svg +4 -0
- package/dist/img/sprite/adfs.svg +5 -0
- package/dist/img/sprite/app-navigator.svg +11 -0
- package/dist/img/sprite/arrow-down.svg +3 -0
- package/dist/img/sprite/arrow-left.svg +3 -0
- package/dist/img/sprite/arrow-right.svg +3 -0
- package/dist/img/sprite/arrow-up.svg +3 -0
- package/dist/img/sprite/attach.svg +3 -0
- package/dist/img/sprite/attention.svg +3 -0
- package/dist/img/sprite/back.svg +4 -0
- package/dist/img/sprite/bell-badged.svg +4 -0
- package/dist/img/sprite/bell.svg +3 -0
- package/dist/img/sprite/bucket.svg +3 -0
- package/dist/img/sprite/calendar.svg +3 -0
- package/dist/img/sprite/call--filled.svg +3 -0
- package/dist/img/sprite/call-add-to--filled.svg +4 -0
- package/dist/img/sprite/call-add-to.svg +4 -0
- package/dist/img/sprite/call-disconnect--filled.svg +3 -0
- package/dist/img/sprite/call-disconnect.svg +3 -0
- package/dist/img/sprite/call-end--filled.svg +3 -0
- package/dist/img/sprite/call-end.svg +3 -0
- package/dist/img/sprite/call-inbound--filled.svg +4 -0
- package/dist/img/sprite/call-inbound.svg +3 -0
- package/dist/img/sprite/call-missed--filled.svg +4 -0
- package/dist/img/sprite/call-missed.svg +3 -0
- package/dist/img/sprite/call-outbound--filled.svg +3 -0
- package/dist/img/sprite/call-outbound.svg +3 -0
- package/dist/img/sprite/call-ringing--filled.svg +5 -0
- package/dist/img/sprite/call-ringing.svg +3 -0
- package/dist/img/sprite/call-transfer--filled.svg +4 -0
- package/dist/img/sprite/call-transfer.svg +3 -0
- package/dist/img/sprite/call.svg +3 -0
- package/dist/img/sprite/chat--filled.svg +3 -0
- package/dist/img/sprite/chat-emoji.svg +3 -0
- package/dist/img/sprite/chat-end--filled.svg +3 -0
- package/dist/img/sprite/chat-end.svg +4 -0
- package/dist/img/sprite/chat-group.svg +5 -0
- package/dist/img/sprite/chat-join.svg +4 -0
- package/dist/img/sprite/chat-message-status-read.svg +3 -0
- package/dist/img/sprite/chat-message-status-sent.svg +3 -0
- package/dist/img/sprite/chat-quick-response--filled.svg +3 -0
- package/dist/img/sprite/chat-quick-response.svg +3 -0
- package/dist/img/sprite/chat-reply.svg +3 -0
- package/dist/img/sprite/chat-send.svg +6 -0
- package/dist/img/sprite/chat-transfer--filled.svg +3 -0
- package/dist/img/sprite/chat-transfer.svg +4 -0
- package/dist/img/sprite/chat.svg +3 -0
- package/dist/img/sprite/checkbox--checked--filled.svg +3 -0
- package/dist/img/sprite/checkbox--checked.svg +3 -0
- package/dist/img/sprite/checkbox.svg +3 -0
- package/dist/img/sprite/clear.svg +3 -0
- package/dist/img/sprite/close--filled.svg +3 -0
- package/dist/img/sprite/close.svg +3 -0
- package/dist/img/sprite/collapse.svg +5 -0
- package/dist/img/sprite/column-select.svg +4 -0
- package/dist/img/sprite/conference.svg +8 -0
- package/dist/img/sprite/contacts.svg +3 -0
- package/dist/img/sprite/copy.svg +3 -0
- package/dist/img/sprite/docs.svg +6 -0
- package/dist/img/sprite/done.svg +4 -0
- package/dist/img/sprite/download.svg +5 -0
- package/dist/img/sprite/edit.svg +3 -0
- package/dist/img/sprite/expand.svg +5 -0
- package/dist/img/sprite/eye--closed.svg +5 -0
- package/dist/img/sprite/eye--opened.svg +4 -0
- package/dist/img/sprite/filter.svg +5 -0
- package/dist/img/sprite/generate.svg +4 -0
- package/dist/img/sprite/google.svg +6 -0
- package/dist/img/sprite/history.svg +4 -0
- package/dist/img/sprite/hold.svg +3 -0
- package/dist/img/sprite/idle.svg +4 -0
- package/dist/img/sprite/index.js +1 -0
- package/dist/img/sprite/instagram.svg +28 -0
- package/dist/img/sprite/job--accept.svg +4 -0
- package/dist/img/sprite/job--end.svg +4 -0
- package/dist/img/sprite/job.svg +5 -0
- package/dist/img/sprite/lock.svg +3 -0
- package/dist/img/sprite/logout.svg +3 -0
- package/dist/img/sprite/mail--color.svg +4 -0
- package/dist/img/sprite/mail.svg +3 -0
- package/dist/img/sprite/menu.svg +3 -0
- package/dist/img/sprite/messenger-facebook--filled.svg +3 -0
- package/dist/img/sprite/messenger-facebook.svg +9 -0
- package/dist/img/sprite/messenger-infobip.svg +5 -0
- package/dist/img/sprite/messenger-messenger.svg +12 -0
- package/dist/img/sprite/messenger-telegram--filled.svg +3 -0
- package/dist/img/sprite/messenger-telegram.svg +10 -0
- package/dist/img/sprite/messenger-viber--filled.svg +3 -0
- package/dist/img/sprite/messenger-viber.svg +3 -0
- package/dist/img/sprite/messenger-web-chat.svg +7 -0
- package/dist/img/sprite/messenger-whatsapp--filled.svg +4 -0
- package/dist/img/sprite/messenger-whatsapp.svg +10 -0
- package/dist/img/sprite/mic-muted.svg +6 -0
- package/dist/img/sprite/mic.svg +4 -0
- package/dist/img/sprite/move.svg +6 -0
- package/dist/img/sprite/note.svg +3 -0
- package/dist/img/sprite/numpad.svg +24 -0
- package/dist/img/sprite/pause.svg +3 -0
- package/dist/img/sprite/pin.svg +3 -0
- package/dist/img/sprite/play.svg +4 -0
- package/dist/img/sprite/plus.svg +3 -0
- package/dist/img/sprite/preview-tag-application.svg +6 -0
- package/dist/img/sprite/preview-tag-audio.svg +4 -0
- package/dist/img/sprite/preview-tag-image.svg +4 -0
- package/dist/img/sprite/preview-tag-video.svg +4 -0
- package/dist/img/sprite/prompter.svg +3 -0
- package/dist/img/sprite/queue-member.svg +3 -0
- package/dist/img/sprite/radio--checked.svg +4 -0
- package/dist/img/sprite/radio.svg +3 -0
- package/dist/img/sprite/rec-off.svg +3 -0
- package/dist/img/sprite/rec.svg +4 -0
- package/dist/img/sprite/refresh.svg +4 -0
- package/dist/img/sprite/rounded-info.svg +3 -0
- package/dist/img/sprite/search.svg +3 -0
- package/dist/img/sprite/send-arrow.svg +4 -0
- package/dist/img/sprite/settings.svg +3 -0
- package/dist/img/sprite/sort-arrow-down.svg +4 -0
- package/dist/img/sprite/sort-arrow-up.svg +4 -0
- package/dist/img/sprite/sound-off.svg +4 -0
- package/dist/img/sprite/sound-on.svg +3 -0
- package/dist/img/sprite/star--filled.svg +3 -0
- package/dist/img/sprite/star.svg +3 -0
- package/dist/img/sprite/stop.svg +4 -0
- package/dist/img/sprite/stt-download.svg +4 -0
- package/dist/img/sprite/stt-search.svg +3 -0
- package/dist/img/sprite/stt.svg +4 -0
- package/dist/img/sprite/telegram-bot.svg +6 -0
- package/dist/img/sprite/tick.svg +3 -0
- package/dist/img/sprite/tts-download.svg +5 -0
- package/dist/img/sprite/unpin.svg +5 -0
- package/dist/img/sprite/upload.svg +5 -0
- package/dist/img/sprite/video-cam-off.svg +4 -0
- package/dist/img/sprite/video-cam.svg +3 -0
- package/dist/img/sprite/zoom-in.svg +3 -0
- package/dist/img/sprite/zoom-out.svg +4 -0
- package/dist/ui-sdk.common.js +18534 -0
- package/dist/ui-sdk.common.js.map +1 -0
- package/dist/ui-sdk.css +1 -0
- package/dist/ui-sdk.umd.js +18553 -0
- package/dist/ui-sdk.umd.js.map +1 -0
- package/dist/ui-sdk.umd.min.js +12 -0
- package/dist/ui-sdk.umd.min.js.map +1 -0
- package/package.json +79 -44
- package/src/components/atoms/wt-avatar/__tests__/wt-avatar.spec.js +9 -0
- package/src/components/atoms/wt-avatar/wt-avatar.vue +102 -0
- package/src/components/atoms/wt-badge/__tests__/wt-badge.spec.js +9 -0
- package/src/components/atoms/wt-badge/wt-badge.vue +44 -7
- package/src/components/atoms/wt-button/__tests__/WtButton.spec.js +29 -0
- package/src/components/atoms/wt-button/wt-button.vue +226 -140
- package/src/components/atoms/wt-chip/__tests__/WtChip.spec.js +19 -0
- package/src/components/atoms/wt-chip/wt-chip.vue +23 -0
- package/src/components/atoms/wt-context-menu/__tests__/WtContextMenu.spec.js +9 -0
- package/src/components/atoms/wt-context-menu/wt-context-menu.vue +105 -0
- package/src/components/atoms/wt-divider/__tests__/WtDivider.spec.js +9 -0
- package/src/components/atoms/wt-divider/wt-divider.vue +2 -1
- package/src/components/atoms/wt-icon/__tests__/WtIcon.spec.js +24 -0
- package/src/components/atoms/wt-icon/wt-icon.vue +133 -482
- package/src/components/atoms/wt-indicator/__tests__/WtIndicator.spec.js +29 -0
- package/src/components/atoms/wt-indicator/wt-indicator.vue +119 -0
- package/src/components/atoms/wt-input-info/__tests__/WtInputInfo.spec.js +9 -0
- package/src/components/atoms/wt-input-info/wt-input-info.vue +2 -1
- package/src/components/atoms/wt-loader/__tests__/WtLoader.spec.js +9 -0
- package/src/components/atoms/wt-loader/_internals/wt-loader--md.vue +83 -0
- package/src/components/atoms/wt-loader/_internals/wt-loader--sm.vue +73 -0
- package/src/components/atoms/wt-loader/wt-loader.vue +21 -73
- package/src/components/atoms/wt-rounded-action/__tests__/WtRoundedAction.spec.js +9 -0
- package/src/components/atoms/wt-rounded-action/wt-rounded-action.vue +156 -0
- package/src/components/atoms/wt-tooltip/__tests__/WtTooltip.spec.js +30 -0
- package/src/components/atoms/wt-tooltip/wt-tooltip.vue +35 -41
- package/src/components/index.js +57 -7
- package/src/components/molecules/wt-button-select/__tests__/WtButtonSelect.spec.js +29 -0
- package/src/components/molecules/wt-button-select/wt-button-select.vue +184 -0
- package/src/components/molecules/wt-checkbox/__tests__/WtCheckbox.spec.js +41 -0
- package/src/components/molecules/wt-checkbox/wt-checkbox.vue +24 -12
- package/src/components/molecules/wt-copy-action/__tests__/WtCopyAction.spec.js +14 -0
- package/src/components/molecules/wt-copy-action/wt-copy-action.vue +63 -0
- package/src/components/molecules/wt-datepicker/__tests__/WtDatepicker.spec.js +28 -0
- package/src/components/molecules/wt-datepicker/wt-datepicker.vue +156 -153
- package/src/components/molecules/wt-datetimepicker/__tests__/WtDatetimepicker.spec.js +79 -0
- package/src/components/molecules/wt-datetimepicker/wt-datetimepicker.vue +79 -85
- package/src/components/molecules/wt-hint/__tests__/WtHint.spec.js +9 -0
- package/src/components/molecules/wt-hint/wt-hint.vue +21 -0
- package/src/components/molecules/wt-icon-btn/__tests__/WtIconBtn.spec.js +15 -0
- package/src/components/molecules/wt-icon-btn/wt-icon-btn.vue +59 -53
- package/src/components/molecules/wt-input/__tests__/WtInput.spec.js +25 -0
- package/src/components/molecules/wt-input/wt-input.vue +248 -225
- package/src/components/molecules/wt-label/__tests__/WtLabel.spec.js +9 -0
- package/src/components/molecules/wt-label/mixins/labelUsageMixin.js +21 -0
- package/src/components/molecules/wt-label/wt-label.vue +72 -0
- package/src/components/molecules/wt-load-bar/__tests__/WtLoadBar.spec.js +9 -0
- package/src/components/molecules/wt-load-bar/wt-load-bar.vue +50 -0
- package/src/components/molecules/wt-notification/__tests__/WtNotification.spec.js +21 -0
- package/src/components/molecules/wt-notification/wt-notification.vue +12 -11
- package/src/components/molecules/wt-popup/__tests__/WtPopup.spec.js +47 -0
- package/src/components/molecules/wt-popup/wt-popup.vue +104 -60
- package/src/components/molecules/wt-progress-bar/__tests__/WtProgressBar.spec.js +17 -0
- package/src/components/molecules/wt-progress-bar/wt-progress-bar.vue +79 -0
- package/src/components/molecules/wt-radio/__tests__/WtRadio.spec.js +42 -0
- package/src/components/molecules/wt-radio/wt-radio.vue +9 -7
- package/src/components/molecules/wt-search-bar/__tests__/WtSearchBar.spec.js +35 -0
- package/src/components/molecules/wt-search-bar/wt-search-bar.vue +91 -83
- package/src/components/molecules/wt-select/__tests__/WtSelect.spec.js +27 -0
- package/src/components/molecules/wt-select/mixins/__tests__/multiselectMixin.spec.js +32 -0
- package/src/components/molecules/wt-select/mixins/multiselectMixin.js +146 -0
- package/src/components/molecules/wt-select/wt-select.vue +211 -331
- package/src/components/molecules/wt-slider/__tests__/WtSlider.spec.js +9 -0
- package/src/components/molecules/wt-slider/wt-slider.vue +174 -0
- package/src/components/molecules/wt-switcher/__tests__/WtSwitcher.spec.js +31 -0
- package/src/components/molecules/wt-switcher/wt-switcher.vue +47 -22
- package/src/components/molecules/wt-tabs/__tests__/WtTabs.spec.js +36 -0
- package/src/components/molecules/wt-tabs/wt-tabs.vue +74 -82
- package/src/components/molecules/wt-tags-input/__tests__/WtTagsInput.spec.js +42 -0
- package/src/components/molecules/wt-tags-input/wt-tags-input.vue +215 -0
- package/src/components/molecules/wt-textarea/__tests__/WtTextarea.spec.js +46 -0
- package/src/components/molecules/wt-textarea/wt-textarea.vue +114 -40
- package/src/components/molecules/wt-time-input/__tests__/WtTimeInput.spec.js +25 -0
- package/src/components/molecules/wt-time-input/wt-time-input.vue +55 -6
- package/src/components/molecules/wt-timepicker/__tests__/WtTimepicker.spec.js +60 -0
- package/src/components/molecules/wt-timepicker/wt-timepicker.vue +148 -85
- package/src/components/organisms/wt-app-header/__tests__/WtAppHeader.spec.js +19 -0
- package/src/components/organisms/wt-app-header/__tests__/WtAppNavigator.spec.js +23 -0
- package/src/components/organisms/wt-app-header/__tests__/WtHeaderActions.spec.js +21 -0
- package/src/components/organisms/wt-app-header/wt-app-header.vue +24 -0
- package/src/components/organisms/wt-app-header/wt-app-navigator.vue +249 -0
- package/src/components/organisms/wt-app-header/wt-header-actions.vue +183 -0
- package/src/components/organisms/wt-error-page/__tests__/wt-error-page.spec.js +17 -0
- package/src/components/organisms/wt-error-page/wt-error-page.vue +104 -0
- package/src/components/organisms/wt-filters-panel-wrapper/__tests__/wt-filters-panel-wrapper.spec.js +24 -0
- package/src/components/organisms/wt-filters-panel-wrapper/wt-filters-panel-wrapper.vue +146 -0
- package/src/components/organisms/wt-headline/__tests__/WtHeadline.spec.js +47 -0
- package/src/components/organisms/wt-headline/wt-headline.vue +45 -0
- package/src/components/organisms/wt-headline-nav/__tests__/wt-headline-nav.spec.js +13 -0
- package/src/components/organisms/wt-headline-nav/wt-headline-nav.vue +85 -0
- package/src/components/organisms/wt-navigation-bar/__tests__/WtNavigationBar.spec.js +64 -0
- package/src/components/organisms/wt-navigation-bar/wt-navigation-bar.vue +271 -0
- package/src/components/organisms/wt-notifications-bar/__tests__/WtNotificationsBar.spec.js +50 -0
- package/src/components/organisms/wt-notifications-bar/wt-notifications-bar.vue +71 -0
- package/src/components/organisms/wt-page-wrapper/__tests__/WtPageWrapper.spec.js +33 -0
- package/src/components/organisms/wt-page-wrapper/wt-page-wrapper.vue +52 -0
- package/src/components/organisms/wt-pagination/__tests__/WtPagination.spec.js +37 -0
- package/src/components/organisms/wt-pagination/wt-pagination.vue +108 -88
- package/src/components/organisms/wt-player/__tests__/WtPlayer.spec.js +9 -0
- package/src/components/organisms/wt-player/wt-player.vue +203 -0
- package/src/components/organisms/wt-status-select/__tests__/WtStatusSelect.spec.js +25 -0
- package/src/components/organisms/wt-status-select/_internals/StatusOptions.lookup.js +24 -0
- package/src/components/organisms/wt-status-select/wt-status-select.vue +130 -0
- package/src/components/organisms/wt-table/__tests__/WtTable.spec.js +134 -0
- package/src/components/organisms/wt-table/__tests__/WtTableDeleteAction.spec.js +9 -0
- package/src/components/organisms/wt-table/__tests__/WtTableEditAction.spec.js +9 -0
- package/src/components/organisms/wt-table/_internals/getSortOrder.js +12 -0
- package/src/components/organisms/wt-table/table-cells/wt-table-delete-action.vue +21 -0
- package/src/components/organisms/wt-table/table-cells/wt-table-edit-action.vue +22 -0
- package/src/components/organisms/wt-table/wt-table.vue +252 -0
- package/src/components/organisms/wt-table-actions/__tests__/WtTableActions.spec.js +9 -0
- package/src/components/organisms/wt-table-actions/wt-table-actions.vue +105 -0
- package/src/components/organisms/wt-table-column-select/__tests__/WtTableColumnSelect.spec.js +31 -0
- package/src/components/organisms/wt-table-column-select/wt-table-column-select.vue +120 -0
- package/src/components/transitions/__tests__/ExpandTransition.spec.js +9 -0
- package/src/components/transitions/wt-expand-transition.vue +70 -0
- package/src/css/components/_components.scss +45 -25
- package/src/css/components/atoms/wt-avatar/_variables.scss +14 -0
- package/src/css/components/atoms/wt-badge/_variables.scss +3 -6
- package/src/css/components/atoms/wt-button/_variables.scss +47 -47
- package/src/css/components/atoms/wt-chip/_variables.scss +7 -0
- package/src/css/components/atoms/wt-chip/wt-chip.scss +41 -0
- package/src/css/components/atoms/wt-context-menu/_variables.scss +7 -0
- package/src/css/components/atoms/wt-divider/_variables.scss +4 -4
- package/src/css/components/atoms/wt-icon/_variables.scss +7 -28
- package/src/css/components/atoms/wt-indicator/_variables.scss +22 -0
- package/src/css/components/atoms/wt-input-info/_variables.scss +6 -5
- package/src/css/components/atoms/wt-label/_variables.scss +3 -4
- package/src/css/components/atoms/wt-loader/_variables.scss +7 -7
- package/src/css/components/atoms/wt-rounded-action/_variables.scss +7 -0
- package/src/css/components/atoms/wt-tooltip/_variables.scss +29 -10
- package/src/css/components/molecules/wt-button-select/_variables.scss +18 -0
- package/src/css/components/molecules/wt-checkbox/_variables.scss +3 -3
- package/src/css/components/molecules/wt-datepicker/_variables.scss +21 -20
- package/src/css/components/molecules/wt-datepicker/datepicker-calendar.scss +90 -100
- package/src/css/components/molecules/wt-datetimepicker/_variables.scss +11 -12
- package/src/css/components/molecules/wt-icon-btn/_variables.scss +2 -2
- package/src/css/components/molecules/wt-input/_variables.scss +7 -5
- package/src/css/components/molecules/wt-load-bar/_variables.scss +6 -0
- package/src/css/components/molecules/wt-notification/_variables.scss +9 -9
- package/src/css/components/molecules/wt-popup/_variables.scss +20 -11
- package/src/css/components/molecules/wt-progress-bar/_variables.scss +11 -0
- package/src/css/components/molecules/wt-radio/_variables.scss +6 -6
- package/src/css/components/molecules/wt-search-bar/_variables.scss +7 -3
- package/src/css/components/molecules/wt-select/_multiselect.scss +198 -0
- package/src/css/components/molecules/wt-select/_variables.scss +14 -23
- package/src/css/components/molecules/wt-slider/_variables.scss +15 -0
- package/src/css/components/molecules/wt-switcher/_variables.scss +17 -14
- package/src/css/components/molecules/wt-tabs/_variables.scss +14 -14
- package/src/css/components/molecules/wt-tags-input/_variables.scss +24 -0
- package/src/css/components/molecules/wt-textarea/_variables.scss +5 -5
- package/src/css/components/molecules/wt-timepicker/_variables.scss +4 -3
- package/src/css/components/organisms/wt-app-header/_variables.scss +24 -0
- package/src/css/components/organisms/wt-headline/_variables.scss +6 -0
- package/src/css/components/organisms/wt-headline-nav/_variables.scss +5 -0
- package/src/css/components/organisms/wt-navigation-bar/_variables.scss +16 -0
- package/src/css/components/organisms/wt-notifications-bar/_variables.scss +7 -0
- package/src/css/components/organisms/wt-page-wrapper/_variables.scss +5 -0
- package/src/css/components/organisms/wt-pagination/_variables.scss +4 -6
- package/src/css/components/organisms/wt-player/_variables.scss +8 -0
- package/src/css/components/organisms/wt-status-select/_variables.scss +6 -0
- package/src/css/components/organisms/wt-table/_variables.scss +16 -0
- package/src/css/components/organisms/wt-table-actions/_variables.scss +5 -0
- package/src/css/main.scss +75 -69
- package/src/css/styleguide/_styleguide.scss +9 -0
- package/src/css/styleguide/border-radius/_border-radius.scss +4 -0
- package/src/css/styleguide/colors/_colors.scss +150 -0
- package/src/css/styleguide/display-helpers/_display-helpers.scss +23 -0
- package/src/css/styleguide/elevations/_elevations.scss +13 -0
- package/src/css/styleguide/fonts/_fonts.scss +126 -0
- package/src/css/styleguide/placeholder/_placeholder.scss +49 -0
- package/src/css/styleguide/scroll.scss +43 -40
- package/src/css/styleguide/spacings/_spacings.scss +15 -0
- package/src/css/styleguide/transitions/_transitions.scss +1 -0
- package/src/css/styleguide/transitions/fade/_fade.scss +8 -0
- package/src/css/styleguide/typography/_typography.scss +113 -0
- package/src/css/styleguide/viewport-breakpoints/_viewport-breakpoints.scss +25 -0
- package/src/enums/AbstractUserStatus/AbstractUserStatus.enum.js +8 -0
- package/src/enums/AgentStatus/AgentStatus.enum.js +6 -0
- package/src/enums/WebitelApplications/AdminSections.enum.js +46 -0
- package/src/enums/WebitelApplications/SupervisorSections.enum.js +7 -0
- package/src/enums/WebitelApplications/WebitelApplications.enum.js +10 -0
- package/src/locale/en/en.js +250 -0
- package/src/locale/i18n.js +5 -5
- package/src/locale/ru/ru.js +248 -2
- package/src/locale/ua/ua.js +273 -0
- package/src/mixins/dataFilterMixins/__tests__/apiFilterMixin.spec.js +57 -0
- package/src/mixins/dataFilterMixins/__tests__/enumFilterMixin.spec.js +66 -0
- package/src/mixins/dataFilterMixins/__tests__/paginationFilterMixin.spec.js +93 -0
- package/src/mixins/dataFilterMixins/__tests__/sortFilterMixin.spec.js +60 -0
- package/src/mixins/dataFilterMixins/__tests__/urlControllerMixin.spec.js +48 -0
- package/src/mixins/dataFilterMixins/_urlControllerMixin/_urlControllerMixin.js +37 -0
- package/src/mixins/dataFilterMixins/apiFilterMixin.js +23 -0
- package/src/mixins/dataFilterMixins/baseFilterMixin/baseFilterMixin.js +29 -0
- package/src/mixins/dataFilterMixins/enumFilterMixin.js +30 -0
- package/src/mixins/dataFilterMixins/paginationFilterMixin.js +79 -0
- package/src/mixins/dataFilterMixins/sortFilterMixin.js +75 -0
- package/src/mixins/validationMixin/__tests__/validationMixin.spec.js +47 -0
- package/src/mixins/validationMixin/validationMixin.js +21 -10
- package/src/modules/CSVExport/CSVExport.js +89 -0
- package/src/modules/CSVExport/__tests__/CSVExport.spec.js +63 -0
- package/src/modules/CSVExport/mixins/exportCSVMixin.js +46 -0
- package/src/modules/FilesExport/FilesExport.js +110 -0
- package/src/modules/FilesExport/__tests__/FilesExport.spec.js +66 -0
- package/src/modules/FilesExport/mixins/exportFilesMixin.js +46 -0
- package/src/modules/FilesExport/scripts/generateMediaURL.js +7 -0
- package/src/modules/Notifications/assets/audio/end-chat.wav +0 -0
- package/src/modules/Notifications/assets/audio/new-chat.wav +0 -0
- package/src/modules/Notifications/assets/audio/new-message.wav +0 -0
- package/src/modules/Notifications/assets/audio/ringing.mp3 +0 -0
- package/src/modules/Notifications/assets/img/notification-icon.png +0 -0
- package/src/modules/Notifications/store/NotificationsStoreModule.js +185 -0
- package/src/modules/Notifications/store/__tests__/NotificationsStoreModule.actions.spec.js +130 -0
- package/src/modules/Notifications/store/__tests__/NotificationsStoreModule.mutations.spec.js +49 -0
- package/src/modules/QueryFilters/api/__tests__/defaults.spec.js +18 -0
- package/src/modules/QueryFilters/api/defaults.js +16 -0
- package/src/modules/QueryFilters/classes/ApiFilterSchema.js +32 -0
- package/src/modules/QueryFilters/classes/BaseFilterSchema.js +6 -0
- package/src/modules/QueryFilters/classes/EnumFilterSchema.js +23 -0
- package/src/modules/QueryFilters/classes/__tests__/ApiFilterSchema.spec.js +25 -0
- package/src/modules/QueryFilters/components/__tests__/abstract-api-filter.spec.js +54 -0
- package/src/modules/QueryFilters/components/__tests__/abstract-enum-filter.spec.js +40 -0
- package/src/modules/QueryFilters/components/__tests__/filter-datetime.spec.js +49 -0
- package/src/modules/QueryFilters/components/__tests__/filter-from-to.spec.js +65 -0
- package/src/modules/QueryFilters/components/__tests__/filter-search.spec.js +49 -0
- package/src/modules/QueryFilters/components/abstract-api-filter.vue +42 -0
- package/src/modules/QueryFilters/components/abstract-enum-filter.vue +32 -0
- package/src/modules/QueryFilters/components/filter-datetime.vue +39 -0
- package/src/modules/QueryFilters/components/filter-from-to.vue +136 -0
- package/src/modules/QueryFilters/components/filter-search.vue +33 -0
- package/src/modules/QueryFilters/mixins/__tests__/apiFilterMixin.spec.js +48 -0
- package/src/modules/QueryFilters/mixins/__tests__/enumFilterMixin.spec.js +70 -0
- package/src/modules/QueryFilters/mixins/__tests__/paginationFilterMixin.spec.js +86 -0
- package/src/modules/QueryFilters/mixins/__tests__/sortFilterMixin.spec.js +58 -0
- package/src/modules/QueryFilters/mixins/__tests__/urlControllerMixin.spec.js +48 -0
- package/src/modules/QueryFilters/mixins/_urlControllerMixin/_urlControllerMixin.js +39 -0
- package/src/modules/QueryFilters/mixins/apiFilterMixin.js +41 -0
- package/src/modules/QueryFilters/mixins/baseFilterMixin/baseFilterMixin.js +34 -0
- package/src/modules/QueryFilters/mixins/enumFilterMixin.js +51 -0
- package/src/modules/QueryFilters/mixins/paginationFilterMixin.js +76 -0
- package/src/modules/QueryFilters/mixins/sortFilterMixin.js +56 -0
- package/src/modules/QueryFilters/store/QueryFiltersStoreModule.js +48 -0
- package/src/modules/QueryFilters/store/__tests__/QueryFiltersStoreModule.spec.js +89 -0
- package/src/modules/QueryFilters/store/queryFilters.js +6 -0
- package/src/modules/Userinfo/api/BaseAPIService.js +7 -0
- package/src/modules/Userinfo/api/auth.js +29 -0
- package/src/modules/Userinfo/api/userinfo.js +32 -0
- package/src/modules/Userinfo/classes/ApplicationsAccess.js +190 -0
- package/src/modules/Userinfo/components/__tests__/auth.spec.js +56 -0
- package/src/modules/Userinfo/components/the-auth.vue +76 -0
- package/src/modules/Userinfo/store/UserinfoStoreModule.js +113 -0
- package/src/plugins/breakpoint/breakpoint.plugin.js +136 -0
- package/src/scripts/__tests__/caseConverters.spec.js +81 -0
- package/src/scripts/__tests__/convertDuration.spec.js +21 -0
- package/src/scripts/__tests__/debounce.spec.js +14 -0
- package/src/scripts/__tests__/editProxy.spec.js +9 -0
- package/src/scripts/__tests__/isEmpty.spec.js +16 -0
- package/src/scripts/__tests__/prettifyFileSize.spec.js +18 -0
- package/src/scripts/__tests__/prettifyTime.spec.js +18 -0
- package/src/scripts/__tests__/preventHiddenPageCallsDecorator.spec.js +16 -0
- package/src/scripts/__tests__/sortQueryAdapters.spec.js +12 -0
- package/src/scripts/caseConverters.js +89 -0
- package/src/scripts/convertDuration.js +15 -0
- package/src/scripts/editProxy.js +9 -0
- package/src/scripts/eventBus.js +4 -0
- package/src/scripts/isEmpty.js +9 -0
- package/src/scripts/prettifyFileSize.js +11 -0
- package/src/scripts/prettifyTime.js +9 -0
- package/src/scripts/preventHiddenPageCallsDecorator.js +6 -0
- package/src/scripts/sortQueryAdapters.js +21 -0
- package/src/store/BaseStoreModules/BaseStoreModule.js +49 -0
- package/src/store/BaseStoreModules/__tests__/BaseStoreModule.spec.js +104 -0
- package/src/store/helpers/__tests__/getNamespacedState.spec.js +11 -0
- package/src/store/helpers/getNamespacedState.js +5 -0
- package/.eslintrc.js +0 -34
- package/babel.config.js +0 -5
- package/dist/@webitel/ui-sdk.common.js +0 -11586
- package/dist/@webitel/ui-sdk.common.js.map +0 -1
- package/dist/@webitel/ui-sdk.css +0 -1
- package/dist/@webitel/ui-sdk.umd.js +0 -11596
- package/dist/@webitel/ui-sdk.umd.js.map +0 -1
- package/dist/@webitel/ui-sdk.umd.min.js +0 -2
- package/dist/@webitel/ui-sdk.umd.min.js.map +0 -1
- package/dist/fonts/Montserrat-Regular.ee653992.ttf +0 -0
- package/dist/fonts/Montserrat-SemiBold.c641dbee.ttf +0 -0
- package/dist/img/arrow-down--active--md.06c6b9a1.svg +0 -3
- package/dist/img/arrow-down--disabled--md.8dd31dcb.svg +0 -3
- package/dist/img/arrow-down--md.907c231e.svg +0 -3
- package/dist/img/calendar--active--md.b649abe2.svg +0 -6
- package/dist/img/calendar--disabled--md.ff268289.svg +0 -3
- package/dist/img/calendar--md.d0280382.svg +0 -6
- package/jest.config.js +0 -3
- package/package-lock.json +0 -15072
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -17
- package/src/assets/icons/arrow-down--active--md.svg +0 -3
- package/src/assets/icons/arrow-down--disabled--md.svg +0 -3
- package/src/assets/icons/arrow-down--md.svg +0 -3
- package/src/assets/icons/calendar--active--md.svg +0 -6
- package/src/assets/icons/calendar--disabled--md.svg +0 -3
- package/src/assets/icons/calendar--md.svg +0 -6
- package/src/components/atoms/wt-label/wt-label.vue +0 -58
- package/src/css/colors/_colors.scss +0 -67
- package/src/css/components/atoms/wt-badge/wt-badge.scss +0 -8
- package/src/css/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/src/css/fonts/Montserrat/Montserrat-SemiBold.ttf +0 -0
- package/src/css/fonts.scss +0 -9
- package/src/css/styleguide/styleguide.scss +0 -3
- package/src/css/typography/_typography.scss +0 -72
- package/src/directives/clickaway/clickaway.js +0 -52
- package/src/directives/index.js +0 -12
- package/src/install.js +0 -15
- package/src/main.js +0 -14
- package/src/playground.vue +0 -451
- package/src/the-app.vue +0 -20
- package/vue.config.js +0 -11
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import deepmerge from 'deepmerge';
|
|
2
|
+
import deepCopy from 'deep-copy';
|
|
3
|
+
import WebitelApplications from '../../../enums/WebitelApplications/WebitelApplications.enum';
|
|
4
|
+
import SupervisorSections from '../../../enums/WebitelApplications/SupervisorSections.enum';
|
|
5
|
+
import AdminSections from '../../../enums/WebitelApplications/AdminSections.enum';
|
|
6
|
+
|
|
7
|
+
const applicationsAccess = (value = true) => ({
|
|
8
|
+
[WebitelApplications.AGENT]: {
|
|
9
|
+
_enabled: value,
|
|
10
|
+
_locale: `WebitelApplications.${WebitelApplications.AGENT}.name`,
|
|
11
|
+
},
|
|
12
|
+
[WebitelApplications.HISTORY]: {
|
|
13
|
+
_enabled: value,
|
|
14
|
+
_locale: `WebitelApplications.${WebitelApplications.HISTORY}.name`,
|
|
15
|
+
},
|
|
16
|
+
[WebitelApplications.ANALYTICS]: {
|
|
17
|
+
_enabled: value,
|
|
18
|
+
_locale: `WebitelApplications.${WebitelApplications.ANALYTICS}.name`,
|
|
19
|
+
},
|
|
20
|
+
[WebitelApplications.SUPERVISOR]: {
|
|
21
|
+
_enabled: value,
|
|
22
|
+
_locale: `WebitelApplications.${WebitelApplications.SUPERVISOR}.name`,
|
|
23
|
+
[SupervisorSections.QUEUES]: {
|
|
24
|
+
_enabled: value,
|
|
25
|
+
_locale: `WebitelApplications.${WebitelApplications.SUPERVISOR}.sections.${SupervisorSections.QUEUES}`,
|
|
26
|
+
},
|
|
27
|
+
[SupervisorSections.AGENTS]: {
|
|
28
|
+
_enabled: value,
|
|
29
|
+
_locale: `WebitelApplications.${WebitelApplications.SUPERVISOR}.sections.${SupervisorSections.AGENTS}`,
|
|
30
|
+
},
|
|
31
|
+
[SupervisorSections.ACTIVE_CALLS]: {
|
|
32
|
+
_enabled: value,
|
|
33
|
+
_locale: `WebitelApplications.${WebitelApplications.SUPERVISOR}.sections.${SupervisorSections.ACTIVE_CALLS}`,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
[WebitelApplications.ADMIN]: {
|
|
37
|
+
_enabled: value,
|
|
38
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.name`,
|
|
39
|
+
[AdminSections.LICENSE]: {
|
|
40
|
+
_enabled: value,
|
|
41
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.LICENSE}`,
|
|
42
|
+
},
|
|
43
|
+
[AdminSections.USERS]: {
|
|
44
|
+
_enabled: value,
|
|
45
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.USERS}`,
|
|
46
|
+
},
|
|
47
|
+
[AdminSections.DEVICES]: {
|
|
48
|
+
_enabled: value,
|
|
49
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.DEVICES}`,
|
|
50
|
+
},
|
|
51
|
+
[AdminSections.FLOW]: {
|
|
52
|
+
_enabled: value,
|
|
53
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.FLOW}`,
|
|
54
|
+
},
|
|
55
|
+
[AdminSections.DIALPLAN]: {
|
|
56
|
+
_enabled: value,
|
|
57
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.DIALPLAN}`,
|
|
58
|
+
},
|
|
59
|
+
[AdminSections.GATEWAYS]: {
|
|
60
|
+
_enabled: value,
|
|
61
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.GATEWAYS}`,
|
|
62
|
+
},
|
|
63
|
+
[AdminSections.CHATPLAN]: {
|
|
64
|
+
_enabled: value,
|
|
65
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.CHATPLAN}`,
|
|
66
|
+
},
|
|
67
|
+
[AdminSections.CHAT_GATEWAYS]: {
|
|
68
|
+
_enabled: value,
|
|
69
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.CHAT_GATEWAYS}`,
|
|
70
|
+
},
|
|
71
|
+
[AdminSections.SKILLS]: {
|
|
72
|
+
_enabled: value,
|
|
73
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.SKILLS}`,
|
|
74
|
+
},
|
|
75
|
+
[AdminSections.BUCKETS]: {
|
|
76
|
+
_enabled: value,
|
|
77
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.BUCKETS}`,
|
|
78
|
+
},
|
|
79
|
+
[AdminSections.BLACKLIST]: {
|
|
80
|
+
_enabled: value,
|
|
81
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.BLACKLIST}`,
|
|
82
|
+
},
|
|
83
|
+
[AdminSections.REGIONS]: {
|
|
84
|
+
_enabled: value,
|
|
85
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.REGIONS}`,
|
|
86
|
+
},
|
|
87
|
+
[AdminSections.CALENDARS]: {
|
|
88
|
+
_enabled: value,
|
|
89
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.CALENDARS}`,
|
|
90
|
+
},
|
|
91
|
+
[AdminSections.COMMUNICATIONS]: {
|
|
92
|
+
_enabled: value,
|
|
93
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.COMMUNICATIONS}`,
|
|
94
|
+
},
|
|
95
|
+
[AdminSections.PAUSE_CAUSE]: {
|
|
96
|
+
_enabled: value,
|
|
97
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.PAUSE_CAUSE}`,
|
|
98
|
+
},
|
|
99
|
+
[AdminSections.MEDIA]: {
|
|
100
|
+
_enabled: value,
|
|
101
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.MEDIA}`,
|
|
102
|
+
},
|
|
103
|
+
[AdminSections.AGENTS]: {
|
|
104
|
+
_enabled: value,
|
|
105
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.AGENTS}`,
|
|
106
|
+
},
|
|
107
|
+
[AdminSections.TEAMS]: {
|
|
108
|
+
_enabled: value,
|
|
109
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.TEAMS}`,
|
|
110
|
+
},
|
|
111
|
+
[AdminSections.RESOURCES]: {
|
|
112
|
+
_enabled: value,
|
|
113
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.RESOURCES}`,
|
|
114
|
+
},
|
|
115
|
+
[AdminSections.RESOURCE_GROUPS]: {
|
|
116
|
+
_enabled: value,
|
|
117
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.RESOURCE_GROUPS}`,
|
|
118
|
+
},
|
|
119
|
+
[AdminSections.QUEUES]: {
|
|
120
|
+
_enabled: value,
|
|
121
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.QUEUES}`,
|
|
122
|
+
},
|
|
123
|
+
[AdminSections.STORAGE]: {
|
|
124
|
+
_enabled: value,
|
|
125
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.STORAGE}`,
|
|
126
|
+
},
|
|
127
|
+
[AdminSections.COGNITIVE_PROFILES]: {
|
|
128
|
+
_enabled: value,
|
|
129
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.COGNITIVE_PROFILES}`,
|
|
130
|
+
},
|
|
131
|
+
[AdminSections.EMAIL_PROFILES]: {
|
|
132
|
+
_enabled: value,
|
|
133
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.EMAIL_PROFILES}`,
|
|
134
|
+
},
|
|
135
|
+
[AdminSections.IMPORT_CSV]: {
|
|
136
|
+
_enabled: value,
|
|
137
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.IMPORT_CSV}`,
|
|
138
|
+
},
|
|
139
|
+
[AdminSections.TRIGGERS]: {
|
|
140
|
+
_enabled: value,
|
|
141
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.TRIGGERS}`,
|
|
142
|
+
},
|
|
143
|
+
[AdminSections.ROLES]: {
|
|
144
|
+
_enabled: value,
|
|
145
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.ROLES}`,
|
|
146
|
+
},
|
|
147
|
+
[AdminSections.OBJECTS]: {
|
|
148
|
+
_enabled: value,
|
|
149
|
+
_locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.OBJECTS}`,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
*/
|
|
156
|
+
export default class ApplicationsAccess {
|
|
157
|
+
// value param could be passed to set same value for all options
|
|
158
|
+
constructor({ access, value } = { value: true }) {
|
|
159
|
+
/* if access, deeply merge with falsy values schema
|
|
160
|
+
if no access, "not configured => full permissions" */
|
|
161
|
+
this.access = access ? ApplicationsAccess.restore(access) : applicationsAccess(value);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
getAccess() {
|
|
165
|
+
return this.access;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// minify schema for API sending
|
|
169
|
+
static minify(access) {
|
|
170
|
+
const rmEmptyKeys = (obj) => {
|
|
171
|
+
Object.keys(obj).forEach((key) => {
|
|
172
|
+
// eslint-disable-next-line no-param-reassign
|
|
173
|
+
if (!obj[key] || key === '_locale') delete obj[key];
|
|
174
|
+
if (typeof obj[key] === 'object') {
|
|
175
|
+
rmEmptyKeys(obj[key]);
|
|
176
|
+
// eslint-disable-next-line no-param-reassign
|
|
177
|
+
if (!Object.keys(obj[key]).length) delete obj[key];
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
return obj;
|
|
181
|
+
};
|
|
182
|
+
return rmEmptyKeys(deepCopy(access));
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// restore minified schema from API response
|
|
186
|
+
static restore(access) {
|
|
187
|
+
return deepmerge(applicationsAccess(false), access);
|
|
188
|
+
// return deepmerge(access, applicationsAccess(false));
|
|
189
|
+
}
|
|
190
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { shallowMount, createLocalVue } from '@vue/test-utils';
|
|
2
|
+
import Vuex from 'vuex';
|
|
3
|
+
import VueRouter from 'vue-router';
|
|
4
|
+
import JSDOM from 'jsdom';
|
|
5
|
+
import authAPI from '../../api/auth';
|
|
6
|
+
import userinfoAPI from '../../api/userinfo';
|
|
7
|
+
import Auth from '../the-auth.vue';
|
|
8
|
+
import UserinfoStoreModule from '../../store/UserinfoStoreModule';
|
|
9
|
+
|
|
10
|
+
import '../../../../../tests/mocks/localStorageMock';
|
|
11
|
+
|
|
12
|
+
localStorage.setItem('access-token', 'jest');
|
|
13
|
+
|
|
14
|
+
const localVue = createLocalVue();
|
|
15
|
+
localVue.use(Vuex);
|
|
16
|
+
localVue.use(VueRouter);
|
|
17
|
+
|
|
18
|
+
authAPI.setToken = jest.fn();
|
|
19
|
+
userinfoAPI.getSession = jest.fn(() => ({}));
|
|
20
|
+
userinfoAPI.getApplicationsAccess = jest.fn(() => ({}));
|
|
21
|
+
|
|
22
|
+
describe('Auth', () => {
|
|
23
|
+
let store;
|
|
24
|
+
let wrapper;
|
|
25
|
+
global.window = new JSDOM.JSDOM().window;
|
|
26
|
+
const router = new VueRouter();
|
|
27
|
+
router.replace = jest.fn();
|
|
28
|
+
|
|
29
|
+
const userinfo = new UserinfoStoreModule().getModule();
|
|
30
|
+
beforeEach(() => {
|
|
31
|
+
store = new Vuex.Store({
|
|
32
|
+
modules: { userinfo },
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
wrapper = shallowMount(Auth, {
|
|
36
|
+
localVue,
|
|
37
|
+
store,
|
|
38
|
+
router,
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('renders a component', () => {
|
|
43
|
+
expect(wrapper.classes('auth-wrap')).toBe(true);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('sets token, gets session and opens app after auth token message emit', async () => {
|
|
47
|
+
const accessToken = 'hello there';
|
|
48
|
+
window.postMessage({ accessToken }, '*');
|
|
49
|
+
await setTimeout(() => {
|
|
50
|
+
expect(authAPI.setToken).toHaveBeenCalledWith(accessToken);
|
|
51
|
+
expect(userinfoAPI.getSession).toHaveBeenCalled();
|
|
52
|
+
expect(userinfoAPI.getApplicationsAccess).toHaveBeenCalled();
|
|
53
|
+
expect(router.replace).toHaveBeenCalled();
|
|
54
|
+
}, 100);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="auth-wrap">
|
|
3
|
+
<div v-show="!isLoaded" class="auth-loader">
|
|
4
|
+
<wt-loader/>
|
|
5
|
+
</div>
|
|
6
|
+
<iframe
|
|
7
|
+
class="auth"
|
|
8
|
+
:src="authURL"
|
|
9
|
+
@load="isLoaded = true"
|
|
10
|
+
>
|
|
11
|
+
<p>Your browser does not support iframes.</p>
|
|
12
|
+
</iframe>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import AuthAPI from '../api/auth';
|
|
18
|
+
|
|
19
|
+
const authURL = process.env.VUE_APP_AUTH_MODULE_URL;
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
name: 'auth',
|
|
23
|
+
props: {
|
|
24
|
+
namespace: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: 'userinfo',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
data: () => ({
|
|
30
|
+
authURL,
|
|
31
|
+
isLoaded: false,
|
|
32
|
+
}),
|
|
33
|
+
|
|
34
|
+
mounted() {
|
|
35
|
+
window.addEventListener('message', this.authMessageHandler, false);
|
|
36
|
+
},
|
|
37
|
+
destroyed() {
|
|
38
|
+
window.removeEventListener('message', this.authMessageHandler, false);
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
methods: {
|
|
42
|
+
openSession(payload) {
|
|
43
|
+
return this.$store.dispatch(`${this.namespace}/OPEN_SESSION`, payload);
|
|
44
|
+
},
|
|
45
|
+
async authMessageHandler(event) {
|
|
46
|
+
if (event.data.accessToken) {
|
|
47
|
+
// eslint-disable-next-line import/no-named-as-default-member
|
|
48
|
+
await AuthAPI.setToken(event.data.accessToken);
|
|
49
|
+
await this.openSession();
|
|
50
|
+
await this.$router.replace('/');
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<style lang="scss" scoped>
|
|
58
|
+
.auth-wrap {
|
|
59
|
+
position: relative;
|
|
60
|
+
height: 100vh;
|
|
61
|
+
width: 100vw;
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
|
|
64
|
+
.wt-loader {
|
|
65
|
+
position: absolute;
|
|
66
|
+
top: 50%;
|
|
67
|
+
right: 50%;
|
|
68
|
+
transform: translate(-50%, -50%);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.auth {
|
|
72
|
+
height: 100%;
|
|
73
|
+
width: 100%;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import userinfo from '../api/userinfo';
|
|
2
|
+
import ApplicationsAccess from '../classes/ApplicationsAccess';
|
|
3
|
+
import BaseStoreModule from '../../../store/BaseStoreModules/BaseStoreModule';
|
|
4
|
+
|
|
5
|
+
const defaultState = () => ({
|
|
6
|
+
isLoading: true,
|
|
7
|
+
domainId: 0,
|
|
8
|
+
name: '',
|
|
9
|
+
username: '',
|
|
10
|
+
account: '',
|
|
11
|
+
preferredUsername: '',
|
|
12
|
+
userId: 0,
|
|
13
|
+
scope: {},
|
|
14
|
+
permissions: {},
|
|
15
|
+
roles: [],
|
|
16
|
+
license: [],
|
|
17
|
+
access: {},
|
|
18
|
+
language: localStorage.getItem('lang'),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export default class UserinfoStoreModule extends BaseStoreModule {
|
|
22
|
+
state = {
|
|
23
|
+
...defaultState(),
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
getters = {
|
|
27
|
+
THIS_APP: (state) => state.thisApp,
|
|
28
|
+
// if no access[app] => accessed by default
|
|
29
|
+
CHECK_APP_ACCESS: (state) => (app) => !state.access[app] || state.access[app]?._enabled,
|
|
30
|
+
CHECK_OBJECT_ACCESS: (state, getters) => ({ name, route }) => {
|
|
31
|
+
if (!state.access[getters.THIS_APP] || !state.access[getters.THIS_APP]._enabled) return false;
|
|
32
|
+
if (route) return getters.CHECK_OBJECT_ACCESS_BY_ROUTE(route);
|
|
33
|
+
return getters.CHECK_OBJECT_ACCESS_BY_NAME(name);
|
|
34
|
+
},
|
|
35
|
+
CHECK_OBJECT_ACCESS_BY_NAME: (state, getters) => (name) => (
|
|
36
|
+
state.access[getters.THIS_APP][name]?._enabled
|
|
37
|
+
),
|
|
38
|
+
CHECK_OBJECT_ACCESS_BY_ROUTE: (state, getters) => (route) => {
|
|
39
|
+
const accessKey = Object.keys(state.access[getters.THIS_APP]).find((object) => route.name.includes(object));
|
|
40
|
+
return state.access[getters.THIS_APP][accessKey]?._enabled;
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
actions = {
|
|
45
|
+
BEFORE_OPEN_SESSION_HOOK: () => {},
|
|
46
|
+
AFTER_OPEN_SESSION_HOOK: () => {},
|
|
47
|
+
CONVERT_USER_SCOPE: (context, scope) => scope,
|
|
48
|
+
CONVERT_USER_PERMISSIONS: (context, permissions) => permissions,
|
|
49
|
+
|
|
50
|
+
OPEN_SESSION: async (context) => {
|
|
51
|
+
await context.dispatch('BEFORE_OPEN_SESSION_HOOK');
|
|
52
|
+
// !!! it should be checked in router.js beforeEach hook
|
|
53
|
+
// if (!localStorage.getItem('access-token')) {
|
|
54
|
+
// context.dispatch('REDIRECT_TO_AUTH');
|
|
55
|
+
// throw new Error('No access-token in localStorage');
|
|
56
|
+
// }
|
|
57
|
+
const session = await userinfo.getSession();
|
|
58
|
+
await context.dispatch('SET_SESSION', session);
|
|
59
|
+
const access = await userinfo.getApplicationsAccess();
|
|
60
|
+
await context.dispatch('SET_APPLICATIONS_ACCESS', new ApplicationsAccess({ access }).getAccess());
|
|
61
|
+
await context.dispatch('AFTER_OPEN_SESSION_HOOK');
|
|
62
|
+
},
|
|
63
|
+
SET_SESSION: async (context, _session) => {
|
|
64
|
+
const defaultSession = {
|
|
65
|
+
domainId: 0,
|
|
66
|
+
username: '',
|
|
67
|
+
userId: 0,
|
|
68
|
+
scope: [],
|
|
69
|
+
roles: [],
|
|
70
|
+
license: [],
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
await context.dispatch('RESET_STATE');
|
|
75
|
+
const session = { ...defaultSession, ..._session };
|
|
76
|
+
const scope = await context.dispatch('CONVERT_USER_SCOPE', session.scope);
|
|
77
|
+
const permissions = await context.dispatch('CONVERT_USER_PERMISSIONS', session.permissions);
|
|
78
|
+
context.commit('SET_SESSION', { ...session, scope, permissions });
|
|
79
|
+
await context.dispatch('SET_LOADING', false);
|
|
80
|
+
} catch (err) {
|
|
81
|
+
throw err;
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
SET_APPLICATIONS_ACCESS: (context, access) => context.commit('SET_APPLICATIONS_ACCESS', access),
|
|
86
|
+
|
|
87
|
+
SET_LOADING: (context, isLoading) => {
|
|
88
|
+
context.commit('SET_LOADING', isLoading);
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
RESET_STATE: (context) => {
|
|
92
|
+
context.commit('RESET_STATE');
|
|
93
|
+
},
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
mutations = {
|
|
97
|
+
SET_SESSION: (state, session) => {
|
|
98
|
+
Object.assign(state, session);
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
SET_APPLICATIONS_ACCESS: (state, access) => {
|
|
102
|
+
state.access = access;
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
SET_LOADING: (state, isLoading) => {
|
|
106
|
+
state.isLoading = isLoading;
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
RESET_STATE: (state) => {
|
|
110
|
+
Object.assign(state, defaultState());
|
|
111
|
+
},
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import debounce from '../../scripts/debounce';
|
|
2
|
+
|
|
3
|
+
// https://stackoverflow.com/questions/41791193/vuejs-reactive-binding-for-a-plugin-how-to/41801107#41801107
|
|
4
|
+
// https://stackoverflow.com/questions/50111231/vue-prototype-not-reactive-when-data-changes
|
|
5
|
+
|
|
6
|
+
// https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/services/breakpoint/index.ts
|
|
7
|
+
|
|
8
|
+
const breakpoint = {
|
|
9
|
+
// Breakpoints
|
|
10
|
+
xs: false,
|
|
11
|
+
sm: false,
|
|
12
|
+
md: false,
|
|
13
|
+
lg: false,
|
|
14
|
+
xl: false,
|
|
15
|
+
|
|
16
|
+
// Conditionals
|
|
17
|
+
xsOnly: false,
|
|
18
|
+
smOnly: false,
|
|
19
|
+
smAndDown: false,
|
|
20
|
+
smAndUp: false,
|
|
21
|
+
mdOnly: false,
|
|
22
|
+
mdAndDown: false,
|
|
23
|
+
mdAndUp: false,
|
|
24
|
+
lgOnly: false,
|
|
25
|
+
lgAndDown: false,
|
|
26
|
+
lgAndUp: false,
|
|
27
|
+
xlOnly: false,
|
|
28
|
+
|
|
29
|
+
// true if screen width < mobileBreakpoint
|
|
30
|
+
mobile: true,
|
|
31
|
+
|
|
32
|
+
// Current breakpoint name (e.g. 'md')
|
|
33
|
+
name: 'xs',
|
|
34
|
+
// Dimensions
|
|
35
|
+
height: 0,
|
|
36
|
+
width: 0,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const getClientWidth = () => Math.max(
|
|
40
|
+
document.documentElement.clientWidth,
|
|
41
|
+
window.innerWidth || 0,
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const getClientHeight = () => Math.max(
|
|
45
|
+
document.documentElement.clientHeight,
|
|
46
|
+
window.innerHeight || 0,
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const thresholds = {
|
|
50
|
+
xs: 600,
|
|
51
|
+
sm: 960,
|
|
52
|
+
md: 1264,
|
|
53
|
+
lg: 1904,
|
|
54
|
+
};
|
|
55
|
+
const mobileBreakpoint = 'sm';
|
|
56
|
+
const scrollBarWidth = 16;
|
|
57
|
+
|
|
58
|
+
const onResize = () => {
|
|
59
|
+
const height = getClientHeight();
|
|
60
|
+
const width = getClientWidth();
|
|
61
|
+
|
|
62
|
+
const xs = width < thresholds.xs;
|
|
63
|
+
const sm = width < thresholds.sm && !xs;
|
|
64
|
+
const md = width < (thresholds.md - scrollBarWidth) && !(sm || xs);
|
|
65
|
+
const lg = width < (thresholds.lg - scrollBarWidth) && !(md || sm || xs);
|
|
66
|
+
const xl = width >= (thresholds.lg - scrollBarWidth);
|
|
67
|
+
|
|
68
|
+
breakpoint.height = height;
|
|
69
|
+
breakpoint.width = width;
|
|
70
|
+
|
|
71
|
+
breakpoint.xs = xs;
|
|
72
|
+
breakpoint.sm = sm;
|
|
73
|
+
breakpoint.md = md;
|
|
74
|
+
breakpoint.lg = lg;
|
|
75
|
+
breakpoint.xl = xl;
|
|
76
|
+
|
|
77
|
+
breakpoint.xsOnly = xs;
|
|
78
|
+
breakpoint.smOnly = sm;
|
|
79
|
+
breakpoint.smAndDown = (xs || sm) && !(md || lg || xl);
|
|
80
|
+
breakpoint.smAndUp = !xs && (sm || md || lg || xl);
|
|
81
|
+
breakpoint.mdOnly = md;
|
|
82
|
+
breakpoint.mdAndDown = (xs || sm || md) && !(lg || xl);
|
|
83
|
+
breakpoint.mdAndUp = !(xs || sm) && (md || lg || xl);
|
|
84
|
+
breakpoint.lgOnly = lg;
|
|
85
|
+
breakpoint.lgAndDown = (xs || sm || md || lg) && !xl;
|
|
86
|
+
breakpoint.lgAndUp = !(xs || sm || md) && (lg || xl);
|
|
87
|
+
breakpoint.xlOnly = xl;
|
|
88
|
+
|
|
89
|
+
switch (true) {
|
|
90
|
+
case (xs):
|
|
91
|
+
breakpoint.name = 'xs';
|
|
92
|
+
break;
|
|
93
|
+
case (sm):
|
|
94
|
+
breakpoint.name = 'sm';
|
|
95
|
+
break;
|
|
96
|
+
case (md):
|
|
97
|
+
breakpoint.name = 'md';
|
|
98
|
+
break;
|
|
99
|
+
case (lg):
|
|
100
|
+
breakpoint.name = 'lg';
|
|
101
|
+
break;
|
|
102
|
+
default:
|
|
103
|
+
breakpoint.name = 'xl';
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (typeof mobileBreakpoint === 'number') {
|
|
108
|
+
breakpoint.mobile = width < parseInt(mobileBreakpoint, 10);
|
|
109
|
+
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const breakpoints = {
|
|
114
|
+
xs: 0,
|
|
115
|
+
sm: 1,
|
|
116
|
+
md: 2,
|
|
117
|
+
lg: 3,
|
|
118
|
+
xl: 4,
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const current = breakpoints[breakpoint.name];
|
|
122
|
+
const max = breakpoints[mobileBreakpoint];
|
|
123
|
+
|
|
124
|
+
breakpoint.mobile = current <= max;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const install = (Vue) => {
|
|
128
|
+
window.addEventListener('resize', debounce(onResize), { passive: true });
|
|
129
|
+
|
|
130
|
+
onResize();
|
|
131
|
+
|
|
132
|
+
// eslint-disable-next-line no-param-reassign
|
|
133
|
+
Vue.prototype.$breakpoint = Vue.observable(breakpoint);
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export { install };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
camelToKebab,
|
|
3
|
+
camelToSnake,
|
|
4
|
+
kebabToCamel,
|
|
5
|
+
snakeToKebab,
|
|
6
|
+
kebabToSnake,
|
|
7
|
+
objCamelToSnake,
|
|
8
|
+
objSnakeToCamel,
|
|
9
|
+
snakeToCamel,
|
|
10
|
+
} from '../caseConverters';
|
|
11
|
+
|
|
12
|
+
describe('Case converters', () => {
|
|
13
|
+
it('Camel-Kebab', () => {
|
|
14
|
+
const camelStr = 'camelToKebab';
|
|
15
|
+
const kebabStr = 'camel-to-kebab';
|
|
16
|
+
expect(camelToKebab(camelStr)).toBe(kebabStr);
|
|
17
|
+
expect(kebabToCamel(kebabStr)).toBe(camelStr);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('Snake-Kebab', () => {
|
|
21
|
+
const snakeStr = 'snake_to_kebab';
|
|
22
|
+
const kebabStr = 'snake-to-kebab';
|
|
23
|
+
expect(snakeToKebab(snakeStr)).toBe(kebabStr);
|
|
24
|
+
expect(kebabToSnake(kebabStr)).toBe(snakeStr);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('Camel-Snake', () => {
|
|
28
|
+
const camelStr = 'camelToSnake';
|
|
29
|
+
const snakeStr = 'camel_to_snake';
|
|
30
|
+
expect(camelToSnake(camelStr)).toBe(snakeStr);
|
|
31
|
+
expect(snakeToCamel(snakeStr)).toBe(camelStr);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('Camel-Snake, test case 1: do not convert 1st uppercase letter', () => {
|
|
35
|
+
const camelStr = 'Timer';
|
|
36
|
+
const snakeStr = 'Timer';
|
|
37
|
+
expect(camelToSnake(camelStr)).toBe(snakeStr);
|
|
38
|
+
expect(snakeToCamel(snakeStr)).toBe(camelStr);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('Camel <- Snake skips first char "_"', () => {
|
|
42
|
+
const camelStr = '_camelToSnake';
|
|
43
|
+
const snakeStr = '_camel_to_snake';
|
|
44
|
+
expect(snakeToCamel(snakeStr)).toBe(camelStr);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('Camel-Snake Objects', () => {
|
|
48
|
+
const camelObj = { camelToSnake: { camelToSnake: null, arr: [10] } };
|
|
49
|
+
const snakeObj = { camel_to_snake: { camel_to_snake: null, arr: [10] } };
|
|
50
|
+
expect(objCamelToSnake(camelObj)).toEqual(snakeObj);
|
|
51
|
+
expect(objSnakeToCamel(snakeObj)).toEqual(camelObj);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('Camel-Snake Objects: NULL VALUES', () => {
|
|
55
|
+
const camelObj = null;
|
|
56
|
+
const snakeObj = null;
|
|
57
|
+
expect(objCamelToSnake(camelObj)).toEqual(snakeObj);
|
|
58
|
+
expect(objSnakeToCamel(snakeObj)).toEqual(camelObj);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('Camel-Snake Arrays', () => {
|
|
62
|
+
const camelArr = ['camelToSnake', { camelToSnake: { camelToSnake: null } }];
|
|
63
|
+
const snakeArr = ['camel_to_snake', { camel_to_snake: { camel_to_snake: null } }];
|
|
64
|
+
expect(objCamelToSnake(camelArr)).toEqual(snakeArr);
|
|
65
|
+
expect(objSnakeToCamel(snakeArr)).toEqual(camelArr);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('Camel-to-Snake Object skips passed keys', () => {
|
|
69
|
+
const skippedKeys = ['skippedKey'];
|
|
70
|
+
const camelArr = { camelToSnake: null, skippedKey: null };
|
|
71
|
+
const snakeArr = { camel_to_snake: null, skippedKey: null };
|
|
72
|
+
expect(objCamelToSnake(camelArr, skippedKeys)).toEqual(snakeArr);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('Snake-to-Camel Object skips passed keys', () => {
|
|
76
|
+
const skippedKeys = ['skipped_key'];
|
|
77
|
+
const camelArr = { camelToSnake: null, skipped_key: null };
|
|
78
|
+
const snakeArr = { camel_to_snake: null, skipped_key: null };
|
|
79
|
+
expect(objSnakeToCamel(snakeArr, skippedKeys)).toEqual(camelArr);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import convertDuration from '../convertDuration';
|
|
2
|
+
|
|
3
|
+
describe('Case converters', () => {
|
|
4
|
+
it('duration from sec value', () => {
|
|
5
|
+
const time = 111;
|
|
6
|
+
const duration = '00:01:51';
|
|
7
|
+
expect(convertDuration(time)).toBe(duration);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('duration from sec string value', () => {
|
|
11
|
+
const time = '61';
|
|
12
|
+
const duration = '00:01:01';
|
|
13
|
+
expect(convertDuration(time)).toBe(duration);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('duration from false value', () => {
|
|
17
|
+
const time = null;
|
|
18
|
+
const duration = '00:00:00';
|
|
19
|
+
expect(convertDuration(time)).toBe(duration);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import debounce from '../debounce';
|
|
2
|
+
|
|
3
|
+
describe('debounce', () => {
|
|
4
|
+
it('debounces call', async () => {
|
|
5
|
+
let isFnCalled = false;
|
|
6
|
+
let fn = () => { isFnCalled = true; };
|
|
7
|
+
fn = debounce(fn, 50);
|
|
8
|
+
fn();
|
|
9
|
+
expect(isFnCalled).toBeFalsy();
|
|
10
|
+
await setTimeout(() => {
|
|
11
|
+
expect(isFnCalled).toBeTruthy();
|
|
12
|
+
}, 100);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import editProxy from '../editProxy';
|
|
2
|
+
|
|
3
|
+
describe('editProxy', () => {
|
|
4
|
+
it('correctly updates _dirty prop at object property change', () => {
|
|
5
|
+
const object = editProxy({ value: 'jest', _dirty: false });
|
|
6
|
+
object.value = 'upd jest';
|
|
7
|
+
expect(object._dirty).toBe(true);
|
|
8
|
+
});
|
|
9
|
+
});
|