@webitel/ui-sdk 3.2.125 → 3.2.127

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 (56) hide show
  1. package/dist/ui-sdk.common.js +606 -384
  2. package/dist/ui-sdk.common.js.map +1 -1
  3. package/dist/ui-sdk.css +1 -1
  4. package/dist/ui-sdk.umd.js +608 -386
  5. package/dist/ui-sdk.umd.js.map +1 -1
  6. package/dist/ui-sdk.umd.min.js +1 -1
  7. package/dist/ui-sdk.umd.min.js.map +1 -1
  8. package/package.json +2 -1
  9. package/src/components/on-demand/wt-cc-agent-status-timers/__tests__/wt-cc-agent-status-timers.spec.js +25 -0
  10. package/src/components/on-demand/wt-cc-agent-status-timers/wt-cc-agent-status-timers.vue +56 -0
  11. package/src/components/wt-app-header/wt-app-header.vue +4 -1
  12. package/src/components/wt-avatar/wt-avatar.vue +4 -1
  13. package/src/components/wt-badge/wt-badge.vue +4 -1
  14. package/src/components/wt-button/wt-button.vue +4 -1
  15. package/src/components/wt-button-select/wt-button-select.vue +5 -1
  16. package/src/components/wt-checkbox/wt-checkbox.vue +4 -1
  17. package/src/components/wt-chip/wt-chip.vue +1 -1
  18. package/src/components/wt-context-menu/wt-context-menu.vue +4 -1
  19. package/src/components/wt-datepicker/wt-datepicker.vue +4 -1
  20. package/src/components/wt-divider/wt-divider.vue +4 -1
  21. package/src/components/wt-headline/wt-headline.vue +4 -1
  22. package/src/components/wt-headline-nav/wt-headline-nav.vue +4 -1
  23. package/src/components/wt-icon/wt-icon.vue +3 -1
  24. package/src/components/wt-indicator/wt-indicator.vue +4 -1
  25. package/src/components/wt-input/wt-input.vue +4 -1
  26. package/src/components/wt-input-info/wt-input-info.vue +4 -1
  27. package/src/components/wt-label/wt-label.vue +4 -1
  28. package/src/components/wt-load-bar/wt-load-bar.vue +4 -1
  29. package/src/components/wt-loader/wt-loader.vue +4 -1
  30. package/src/components/wt-navigation-bar/wt-navigation-bar.vue +4 -1
  31. package/src/components/wt-notification/wt-notification.vue +4 -1
  32. package/src/components/wt-notifications-bar/wt-notifications-bar.vue +4 -1
  33. package/src/components/wt-page-wrapper/wt-page-wrapper.vue +4 -1
  34. package/src/components/wt-pagination/wt-pagination.vue +4 -1
  35. package/src/components/wt-popup/wt-popup.vue +4 -1
  36. package/src/components/wt-progress-bar/wt-progress-bar.vue +4 -1
  37. package/src/components/wt-rounded-action/wt-rounded-action.vue +4 -1
  38. package/src/components/wt-search-bar/wt-search-bar.vue +4 -1
  39. package/src/components/wt-select/wt-select.vue +4 -1
  40. package/src/components/wt-slider/wt-slider.vue +4 -1
  41. package/src/components/wt-status-select/wt-status-select.vue +4 -1
  42. package/src/components/wt-switcher/wt-switcher.vue +4 -1
  43. package/src/components/wt-table/wt-table.vue +4 -1
  44. package/src/components/wt-table-actions/wt-table-actions.vue +4 -1
  45. package/src/components/wt-tabs/wt-tabs.vue +4 -1
  46. package/src/components/wt-tags-input/wt-tags-input.vue +3 -1
  47. package/src/components/wt-textarea/wt-textarea.vue +4 -1
  48. package/src/components/wt-timepicker/wt-timepicker.vue +4 -1
  49. package/src/components/wt-tooltip/wt-tooltip.vue +4 -1
  50. package/src/composables/useRepresentableAgentPauseCause/__tests__/useRepresentableAgentPauseCause.spec.js +78 -0
  51. package/src/composables/useRepresentableAgentPauseCause/useRepresentableAgentPauseCause.js +36 -0
  52. package/src/locale/en/en.js +7 -0
  53. package/src/locale/ru/ru.js +7 -0
  54. package/src/locale/ua/ua.js +7 -0
  55. package/src/locale/.DS_Store +0 -0
  56. /package/src/{scripts/validators → validators}/domainValidator.js +0 -0
