@webitel/ui-sdk 23.12.2 → 23.12.5-1

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 (191) hide show
  1. package/dist/favicon.ico +0 -0
  2. package/dist/img/sprite/index.js +148 -1
  3. package/dist/img/sprite/link.svg +8 -0
  4. package/dist/img/sprite/variable-select.svg +9 -0
  5. package/dist/plyr.svg +70 -0
  6. package/dist/ui-sdk.css +1 -1
  7. package/dist/ui-sdk.mjs +22670 -0
  8. package/dist/ui-sdk.umd.js +37 -43084
  9. package/package.json +34 -40
  10. package/src/api/axios/generateInstance.js +1 -1
  11. package/src/components/on-demand/wt-cc-agent-status-timers/wt-cc-agent-status-timers.vue +3 -3
  12. package/src/components/on-demand/wt-save-failed-popup/__tests__/WtPopup.spec.js +9 -0
  13. package/src/components/on-demand/wt-save-failed-popup/wt-save-failed-popup.vue +70 -0
  14. package/src/components/transitions/wt-expand-transition.vue +2 -2
  15. package/src/components/wt-app-header/_variables.scss +1 -1
  16. package/src/components/wt-app-header/wt-app-header.vue +2 -5
  17. package/src/components/wt-app-header/wt-app-navigator.vue +6 -5
  18. package/src/components/wt-app-header/wt-header-actions.vue +30 -14
  19. package/src/components/wt-avatar/_variables.scss +1 -1
  20. package/src/components/wt-avatar/wt-avatar.vue +2 -2
  21. package/src/components/wt-badge/wt-badge.vue +3 -3
  22. package/src/components/wt-button/_variables.scss +2 -32
  23. package/src/components/wt-button/wt-button.vue +5 -3
  24. package/src/components/wt-button-select/__tests__/WtButtonSelect.spec.js +9 -8
  25. package/src/components/wt-button-select/wt-button-select.vue +58 -59
  26. package/src/components/wt-checkbox/wt-checkbox.vue +15 -48
  27. package/src/components/wt-chip/_variables.scss +21 -2
  28. package/src/components/wt-chip/wt-chip.scss +20 -17
  29. package/src/components/wt-chip/wt-chip.vue +10 -5
  30. package/src/components/wt-context-menu/wt-context-menu.vue +4 -4
  31. package/src/components/wt-copy-action/wt-copy-action.vue +6 -6
  32. package/src/components/wt-datepicker/_variables.scss +1 -1
  33. package/src/components/wt-datepicker/wt-datepicker.vue +14 -12
  34. package/src/components/wt-divider/wt-divider.vue +1 -1
  35. package/src/components/wt-dummy/wt-dummy.vue +6 -2
  36. package/src/components/wt-error-page/wt-error-page.vue +10 -4
  37. package/src/components/wt-expansion-panel/wt-expansion-panel.vue +4 -4
  38. package/src/components/wt-filters-panel-wrapper/wt-filters-panel-wrapper.vue +7 -4
  39. package/src/components/wt-headline/wt-headline.vue +4 -4
  40. package/src/components/wt-headline-nav/_variables.scss +5 -2
  41. package/src/components/wt-headline-nav/wt-headline-nav.vue +46 -33
  42. package/src/components/wt-hint/wt-hint.vue +5 -6
  43. package/src/components/wt-icon/_variables.scss +5 -10
  44. package/src/components/wt-icon/wt-icon.vue +15 -6
  45. package/src/components/wt-icon-action/_internals/wt-add-icon-action.vue +2 -2
  46. package/src/components/wt-icon-action/_internals/wt-delete-icon-action.vue +2 -2
  47. package/src/components/wt-icon-action/_internals/wt-download-icon-action.vue +2 -2
  48. package/src/components/wt-icon-action/_internals/wt-edit-icon-action.vue +2 -2
  49. package/src/components/wt-icon-action/_internals/wt-history-icon-action.vue +2 -2
  50. package/src/components/wt-icon-action/_internals/wt-refresh-icon-action.vue +2 -2
  51. package/src/components/wt-icon-action/wt-icon-action.vue +1 -1
  52. package/src/components/wt-icon-btn/wt-icon-btn.vue +4 -2
  53. package/src/components/wt-indicator/_variables.scss +14 -19
  54. package/src/components/wt-indicator/wt-indicator.vue +26 -27
  55. package/src/components/wt-input/wt-input.vue +200 -219
  56. package/src/components/wt-input-info/wt-input-info.vue +2 -2
  57. package/src/components/wt-item-link/wt-item-link.vue +1 -1
  58. package/src/components/wt-label/_variables.scss +4 -2
  59. package/src/components/wt-label/wt-label.vue +5 -18
  60. package/src/components/wt-load-bar/wt-load-bar.vue +7 -4
  61. package/src/components/wt-loader/_internals/wt-loader--md.vue +11 -2
  62. package/src/components/wt-loader/_internals/wt-loader--sm.vue +9 -2
  63. package/src/components/wt-loader/_variables.scss +2 -2
  64. package/src/components/wt-loader/wt-loader.vue +10 -3
  65. package/src/components/wt-navigation-bar/wt-navigation-bar.vue +17 -9
  66. package/src/components/wt-notification/wt-notification.vue +4 -4
  67. package/src/components/wt-notifications-bar/wt-notifications-bar.vue +9 -5
  68. package/src/components/wt-page-header/wt-page-header.vue +7 -8
  69. package/src/components/wt-page-wrapper/wt-page-wrapper.vue +8 -5
  70. package/src/components/wt-pagination/wt-pagination.vue +17 -15
  71. package/src/components/wt-player/__tests__/WtPlayer.spec.js +1 -1
  72. package/src/components/wt-player/_variables.scss +1 -1
  73. package/src/components/wt-player/wt-player.vue +17 -17
  74. package/src/components/wt-popup/_variables.scss +4 -3
  75. package/src/components/wt-popup/wt-popup.vue +18 -10
  76. package/src/components/wt-progress-bar/_variables.scss +10 -8
  77. package/src/components/wt-progress-bar/wt-progress-bar.vue +27 -18
  78. package/src/components/wt-radio/wt-radio.vue +26 -54
  79. package/src/components/wt-rounded-action/_variables.scss +4 -35
  80. package/src/components/wt-rounded-action/wt-rounded-action.vue +15 -70
  81. package/src/components/wt-search-bar/__tests__/WtSearchBar.spec.js +1 -1
  82. package/src/components/wt-search-bar/wt-search-bar.vue +18 -42
  83. package/src/components/wt-select/_multiselect.scss +48 -53
  84. package/src/components/wt-select/_variables.scss +0 -3
  85. package/src/components/wt-select/mixins/multiselectMixin.js +9 -1
  86. package/src/components/wt-select/wt-select.vue +41 -40
  87. package/src/components/wt-slider/_variables.scss +6 -0
  88. package/src/components/wt-slider/wt-slider.vue +25 -9
  89. package/src/components/wt-status-select/_variables.scss +7 -4
  90. package/src/components/wt-status-select/wt-status-select.vue +18 -12
  91. package/src/components/wt-stepper/_variables.scss +5 -0
  92. package/src/components/wt-stepper/wt-stepper.vue +15 -9
  93. package/src/components/wt-switcher/_variables.scss +30 -7
  94. package/src/components/wt-switcher/wt-switcher.vue +56 -35
  95. package/src/components/wt-table/_variables.scss +8 -5
  96. package/src/components/wt-table/wt-table.vue +123 -90
  97. package/src/components/wt-table-actions/wt-table-actions.vue +14 -14
  98. package/src/components/wt-table-column-select/wt-table-column-select.vue +33 -28
  99. package/src/components/wt-tabs/_variables.scss +4 -4
  100. package/src/components/wt-tabs/wt-tabs.vue +15 -13
  101. package/src/components/wt-tags-input/wt-tags-input.vue +26 -35
  102. package/src/components/wt-textarea/wt-textarea.vue +37 -54
  103. package/src/components/wt-time-input/wt-time-input.vue +24 -54
  104. package/src/components/wt-timepicker/wt-timepicker.vue +19 -27
  105. package/src/components/wt-tooltip/__tests__/WtTooltip.spec.js +0 -10
  106. package/src/components/wt-tooltip/_internals/wt-tooltip-floating.vue +2 -2
  107. package/src/components/wt-tooltip/_variables.scss +2 -4
  108. package/src/components/wt-tooltip/wt-tooltip.vue +6 -18
  109. package/src/composables/useCachedInterval/__tests__/useCachedInterval.spec.js +5 -5
  110. package/src/composables/useRepresentableAgentPauseCause/__tests__/useRepresentableAgentPauseCause.spec.js +1 -1
  111. package/src/composables/useRepresentableAgentPauseCause/useRepresentableAgentPauseCause.js +1 -1
  112. package/src/css/styleguide/colors/_colors.scss +45 -29
  113. package/src/css/styleguide/colors/reusable/_text-field.scss +36 -0
  114. package/src/css/styleguide/placeholder/_placeholder.scss +9 -9
  115. package/src/enums/WebitelApplications/AdminSections.enum.js +2 -1
  116. package/src/locale/en/en.js +11 -3
  117. package/src/locale/es/es.js +2 -0
  118. package/src/locale/i18n.js +3 -1
  119. package/src/locale/kz/kz.js +327 -0
  120. package/src/locale/ru/ru.js +11 -3
  121. package/src/locale/ua/ua.js +11 -3
  122. package/src/mixins/validationMixin/__tests__/validationMixin.spec.js +2 -2
  123. package/src/mixins/validationMixin/useValidation.js +19 -4
  124. package/src/mixins/validationMixin/validationMixin.js +1 -0
  125. package/src/modules/AgentStatusSelect/components/__tests__/wt-cc-agent-status-select.spec.js +4 -4
  126. package/src/modules/AgentStatusSelect/components/_internals/wt-cc-pause-cause-popup.vue +11 -9
  127. package/src/modules/AgentStatusSelect/components/_internals/wt-cc-status-select-error-popup.vue +6 -5
  128. package/src/modules/AgentStatusSelect/components/wt-cc-agent-status-select.vue +3 -3
  129. package/src/modules/AuditForm/components/__tests__/audit-form.spec.js +1 -1
  130. package/src/modules/AuditForm/components/audit-form-question-read-wrapper.vue +11 -8
  131. package/src/modules/AuditForm/components/audit-form-question-write-wrapper.vue +8 -8
  132. package/src/modules/AuditForm/components/audit-form-question.vue +8 -8
  133. package/src/modules/AuditForm/components/audit-form.vue +6 -5
  134. package/src/modules/AuditForm/components/questions/options/audit-form-question-options-write-row.vue +4 -4
  135. package/src/modules/AuditForm/components/questions/options/audit-form-question-options.vue +7 -4
  136. package/src/modules/AuditForm/components/questions/score/audit-form-question-score.vue +3 -3
  137. package/src/modules/CSVExport/__tests__/CSVExport.spec.js +5 -2
  138. package/src/modules/DeleteConfirmationPopup/__tests__/delete-confirmation-popup.spec.js +77 -0
  139. package/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue +35 -17
  140. package/src/modules/FilesExport/__tests__/FilesExport.spec.js +6 -3
  141. package/src/modules/FilesExport/scripts/generateMediaURL.js +1 -1
  142. package/src/modules/Filters/components/filter-pagination.vue +1 -1
  143. package/src/modules/Filters/components/filter-table-fields.vue +1 -1
  144. package/src/modules/Notifications/store/__tests__/NotificationsStoreModule.actions.spec.js +6 -6
  145. package/src/modules/QueryFilters/classes/__tests__/ApiFilterSchema.spec.js +1 -1
  146. package/src/modules/QueryFilters/components/__tests__/abstract-api-filter.spec.js +7 -5
  147. package/src/modules/QueryFilters/components/__tests__/abstract-enum-filter.spec.js +3 -1
  148. package/src/modules/QueryFilters/components/__tests__/filter-datetime.spec.js +2 -2
  149. package/src/modules/QueryFilters/components/__tests__/filter-from-to.spec.js +4 -4
  150. package/src/modules/QueryFilters/components/__tests__/filter-search.spec.js +2 -2
  151. package/src/modules/QueryFilters/components/abstract-api-filter.vue +2 -2
  152. package/src/modules/QueryFilters/components/abstract-enum-filter.vue +2 -2
  153. package/src/modules/QueryFilters/components/filter-datetime.vue +2 -2
  154. package/src/modules/QueryFilters/components/filter-from-to.vue +12 -10
  155. package/src/modules/QueryFilters/components/filter-search.vue +2 -2
  156. package/src/modules/QueryFilters/components/filter-table-fields.vue +7 -7
  157. package/src/modules/QueryFilters/mixins/__tests__/apiFilterMixin.spec.js +1 -1
  158. package/src/modules/QueryFilters/mixins/__tests__/enumFilterMixin.spec.js +2 -2
  159. package/src/modules/QueryFilters/mixins/__tests__/paginationFilterMixin.spec.js +2 -2
  160. package/src/modules/QueryFilters/mixins/__tests__/sortFilterMixin.spec.js +1 -1
  161. package/src/modules/QueryFilters/store/__tests__/QueryFiltersStoreModule.spec.js +2 -2
  162. package/src/modules/Userinfo/classes/ApplicationsAccess.js +6 -2
  163. package/src/modules/Userinfo/components/__tests__/auth.spec.js +7 -8
  164. package/src/modules/Userinfo/components/the-auth.vue +8 -5
  165. package/src/scripts/debounce.js +1 -1
  166. package/src/scripts/saveAsJSON.js +9 -0
  167. package/src/store/BaseStoreModules/__tests__/BaseStoreModule.spec.js +6 -6
  168. package/src/validators/variableSearchValidator/__tests__/variableSearchValidator.spec.js +48 -0
  169. package/src/validators/variableSearchValidator/variableSearchValidator.js +10 -0
  170. package/src/validators/websocketValidator/__tests__/websocketValidator.spec.js +28 -0
  171. package/src/validators/websocketValidator/websocketValidator.js +9 -0
  172. package/dist/demo.html +0 -1
  173. package/dist/ui-sdk.common.js +0 -43066
  174. package/dist/ui-sdk.common.js.map +0 -1
  175. package/dist/ui-sdk.umd.js.map +0 -1
  176. package/dist/ui-sdk.umd.min.js +0 -35
  177. package/dist/ui-sdk.umd.min.js.map +0 -1
  178. package/src/components/wt-button/Readme.md +0 -23
  179. package/src/components/wt-button-select/Readme.md +0 -13
  180. package/src/components/wt-icon/Readme.md +0 -327
  181. package/src/components/wt-icon/docs/cleanup-svg-fill-none.png +0 -0
  182. package/src/components/wt-icon/docs/cleanup-svg-fill.png +0 -0
  183. package/src/components/wt-icon/docs/cleanup-svg-viewbox-correct.png +0 -0
  184. package/src/components/wt-icon/docs/cleanup-svg-viewbox-incorrect.png +0 -0
  185. package/src/components/wt-icon/docs/cleanup-svg-width-height.png +0 -0
  186. package/src/components/wt-icon/docs/svg-icon-code-example.png +0 -0
  187. package/src/components/wt-icon/docs/svg-sprite-in-dom.png +0 -0
  188. package/src/components/wt-icon-btn/Readme.md +0 -10
  189. package/src/components/wt-rounded-action/Readme.md +0 -68
  190. package/src/components/wt-tags-input/_variables.scss +0 -24
  191. package/src/locale/.DS_Store +0 -0
