@webitel/ui-sdk 26.4.17 → 26.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/displayText-Cbh4IOfM.js +5 -0
- package/dist/{index-eEFER0lI.js → index-CeADjYK9.js} +1 -1
- package/dist/{index-B_bOPX3o.js → index-DZ_bvNVs.js} +1 -1
- package/dist/{install-C_4PcYy4.js → install-Dofcp90y.js} +1749 -1752
- package/dist/{isObject-Bc_zejYi.js → isObject-B2zd2O3f.js} +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +1 -1
- package/dist/ui-sdk.umd.cjs +232 -232
- package/dist/{useVidstackSrc-BjBi-Z6a.js → useVidstackSrc-D9uo15mF.js} +3 -4
- package/dist/{vidstack-Bq6c3Bam-Do_GZqV0.js → vidstack-Bq6c3Bam-Bs73fRdp.js} +3 -3
- package/dist/{vidstack-D2pY00kU-DtEQuJNJ.js → vidstack-D2pY00kU-BVC5bxHL.js} +3 -3
- package/dist/{vidstack-DDXt6fpN-BjUme5OE.js → vidstack-DDXt6fpN-DA-lnlhX.js} +2 -2
- package/dist/{vidstack-D_-9AA6_-BUgV5EDC.js → vidstack-D_-9AA6_-C0QZLaX5.js} +2 -2
- package/dist/{vidstack-DqAw8m9J-D5-emHfz.js → vidstack-DqAw8m9J-DAs7LwX_.js} +1 -1
- package/dist/{vidstack-audio-DmysFuAQ.js → vidstack-audio-BrbZotHa.js} +2 -2
- package/dist/{vidstack-dash-CF4d8BuX.js → vidstack-dash-KNjyvq2R.js} +4 -4
- package/dist/{vidstack-google-cast-CNPyXY9S.js → vidstack-google-cast-DMZQ1jRD.js} +4 -4
- package/dist/{vidstack-hls-BLaXkLiF.js → vidstack-hls-BfOysul0.js} +4 -4
- package/dist/{vidstack-video-v_RKZWR5.js → vidstack-video-PWMSQ3Gk.js} +3 -3
- package/dist/{vidstack-vimeo-BCNYIpmz.js → vidstack-vimeo-C5Khtd48.js} +4 -4
- package/dist/{vidstack-youtube-C1DaWOJU.js → vidstack-youtube-CPcpsir2.js} +3 -3
- package/dist/{wt-action-bar-Ckg4xWY1.js → wt-action-bar-By55sdZf.js} +1 -1
- package/dist/{wt-button-select-DHqtUP4R.js → wt-button-select-C34W0lYV.js} +1 -1
- package/dist/{wt-chat-emoji-BVMxNx8W.js → wt-chat-emoji-DjgWXA_2.js} +2 -2
- package/dist/{wt-confirm-dialog-BNjF-amp.js → wt-confirm-dialog-GNka4gxY.js} +1 -1
- package/dist/{wt-context-menu-DkK9-qLI.js → wt-context-menu-Bjl5aGzG.js} +1 -1
- package/dist/{wt-copy-action-7hL0mEvW.js → wt-copy-action-Xo2DsqJZ.js} +1 -1
- package/dist/{wt-datepicker-Bvde1_4k.js → wt-datepicker-CL3jLy5h.js} +1 -1
- package/dist/wt-display-chip-items-CCNWd5Nt.js +47 -0
- package/dist/{wt-dual-panel-C6E7X3c8.js → wt-dual-panel-CMUeBmf-.js} +1 -1
- package/dist/{wt-dummy-oCvw9ZAO.js → wt-dummy-BOgeleXm.js} +1 -1
- package/dist/{wt-error-page-BWRGUdsV.js → wt-error-page-Ctl0-_Yp.js} +1 -1
- package/dist/{wt-expansion-card-DqdyzBFB.js → wt-expansion-card-BCOBdTuS.js} +1 -1
- package/dist/{wt-expansion-panel-CGYB7-8V.js → wt-expansion-panel-C7W_5dxd.js} +1 -1
- package/dist/{wt-filters-panel-wrapper-BdWYuFBU.js → wt-filters-panel-wrapper-CkLHeV4o.js} +1 -1
- package/dist/{wt-galleria-BBSNSwsR.js → wt-galleria-Bls8Xxh4.js} +2 -2
- package/dist/{wt-navigation-menu-CubDPnaE.js → wt-navigation-menu-CFPMD9o1.js} +1 -1
- package/dist/{wt-notifications-bar-B9gUZbnG.js → wt-notifications-bar-BTDN7hSn.js} +2 -2
- package/dist/{wt-pagination-Dafsnmhz.js → wt-pagination-DtjeKcpO.js} +1 -1
- package/dist/{wt-player-DxvKDEYJ.js → wt-player-Co3Ib7qU.js} +13 -13
- package/dist/wt-screen-recordings-action-CmY7R2B-.js +55 -0
- package/dist/{wt-search-bar-BSTKSDBo.js → wt-search-bar-CmN8Nq-n.js} +1 -1
- package/dist/{wt-selection-popup-D_mDRYjd.js → wt-selection-popup-BNKNa5jy.js} +1 -1
- package/dist/{wt-start-page-BYGMWDsS.js → wt-start-page-BC4r_EPK.js} +1 -1
- package/dist/{wt-status-select-BDFd1JE-.js → wt-status-select-CBq_ihcS.js} +11 -14
- package/dist/{wt-stepper-Db5aEz47.js → wt-stepper-DvmRISSE.js} +1 -1
- package/dist/{wt-table-92BKexHp.js → wt-table-BDnXcyai.js} +14 -14
- package/dist/{wt-table-actions-BTmBjf1Q.js → wt-table-actions-52X557c8.js} +1 -1
- package/dist/{wt-table-column-select-abILUxUr.js → wt-table-column-select-vKGXHla2.js} +2 -2
- package/dist/{wt-tabs-B21sWbPs.js → wt-tabs-zXlsvaeU.js} +16 -17
- package/dist/{wt-tags-input-DNA22dSR.js → wt-tags-input-B8w0KXPv.js} +2 -2
- package/dist/{wt-timepicker-CgowHF74.js → wt-timepicker-Cm4aLsPK.js} +1 -1
- package/dist/{wt-tree-CvHw827i.js → wt-tree-IVOTwA3x.js} +4 -4
- package/dist/{wt-tree-table-DWgEjAUG.js → wt-tree-table-zA7HHvru.js} +3 -3
- package/dist/{wt-type-extension-value-input-BvHowj58.js → wt-type-extension-value-input-DTmneCoP.js} +4 -7
- package/dist/{wt-vidstack-player-BnK8NLH3.js → wt-vidstack-player-DHmGgiDL.js} +13 -13
- package/package.json +7 -3
- package/src/api/clients/agents/agentChats.js +0 -1
- package/src/api/clients/agents/agents.js +1 -1
- package/src/api/clients/caseSources/caseSources.ts +1 -1
- package/src/api/clients/chatGateways/defaults/webChatGateway.js +5 -5
- package/src/api/clients/contactGroups/contactGroups.js +0 -1
- package/src/api/clients/queues/queues.js +16 -22
- package/src/api/clients/users/__tests__/users.spec.js +1 -1
- package/src/api/clients/users/users.js +10 -2
- package/src/api/clients//321/201ontacts/contacts.js +0 -1
- package/src/api/clients//321/201ontacts/index.js +1 -1
- package/src/api/defaults/getDefaultGetListResponse/getDefaultGetListResponse.js +1 -1
- package/src/api/transformers/addQueryParamsToUrl/addQueryParamsToUrl.transformer.js +2 -2
- package/src/api/transformers/sanitize/sanitize.transformer.js +2 -4
- package/src/api/websocket/WebSocketClientController.ts +6 -4
- package/src/components/index.js +10 -2
- package/src/components/on-demand/wt-screen-recordings-action/wt-screen-recordings-action.vue +72 -0
- package/src/components/wt-app-header/wt-app-navigator.vue +8 -11
- package/src/components/wt-button/__tests__/WtButton.spec.js +10 -5
- package/src/components/wt-button-select/__tests__/WtButtonSelect.spec.js +13 -16
- package/src/components/wt-checkbox/__tests__/WtCheckbox.spec.js +6 -2
- package/src/components/wt-chip/__tests__/WtChip.spec.js +3 -3
- package/src/components/wt-filters-panel-wrapper/__tests__/WtFiltersPanelWrapper.spec.js +4 -17
- package/src/components/wt-galleria/wt-galleria.vue +1 -1
- package/src/components/wt-icon/__tests__/WtIcon.spec.js +19 -2
- package/src/components/wt-intersection-observer/wt-intersection-observer.vue +1 -1
- package/src/components/wt-pagination/__tests__/WtPagination.spec.js +80 -16
- package/src/components/wt-player/src/components/buttons/mute-button.vue +0 -1
- package/src/components/wt-radio/__tests__/WtRadio.spec.js +8 -2
- package/src/components/wt-rounded-action/__tests__/WtRoundedAction.spec.js +98 -0
- package/src/components/wt-rounded-action/_variables.css +0 -3
- package/src/components/wt-select/mixins/multiselectMixin.js +0 -1
- package/src/components/wt-select/multiselect.css +2 -0
- package/src/components/wt-select/wt-select-v2.vue +3 -2
- package/src/components/wt-status-select/wt-status-select.vue +2 -4
- package/src/components/wt-switcher/__tests__/WtSwitcher.spec.js +9 -11
- package/src/components/wt-switcher/wt-switcher.vue +1 -1
- package/src/components/wt-table/wt-table.vue +1 -1
- package/src/components/wt-tabs/wt-tabs.vue +1 -2
- package/src/components/wt-textarea/__tests__/WtTextarea.spec.js +2 -2
- package/src/components/wt-textarea/wt-textarea.vue +3 -4
- package/src/components/wt-time-input/__tests__/WtTimeInput.spec.js +18 -1
- package/src/components/wt-timepicker/__tests__/WtTimepicker.spec.js +9 -15
- package/src/components/wt-tree/__tests__/WtTree.spec.js +1 -1
- package/src/components/wt-tree/wt-tree.vue +92 -60
- package/src/components/wt-tree-line/wt-tree-line.vue +2 -2
- package/src/components/wt-tree-table/wt-tree-table.vue +90 -84
- package/src/components/wt-tree-table-row/wt-tree-table-row.vue +2 -2
- package/src/components/wt-vidstack-player/components/panels/video-display-panel/video-display-panel.vue +2 -2
- package/src/components/wt-vidstack-player/composables/useVidstackSrc.ts +1 -1
- package/src/composables/useCachedInterval/__tests__/useCachedInterval.spec.js +1 -1
- package/src/composables/useCard/useCardComponent.js +1 -1
- package/src/composables/useInputControl/useInputControl.ts +1 -1
- package/src/composables/useRepresentableAgentPauseCause/__tests__/useRepresentableAgentPauseCause.spec.js +60 -80
- package/src/composables/useRepresentableAgentPauseCause/useRepresentableAgentPauseCause.js +1 -1
- package/src/composables/useTableColumnDrag/useTableColumnDrag.ts +1 -1
- package/src/enums/index.ts +0 -1
- package/src/install.ts +1 -1
- package/src/locale/kz/kz.js +2 -4
- package/src/locale/pl/pl.js +2 -4
- package/src/mixins/dataFilterMixins/__tests__/sortFilterMixin.spec.js +1 -1
- package/src/modules/AgentPdfs/components/agent-pdfs-tab.vue +104 -96
- package/src/modules/AgentStatusSelect/api/agent-status.js +9 -13
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-agent-status-select.spec.js +6 -47
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-pause-cause-popup.spec.js +31 -3
- package/src/modules/Appearance/components/__tests__/wt-dark-mode-switcher.spec.js +16 -10
- package/src/modules/AuditForm/components/audit-form.vue +1 -1
- package/src/modules/AuditForm/components/form-answers/answer-editing-info/audit-form-answer-editing-info.vue +1 -1
- package/src/modules/AuditForm/components/form-questions/options/__tests__/audit-form-question-options.spec.js +4 -6
- package/src/modules/AuditForm/components/form-questions/score/__tests__/audit-form-question-score.spec.js +2 -2
- package/src/modules/CSVExport/XLSExport.js +5 -7
- package/src/modules/CSVExport/composables/useCSVExport.ts +3 -3
- package/src/modules/CSVExport/mixins/exportCSVMixin.js +1 -5
- package/src/modules/CSVExport/mixins/exportXLSMixin.js +1 -5
- package/src/modules/DeleteConfirmationPopup/__tests__/delete-confirmation-popup.spec.js +7 -51
- package/src/modules/FilesExport/composables/useFilesExport.ts +1 -1
- package/src/modules/FilesExport/types/types.ts +1 -1
- package/src/modules/Filters/store/FiltersStoreModule.js +27 -27
- package/src/modules/Notifications/store/NotificationsStoreModule.js +1 -1
- package/src/modules/ObjectPermissions/_internals/store/helpers/createObjectPermissionsStoreModule.js +0 -4
- package/src/modules/ObjectPermissions/components/permissions-tab.vue +5 -7
- package/src/modules/QueryFilters/mixins/__tests__/apiFilterMixin.spec.js +2 -2
- package/src/modules/QueryFilters/mixins/__tests__/sortFilterMixin.spec.js +1 -1
- package/src/modules/QueryFilters/store/QueryFiltersStoreModule.js +5 -6
- package/src/modules/QueryFilters/store/__tests__/QueryFiltersStoreModule.spec.js +12 -8
- package/src/modules/TableStoreModule/store/TableStoreModule.js +10 -18
- package/src/modules/UploadCsvPopup/scripts/normalizeCSVData.ts +9 -9
- package/src/modules/UploadCsvPopup/scripts/parseCSV.ts +1 -1
- package/src/modules/Userinfo/composables/createUserAccessControl.ts +2 -2
- package/src/modules/Userinfo/composables/types/CreateUserAccessControl.d.ts +2 -4
- package/src/modules/Userinfo/scripts/utils.ts +4 -2
- package/src/scripts/compareSize.ts +7 -6
- package/src/store/new/modules/tableStoreModule/tableStoreModule.js +17 -29
- package/src/validations/vuelidate/validators/decimalValidator.js +2 -1
- package/src/validations/vuelidate/validators/websocketValidator/websocketValidator.js +1 -1
- package/types/api/clients//321/201ontacts/index.d.ts +2 -2
- package/types/api/defaults/getDefaultGetListResponse/getDefaultGetListResponse.d.ts +1 -1
- package/types/components/on-demand/wt-screen-recordings-action/wt-screen-recordings-action.vue.d.ts +10 -0
- package/types/components/wt-switcher/wt-switcher.vue.d.ts +1 -1
- package/types/components/wt-table/wt-table.vue.d.ts +1 -1
- package/types/components/wt-textarea/wt-textarea.vue.d.ts +3 -4
- package/types/components/wt-tree/wt-tree.vue.d.ts +6 -6
- package/types/components/wt-tree-line/wt-tree-line.vue.d.ts +2 -2
- package/types/components/wt-tree-table/wt-tree-table.vue.d.ts +2 -2
- package/types/components/wt-tree-table-row/wt-tree-table-row.vue.d.ts +1 -1
- package/types/install.d.ts +1 -2
- package/types/modules/AgentPdfs/components/agent-pdfs-tab.vue.d.ts +1 -1
- package/types/modules/CSVExport/composables/useCSVExport.d.ts +3 -3
- package/types/modules/FilesExport/composables/useFilesExport.d.ts +1 -1
- package/types/modules/FilesExport/types/types.d.ts +1 -1
- package/types/modules/Filters/store/FiltersStoreModule.d.ts +2 -2
- package/types/modules/Notifications/store/NotificationsStoreModule.d.ts +1 -1
- package/types/modules/TableStoreModule/store/TableStoreModule.d.ts +2 -2
- package/types/modules/Userinfo/composables/createUserAccessControl.d.ts +2 -2
- package/types/modules/Userinfo/scripts/utils.d.ts +1 -1
- package/types/store/new/modules/tableStoreModule/tableStoreModule.d.ts +2 -2
- package/dist/wt-display-chip-items-DPoEtUZ-.js +0 -46
- package/src/components/wt-copy-action/__tests__/WtCopyAction.spec.js +0 -15
- package/src/components/wt-divider/__tests__/WtDivider.spec.js +0 -10
- package/src/components/wt-slider/__tests__/WtSlider.spec.js +0 -10
- package/src/components/wt-table/__tests__/WtTable.spec.js +0 -140
- package/src/modules/Filters/components/__tests__/filter-pagination.spec.js +0 -109
- package/src/modules/Filters/components/__tests__/filter-table-fields.spec.js +0 -112
- package/types/components/wt-copy-action/__tests__/WtCopyAction.spec.d.ts +0 -1
- package/types/components/wt-divider/__tests__/WtDivider.spec.d.ts +0 -1
- package/types/components/wt-slider/__tests__/WtSlider.spec.d.ts +0 -1
- package/types/components/wt-table/__tests__/WtTable.spec.d.ts +0 -1
- package/types/modules/Filters/components/__tests__/filter-pagination.spec.d.ts +0 -1
- package/types/modules/Filters/components/__tests__/filter-table-fields.spec.d.ts +0 -1
|
@@ -5,16 +5,20 @@ import AppearanceStoreModule from '../../store/AppearanceStoreModule.js';
|
|
|
5
5
|
import WtDarkModeSwitcher from '../wt-dark-mode-switcher.vue';
|
|
6
6
|
|
|
7
7
|
describe('WtDarkModeSwitcher', () => {
|
|
8
|
-
let
|
|
8
|
+
let wrapper;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
const store = createStore(new AppearanceStoreModule().getModule());
|
|
12
|
+
localStorage.removeItem('theme');
|
|
13
|
+
document.documentElement.classList.remove('theme--dark');
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
wrapper = shallowMount(WtDarkModeSwitcher, {
|
|
16
|
+
global: {
|
|
17
|
+
plugins: [
|
|
18
|
+
store,
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
});
|
|
18
22
|
});
|
|
19
23
|
|
|
20
24
|
it('should render component', () => {
|
|
@@ -25,13 +29,15 @@ describe('WtDarkModeSwitcher', () => {
|
|
|
25
29
|
expect(
|
|
26
30
|
window.document.documentElement.classList.contains('theme--dark'),
|
|
27
31
|
).toBe(false);
|
|
28
|
-
|
|
32
|
+
wrapper
|
|
29
33
|
.findComponent({
|
|
30
34
|
name: 'wt-switcher',
|
|
31
35
|
})
|
|
32
|
-
.
|
|
36
|
+
.vm.$emit('update:model-value');
|
|
37
|
+
await wrapper.vm.$nextTick();
|
|
33
38
|
expect(
|
|
34
39
|
window.document.documentElement.classList.contains('theme--dark'),
|
|
35
40
|
).toBe(true);
|
|
41
|
+
expect(localStorage.getItem('theme')).toBe('dark');
|
|
36
42
|
});
|
|
37
43
|
});
|
|
@@ -164,7 +164,7 @@ function handleAnswerUpdate({ key, value }) {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
function initAnswers() {
|
|
167
|
-
if (!answersModel.value
|
|
167
|
+
if (!answersModel.value?.length) {
|
|
168
168
|
answersModel.value = props.questions.map(() => ({}));
|
|
169
169
|
}
|
|
170
170
|
}
|
|
@@ -25,7 +25,7 @@ describe('AuditFormQuestionOptions', () => {
|
|
|
25
25
|
wrapper
|
|
26
26
|
.findComponent('.audit-form-question-options-write__add-button')
|
|
27
27
|
.vm.$emit('click');
|
|
28
|
-
expect(wrapper.emitted()['
|
|
28
|
+
expect(wrapper.emitted()['update:question'][0][0].options.length).toBe(2);
|
|
29
29
|
});
|
|
30
30
|
it('deletes existing question option at "delete" icon-btn click', () => {
|
|
31
31
|
const wrapper = mount(AuditFormQuestionOptions, {
|
|
@@ -42,7 +42,7 @@ describe('AuditFormQuestionOptions', () => {
|
|
|
42
42
|
name: 'audit-form-question-options-write-row',
|
|
43
43
|
});
|
|
44
44
|
writeRow.vm.$emit('delete');
|
|
45
|
-
expect(wrapper.emitted()['
|
|
45
|
+
expect(wrapper.emitted()['update:question'][0][0].options.length).toBe(0);
|
|
46
46
|
});
|
|
47
47
|
it('emits result change with selected radio option score', () => {
|
|
48
48
|
const score = 11;
|
|
@@ -62,10 +62,8 @@ describe('AuditFormQuestionOptions', () => {
|
|
|
62
62
|
.findComponent({
|
|
63
63
|
name: 'wt-radio',
|
|
64
64
|
})
|
|
65
|
-
.vm.$emit('
|
|
66
|
-
|
|
67
|
-
});
|
|
68
|
-
expect(wrapper.emitted()['change:result'][0][0]).toEqual({
|
|
65
|
+
.vm.$emit('update:selected', score);
|
|
66
|
+
expect(wrapper.emitted()['update:answer'][0][0]).toEqual({
|
|
69
67
|
score,
|
|
70
68
|
});
|
|
71
69
|
});
|
|
@@ -29,8 +29,8 @@ describe('AuditFormQuestionScore', () => {
|
|
|
29
29
|
.findComponent({
|
|
30
30
|
name: 'wt-radio',
|
|
31
31
|
})
|
|
32
|
-
.vm.$emit('
|
|
33
|
-
expect(wrapper.emitted()['
|
|
32
|
+
.vm.$emit('update:selected', min);
|
|
33
|
+
expect(wrapper.emitted()['update:answer'][0][0]).toEqual({
|
|
34
34
|
score: min,
|
|
35
35
|
});
|
|
36
36
|
});
|
|
@@ -59,13 +59,11 @@ export default class XLSExport {
|
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
return columns.reduce((acc, column) => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
[column]
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
'',
|
|
68
|
-
};
|
|
62
|
+
acc[column] =
|
|
63
|
+
this.extractNameFromObject(item[column]) ||
|
|
64
|
+
flatVariables[column] ||
|
|
65
|
+
'';
|
|
66
|
+
return acc;
|
|
69
67
|
}, {});
|
|
70
68
|
});
|
|
71
69
|
|
|
@@ -4,9 +4,9 @@ import { useRoute } from 'vue-router';
|
|
|
4
4
|
|
|
5
5
|
import CSVExport from '../CSVExport';
|
|
6
6
|
|
|
7
|
-
export type CSVRow = Record<string,
|
|
7
|
+
export type CSVRow = Record<string, unknown>;
|
|
8
8
|
|
|
9
|
-
export type FetchMethod = (params: Record<string,
|
|
9
|
+
export type FetchMethod = (params: Record<string, unknown>) => Promise<{
|
|
10
10
|
items: CSVRow[];
|
|
11
11
|
next: boolean;
|
|
12
12
|
}>;
|
|
@@ -39,7 +39,7 @@ export function useCSVExport({ selected }: { selected: Ref<number[]> }) {
|
|
|
39
39
|
CSVExportInstance.value = new CSVExport(fetchMethod, options);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
async function exportCSV(exportParams?: Record<string,
|
|
42
|
+
async function exportCSV(exportParams?: Record<string, unknown>) {
|
|
43
43
|
const routeQuery = route.query;
|
|
44
44
|
const params = {
|
|
45
45
|
...(exportParams || routeQuery),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
2
|
import { ref } from 'vue';
|
|
3
3
|
|
|
4
4
|
import { useValidation } from '../../../mixins/validationMixin/useValidation';
|
|
@@ -23,69 +23,25 @@ describe('DeleteConfirmationPopup', () => {
|
|
|
23
23
|
expect(wrapper.classes('delete-confirmation-popup')).toBe(true);
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
it('yes button called props callback', async () => {
|
|
27
|
-
const callback = vi.fn();
|
|
28
|
-
const wrapper = mount(DeleteConfirmationPopup, {
|
|
29
|
-
props: {
|
|
30
|
-
deleteCount: 1,
|
|
31
|
-
callback,
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
const button = wrapper
|
|
35
|
-
.findAllComponents({
|
|
36
|
-
name: 'wt-button',
|
|
37
|
-
})
|
|
38
|
-
.find((btn) => btn.text().includes('Yes'));
|
|
39
|
-
expect(button.text()).toContain('Yes');
|
|
40
|
-
await button.trigger('click');
|
|
41
|
-
await wrapper.vm.$nextTick();
|
|
42
|
-
expect(callback).toHaveBeenCalled();
|
|
43
|
-
});
|
|
44
|
-
|
|
45
26
|
it('popup message block have delete count', () => {
|
|
46
27
|
const deleteCount = 123;
|
|
47
|
-
const wrapper =
|
|
28
|
+
const wrapper = shallowMount(DeleteConfirmationPopup, {
|
|
48
29
|
props: {
|
|
49
30
|
deleteCount,
|
|
50
31
|
callback: vi.fn(),
|
|
51
32
|
},
|
|
52
33
|
});
|
|
53
|
-
expect(
|
|
54
|
-
wrapper.find('.delete-confirmation-popup__content').text(),
|
|
55
|
-
).toContain(deleteCount.toString());
|
|
34
|
+
expect(wrapper.vm.deleteMessage).toContain(deleteCount.toString());
|
|
56
35
|
});
|
|
57
36
|
|
|
58
|
-
it('
|
|
59
|
-
const wrapper =
|
|
37
|
+
it('uses "delete all" text for zero count', () => {
|
|
38
|
+
const wrapper = shallowMount(DeleteConfirmationPopup, {
|
|
60
39
|
props: {
|
|
61
|
-
deleteCount:
|
|
40
|
+
deleteCount: 0,
|
|
62
41
|
callback: vi.fn(),
|
|
63
42
|
},
|
|
64
43
|
});
|
|
65
|
-
const button = wrapper
|
|
66
|
-
.findAllComponents({
|
|
67
|
-
name: 'wt-button',
|
|
68
|
-
})
|
|
69
|
-
.find((btn) => btn.text().includes('Yes'));
|
|
70
|
-
await button.vm.$emit('close');
|
|
71
|
-
await wrapper.vm.$nextTick();
|
|
72
|
-
expect(button.emitted('close')).toBeTruthy();
|
|
73
|
-
});
|
|
74
44
|
|
|
75
|
-
|
|
76
|
-
const wrapper = mount(DeleteConfirmationPopup, {
|
|
77
|
-
props: {
|
|
78
|
-
deleteCount: 1,
|
|
79
|
-
callback: vi.fn(),
|
|
80
|
-
},
|
|
81
|
-
});
|
|
82
|
-
const button = wrapper
|
|
83
|
-
.findAllComponents({
|
|
84
|
-
name: 'wt-button',
|
|
85
|
-
})
|
|
86
|
-
.find((btn) => btn.text().includes('No'));
|
|
87
|
-
await button.vm.$emit('close');
|
|
88
|
-
await wrapper.vm.$nextTick();
|
|
89
|
-
expect(button.emitted('close')).toBeTruthy();
|
|
45
|
+
expect(wrapper.vm.deleteMessage).toBeTruthy();
|
|
90
46
|
});
|
|
91
47
|
});
|
|
@@ -11,7 +11,7 @@ export default class FiltersStoreModule extends BaseStoreModule {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
getters = {
|
|
14
|
-
ROUTER: (
|
|
14
|
+
ROUTER: (_s, _g, rootState) => {
|
|
15
15
|
if (rootState.router === undefined) {
|
|
16
16
|
console.warn(
|
|
17
17
|
'"rootState.router" is needed for filters to work properly.' +
|
|
@@ -22,16 +22,12 @@ export default class FiltersStoreModule extends BaseStoreModule {
|
|
|
22
22
|
},
|
|
23
23
|
|
|
24
24
|
_STATE_FILTER_NAMES: (state) => {
|
|
25
|
-
return Object.values(state).reduce(
|
|
26
|
-
(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
]
|
|
32
|
-
: names,
|
|
33
|
-
[],
|
|
34
|
-
);
|
|
25
|
+
return Object.values(state).reduce((names, prop) => {
|
|
26
|
+
if (prop.value || prop.name) {
|
|
27
|
+
names.push(prop.name);
|
|
28
|
+
}
|
|
29
|
+
return names;
|
|
30
|
+
}, []);
|
|
35
31
|
},
|
|
36
32
|
|
|
37
33
|
// get value of specific filter
|
|
@@ -46,15 +42,14 @@ export default class FiltersStoreModule extends BaseStoreModule {
|
|
|
46
42
|
},
|
|
47
43
|
|
|
48
44
|
// get all filters values
|
|
49
|
-
GET_FILTERS: (
|
|
45
|
+
GET_FILTERS: (_state, getters) => () => {
|
|
50
46
|
return getters._STATE_FILTER_NAMES.reduce((values, filterName) => {
|
|
51
47
|
const filterValue = getters.GET_FILTER(filterName);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
};
|
|
48
|
+
if (isEmpty(filterValue)) {
|
|
49
|
+
return values;
|
|
50
|
+
}
|
|
51
|
+
values[filterName] = filterValue;
|
|
52
|
+
return values;
|
|
58
53
|
}, {});
|
|
59
54
|
},
|
|
60
55
|
};
|
|
@@ -146,10 +141,8 @@ export default class FiltersStoreModule extends BaseStoreModule {
|
|
|
146
141
|
if (context.state[qKey]) {
|
|
147
142
|
return filteredQuery;
|
|
148
143
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
[qKey]: qValue,
|
|
152
|
-
};
|
|
144
|
+
filteredQuery[qKey] = qValue;
|
|
145
|
+
return filteredQuery;
|
|
153
146
|
},
|
|
154
147
|
{},
|
|
155
148
|
);
|
|
@@ -166,9 +159,13 @@ export default class FiltersStoreModule extends BaseStoreModule {
|
|
|
166
159
|
},
|
|
167
160
|
|
|
168
161
|
SUBSCRIBE: (context, { event, callback }) => {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
162
|
+
if (Array.isArray(event)) {
|
|
163
|
+
event.forEach((e) => {
|
|
164
|
+
context.state._emitter.on(e, callback);
|
|
165
|
+
});
|
|
166
|
+
} else {
|
|
167
|
+
context.state._emitter.on(event, callback);
|
|
168
|
+
}
|
|
172
169
|
},
|
|
173
170
|
|
|
174
171
|
FLUSH_SUBSCRIBERS: (context) => {
|
|
@@ -217,8 +214,11 @@ export default class FiltersStoreModule extends BaseStoreModule {
|
|
|
217
214
|
};
|
|
218
215
|
};
|
|
219
216
|
|
|
220
|
-
if (Array.isArray(filter))
|
|
221
|
-
|
|
217
|
+
if (Array.isArray(filter)) {
|
|
218
|
+
filter.forEach((f) => {
|
|
219
|
+
setup(f);
|
|
220
|
+
});
|
|
221
|
+
} else setup(filter);
|
|
222
222
|
|
|
223
223
|
return this;
|
|
224
224
|
}
|
package/src/modules/ObjectPermissions/_internals/store/helpers/createObjectPermissionsStoreModule.js
CHANGED
|
@@ -15,10 +15,6 @@ export const createObjectPermissionsStoreModule = (modules) => {
|
|
|
15
15
|
objectPermissionsStoreModule(),
|
|
16
16
|
]);
|
|
17
17
|
|
|
18
|
-
const cardSubmodule = [
|
|
19
|
-
// empty, now permissions don't have standard card functionality
|
|
20
|
-
];
|
|
21
|
-
|
|
22
18
|
return createBaseStoreModule([
|
|
23
19
|
{
|
|
24
20
|
modules: {
|
|
@@ -150,14 +150,12 @@ const {
|
|
|
150
150
|
|
|
151
151
|
const localizedDataList = computed(() => {
|
|
152
152
|
return dataList.value.map((item) => {
|
|
153
|
-
const access = Object.keys(item.access).reduce((
|
|
154
|
-
|
|
155
|
-
...access,
|
|
156
|
-
[rule]
|
|
157
|
-
...item.access[rule],
|
|
158
|
-
name: t(`access.accessMode.${item.access[rule].id}`),
|
|
159
|
-
},
|
|
153
|
+
const access = Object.keys(item.access).reduce((acc, rule) => {
|
|
154
|
+
acc[rule] = {
|
|
155
|
+
...item.access[rule],
|
|
156
|
+
name: t(`access.accessMode.${item.access[rule].id}`),
|
|
160
157
|
};
|
|
158
|
+
return acc;
|
|
161
159
|
}, {});
|
|
162
160
|
|
|
163
161
|
return {
|
|
@@ -53,7 +53,7 @@ describe('API filter mixin', () => {
|
|
|
53
53
|
team,
|
|
54
54
|
},
|
|
55
55
|
});
|
|
56
|
-
|
|
56
|
+
shallowMount(Component, {
|
|
57
57
|
global: {
|
|
58
58
|
plugins: [
|
|
59
59
|
router,
|
|
@@ -74,7 +74,7 @@ describe('API filter mixin', () => {
|
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
it('Sets empty array value if $route query is empty', async () => {
|
|
77
|
-
|
|
77
|
+
shallowMount(Component, {
|
|
78
78
|
global: {
|
|
79
79
|
plugins: [
|
|
80
80
|
router,
|
|
@@ -6,12 +6,11 @@ export default class QueryFiltersStoreModule extends BaseStoreModule {
|
|
|
6
6
|
GET_FILTERS: (state, getters) =>
|
|
7
7
|
Object.keys(state).reduce((filters, filterKey) => {
|
|
8
8
|
const filterValue = getters.GET_FILTER(filterKey);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
9
|
+
if (isEmpty(filterValue)) {
|
|
10
|
+
return filters;
|
|
11
|
+
}
|
|
12
|
+
filters[filterKey] = filterValue;
|
|
13
|
+
return filters;
|
|
15
14
|
}, {}),
|
|
16
15
|
GET_FILTER: (state) => (filter) => {
|
|
17
16
|
const { value, storedProp, multiple } = state[filter];
|
|
@@ -48,13 +48,17 @@ describe('QueryFiltersStoreModule getters', () => {
|
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
describe('QueryFiltersStoreModule actions', () => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
let context;
|
|
52
|
+
let module;
|
|
53
|
+
beforeEach(() => {
|
|
54
|
+
context = {
|
|
55
|
+
state: {
|
|
56
|
+
...state,
|
|
57
|
+
},
|
|
58
|
+
commit: vi.fn(),
|
|
59
|
+
};
|
|
60
|
+
module = new QueryFiltersStoreModule().getModule();
|
|
61
|
+
});
|
|
58
62
|
it('SET_FILTER: single value filter', () => {
|
|
59
63
|
const filter = {
|
|
60
64
|
filter: valueFilter,
|
|
@@ -114,7 +118,7 @@ describe('QueryFiltersStoreModule actions', () => {
|
|
|
114
118
|
});
|
|
115
119
|
it('calls RESET_FILTERS mutation on RESET_FILTERS action call', () => {
|
|
116
120
|
module.actions.RESET_FILTERS(context);
|
|
117
|
-
expect(context.commit).toHaveBeenCalledWith('RESET_FILTERS');
|
|
121
|
+
expect(context.commit).toHaveBeenCalledWith('RESET_FILTERS', undefined);
|
|
118
122
|
});
|
|
119
123
|
});
|
|
120
124
|
|
|
@@ -19,15 +19,13 @@ export default class TableStoreModule extends BaseStoreModule {
|
|
|
19
19
|
PARENT_ID: () => null, // override me
|
|
20
20
|
|
|
21
21
|
// FIXME: maybe move to filters module?
|
|
22
|
-
FILTERS: (
|
|
22
|
+
FILTERS: (_, getters) => getters['filters/GET_FILTERS'],
|
|
23
23
|
|
|
24
24
|
FIELDS: (state) => {
|
|
25
25
|
const fields = state.headers.reduce((fields, { show, field }) => {
|
|
26
|
-
if (show)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
field,
|
|
30
|
-
];
|
|
26
|
+
if (show) {
|
|
27
|
+
fields.push(field);
|
|
28
|
+
}
|
|
31
29
|
return fields;
|
|
32
30
|
}, []);
|
|
33
31
|
|
|
@@ -40,7 +38,7 @@ export default class TableStoreModule extends BaseStoreModule {
|
|
|
40
38
|
},
|
|
41
39
|
|
|
42
40
|
// main GET_LIST params collector
|
|
43
|
-
GET_LIST_PARAMS: (
|
|
41
|
+
GET_LIST_PARAMS: (_state, getters) => (overrides) => {
|
|
44
42
|
const filters = getters.FILTERS();
|
|
45
43
|
const fields = getters.FIELDS;
|
|
46
44
|
const parentId = getters.PARENT_ID;
|
|
@@ -250,8 +248,6 @@ export default class TableStoreModule extends BaseStoreModule {
|
|
|
250
248
|
}
|
|
251
249
|
try {
|
|
252
250
|
await context.dispatch(action, deleted);
|
|
253
|
-
} catch (err) {
|
|
254
|
-
throw err;
|
|
255
251
|
} finally {
|
|
256
252
|
await context.dispatch('LOAD_DATA_LIST');
|
|
257
253
|
|
|
@@ -269,15 +265,11 @@ export default class TableStoreModule extends BaseStoreModule {
|
|
|
269
265
|
},
|
|
270
266
|
|
|
271
267
|
DELETE_SINGLE: async (context, { id, etag }) => {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
});
|
|
278
|
-
} catch (err) {
|
|
279
|
-
throw err;
|
|
280
|
-
}
|
|
268
|
+
await context.dispatch('api/DELETE_ITEM', {
|
|
269
|
+
context,
|
|
270
|
+
id,
|
|
271
|
+
etag,
|
|
272
|
+
});
|
|
281
273
|
},
|
|
282
274
|
|
|
283
275
|
DELETE_BULK: async (context, deleted) =>
|
|
@@ -21,12 +21,12 @@ const normalizeCSVData = ({ data, mappings }) => {
|
|
|
21
21
|
|
|
22
22
|
return data.map((dataItem, index) => {
|
|
23
23
|
const normalized = nonEmptyMappingFields.reduce(
|
|
24
|
-
(normalizedItem, { name, csv, required }) => {
|
|
24
|
+
(normalizedItem: Record<string, unknown>, { name, csv, required }) => {
|
|
25
25
|
const value = Array.isArray(csv)
|
|
26
26
|
? csv.map((csv) => dataItem[csv])
|
|
27
27
|
: dataItem[csv];
|
|
28
28
|
|
|
29
|
-
let filteredValue; // Filter empty values in validation purposes
|
|
29
|
+
let filteredValue: unknown; // Filter empty values in validation purposes
|
|
30
30
|
if (Array.isArray(value)) {
|
|
31
31
|
// Because required field can be combined from many fields in multiple select, so we need to check all values.
|
|
32
32
|
// For example, if we have 3 fields and they are empty, we will get empty array.
|
|
@@ -43,14 +43,14 @@ const normalizeCSVData = ({ data, mappings }) => {
|
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
if (isValueEmpty) {
|
|
47
|
+
return normalizedItem;
|
|
48
|
+
}
|
|
49
|
+
// Original value for proper mapping (e.g., variables in members)
|
|
50
|
+
normalizedItem[name] = value;
|
|
51
|
+
return normalizedItem;
|
|
52
52
|
},
|
|
53
|
-
{},
|
|
53
|
+
{} as Record<string, unknown>,
|
|
54
54
|
);
|
|
55
55
|
|
|
56
56
|
return normalized;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { computed, Ref } from 'vue';
|
|
1
|
+
import { computed, type Ref } from 'vue';
|
|
2
2
|
import { useRoute } from 'vue-router';
|
|
3
3
|
import { CrudAction, type WtObject } from '../../../enums';
|
|
4
4
|
import { _wtUiLog } from '../../../scripts/logger';
|
|
5
|
-
import { createUserAccessStore } from '../stores/accessStore';
|
|
5
|
+
import type { createUserAccessStore } from '../stores/accessStore';
|
|
6
6
|
import type { UserAccessStore } from '../types/UserAccess.d.ts';
|
|
7
7
|
|
|
8
8
|
export type UseUserAccessControlComposableOptions =
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { WtObject } from '../../../../enums';
|
|
4
|
-
import type { createUserAccessStore } from '../../../../modules/Userinfo/v2/stores/accessStore';
|
|
1
|
+
/** Ambient declarations for create-user-access-control can be added here. */
|
|
2
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CrudAction, WtObject } from '../../../enums';
|
|
2
2
|
import { _wtUiLog as wtlog } from '../../../scripts/logger';
|
|
3
3
|
import {
|
|
4
4
|
mapGlobalActionToCrudAction,
|
|
@@ -92,7 +92,9 @@ export const makeSectionVisibilityMap = (
|
|
|
92
92
|
|
|
93
93
|
Object.entries(rawVisibility).forEach(([app, appSectionsVisibility]) => {
|
|
94
94
|
Object.entries(appSectionsVisibility).forEach(([section, visibility]) => {
|
|
95
|
-
if (section.startsWith('_'))
|
|
95
|
+
if (section.startsWith('_')) {
|
|
96
|
+
return; // skip private fields
|
|
97
|
+
}
|
|
96
98
|
map.set(
|
|
97
99
|
`${app}/${section}`,
|
|
98
100
|
(
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ComponentSize } from '../enums/ComponentSize/ComponentSize';
|
|
2
2
|
|
|
3
|
-
const numerics = Object.values(ComponentSize).reduce(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
},
|
|
3
|
+
const numerics = Object.values(ComponentSize).reduce(
|
|
4
|
+
(nums, size, index) => {
|
|
5
|
+
nums[size] = index;
|
|
6
|
+
return nums;
|
|
7
|
+
},
|
|
8
|
+
{} as Record<ComponentSize, number>,
|
|
9
|
+
);
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Compare two sizes, returning a number indicating the difference between them.
|