@@ -0,0 +1,78 @@
1
+ import {
2
+ useRepresentableAgentPauseCause,
3
+ } from '../useRepresentableAgentPauseCause';
4
+
5
+ let pauseCauses = [];
6
+
7
+ describe('useRepresentableAgentPauseCause', () => {
8
+ beforeEach(() => {
9
+ pauseCauses = [{ durationMin: 10, limitMin: 12 }];
10
+ });
11
+
12
+ it('correctly computes duration', () => {
13
+ const {
14
+ representablePauseCause,
15
+ } = useRepresentableAgentPauseCause(pauseCauses);
16
+ expect(representablePauseCause.value[0].duration).toBe('00:10');
17
+ });
18
+ it('isOverflow with limit = 0 returns false', () => {
19
+ const pauseCauses = [{ durationMin: 10, limitMin: 0 }];
20
+ const {
21
+ representablePauseCause,
22
+ } = useRepresentableAgentPauseCause(pauseCauses);
23
+ expect(representablePauseCause.value[0].isOverflow).toBe(false);
24
+ });
25
+ it('isOverflow with duration < limit returns false', () => {
26
+ const pauseCauses = [{ durationMin: 10, limitMin: 15 }];
27
+ const {
28
+ representablePauseCause,
29
+ } = useRepresentableAgentPauseCause(pauseCauses);
30
+ expect(representablePauseCause.value[0].isOverflow).toBe(false);
31
+ });
32
+ it('isOverflow with duration > limit returns true', () => {
33
+ const pauseCauses = [{ durationMin: 15, limitMin: 10 }];
34
+ const {
35
+ representablePauseCause,
36
+ } = useRepresentableAgentPauseCause(pauseCauses);
37
+ expect(representablePauseCause.value[0].isOverflow).toBe(true);
38
+ });
39
+
40
+ it('isOverflow with duration = limit returns false', () => {
41
+ const pauseCauses = [{ durationMin: 10, limitMin: 10 }];
42
+ const {
43
+ representablePauseCause,
44
+ } = useRepresentableAgentPauseCause(pauseCauses);
45
+ expect(representablePauseCause.value[0].isOverflow).toBe(false);
46
+ });
47
+
48
+ it('correctly computes progressColor', () => {
49
+ const {
50
+ representablePauseCause,
51
+ } = useRepresentableAgentPauseCause(pauseCauses);
52
+ expect(representablePauseCause.value[0].progressColor).toBe('primary');
53
+ });
54
+
55
+ it('correctly computes progressColor with duration > limit', () => {
56
+ const pauseCauses = [{ durationMin: 15, limitMin: 10 }];
57
+ const {
58
+ representablePauseCause,
59
+ } = useRepresentableAgentPauseCause(pauseCauses);
60
+ expect(representablePauseCause.value[0].progressColor).toBe('danger');
61
+ });
62
+
63
+ it('correctly computes progressColor with duration < limit', () => {
64
+ const pauseCauses = [{ durationMin: 10, limitMin: 15 }];
65
+ const {
66
+ representablePauseCause,
67
+ } = useRepresentableAgentPauseCause(pauseCauses);
68
+ expect(representablePauseCause.value[0].progressColor).toBe('success');
69
+ });
70
+
71
+ it('correctly computes progressColor with duration = limit', () => {
72
+ const pauseCauses = [{ durationMin: 10, limitMin: 10 }];
73
+ const {
74
+ representablePauseCause,
75
+ } = useRepresentableAgentPauseCause(pauseCauses);
76
+ expect(representablePauseCause.value[0].progressColor).toBe('primary');
77
+ });
78
+ });
@@ -0,0 +1,36 @@
1
+ import { computed } from 'vue';
2
+ import convertDuration from '../../scripts/convertDuration';
3
+
4
+ const prettifyPauseCauseDuration = (min) => {
5
+ const SEC_IN_MIN = 60;
6
+ const secDuration = convertDuration(min * SEC_IN_MIN);
7
+ return secDuration.slice(0, -3);
8
+ };
9
+
10
+ const isDurationOverflow = ({ durationMin, limitMin }) => {
11
+ return (durationMin > limitMin) && limitMin !== 0;
12
+ };
13
+
14
+ const duration = ({ durationMin, limitMin }) => {
15
+ return isDurationOverflow({ durationMin, limitMin })
16
+ ? `-${prettifyPauseCauseDuration(durationMin - limitMin)}`
17
+ : prettifyPauseCauseDuration(durationMin);
18
+ };
19
+
20
+ const pauseCauseProgressColor = ({ durationMin, limitMin }) => {
21
+ if (isDurationOverflow({ durationMin, limitMin })) return 'danger';
22
+ if (durationMin <= (limitMin * 0.75)) return 'success';
23
+ return 'primary';
24
+ };
25
+
26
+ // eslint-disable-next-line import/prefer-default-export
27
+ export const useRepresentableAgentPauseCause = (pauseCauses) => {
28
+ const representablePauseCause = computed(() => pauseCauses.map((pauseCause) => ({
29
+ ...pauseCause,
30
+ duration: duration(pauseCause),
31
+ progressColor: pauseCauseProgressColor(pauseCause),
32
+ isOverflow: isDurationOverflow(pauseCause),
33
+ })));
34
+
35
+ return { representablePauseCause };
36
+ };
@@ -340,5 +340,12 @@ export default {
340
340
  dummy: {
341
341
  text: 'There are no records yet',
342
342
  },
343
+ agentStatusSelect: {
344
+ pauseCausePopup: {
345
+ title: 'Select a pause cause',
346
+ min: 'Min',
347
+ unlimited: 'Unlimited',
348
+ },
349
+ },
343
350
  },
344
351
  };
@@ -338,5 +338,12 @@ export default {
338
338
  dummy: {
339
339
  text: 'Записи в разделе еще не созданы',
340
340
  },
341
+ agentStatusSelect: {
342
+ pauseCausePopup: {
343
+ title: 'Выберите причину паузы',
344
+ min: 'Мин',
345
+ unlimited: 'Безлимит',
346
+ },
347
+ },
341
348
  },
342
349
  };
@@ -338,5 +338,12 @@ export default {
338
338
  dummy: {
339
339
  text: 'Записи у розділі ще не створені',
340
340
  },
341
+ agentStatusSelect: {
342
+ pauseCausePopup: {
343
+ title: 'Виберіть причину паузи',
344
+ min: 'Хв',
345
+ unlimited: 'Безліміт',
346
+ },
347
+ },
341
348
  },
342
349
  };
Binary file