@@ -14,13 +14,14 @@
14
14
  :class="{
15
15
  'audit-form-question-read-text--required': question.required,
16
16
  }"
17
- >{{ question.question }}</p>
17
+ >
18
+ {{ question.question }}
19
+ </p>
18
20
  <wt-icon
19
- class="audit-form-question-read__drag-icon"
20
21
  v-if="!disableDragging && !first"
22
+ class="audit-form-question-read__drag-icon"
21
23
  icon="move"
22
- color="secondary"
23
- ></wt-icon>
24
+ />
24
25
  </header>
25
26
  <section class="audit-form-question-read-content">
26
27
  <component
@@ -29,12 +30,14 @@
29
30
  :result="result"
30
31
  mode="read"
31
32
  @change:result="!readonly && emit('change:result', $event)"
32
- ></component>
33
+ />
33
34
  <div
34
35
  v-show="isResult"
35
36
  class="audit-form-question--clear"
36
37
  @click="emit('change:result', {})"
37
- >{{ $t('webitelUI.auditForm.clearSelection') }}</div>
38
+ >
39
+ {{ $t('webitelUI.auditForm.clearSelection') }}
40
+ </div>
38
41
  </section>
39
42
  </article>
40
43
  </template>
@@ -96,7 +99,7 @@ const isResult = computed(() => !isEmpty(props.result));
96
99
  &:not(.audit-form-question-read--readonly) {
97
100
  &:hover,
98
101
  &:focus-within {
99
- border: 1px solid var(--accent-color);
102
+ border: 1px solid var(--primary-color);
100
103
  }
101
104
  }
