@webitel/ui-sdk 24.10.2 → 24.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +111 -114
- package/dist/ui-sdk.umd.cjs +8 -8
- package/package.json +6 -4
- package/src/api/axios/generateInstance.js +1 -4
- package/src/api/clients/agents/agents.js +31 -78
- package/src/api/clients/buckets/buckets.js +17 -57
- package/src/api/clients/calendars/calendars.js +18 -71
- package/src/api/clients/chatGateways/chatGateways.js +23 -61
- package/src/api/clients/chatGateways/defaults/webChatGateway.js +6 -8
- package/src/api/clients/chatGateways/enums/WebchatAlternativeChannel.enum.js +3 -3
- package/src/api/clients/communications/communications.js +20 -62
- package/src/api/clients/configurations/configurations.js +18 -3
- package/src/api/clients/flows/flow.js +17 -60
- package/src/api/clients/gateways/gateways.js +20 -59
- package/src/api/clients/index.js +1 -1
- package/src/api/clients/lists/blacklists.js +18 -60
- package/src/api/clients/media/media.js +13 -43
- package/src/api/clients/queues/defaults/processing.js +10 -6
- package/src/api/clients/queues/queues.js +21 -69
- package/src/api/clients/roles/roles.js +15 -33
- package/src/api/clients/users/__tests__/users.spec.js +43 -26
- package/src/api/clients/users/users.js +21 -56
- package/src/api/crm/contactChatMessagesHistory.js +8 -23
- package/src/api/crm/index.js +1 -3
- package/src/api/defaults/getDefaultGetParams/getDefaultGetParams.js +1 -4
- package/src/api/defaults/getDefaultInstance/getDefaultInstance.js +10 -11
- package/src/api/defaults/getDefaultOpenAPIConfig/getDefaultOpenAPIConfig.js +6 -5
- package/src/api/defaults/index.js +2 -4
- package/src/api/history/index.js +1 -3
- package/src/api/history/transcript/callTranscript.js +10 -30
- package/src/api/interceptors/request/updateToken.interceptor.js +1 -2
- package/src/api/transformers/merge/merge.transformer.js +4 -1
- package/src/api/transformers/mergeEach/mergeEach.transformer.js +4 -4
- package/src/api/transformers/notify/notify.transformer.js +9 -6
- package/src/api/transformers/starToSearch/starToSearch.transformer.js +8 -6
- package/src/components/index.js +3 -6
- package/src/components/on-demand/wt-cc-agent-status-timers/__tests__/wt-cc-agent-status-timers.spec.js +2 -4
- package/src/components/transitions/wt-expand-transition.vue +2 -3
- package/src/components/wt-app-header/__tests__/WtAppNavigator.spec.js +1 -2
- package/src/components/wt-app-header/__tests__/WtHeaderActions.spec.js +1 -2
- package/src/components/wt-app-header/wt-app-navigator.vue +15 -9
- package/src/components/wt-avatar/wt-avatar.vue +8 -3
- package/src/components/wt-button/wt-button.vue +0 -1
- package/src/components/wt-button-select/__tests__/WtButtonSelect.spec.js +4 -5
- package/src/components/wt-button-select/wt-button-select.vue +0 -1
- package/src/components/wt-context-menu/wt-context-menu.vue +32 -35
- package/src/components/wt-dummy/wt-dummy.vue +2 -5
- package/src/components/wt-expansion-panel/wt-expansion-panel.vue +10 -7
- package/src/components/wt-filters-panel-wrapper/__tests__/WtFiltersPanelWrapper.spec.js +4 -8
- package/src/components/wt-icon/wt-icon.vue +0 -1
- package/src/components/wt-indicator/__tests__/WtIndicator.spec.js +3 -2
- package/src/components/wt-indicator/wt-indicator.vue +10 -1
- package/src/components/wt-input/wt-input.vue +7 -10
- package/src/components/wt-item-link/wt-item-link.vue +7 -4
- package/src/components/wt-navigation-bar/__tests__/WtNavigationBar.spec.js +7 -15
- package/src/components/wt-navigation-bar/wt-navigation-bar.vue +7 -7
- package/src/components/wt-notification/wt-notification.vue +1 -2
- package/src/components/wt-notifications-bar/__tests__/WtNotificationsBar.spec.js +6 -3
- package/src/components/wt-notifications-bar/wt-notifications-bar.vue +4 -1
- package/src/components/wt-page-wrapper/__tests__/WtPageWrapper.spec.js +1 -2
- package/src/components/wt-pagination/wt-pagination.vue +1 -3
- package/src/components/wt-player/scripts/__tests__/createPlyrURL.spec.js +4 -8
- package/src/components/wt-player/wt-player.vue +13 -4
- package/src/components/wt-popup/wt-popup.vue +2 -1
- package/src/components/wt-search-bar/wt-search-bar.vue +1 -1
- package/src/components/wt-select/mixins/multiselectMixin.js +2 -5
- package/src/components/wt-select/wt-select.vue +12 -11
- package/src/components/wt-slider/wt-slider.vue +4 -2
- package/src/components/wt-status-select/wt-status-select.vue +10 -6
- package/src/components/wt-stepper/wt-stepper.vue +6 -4
- package/src/components/wt-switcher/wt-switcher.vue +1 -3
- package/src/components/wt-table/__tests__/WtTable.spec.js +2 -5
- package/src/components/wt-table/wt-table.vue +18 -16
- package/src/components/wt-table-column-select/wt-table-column-select.vue +9 -8
- package/src/components/wt-tabs/wt-tabs.vue +1 -3
- package/src/components/wt-tags-input/mixin/taggableMixin.js +7 -7
- package/src/components/wt-textarea/__tests__/WtTextarea.spec.js +2 -4
- package/src/components/wt-textarea/wt-textarea.vue +3 -2
- package/src/components/wt-timepicker/wt-timepicker.vue +1 -3
- package/src/components/wt-tooltip/_internals/useTooltipTriggerSubscriptions.js +1 -3
- package/src/components/wt-tooltip/_internals/wt-tooltip-floating.vue +8 -12
- package/src/components/wt-tooltip/wt-tooltip.vue +13 -13
- package/src/composables/useCachedInterval/__tests__/useCachedInterval.spec.js +6 -4
- package/src/composables/useCachedInterval/useCachedInterval.js +3 -8
- package/src/composables/useRepresentableAgentPauseCause/__tests__/useRepresentableAgentPauseCause.spec.js +11 -33
- package/src/composables/useRepresentableAgentPauseCause/useRepresentableAgentPauseCause.js +11 -9
- package/src/enums/WebitelApplications/AdminSections.enum.js +28 -28
- package/src/enums/WebitelApplications/CrmSections.enum.js +1 -1
- package/src/locale/en/en.js +12 -15
- package/src/locale/es/es.js +4 -8
- package/src/locale/kz/kz.js +5 -7
- package/src/locale/ru/ru.js +7 -11
- package/src/locale/ua/ua.js +13 -17
- package/src/mixins/dataFilterMixins/__tests__/enumFilterMixin.spec.js +1 -2
- package/src/mixins/dataFilterMixins/__tests__/sortFilterMixin.spec.js +4 -2
- package/src/mixins/dataFilterMixins/__tests__/urlControllerMixin.spec.js +4 -1
- package/src/mixins/dataFilterMixins/_urlControllerMixin/_urlControllerMixin.js +1 -1
- package/src/mixins/dataFilterMixins/apiFilterMixin.js +1 -2
- package/src/mixins/dataFilterMixins/baseFilterMixin/baseFilterMixin.js +1 -2
- package/src/mixins/dataFilterMixins/enumFilterMixin.js +5 -6
- package/src/mixins/dataFilterMixins/paginationFilterMixin.js +1 -2
- package/src/mixins/dataFilterMixins/sortFilterMixin.js +1 -4
- package/src/mixins/validationMixin/__tests__/validationMixin.spec.js +1 -2
- package/src/mixins/validationMixin/useValidation.js +25 -19
- package/src/mixins/validationMixin/validationMixin.js +22 -10
- package/src/modules/AgentStatusSelect/api/pause-cause.js +3 -11
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-agent-status-select.spec.js +16 -18
- package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-pause-cause-popup.spec.js +1 -2
- package/src/modules/AgentStatusSelect/components/_internals/wt-cc-pause-cause-popup.vue +12 -12
- package/src/modules/AgentStatusSelect/components/_internals/wt-cc-status-select-error-popup.vue +0 -1
- package/src/modules/AgentStatusSelect/components/wt-cc-agent-status-select.vue +20 -7
- package/src/modules/Appearance/components/__tests__/wt-dark-mode-switcher.spec.js +2 -4
- package/src/modules/Appearance/components/wt-dark-mode-switcher.vue +0 -1
- package/src/modules/AuditForm/components/__tests__/audit-form-question-read-wrapper.spec.js +1 -2
- package/src/modules/AuditForm/components/__tests__/audit-form-question-write-wrapper.spec.js +15 -25
- package/src/modules/AuditForm/components/__tests__/audit-form.spec.js +11 -20
- package/src/modules/AuditForm/components/audit-form-question-read-wrapper.vue +1 -4
- package/src/modules/AuditForm/components/audit-form-question-write-wrapper.vue +4 -7
- package/src/modules/AuditForm/components/audit-form-question.vue +18 -17
- package/src/modules/AuditForm/components/audit-form.vue +12 -14
- package/src/modules/AuditForm/components/questions/options/__tests__/audit-form-question-options-write-row.spec.js +1 -2
- package/src/modules/AuditForm/components/questions/options/__tests__/audit-form-question-options.spec.js +1 -3
- package/src/modules/AuditForm/components/questions/options/audit-form-question-options-write-row.vue +11 -15
- package/src/modules/AuditForm/components/questions/options/audit-form-question-options.vue +1 -4
- package/src/modules/AuditForm/components/questions/score/audit-form-question-score.vue +16 -20
- package/src/modules/AuditForm/schemas/AuditFormQuestionOptionsSchema.js +1 -3
- package/src/modules/CSVExport/CSVExport.js +3 -7
- package/src/modules/CSVExport/XLSExport.js +6 -7
- package/src/modules/CSVExport/__tests__/CSVExport.spec.js +1 -2
- package/src/modules/CSVExport/mixins/exportCSVMixin.js +2 -5
- package/src/modules/CSVExport/mixins/exportXLSMixin.js +2 -4
- package/src/modules/CardStoreModule/store/CardStoreModule.js +2 -6
- package/src/modules/DeleteConfirmationPopup/__tests__/delete-confirmation-popup.spec.js +13 -10
- package/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue +5 -14
- package/src/modules/FilesExport/FilesExport.js +4 -3
- package/src/modules/FilesExport/__tests__/FilesExport.spec.js +12 -12
- package/src/modules/FilesExport/mixins/exportFilesMixin.js +6 -7
- package/src/modules/FilesExport/scripts/generateMediaURL.js +1 -2
- package/src/modules/Filters/classes/BaseFilterSchema.js +21 -23
- package/src/modules/Filters/components/filter-pagination.vue +7 -3
- package/src/modules/Filters/components/filter-search.vue +21 -12
- package/src/modules/Filters/components/filter-table-fields.vue +1 -3
- package/src/modules/Filters/scripts/getters/index.js +1 -5
- package/src/modules/Filters/scripts/getters/queryGetter.js +8 -3
- package/src/modules/Filters/scripts/getters/valueGetter.js +1 -2
- package/src/modules/Filters/scripts/restores/index.js +1 -4
- package/src/modules/Filters/scripts/setters/index.js +1 -5
- package/src/modules/Filters/scripts/setters/querySetter.js +24 -22
- package/src/modules/Filters/scripts/utils/changeRouteQuery.js +16 -15
- package/src/modules/Filters/store/FiltersStoreModule.js +51 -45
- package/src/modules/Filters/store/__tests__/FiltersStoreModule.spec.js +51 -45
- package/src/modules/Notifications/store/NotificationsStoreModule.js +41 -38
- package/src/modules/Notifications/store/__tests__/NotificationsStoreModule.actions.spec.js +6 -6
- package/src/modules/QueryFilters/api/defaults.js +2 -3
- package/src/modules/QueryFilters/classes/ApiFilterSchema.js +1 -4
- package/src/modules/QueryFilters/classes/EnumFilterSchema.js +1 -4
- package/src/modules/QueryFilters/components/__tests__/filter-datetime.spec.js +1 -2
- package/src/modules/QueryFilters/components/__tests__/filter-from-to.spec.js +2 -4
- package/src/modules/QueryFilters/components/__tests__/filter-search.spec.js +2 -4
- package/src/modules/QueryFilters/components/filter-table-fields.vue +1 -5
- package/src/modules/QueryFilters/mixins/__tests__/apiFilterMixin.spec.js +4 -3
- package/src/modules/QueryFilters/mixins/__tests__/enumFilterMixin.spec.js +2 -4
- package/src/modules/QueryFilters/mixins/__tests__/sortFilterMixin.spec.js +4 -2
- package/src/modules/QueryFilters/mixins/__tests__/urlControllerMixin.spec.js +4 -1
- package/src/modules/QueryFilters/mixins/_urlControllerMixin/_urlControllerMixin.js +1 -1
- package/src/modules/QueryFilters/mixins/apiFilterMixin.js +1 -1
- package/src/modules/QueryFilters/mixins/baseFilterMixin/baseFilterMixin.js +4 -2
- package/src/modules/QueryFilters/mixins/enumFilterMixin.js +9 -11
- package/src/modules/QueryFilters/mixins/paginationFilterMixin.js +2 -4
- package/src/modules/QueryFilters/mixins/sortFilterMixin.js +2 -5
- package/src/modules/QueryFilters/store/QueryFiltersStoreModule.js +13 -17
- package/src/modules/QueryFilters/store/__tests__/QueryFiltersStoreModule.spec.js +15 -16
- package/src/modules/TableStoreModule/store/TableStoreModule.js +14 -33
- package/src/modules/TableStoreModule/store/__tests__/TableStoreModule.spec.js +69 -83
- package/src/modules/Userinfo/api/userinfo.js +6 -19
- package/src/modules/Userinfo/classes/ApplicationsAccess.js +5 -12
- package/src/modules/Userinfo/store/UserinfoStoreModule.js +38 -41
- package/src/plugins/breakpoint/breakpoint.plugin.js +11 -16
- package/src/scripts/__tests__/caseConverters.spec.js +1 -4
- package/src/scripts/__tests__/debounce.spec.js +3 -1
- package/src/scripts/__tests__/prettifyFileSize.spec.js +2 -2
- package/src/scripts/__tests__/preventHiddenPageCallsDecorator.spec.js +7 -4
- package/src/scripts/__tests__/updateObject.spec.js +3 -5
- package/src/scripts/caseConverters.js +22 -38
- package/src/scripts/debounce.js +1 -5
- package/src/scripts/editProxy.js +8 -7
- package/src/scripts/prettifyFileSize.js +1 -1
- package/src/scripts/preventHiddenPageCallsDecorator.js +3 -6
- package/src/store/BaseStoreModules/ApiStoreModule.js +7 -33
- package/src/store/BaseStoreModules/BaseStoreModule.js +14 -23
- package/src/store/BaseStoreModules/__tests__/BaseStoreModule.spec.js +7 -28
- package/src/store/helpers/getNamespacedState.js +2 -4
- package/src/store/new/modules/apiStoreModule/apiStoreModule.js +7 -27
- package/src/store/new/modules/cardStoreModule/cardStoreModule.js +0 -1
- package/src/store/new/modules/tableStoreModule/__tests__/tableStoreModule.spec.js +64 -77
- package/src/store/new/modules/tableStoreModule/tableStoreModule.js +12 -29
- package/src/tests/mocks/axiosMock.js +25 -19
- package/src/validators/decimalValidator.js +5 -4
- package/src/validators/websocketValidator/__tests__/websocketValidator.spec.js +1 -2
- package/src/validators/websocketValidator/websocketValidator.js +1 -1
|
@@ -89,18 +89,16 @@ const props = defineProps({
|
|
|
89
89
|
},
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
const emit = defineEmits([
|
|
93
|
-
'change:question',
|
|
94
|
-
'copy',
|
|
95
|
-
'delete',
|
|
96
|
-
]);
|
|
92
|
+
const emit = defineEmits(['change:question', 'copy', 'delete']);
|
|
97
93
|
|
|
98
94
|
const QuestionType = [
|
|
99
95
|
{ value: EngineAuditQuestionType.Option, locale: 'webitelUI.auditForm.type.options' },
|
|
100
96
|
{ value: EngineAuditQuestionType.Score, locale: 'webitelUI.auditForm.type.score' },
|
|
101
97
|
];
|
|
102
98
|
|
|
103
|
-
const prettifiedQuestionType = computed(() =>
|
|
99
|
+
const prettifiedQuestionType = computed(() =>
|
|
100
|
+
QuestionType.find(({ value }) => value === props.question.type),
|
|
101
|
+
);
|
|
104
102
|
|
|
105
103
|
const QuestionTypeComponent = computed(() => {
|
|
106
104
|
if (props.question.type === EngineAuditQuestionType.Option) return AuditFormQuestionOptions;
|
|
@@ -122,7 +120,6 @@ function handleQuestionTypeChange(type) {
|
|
|
122
120
|
}
|
|
123
121
|
emit('change:question', question);
|
|
124
122
|
}
|
|
125
|
-
|
|
126
123
|
</script>
|
|
127
124
|
|
|
128
125
|
<style lang="scss" scoped>
|
|
@@ -56,12 +56,7 @@ const props = defineProps({
|
|
|
56
56
|
},
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
const emits = defineEmits([
|
|
60
|
-
'copy',
|
|
61
|
-
'delete',
|
|
62
|
-
'update:question',
|
|
63
|
-
'update:result',
|
|
64
|
-
]);
|
|
59
|
+
const emits = defineEmits(['copy', 'delete', 'update:question', 'update:result']);
|
|
65
60
|
|
|
66
61
|
const QuestionState = {
|
|
67
62
|
SAVED: 'saved',
|
|
@@ -73,17 +68,23 @@ const state = ref(QuestionState.SAVED);
|
|
|
73
68
|
// is needed for useVuelidate, because props.question/props.result isn't reactive
|
|
74
69
|
const { question, result } = toRefs(props);
|
|
75
70
|
|
|
76
|
-
const v$ = useVuelidate(
|
|
77
|
-
(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
71
|
+
const v$ = useVuelidate(
|
|
72
|
+
computed(() =>
|
|
73
|
+
props.mode === 'create'
|
|
74
|
+
? {
|
|
75
|
+
question: {
|
|
76
|
+
question: { required },
|
|
77
|
+
},
|
|
78
|
+
}
|
|
79
|
+
: {
|
|
80
|
+
result: {
|
|
81
|
+
required: (value) => (question.value.required ? !isEmpty(value) : true),
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
),
|
|
85
|
+
{ question, result },
|
|
86
|
+
{ $autoDirty: true },
|
|
87
|
+
);
|
|
87
88
|
|
|
88
89
|
const component = computed(() => {
|
|
89
90
|
if (props.readonly) return QuestionRead;
|
|
@@ -45,8 +45,8 @@ const props = defineProps({
|
|
|
45
45
|
type: String,
|
|
46
46
|
required: true,
|
|
47
47
|
/*
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
* Available options: ['create', 'fill']
|
|
49
|
+
* */
|
|
50
50
|
},
|
|
51
51
|
questions: {
|
|
52
52
|
type: Array,
|
|
@@ -61,11 +61,7 @@ const props = defineProps({
|
|
|
61
61
|
},
|
|
62
62
|
});
|
|
63
63
|
|
|
64
|
-
const emit = defineEmits([
|
|
65
|
-
'update:questions',
|
|
66
|
-
'update:result',
|
|
67
|
-
'update:validation',
|
|
68
|
-
]);
|
|
64
|
+
const emit = defineEmits(['update:questions', 'update:result', 'update:validation']);
|
|
69
65
|
|
|
70
66
|
const v$ = useVuelidate();
|
|
71
67
|
|
|
@@ -131,9 +127,8 @@ function initQuestions() {
|
|
|
131
127
|
async function atQuestionAdded() {
|
|
132
128
|
// wait for new question to render
|
|
133
129
|
await nextTick();
|
|
134
|
-
const index =
|
|
135
|
-
? -1
|
|
136
|
-
: isQuestionAdded.index;
|
|
130
|
+
const index =
|
|
131
|
+
isQuestionAdded.index && isQuestionAdded.index === 'last' ? -1 : isQuestionAdded.index;
|
|
137
132
|
auditQuestions.value.at(index).activateQuestion();
|
|
138
133
|
|
|
139
134
|
isQuestionAdded.value = false;
|
|
@@ -154,10 +149,13 @@ const { reloadSortable } = useDestroyableSortable(sortableWrapper, {
|
|
|
154
149
|
|
|
155
150
|
watch(v$, () => emit('update:validation', { invalid: isInvalidForm.value, v$: v$.value }));
|
|
156
151
|
watchEffect(initResult);
|
|
157
|
-
watch(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
152
|
+
watch(
|
|
153
|
+
() => props.questions,
|
|
154
|
+
() => {
|
|
155
|
+
if (!isQuestionAdded.value) return;
|
|
156
|
+
atQuestionAdded();
|
|
157
|
+
},
|
|
158
|
+
);
|
|
161
159
|
|
|
162
160
|
onMounted(() => {
|
|
163
161
|
initQuestions();
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
|
-
import AuditFormQuestionOptionsWriteRow
|
|
3
|
-
from '../audit-form-question-options-write-row.vue';
|
|
2
|
+
import AuditFormQuestionOptionsWriteRow from '../audit-form-question-options-write-row.vue';
|
|
4
3
|
|
|
5
4
|
describe('AuditFormQuestionOptionsWriteRow', () => {
|
|
6
5
|
it('renders a component', () => {
|
|
@@ -17,9 +17,7 @@ describe('AuditFormQuestionOptions', () => {
|
|
|
17
17
|
mode: 'write',
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
|
-
wrapper.findComponent('.audit-form-question-options-write__add-button')
|
|
21
|
-
.vm
|
|
22
|
-
.$emit('click');
|
|
20
|
+
wrapper.findComponent('.audit-form-question-options-write__add-button').vm.$emit('click');
|
|
23
21
|
expect(wrapper.emitted()['change:question'][0][0].options.length).toBe(2);
|
|
24
22
|
});
|
|
25
23
|
it('deletes existing question option at "delete" icon-btn click', () => {
|
package/src/modules/AuditForm/components/questions/options/audit-form-question-options-write-row.vue
CHANGED
|
@@ -47,27 +47,23 @@ const props = defineProps({
|
|
|
47
47
|
},
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
const emit = defineEmits([
|
|
51
|
-
'change:option',
|
|
52
|
-
'delete',
|
|
53
|
-
]);
|
|
50
|
+
const emit = defineEmits(['change:option', 'delete']);
|
|
54
51
|
|
|
55
52
|
// is needed for useVuelidate, because props.question/props.result isn't reactive
|
|
56
53
|
const { option } = toRefs(props);
|
|
57
54
|
|
|
58
55
|
const v$ = useVuelidate(
|
|
59
|
-
computed(() => (
|
|
60
|
-
{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
decimalValidator: decimalValidator(2),
|
|
68
|
-
},
|
|
56
|
+
computed(() => ({
|
|
57
|
+
option: {
|
|
58
|
+
name: { required },
|
|
59
|
+
score: {
|
|
60
|
+
required,
|
|
61
|
+
minValue: minValue(0),
|
|
62
|
+
maxValue: maxValue(10),
|
|
63
|
+
decimalValidator: decimalValidator(2),
|
|
69
64
|
},
|
|
70
|
-
}
|
|
65
|
+
},
|
|
66
|
+
})),
|
|
71
67
|
{ option },
|
|
72
68
|
{ $autoDirty: true },
|
|
73
69
|
);
|
|
@@ -60,10 +60,7 @@ const props = defineProps({
|
|
|
60
60
|
},
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
-
const emit = defineEmits([
|
|
64
|
-
'change:question',
|
|
65
|
-
'change:result',
|
|
66
|
-
]);
|
|
63
|
+
const emit = defineEmits(['change:question', 'change:result']);
|
|
67
64
|
|
|
68
65
|
function updateQuestion({ path, value }) {
|
|
69
66
|
emit('change:question', updateObject({ obj: props.question, path, value }));
|
|
@@ -60,32 +60,28 @@ const props = defineProps({
|
|
|
60
60
|
},
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
-
const emit = defineEmits([
|
|
64
|
-
'change:question',
|
|
65
|
-
'change:result',
|
|
66
|
-
]);
|
|
63
|
+
const emit = defineEmits(['change:question', 'change:result']);
|
|
67
64
|
|
|
68
65
|
// is needed for useVuelidate, because props.question/props.result isn't reactive
|
|
69
66
|
const { question } = toRefs(props);
|
|
70
67
|
|
|
71
68
|
const v$ = useVuelidate(
|
|
72
|
-
computed(() => (
|
|
73
|
-
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
integer,
|
|
80
|
-
},
|
|
81
|
-
max: {
|
|
82
|
-
minValue: minValue(props.question.min ? props.question.min : 1),
|
|
83
|
-
maxValue: maxValue(10),
|
|
84
|
-
required,
|
|
85
|
-
integer,
|
|
86
|
-
},
|
|
69
|
+
computed(() => ({
|
|
70
|
+
question: {
|
|
71
|
+
min: {
|
|
72
|
+
minValue: minValue(0),
|
|
73
|
+
maxValue: maxValue(9),
|
|
74
|
+
required,
|
|
75
|
+
integer,
|
|
87
76
|
},
|
|
88
|
-
|
|
77
|
+
max: {
|
|
78
|
+
minValue: minValue(props.question.min ? props.question.min : 1),
|
|
79
|
+
maxValue: maxValue(10),
|
|
80
|
+
required,
|
|
81
|
+
integer,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
})),
|
|
89
85
|
{ question },
|
|
90
86
|
{ $autoDirty: true },
|
|
91
87
|
);
|
|
@@ -6,8 +6,7 @@ const cast = {
|
|
|
6
6
|
object: (separator) => {
|
|
7
7
|
const cast = (object) => {
|
|
8
8
|
if (Array.isArray(object)) {
|
|
9
|
-
return object.map((item) => cast(item))
|
|
10
|
-
.join(separator);
|
|
9
|
+
return object.map((item) => cast(item)).join(separator);
|
|
11
10
|
}
|
|
12
11
|
return object.name || JSON.stringify(object);
|
|
13
12
|
};
|
|
@@ -34,8 +33,7 @@ export default class CSVExport {
|
|
|
34
33
|
header: true,
|
|
35
34
|
delimiter,
|
|
36
35
|
};
|
|
37
|
-
const localStorageOptions = JSON.parse(localStorage.getItem('csv-export-options')) ||
|
|
38
|
-
{};
|
|
36
|
+
const localStorageOptions = JSON.parse(localStorage.getItem('csv-export-options')) || {};
|
|
39
37
|
return {
|
|
40
38
|
...defaultOptions,
|
|
41
39
|
...localStorageOptions,
|
|
@@ -59,12 +57,10 @@ export default class CSVExport {
|
|
|
59
57
|
let csv = '';
|
|
60
58
|
let isNext = false;
|
|
61
59
|
// why _columns? https://webitel.atlassian.net/browse/DEV-3797
|
|
62
|
-
let columns = params._columns ||
|
|
63
|
-
(params?.fields ? objSnakeToCamel(params?.fields) : []);
|
|
60
|
+
let columns = params._columns || (params?.fields ? objSnakeToCamel(params?.fields) : []);
|
|
64
61
|
let page = 1;
|
|
65
62
|
|
|
66
63
|
do {
|
|
67
|
-
|
|
68
64
|
const { items, next } = await this.fetchMethod({
|
|
69
65
|
...params,
|
|
70
66
|
page,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as XLSX from 'xlsx';
|
|
2
1
|
import { saveAs } from 'file-saver-es';
|
|
2
|
+
import * as XLSX from 'xlsx';
|
|
3
3
|
import { objSnakeToCamel } from '../../scripts/caseConverters.js';
|
|
4
4
|
|
|
5
5
|
export default class XLSExport {
|
|
@@ -29,9 +29,9 @@ export default class XLSExport {
|
|
|
29
29
|
|
|
30
30
|
// NOTE: creates a new object that only includes the properties specified in the columns array
|
|
31
31
|
filterDataByColumns(data, columns) {
|
|
32
|
-
return data.map(item => {
|
|
33
|
-
|
|
34
|
-
columns.forEach(column => {
|
|
32
|
+
return data.map((item) => {
|
|
33
|
+
const filteredItem = {};
|
|
34
|
+
columns.forEach((column) => {
|
|
35
35
|
const value = item.hasOwnProperty(column) ? this.extractNameFromObject(item[column]) : ''; // '' needed to display column that has no data
|
|
36
36
|
filteredItem[column] = value;
|
|
37
37
|
});
|
|
@@ -41,7 +41,7 @@ export default class XLSExport {
|
|
|
41
41
|
|
|
42
42
|
// NOTE: calculates the width of the columns based on the data to display it in the EXEL file
|
|
43
43
|
calculateColumnWidths(data, columns) {
|
|
44
|
-
return columns.map(column => {
|
|
44
|
+
return columns.map((column) => {
|
|
45
45
|
const maxLength = data.reduce((max, item) => {
|
|
46
46
|
const value = item[column] || '';
|
|
47
47
|
return Math.max(max, value.toString().length);
|
|
@@ -66,8 +66,7 @@ export default class XLSExport {
|
|
|
66
66
|
let data = [];
|
|
67
67
|
let isNext = false;
|
|
68
68
|
let page = 1;
|
|
69
|
-
|
|
70
|
-
(params?.fields ? objSnakeToCamel(params?.fields) : []);
|
|
69
|
+
const columns = params._columns || (params?.fields ? objSnakeToCamel(params?.fields) : []);
|
|
71
70
|
|
|
72
71
|
do {
|
|
73
72
|
const { items, next } = await this.fetchMethod({
|
|
@@ -14,9 +14,7 @@ export default {
|
|
|
14
14
|
return this.CSVExport ? this.CSVExport.downloadProgress.count : 0;
|
|
15
15
|
},
|
|
16
16
|
selectedIds() {
|
|
17
|
-
return this.dataList
|
|
18
|
-
.filter((item) => item._isSelected)
|
|
19
|
-
.map((item) => item.id);
|
|
17
|
+
return this.dataList.filter((item) => item._isSelected).map((item) => item.id);
|
|
20
18
|
},
|
|
21
19
|
isAnySelected() {
|
|
22
20
|
return !!this.selectedIds.length;
|
|
@@ -31,7 +29,7 @@ export default {
|
|
|
31
29
|
async exportCSV(exportParams) {
|
|
32
30
|
const routeQuery = this.$route?.query;
|
|
33
31
|
const params = {
|
|
34
|
-
...exportParams || routeQuery,
|
|
32
|
+
...(exportParams || routeQuery),
|
|
35
33
|
size: 5000,
|
|
36
34
|
};
|
|
37
35
|
if (this.isAnySelected) params.id = this.selectedIds;
|
|
@@ -41,7 +39,6 @@ export default {
|
|
|
41
39
|
} catch (err) {
|
|
42
40
|
throw err;
|
|
43
41
|
}
|
|
44
|
-
|
|
45
42
|
},
|
|
46
43
|
},
|
|
47
44
|
};
|
|
@@ -14,9 +14,7 @@ export default {
|
|
|
14
14
|
return this.XLSExport ? this.XLSExport.downloadProgress.count : 0;
|
|
15
15
|
},
|
|
16
16
|
selectedIds() {
|
|
17
|
-
return this.dataList
|
|
18
|
-
.filter((item) => item._isSelected)
|
|
19
|
-
.map((item) => item.id);
|
|
17
|
+
return this.dataList.filter((item) => item._isSelected).map((item) => item.id);
|
|
20
18
|
},
|
|
21
19
|
isAnySelected() {
|
|
22
20
|
return !!this.selectedIds.length;
|
|
@@ -30,7 +28,7 @@ export default {
|
|
|
30
28
|
async exportXLS(exportParams) {
|
|
31
29
|
const routeQuery = this.$route?.query;
|
|
32
30
|
const params = {
|
|
33
|
-
...exportParams || routeQuery,
|
|
31
|
+
...(exportParams || routeQuery),
|
|
34
32
|
size: 5000,
|
|
35
33
|
};
|
|
36
34
|
if (this.isAnySelected) params.id = this.selectedIds;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import deepCopy from 'deep-copy';
|
|
2
2
|
import set from 'lodash/set.js';
|
|
3
|
-
import BaseStoreModule
|
|
4
|
-
from '../../../store/BaseStoreModules/BaseStoreModule.js';
|
|
3
|
+
import BaseStoreModule from '../../../store/BaseStoreModules/BaseStoreModule.js';
|
|
5
4
|
|
|
6
5
|
export default class CardStoreModule extends BaseStoreModule {
|
|
7
6
|
state = {
|
|
@@ -69,10 +68,7 @@ export default class CardStoreModule extends BaseStoreModule {
|
|
|
69
68
|
},
|
|
70
69
|
};
|
|
71
70
|
|
|
72
|
-
getModule({
|
|
73
|
-
state = {},
|
|
74
|
-
...rest
|
|
75
|
-
} = {}) {
|
|
71
|
+
getModule({ state = {}, ...rest } = {}) {
|
|
76
72
|
this.state = {
|
|
77
73
|
...this.state,
|
|
78
74
|
...state,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
2
|
import { ref } from 'vue';
|
|
3
3
|
import { useValidation } from '../../../mixins/validationMixin/useValidation.js';
|
|
4
|
-
import DeleteConfirmationPopup
|
|
5
|
-
from '../components/delete-confirmation-popup.vue';
|
|
4
|
+
import DeleteConfirmationPopup from '../components/delete-confirmation-popup.vue';
|
|
6
5
|
|
|
7
6
|
vi.mock('../../../mixins/validationMixin/useValidation.js');
|
|
8
7
|
|
|
@@ -31,8 +30,9 @@ describe('DeleteConfirmationPopup', () => {
|
|
|
31
30
|
callback,
|
|
32
31
|
},
|
|
33
32
|
});
|
|
34
|
-
const button = wrapper
|
|
35
|
-
|
|
33
|
+
const button = wrapper
|
|
34
|
+
.findAllComponents({ name: 'wt-button' })
|
|
35
|
+
.find((btn) => btn.text().includes('Yes'));
|
|
36
36
|
expect(button.text()).toContain('Yes');
|
|
37
37
|
await button.trigger('click');
|
|
38
38
|
await wrapper.vm.$nextTick();
|
|
@@ -47,8 +47,9 @@ describe('DeleteConfirmationPopup', () => {
|
|
|
47
47
|
callback: vi.fn(),
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
|
-
expect(wrapper.find('.delete-confirmation-popup__content').text())
|
|
51
|
-
|
|
50
|
+
expect(wrapper.find('.delete-confirmation-popup__content').text()).toContain(
|
|
51
|
+
deleteCount.toString(),
|
|
52
|
+
);
|
|
52
53
|
});
|
|
53
54
|
|
|
54
55
|
it('yes button emitted close', async () => {
|
|
@@ -58,8 +59,9 @@ describe('DeleteConfirmationPopup', () => {
|
|
|
58
59
|
callback: vi.fn(),
|
|
59
60
|
},
|
|
60
61
|
});
|
|
61
|
-
const button = wrapper
|
|
62
|
-
|
|
62
|
+
const button = wrapper
|
|
63
|
+
.findAllComponents({ name: 'wt-button' })
|
|
64
|
+
.find((btn) => btn.text().includes('Yes'));
|
|
63
65
|
await button.vm.$emit('close');
|
|
64
66
|
await wrapper.vm.$nextTick();
|
|
65
67
|
expect(button.emitted('close')).toBeTruthy();
|
|
@@ -72,8 +74,9 @@ describe('DeleteConfirmationPopup', () => {
|
|
|
72
74
|
callback: vi.fn(),
|
|
73
75
|
},
|
|
74
76
|
});
|
|
75
|
-
const button = wrapper
|
|
76
|
-
|
|
77
|
+
const button = wrapper
|
|
78
|
+
.findAllComponents({ name: 'wt-button' })
|
|
79
|
+
.find((btn) => btn.text().includes('No'));
|
|
77
80
|
await button.vm.$emit('close');
|
|
78
81
|
await wrapper.vm.$nextTick();
|
|
79
82
|
expect(button.emitted('close')).toBeTruthy();
|
|
@@ -52,9 +52,7 @@ const props = defineProps({
|
|
|
52
52
|
},
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
const emit = defineEmits([
|
|
56
|
-
'close',
|
|
57
|
-
]);
|
|
55
|
+
const emit = defineEmits(['close']);
|
|
58
56
|
|
|
59
57
|
const attrs = useAttrs();
|
|
60
58
|
|
|
@@ -64,18 +62,11 @@ const isDeleting = ref(false);
|
|
|
64
62
|
|
|
65
63
|
const deleteMessage = computed(() => {
|
|
66
64
|
if (props.deleteCount === 0) {
|
|
67
|
-
return t(
|
|
68
|
-
'webitelUI.deleteConfirmationPopup.
|
|
69
|
-
|
|
70
|
-
null,
|
|
71
|
-
{ count: t('webitelUI.deleteConfirmationPopup.deleteAll') },
|
|
72
|
-
);
|
|
65
|
+
return t('webitelUI.deleteConfirmationPopup.askingAlert', 2, null, {
|
|
66
|
+
count: t('webitelUI.deleteConfirmationPopup.deleteAll'),
|
|
67
|
+
});
|
|
73
68
|
}
|
|
74
|
-
return t(
|
|
75
|
-
'webitelUI.deleteConfirmationPopup.askingAlert',
|
|
76
|
-
{ count: props.deleteCount },
|
|
77
|
-
null,
|
|
78
|
-
);
|
|
69
|
+
return t('webitelUI.deleteConfirmationPopup.askingAlert', { count: props.deleteCount }, null);
|
|
79
70
|
});
|
|
80
71
|
|
|
81
72
|
function close() {
|
|
@@ -25,14 +25,15 @@ export default class FilesExport {
|
|
|
25
25
|
|
|
26
26
|
_fetchFileBinary(fileId) {
|
|
27
27
|
const url = this.filesURL(fileId);
|
|
28
|
-
return new Promise((resolve, reject) =>
|
|
28
|
+
return new Promise((resolve, reject) =>
|
|
29
29
|
jszipUtils.getBinaryContent(url, (err, data) => {
|
|
30
30
|
if (err) {
|
|
31
31
|
reject(err);
|
|
32
32
|
} else {
|
|
33
33
|
resolve(data);
|
|
34
34
|
}
|
|
35
|
-
})
|
|
35
|
+
}),
|
|
36
|
+
);
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
resetProgress() {
|
|
@@ -96,7 +97,7 @@ export default class FilesExport {
|
|
|
96
97
|
try {
|
|
97
98
|
this.isLoading = true;
|
|
98
99
|
const zip = new JSZip();
|
|
99
|
-
if (files
|
|
100
|
+
if (files?.length) await this._addFilesToZip(files, zip);
|
|
100
101
|
else {
|
|
101
102
|
await this._fetchAndZip(zip, reqParams);
|
|
102
103
|
}
|
|
@@ -11,9 +11,7 @@ vi.mock('file-saver-es', () => ({
|
|
|
11
11
|
saveAs: vi.fn(),
|
|
12
12
|
}));
|
|
13
13
|
|
|
14
|
-
const dataList = [
|
|
15
|
-
{ files: [{ name: 'jest', id: '1', mimeType: 'mime/type' }] },
|
|
16
|
-
];
|
|
14
|
+
const dataList = [{ files: [{ name: 'jest', id: '1', mimeType: 'mime/type' }] }];
|
|
17
15
|
const selectedDataList = [
|
|
18
16
|
{
|
|
19
17
|
_isSelected: true,
|
|
@@ -26,14 +24,10 @@ const selectedDataList = [
|
|
|
26
24
|
];
|
|
27
25
|
|
|
28
26
|
describe('File Export', () => {
|
|
29
|
-
jszipUtils.getBinaryContent.mockImplementation((
|
|
30
|
-
url,
|
|
31
|
-
callback,
|
|
32
|
-
) => callback(null, {}));
|
|
27
|
+
jszipUtils.getBinaryContent.mockImplementation((url, callback) => callback(null, {}));
|
|
33
28
|
let wrapper;
|
|
34
29
|
const Component = {
|
|
35
|
-
render() {
|
|
36
|
-
},
|
|
30
|
+
render() {},
|
|
37
31
|
mixins: [FilesExportMixin],
|
|
38
32
|
created() {
|
|
39
33
|
this.initFilesExport({
|
|
@@ -60,10 +54,16 @@ describe('File Export', () => {
|
|
|
60
54
|
|
|
61
55
|
it('mixin correctly computes selectedFiles()', () => {
|
|
62
56
|
wrapper = shallowMount(Component, {
|
|
63
|
-
computed: {
|
|
57
|
+
computed: {
|
|
58
|
+
selectedItems() {
|
|
59
|
+
return selectedDataList;
|
|
60
|
+
},
|
|
61
|
+
},
|
|
64
62
|
});
|
|
65
|
-
expect(wrapper.vm.getSelectedFiles())
|
|
66
|
-
|
|
63
|
+
expect(wrapper.vm.getSelectedFiles()).toEqual([
|
|
64
|
+
...selectedDataList[0].files,
|
|
65
|
+
...selectedDataList[1].files,
|
|
66
|
+
]);
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
it('mixin catches export error and resets isFilesLoading on export error', async () => {
|
|
@@ -15,9 +15,7 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
|
|
17
17
|
filesZippingProgress() {
|
|
18
|
-
return this.FilesExport
|
|
19
|
-
? Math.floor(this.FilesExport.zippingProgress.percent)
|
|
20
|
-
: 0;
|
|
18
|
+
return this.FilesExport ? Math.floor(this.FilesExport.zippingProgress.percent) : 0;
|
|
21
19
|
},
|
|
22
20
|
},
|
|
23
21
|
|
|
@@ -29,10 +27,11 @@ export default {
|
|
|
29
27
|
getSelectedFiles() {
|
|
30
28
|
let files = null;
|
|
31
29
|
if (this.selectedItems?.length) {
|
|
32
|
-
files = this.selectedItems.reduce(
|
|
33
|
-
next
|
|
34
|
-
? [...filesAccumulator, ...next.files]
|
|
35
|
-
|
|
30
|
+
files = this.selectedItems.reduce(
|
|
31
|
+
(filesAccumulator, next) =>
|
|
32
|
+
next.files ? [...filesAccumulator, ...next.files] : filesAccumulator,
|
|
33
|
+
[],
|
|
34
|
+
);
|
|
36
35
|
}
|
|
37
36
|
return files;
|
|
38
37
|
},
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const generateMediaURL = (id) => {
|
|
2
2
|
const token = localStorage.getItem('access-token');
|
|
3
|
-
const BASE_URL = process?.env?.VUE_APP_API_URL ||
|
|
4
|
-
import.meta.env.VITE_API_URL;
|
|
3
|
+
const BASE_URL = process?.env?.VUE_APP_API_URL || import.meta.env.VITE_API_URL;
|
|
5
4
|
return `${BASE_URL}/storage/recordings/${id}/stream?access_token=${token}`;
|
|
6
5
|
};
|
|
7
6
|
|