@webitel/ui-sdk 26.8.54 → 26.8.56

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.
Files changed (30) hide show
  1. package/dist/{clients-jhkEj9YI.js → clients-CWSXQd89.js} +8319 -7470
  2. package/dist/{components-C4rE9PlV.js → components-CWSUHV29.js} +8 -8
  3. package/dist/ui-sdk.css +1 -1
  4. package/dist/ui-sdk.js +1 -1
  5. package/dist/ui-sdk.umd.cjs +1495 -1383
  6. package/dist/{wt-chat-emoji-DVIlMP3o.js → wt-chat-emoji-DRK_E-lD.js} +1 -1
  7. package/dist/{wt-display-chip-items-DwMS-DJc.js → wt-display-chip-items-C5z7aCDZ.js} +1 -1
  8. package/dist/{wt-send-message-popup-DPjllTAk.js → wt-send-message-popup-G26F9NPH.js} +2 -2
  9. package/dist/{wt-type-extension-value-input-BO44atDh.js → wt-type-extension-value-input--Vc1cs5d.js} +2 -2
  10. package/dist/{wt-vidstack-player-BD28KRTU.js → wt-vidstack-player-FD4gfDSE.js} +1 -1
  11. package/package.json +2 -1
  12. package/src/api/clients/caseSources/caseSources.ts +2 -151
  13. package/src/api/clients/quickReplies/quickReplies.ts +2 -157
  14. package/src/components/on-demand/wt-type-extension-value-input/wt-type-extension-value-input.vue +2 -2
  15. package/src/components/wt-image/wt-image.vue +4 -4
  16. package/src/components/wt-multi-select/wt-multi-select.vue +3 -2
  17. package/src/components/wt-single-select/wt-single-select.vue +6 -3
  18. package/src/modules/AgentStatusSelect/components/_internals/wt-cc-activity-type-options.vue +52 -0
  19. package/src/modules/AgentStatusSelect/components/_internals/wt-cc-activity-type-popup.vue +7 -35
  20. package/src/modules/AgentStatusSelect/components/_internals/wt-cc-pause-cause-popup.vue +2 -2
  21. package/src/modules/AgentStatusSelect/components/wt-cc-agent-status-select.vue +4 -18
  22. package/src/modules/AgentStatusSelect/composables/useActivityTypesOptions.ts +37 -0
  23. package/src/modules/QueryFilters/mixins/__tests__/enumFilterMixin.spec.js +60 -0
  24. package/src/modules/QueryFilters/mixins/enumFilterMixin.js +21 -6
  25. package/src/modules/UserNotifications/api/UserNotifications.ts +1 -1
  26. package/types/.tsbuildinfo +1 -1
  27. package/types/api/clients/caseSources/caseSources.d.ts +1 -16
  28. package/types/api/clients/quickReplies/quickReplies.d.ts +1 -16
  29. package/types/modules/AgentStatusSelect/components/_internals/wt-cc-activity-type-options.vue.d.ts +17 -0
  30. package/types/modules/AgentStatusSelect/composables/useActivityTypesOptions.d.ts +18 -0
@@ -0,0 +1,37 @@
1
+ import { OnlineSkillsAPI } from '@webitel/api-services/api';
2
+ import { ref } from 'vue';
3
+ import { useI18n } from 'vue-i18n';
4
+
5
+ import type { LookupOption } from '../../../types';
6
+
7
+ export const useActivityTypesOptions = () => {
8
+ const { t } = useI18n();
9
+
10
+ const activityTypes = ref<LookupOption[]>([]);
11
+ const defaultActivityTypeOption = ref<LookupOption | null>(null);
12
+
13
+ async function loadActivityTypes(): Promise<void> {
14
+ const response = await OnlineSkillsAPI.getList({
15
+ skipDefault: false,
16
+ });
17
+ if (!response?.items?.length) {
18
+ defaultActivityTypeOption.value = null;
19
+ activityTypes.value = [];
20
+ return;
21
+ }
22
+ defaultActivityTypeOption.value = response.items[0];
23
+ activityTypes.value = [
24
+ {
25
+ id: response.items[0].id,
26
+ name: t('webitelUI.agentStatusSelect.activityTypePopup.defaultOption'),
27
+ },
28
+ ...response.items.slice(1),
29
+ ];
30
+ }
31
+
32
+ return {
33
+ activityTypes,
34
+ defaultActivityTypeOption,
35
+ loadActivityTypes,
36
+ };
37
+ };
@@ -103,4 +103,64 @@ describe('Enum filter mixin', () => {
103
103
  });