102
105
 
@@ -127,6 +130,6 @@ const isResult = computed(() => !isEmpty(props.result));
127
130
  .audit-form-question--clear {
128
131
  margin-top: var(--spacing-sm);;
129
132
  cursor: pointer;
130
- color: var(--link-color);
133
+ color: var(--text-link-color);
131
134
  }
132
135
  </style>
@@ -6,24 +6,24 @@
6
6
  :label="$t('reusable.required')"
7
7
  :disabled="first"
8
8
  @change="updateQuestion({ path: 'required', value: $event })"
9
- ></wt-switcher>
9
+ />
10
10
  <div class="audit-form-question-write-header__actions">
11
11
  <wt-tooltip>
12
- <template v-slot:activator>
12
+ <template #activator>
13
13
  <wt-icon-btn
14
14
  icon="copy"
15
15
  @click="emit('copy')"
16
- ></wt-icon-btn>
16
+ />
17
17
  </template>
18
18
  {{ $t('reusable.copy') }}
19
19
  </wt-tooltip>
20
20
  <wt-tooltip>
21
- <template v-slot:activator>
21
+ <template #activator>
22
22
  <wt-icon-btn
23
23
  icon="bucket"
24
24
  :disabled="first"
25
25
  @click="emit('delete')"
26
- ></wt-icon-btn>
26
+ />
27
27
  </template>
