@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.
- package/dist/ui-sdk.common.js +606 -384
- package/dist/ui-sdk.common.js.map +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.umd.js +608 -386
- package/dist/ui-sdk.umd.js.map +1 -1
- package/dist/ui-sdk.umd.min.js +1 -1
- package/dist/ui-sdk.umd.min.js.map +1 -1
- package/package.json +2 -1
- package/src/components/on-demand/wt-cc-agent-status-timers/__tests__/wt-cc-agent-status-timers.spec.js +25 -0
- package/src/components/on-demand/wt-cc-agent-status-timers/wt-cc-agent-status-timers.vue +56 -0
- package/src/components/wt-app-header/wt-app-header.vue +4 -1
- package/src/components/wt-avatar/wt-avatar.vue +4 -1
- package/src/components/wt-badge/wt-badge.vue +4 -1
- package/src/components/wt-button/wt-button.vue +4 -1
- package/src/components/wt-button-select/wt-button-select.vue +5 -1
- package/src/components/wt-checkbox/wt-checkbox.vue +4 -1
- package/src/components/wt-chip/wt-chip.vue +1 -1
- package/src/components/wt-context-menu/wt-context-menu.vue +4 -1
- package/src/components/wt-datepicker/wt-datepicker.vue +4 -1
- package/src/components/wt-divider/wt-divider.vue +4 -1
- package/src/components/wt-headline/wt-headline.vue +4 -1
- package/src/components/wt-headline-nav/wt-headline-nav.vue +4 -1
- package/src/components/wt-icon/wt-icon.vue +3 -1
- package/src/components/wt-indicator/wt-indicator.vue +4 -1
- package/src/components/wt-input/wt-input.vue +4 -1
- package/src/components/wt-input-info/wt-input-info.vue +4 -1
- package/src/components/wt-label/wt-label.vue +4 -1
- package/src/components/wt-load-bar/wt-load-bar.vue +4 -1
- package/src/components/wt-loader/wt-loader.vue +4 -1
- package/src/components/wt-navigation-bar/wt-navigation-bar.vue +4 -1
- package/src/components/wt-notification/wt-notification.vue +4 -1
- package/src/components/wt-notifications-bar/wt-notifications-bar.vue +4 -1
- package/src/components/wt-page-wrapper/wt-page-wrapper.vue +4 -1
- package/src/components/wt-pagination/wt-pagination.vue +4 -1
- package/src/components/wt-popup/wt-popup.vue +4 -1
- package/src/components/wt-progress-bar/wt-progress-bar.vue +4 -1
- package/src/components/wt-rounded-action/wt-rounded-action.vue +4 -1
- package/src/components/wt-search-bar/wt-search-bar.vue +4 -1
- package/src/components/wt-select/wt-select.vue +4 -1
- package/src/components/wt-slider/wt-slider.vue +4 -1
- package/src/components/wt-status-select/wt-status-select.vue +4 -1
- package/src/components/wt-switcher/wt-switcher.vue +4 -1
- package/src/components/wt-table/wt-table.vue +4 -1
- package/src/components/wt-table-actions/wt-table-actions.vue +4 -1
- package/src/components/wt-tabs/wt-tabs.vue +4 -1
- package/src/components/wt-tags-input/wt-tags-input.vue +3 -1
- package/src/components/wt-textarea/wt-textarea.vue +4 -1
- package/src/components/wt-timepicker/wt-timepicker.vue +4 -1
- package/src/components/wt-tooltip/wt-tooltip.vue +4 -1
- package/src/composables/useRepresentableAgentPauseCause/__tests__/useRepresentableAgentPauseCause.spec.js +78 -0
- package/src/composables/useRepresentableAgentPauseCause/useRepresentableAgentPauseCause.js +36 -0
- package/src/locale/en/en.js +7 -0
- package/src/locale/ru/ru.js +7 -0
- package/src/locale/ua/ua.js +7 -0
- package/src/locale/.DS_Store +0 -0
- /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
|
+
};
|
package/src/locale/en/en.js
CHANGED
package/src/locale/ru/ru.js
CHANGED
package/src/locale/ua/ua.js
CHANGED
package/src/locale/.DS_Store
DELETED
|
Binary file
|
|
File without changes
|