104
104
  expect(wrapper.vm.localizedOptions).toEqual(expectedOptions);
105
105
  });
106
+
107
+ it('Normalizes a snake_case scalar locale and translates using the normalized key', async () => {
108
+ const options = [
109
+ {
110
+ locale: 'vi.snake_case_locale',
111
+ },
112
+ ];
113
+ const expectedOptions = [
114
+ {
115
+ locale: 'vi.snakeCaseLocale',
116
+ name: 'vi.snakeCaseLocale',
117
+ },
118
+ ];
119
+ const wrapper = shallowMount(Component, {
120
+ global: {
121
+ plugins: [
122
+ router,
123
+ ],
124
+ },
125
+ data: () => ({
126
+ options,
127
+ }),
128
+ });
129
+ expect(wrapper.vm.localizedOptions).toEqual(expectedOptions);
130
+ });
131
+
132
+ it('Normalizes only the key element of an array locale, preserving the rest of the translation arguments, and translates using the normalized key', async () => {
133
+ const options = [
134
+ {
135
+ locale: [
136
+ 'vi.snake_case_locale',
137
+ {
138
+ count: 5,
139
+ },
140
+ ],
141
+ },
142
+ ];
143
+ const expectedOptions = [
144
+ {
145
+ locale: [
146
+ 'vi.snakeCaseLocale',
147
+ {
148
+ count: 5,
149
+ },
150
+ ],
151
+ name: 'vi.snakeCaseLocale',
152
+ },
153
+ ];
154
+ const wrapper = shallowMount(Component, {
155
+ global: {
156
+ plugins: [
157
+ router,
158
+ ],
159
+ },
160
+ data: () => ({
161
+ options,
162
+ }),
163
+ });
164
+ expect(wrapper.vm.localizedOptions).toEqual(expectedOptions);
165
+ });
106
166
  });
@@ -1,3 +1,4 @@
1
+ import { snakeToCamel } from '../../../scripts';
1
2
  import baseFilterMixin from './baseFilterMixin/baseFilterMixin.js';
2
3
 
3
4
  export default {
@@ -33,12 +34,26 @@ export default {
33
34
  localizedOptions() {
34
35
  const optsHaveLocale = this.options.length && this.options[0].locale; // just check 1st el
35
36
  if (optsHaveLocale) {
36
- return this.options.map((opt) => ({
37
- ...opt,
38
- name: Array.isArray(opt.locale)
39
- ? this.$t(...opt.locale)
40
- : this.$t(opt.locale),
41
- }));
37
+ return this.options.map((opt) => {
38
+ const isLocaleArray = Array.isArray(opt.locale);
39
+ const normalizedLocale = isLocaleArray
40
+ ? [
41
+ typeof opt.locale[0] === 'string'
42
+ ? snakeToCamel(opt.locale[0])
43
+ : opt.locale[0],
44
+ ...opt.locale.slice(1),
45
+ ]
46
+ : typeof opt.locale === 'string'
47
+ ? snakeToCamel(opt.locale)
48
+ : opt.locale;
49
+ return {
50
+ ...opt,
51
+ locale: normalizedLocale,
52
+ name: isLocaleArray
53
+ ? this.$t(...normalizedLocale)
54
+ : this.$t(normalizedLocale),
55
+ };
56
+ });
42
57
  }
43
58
  return this.options;
44
59
  },
@@ -2,7 +2,7 @@ import {
2
2
  applyTransform,
3
3
  snakeToCamel,
4
4
  } from '@webitel/api-services/api/transformers';
5
- import { getUsers } from '@webitel/api-services/gen';
5
+ import { getUsers } from '@webitel/api-services/gen-wire';
6
6
 
7
7
  const getUserWarnings = async () => {
8
8
  try {