28
28
  {{ $t('reusable.delete') }}
29
29
  </wt-tooltip>
@@ -38,7 +38,7 @@
38
38
  required
39
39
  prevent-trim
40
40
  @input="updateQuestion({ path: 'question', value: $event })"
41
- ></wt-input>
41
+ />
42
42
  <wt-select
43
43
  :value="prettifiedQuestionType"
44
44
  :options="QuestionType"
@@ -46,14 +46,14 @@
46
46
  :clearable="false"
47
47
  :label="$t('webitelUI.auditForm.answerType')"
48
48
  @input="handleQuestionTypeChange($event.value)"
49
- ></wt-select>
49
+ />
50
50
  </div>
51
51
  <component
52
52
  :is="QuestionTypeComponent"
53
53
  :question="question"
54
54
  mode="write"
55
55
  @change:question="emit('change:question', $event)"
56
- ></component>
56
+ />
57
57
  </section>
58
58
  </article>
59
59
  </template>
@@ -3,13 +3,13 @@
3
3
  :is="component"
4
4
  v-clickaway="saveQuestion"
5
5
  :class="[
6
- `audit-form-question--mode-${mode}`,
7
- {
8
- 'audit-form-question--answered': isResult,
9
- },
10
- {
11
- 'audit-form-question--sort-ignore': first && mode === 'fill'
12
- }
6
+ `audit-form-question--mode-${mode}`,
7
+ {
8
+ 'audit-form-question--answered': isResult,
9
+ },
10
+ {
11
+ 'audit-form-question--sort-ignore': first && mode === 'fill'
12
+ }
13
13
  ]"
14
14
  :disable-dragging="mode === 'fill'"
15
15
  :first="first"
@@ -23,7 +23,7 @@
23
23
  @delete="emits('delete')"
24
24
  @change:question="emits('update:question', $event)"
25
25
  @change:result="emits('update:result', $event)"
26
- ></component>
26
+ />
27
27
  </template>
28
28
 
29
29
  <script setup>
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <section class="audit-form">
3
3
  <div
4
- class="audit-form__sortable-wrapper"
5
- ref="sortableWrapper"
6
4
  v-if="!reloadSortable"
5
+ ref="sortableWrapper"
6
+ class="audit-form__sortable-wrapper"
7
7
  >
8
8
  <audit-form-question
9
9
  v-for="(question, key) of questions"
@@ -18,14 +18,15 @@
18
18
  @delete="deleteQuestion({ question, key})"
19
19
  @update:question="handleQuestionUpdate({ key, value: $event })"
20
20
  @update:result="handleResultUpdate({ key, value: $event })"
21
- ></audit-form-question>
21
+ />
22
22
  </div>
23
23
  <wt-button
24
- class="audit-form__add-button"
25
24
  v-if="mode === 'create' && !readonly"
25
+ class="audit-form__add-button"
26
26
  :disabled="isInvalidForm"
27
27
  @click="addQuestion"
28
- >{{ $t('webitelUI.auditForm.addQuestion') }}
28
+ >
29
+ {{ $t('webitelUI.auditForm.addQuestion') }}
29
30
  </wt-button>
30
31
  </section>
31
32
  </template>
@@ -6,21 +6,21 @@
6
6
  :v="v$.option.name"
7
7
  prevent-trim
8
8
  @input="emit('update:option', { name: $event, score: option.score })"
9
- ></wt-input>
9
+ />
10
10
  <wt-input
11
11
  :label="$t('webitelUI.auditForm.score', 1)"
12
12
  :value="option.score"
13
13
  :v="v$.option.score"
14
14
  type="number"
15
15
  @input="emit('update:option', { name: option.name, score: $event })"
16
- ></wt-input>
16
+ />
17
17
  <wt-tooltip class="audit-form-question-options-write-row__tooltip">
18
- <template v-slot:activator>
18
+ <template #activator>
19
19
  <wt-icon-btn
20
20
  :disabled="first"
21
21
  icon="bucket"
22
22
  @click="emit('delete')"
23
- ></wt-icon-btn>
23
+ />
24
24
  </template>
25
25
  {{ $t('reusable.delete') }}
26
26
  </wt-tooltip>
@@ -11,11 +11,12 @@
11
11
  :first="key === 0"
12
12
  @update:option="updateQuestion({ path: `options[${key}]`, value: $event })"
13
13
  @delete="deleteQuestionOption({ key })"
14
- ></options-write-row>
14
+ />
15
15
  <wt-button
16
16
  class="audit-form-question-options-write__add-button"
17
17
  @click="addQuestionOption"
18
- >{{ $t('reusable.add') }}
18
+ >
19
+ {{ $t('reusable.add') }}
19
20
  </wt-button>
20
21
  </div>
21
22
  <div
@@ -29,9 +30,11 @@
29
30
  :selected="result"
30
31
  :value="opt"
31
32
  @input="emit('change:result', $event)"
32
- ></wt-radio>
33
+ />
34
+ </div>
35
+ <div v-else>
36
+ Unknown mode: {{ mode }}
33
37
  </div>
34
- <div v-else>Unknown mode: {{ mode }}</div>
35
38
  </article>
36
39
  </template>
37
40
 
@@ -13,7 +13,7 @@
13
13
  type="number"
14
14
  required
15
15
  @input="updateQuestion({ path: 'min', value: $event })"
16
- ></wt-input>
16
+ />
17
17
  <wt-input
18
18
  :value="question.max"
19
19
  :v="v$.question.max"
@@ -23,7 +23,7 @@
23
23
  type="number"
24
24
  required
25
25
  @input="updateQuestion({ path: 'max', value: $event })"
26
- ></wt-input>
26
+ />
27
27
  </div>
28
28
  <div
29
29
  v-else-if="mode === 'read'"
@@ -36,7 +36,7 @@
36
36
  :value="value"
37
37
  :selected="isResult ? result.score : null"
38
38
  @input="emit('change:result', { score: value })"
39
- ></wt-radio>
39
+ />
40
40
  </div>
41
41
  </article>
42
42
  </template>
@@ -4,8 +4,11 @@ import stringify from 'csv-stringify/lib/sync';
4
4
  import CSVExportMixin from '../mixins/exportCSVMixin';
5
5
  import '../../../../tests/mocks/localStorageMock';
6
6
 
7
- jest.mock('csv-stringify/lib/sync');
8
- jest.mock('file-saver');
7
+ vi.mock('csv-stringify/lib/sync');
8
+ vi.mock('file-saver', () => ({
9
+ saveAs: vi.fn(),
10
+ }));
11
+
9
12
  const dataList = [
10
13
  { _isSelected: true, id: 1 },
11
14
  { _isSelected: true, id: 2 },
@@ -0,0 +1,77 @@
1
+ import { mount, shallowMount } from '@vue/test-utils';
2
+ import { ref } from 'vue';
3
+ import { useValidation } from '../../../mixins/validationMixin/useValidation';
4
+ import DeleteConfirmationPopup from '../components/delete-confirmation-popup.vue';
5
+
6
+ vi.mock('../../../mixins/validationMixin/useValidation');
7
+
8
+ useValidation.mockImplementation(() => ({
9
+ isValidation: ref(false),
10
+ invalid: ref(false),
11
+ validationText: ref(''),
12
+ }));
13
+
14
+ describe('DeleteConfirmationPopup', () => {
15
+ it('renders a component', () => {
16
+ const wrapper = shallowMount(DeleteConfirmationPopup, {
17
+ props: {
18
+ deleteCount: 1,
19
+ callback: vi.fn(),
20
+ },
21
+ });
22
+ expect(wrapper.classes('delete-confirmation-popup')).toBe(true);
23
+ });
24
+
25
+ it('yes button called props callback', async () => {
26
+ const callback = vi.fn();
27
+ const wrapper = mount(DeleteConfirmationPopup, {
28
+ props: {
29
+ deleteCount: 1,
30
+ callback,
31
+ },
32
+ });
33
+ const button = wrapper.findAllComponents({ name: 'wt-button' }).find((btn) => btn.text().includes('Yes'));
34
+ expect(button.text()).toContain('Yes');
35
+ await button.trigger('click');
36
+ await wrapper.vm.$nextTick();
37
+ expect(callback).toHaveBeenCalled();
38
+ });
39
+
40
+ it('popup message block have delete count', () => {
41
+ const deleteCount = 123;
42
+ const wrapper = mount(DeleteConfirmationPopup, {
43
+ props: {
44
+ deleteCount,
45
+ callback: vi.fn(),
46
+ },
47
+ });
48
+ expect(wrapper.find('.delete-confirmation-popup__content').text())
49
+ .toContain(deleteCount.toString());
50
+ });
51
+
52
+ it('yes button emitted close', async () => {
53
+ const wrapper = mount(DeleteConfirmationPopup, {
54
+ props: {
55
+ deleteCount: 1,
56
+ callback: vi.fn(),
57
+ },
58
+ });
59
+ const button = wrapper.findAllComponents({ name: 'wt-button' }).find((btn) => btn.text().includes('Yes'));
60
+ await button.vm.$emit('close');
61
+ await wrapper.vm.$nextTick();
62
+ expect(button.emitted('close')).toBeTruthy();
63
+ });
64
+
65
+ it('no button emitted close', async () => {
66
+ const wrapper = mount(DeleteConfirmationPopup, {
67
+ props: {
68
+ deleteCount: 1,
69
+ callback: vi.fn(),
70
+ },
71
+ });
72
+ const button = wrapper.findAllComponents({ name: 'wt-button' }).find((btn) => btn.text().includes('No'));
73
+ await button.vm.$emit('close');
74
+ await wrapper.vm.$nextTick();
75
+ expect(button.emitted('close')).toBeTruthy();
76
+ });
77
+ });
@@ -1,28 +1,36 @@
1
1
  <template>
2
2
  <wt-popup
3
3
  class="delete-confirmation-popup"
4
- min-width="480"
4
+ width="500"
5
5
  @close="close"
6
6
  >
7
- <template v-slot:title>{{ $t('webitelUI.deleteConfirmationPopup.title') }}</template>
8
- <template v-slot:main>
9
- <p>
10
- {{ deleteMessage }}
11
- {{ $t('webitelUI.deleteConfirmationPopup.undoneActionAlert') }}
12
- </p>
7
+ <template #title>
8
+ {{ $t('webitelUI.deleteConfirmationPopup.title') }}
13
9
  </template>
14
- <template v-slot:actions>
15
- <wt-button
16
- color="secondary"
17
- :disabled="isDeleting"
18
- @click="close"
19
- >{{ $t('reusable.cancel') }}
20
- </wt-button>
10
+ <template #main>
11
+ <div class="delete-confirmation-popup__content">
12
+ <wt-icon
13
+ icon="attention"
14
+ color="error"
15
+ />
16
+ <p class="delete-confirmation-popup__message">
17
+ {{ deleteMessage }}
18
+ </p>
19
+ </div>
20
+ </template>
21
+ <template #actions>
21
22
  <wt-button
22
- color="danger"
23
23
  :loading="isDeleting"
24
24
  @click="confirm"
25
- >{{ $t('reusable.delete') }}
25
+ >
26
+ {{ $t('vocabulary.yes') }}
27
+ </wt-button>
28
+ <wt-button
29
+ :disabled="isDeleting"
30
+ color="secondary"
31
+ @click="close"
32
+ >
33
+ {{ $t('vocabulary.no') }}
26
34
  </wt-button>
27
35
  </template>
28
36
  </wt-popup>
@@ -44,7 +52,7 @@ const props = defineProps({
44
52
  });
45
53
 
46
54
  const emit = defineEmits([
47
- 'close',
55
+ 'close',
48
56
  ]);
49
57
 
50
58
  const { t } = useI18n();
@@ -83,5 +91,15 @@ async function confirm() {
83
91
  </script>
84
92
 
85
93
  <style scoped>
94
+ .delete-confirmation-popup__content {
95
+ display: flex;
96
+ flex-direction: column;
97
+ align-items: center;
98
+ gap: var(--spacing-sm);
99
+ }
100
+
101
+ .delete-confirmation-popup__message {
102
+ text-align: center;
103
+ }
86
104
 
87
105
  </style>
@@ -5,9 +5,12 @@ import jszipUtils from 'jszip-utils';
5
5
  import FilesExportMixin from '../mixins/exportFilesMixin';
6
6
  import '../../../../tests/mocks/localStorageMock';
7
7
 
8
- jest.mock('jszip');
9
- jest.mock('jszip-utils');
10
- jest.mock('file-saver');
8
+ vi.mock('jszip');
9
+ vi.mock('jszip-utils');
10
+ vi.mock('file-saver', () => ({
11
+ saveAs: vi.fn(),
12
+ }));
13
+
11
14
  const dataList = [
12
15
  { files: [{ name: 'jest', id: '1', mimeType: 'mime/type' }] },
13
16
  ];
@@ -1,6 +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;
3
+ const BASE_URL = process ? process.env.VUE_APP_API_URL : import.meta.env.VITE_API_URL;
4
4
  return `${BASE_URL}/storage/recordings/${id}/stream?access_token=${token}`;
5
5
  };
6
6
 
@@ -8,7 +8,7 @@
8
8
  @change="setSize(localSize)"
9
9
  @next="setPage(+page + 1)"
10
10
  @prev="setPage(page - 1)"
11
- ></wt-pagination>
11
+ />
12
12
  </template>
13
13
 
14
14
  <script setup>
@@ -3,7 +3,7 @@
3
3
  :headers="headers"
4
4
  :static-headers="staticHeaders"
5
5
  @change="handleChange"
6
- ></wt-table-column-select>
6
+ />
7
7
  </template>
8
8
 
9
9
  <script setup>
@@ -14,8 +14,8 @@ const state = {
14
14
 
15
15
  describe('features/notifications store: actions', () => {
16
16
  const context = {
17
- dispatch: jest.fn(),
18
- commit: jest.fn(),
17
+ dispatch: vi.fn(),
18
+ commit: vi.fn(),
19
19
  getters: {
20
20
  IS_MAIN_TAB: () => true,
21
21
  IS_SOUND_ALLOWED: () => true,
@@ -69,13 +69,13 @@ describe('features/notifications store: actions', () => {
69
69
  it('_SUBSCRIBE_TAB_CLOSING action commits SET_CURRENT_TAB_ID mutation', async () => {
70
70
  await notificationsModule.actions._SUBSCRIBE_TAB_CLOSING(context);
71
71
  window.dispatchEvent(new Event('storage'));
72
- expect(context.commit).toHaveBeenCalledWith('SET_CURRENT_TAB_ID', 'null');
72
+ expect(context.commit).toHaveBeenCalledWith('SET_CURRENT_TAB_ID', null);
73
73
  });
74
74
 
75
- it('PLAY_SOUND action commits SET_CURRENTLY_PLAIYNG mutation with sound', async () => {
76
- const sound = new Audio(audio);
75
+ it('PLAY_SOUND action commits SET_CURRENTLY_PLAYING mutation with sound', async () => {
76
+ const sound = {};
77
77
  await notificationsModule.actions.PLAY_SOUND(context, { sound });
78
- expect(context.commit).toHaveBeenCalledWith('SET_CURRENTLY_PLAYING', sound);
78
+ expect(context.commit.mock.calls[0][0]).toBe('SET_CURRENTLY_PLAYING');
79
79
  });
80
80
 
81
81
  it('_SET_UNREAD_COUNT dispatches _SET_TAB_TITLE action', () => {
@@ -1,7 +1,7 @@
1
1
  import ApiFilterSchema from '../ApiFilterSchema';
2
2
 
3
3
  describe('Api Filter Schema', () => {
4
- const APIMock = jest.fn();
4
+ const APIMock = vi.fn();
5
5
  beforeEach(() => {
6
6
  APIMock.mockClear();
7
7
  });
@@ -12,11 +12,13 @@ const router = createRouter({
12
12
  describe('Abstract Api Filter', () => {
13
13
  const namespace = 'jest';
14
14
  const filterQuery = 'jest';
15
- const filterSchema = new ApiFilterSchema({ locale: {} });
16
- const searchMock = jest.fn();
17
- const fetchSelectedMock = jest.fn(() => ({ items: [] }));
18
- jest.spyOn(filterSchema, 'search').mockImplementation(searchMock);
19
- jest.spyOn(filterSchema, 'fetchSelected').mockImplementation(fetchSelectedMock);
15
+ const filterSchema = new ApiFilterSchema({
16
+ locale: { label: '' }
17
+ });
18
+ const searchMock = vi.fn();
19
+ const fetchSelectedMock = vi.fn(() => ({ items: [] }));
20
+ vi.spyOn(filterSchema, 'search').mockImplementation(searchMock);
21
+ vi.spyOn(filterSchema, 'fetchSelected').mockImplementation(fetchSelectedMock);
20
22
  const store = createStore({
21
23
  modules: {
22
24
  [namespace]: {
@@ -12,7 +12,9 @@ const router = createRouter({
12
12
  describe('Abstract Enum Filter', () => {
13
13
  const namespace = 'jest';
14
14
  const filterQuery = 'jest';
15
- const filterSchema = new EnumFilterSchema({ locale: {} });
15
+ const filterSchema = new EnumFilterSchema({
16
+ locale: { label: ''}
17
+ });
16
18
  const store = createStore({
17
19
  modules: {
18
20
  [namespace]: {
@@ -41,8 +41,8 @@ describe('DatetimeFilter Filter', () => {
41
41
  it('initial restoreValue() triggers setValue() method', async () => {
42
42
  const value = Date.now();
43
43
  await router.replace({ query: { [filterQuery]: value } });
44
- const setValueMock = jest.fn();
45
- jest.spyOn(baseFilterMixin.methods, 'setValue').mockImplementationOnce(setValueMock);
44
+ const setValueMock = vi.fn();
45
+ vi.spyOn(baseFilterMixin.methods, 'setValue').mockImplementationOnce(setValueMock);
46
46
  shallowMount(DatetimeFilter, mountOptions);
47
47
  expect(setValueMock).toHaveBeenCalledWith({ filter: filterQuery, value });
48
48
  });
@@ -39,8 +39,8 @@ describe('FilterFromTo Filter', () => {
39
39
  it('initial restoreValue() triggers setValue() method: From case', async () => {
40
40
  const value = 10;
41
41
  await router.replace({ query: { [`${filterQuery}From`]: value } });
42
- const setValueMock = jest.fn();
43
- jest.spyOn(baseFilterMixin.methods, 'setValue')
42
+ const setValueMock = vi.fn();
43
+ vi.spyOn(baseFilterMixin.methods, 'setValue')
44
44
  .mockImplementation(setValueMock);
45
45
  shallowMount(FilterFromTo, mountOptions);
46
46
  expect(setValueMock).toHaveBeenNthCalledWith(1, {
@@ -51,8 +51,8 @@ describe('FilterFromTo Filter', () => {
51
51
  it('initial restoreValue() triggers setValue() method: To case', async () => {
52
52
  const value = 10;
53
53
  await router.replace({ query: { [`${filterQuery}To`]: value } });
54
- const setValueMock = jest.fn();
55
- jest.spyOn(baseFilterMixin.methods, 'setValue')
54
+ const setValueMock = vi.fn();
55
+ vi.spyOn(baseFilterMixin.methods, 'setValue')
56
56
  .mockImplementation(setValueMock);
57
57
  shallowMount(FilterFromTo, mountOptions);
58
58
  expect(setValueMock).toHaveBeenNthCalledWith(2, {
@@ -39,8 +39,8 @@ describe('Search Filter', () => {
39
39
  it('initial restoreValue() triggers setValue() method', async () => {
40
40
  const search = 'jest';
41
41
  await router.replace({ query: { [filterQuery]: search } });
42
- const setValueMock = jest.fn();
43
- jest.spyOn(baseFilterMixin.methods, 'setValue').mockImplementationOnce(setValueMock);
42
+ const setValueMock = vi.fn();
43
+ vi.spyOn(baseFilterMixin.methods, 'setValue').mockImplementationOnce(setValueMock);
44
44
  shallowMount(SearchFilter, mountOptions);
45
45
  expect(setValueMock).toHaveBeenCalledWith({ filter: filterQuery, value: search });
46
46
  });
@@ -10,14 +10,14 @@
10
10
  @input="setValue({ filter: filterQuery, value: $event })"
11
11
  @reset="setValueToQuery({ value, filterQuery, storedProp: filterSchema.storedProp })"
12
12
  @closed="setValueToQuery({ value, filterQuery, storedProp: filterSchema.storedProp })"
13
- ></wt-select>
13
+ />
14
14
  </template>
15
15
 
16
16
  <script>
17
17
  import apiFilterMixin from '../mixins/apiFilterMixin';
18
18
 
19
19
  export default {
20
- name: 'abstract-api-filter',
20
+ name: 'AbstractApiFilter',
21
21
  mixins: [apiFilterMixin],
22
22
  props: {
23
23
  filterQuery: {
@@ -9,14 +9,14 @@
9
9
  @input="setValue({ filter: filterQuery, value: $event })"
10
10
  @reset="setValueToQuery({ value, filterQuery, storedProp: filterSchema.storedProp })"
11
11
  @closed="setValueToQuery({ value, filterQuery, storedProp: filterSchema.storedProp })"
12
- ></wt-select>
12
+ />
13
13
  </template>
14
14
 
15
15
  <script>
16
16
  import enumFilterMixin from '../mixins/enumFilterMixin';
17
17
 
18
18
  export default {
19
- name: 'abstract-enum-filter',
19
+ name: 'AbstractEnumFilter',
20
20
  mixins: [enumFilterMixin],
21
21
  props: {
22
22
  filterQuery: {
@@ -4,14 +4,14 @@
4
4
  :label="label"
5
5
  mode="datetime"
6
6
  @input="handleChange"
7
- ></wt-datepicker>
7
+ />
8
8
  </template>
9
9
 
10
10
  <script>
11
11
  import baseFilterMixin from '../mixins/baseFilterMixin/baseFilterMixin';
12
12
 
13
13
  export default {
14
- name: 'filter-from',
14
+ name: 'FilterFrom',
15
15
  mixins: [baseFilterMixin],
16
16
  props: {
17
17
  filterQuery: {