@webitel/ui-sdk 26.8.132 → 26.8.134
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/clients-BVxipio3.js +42442 -0
- package/dist/{components-EhdFHjjv.js → components-Bp-9Pd3E.js} +513 -508
- package/dist/{convertDuration-B7EyPh1B.js → convertDuration-r4cKShcD.js} +1 -1
- package/dist/{enums-Qt_FgVQw.js → enums-De3aMU0v.js} +10 -3
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +15 -15
- package/dist/ui-sdk.umd.cjs +537 -537
- package/dist/{useValidation-Doxk7u8O.js → useValidation-DVMLhp7P.js} +1 -1
- package/dist/{utils-g-eGs-rV.js → utils-DDzzeDYC.js} +1 -1
- package/dist/{wt-action-bar-C8x6JuWV.js → wt-action-bar-Bmam7PTX.js} +2 -2
- package/dist/{wt-badge-Dyvw8SJe.js → wt-badge-B2sYDOIO.js} +1 -1
- package/dist/{wt-button-qmvx3hrn.js → wt-button-CnE463wN.js} +2 -2
- package/dist/{wt-chat-emoji-B2uZwnma.js → wt-chat-emoji-57Q-4jDY.js} +4 -4
- package/dist/{wt-datepicker-Da7l0Gm1.js → wt-datepicker-BMD_vwhp.js} +6 -6
- package/dist/{wt-display-chip-items-B_4ueviQ.js → wt-display-chip-items-DUKofLnh.js} +2 -2
- package/dist/{wt-dual-panel-DliLMQ_m.js → wt-dual-panel-BLvpBVYd.js} +1 -1
- package/dist/{wt-expansion-card-CcziJa7V.js → wt-expansion-card-BtjKjHn7.js} +1 -1
- package/dist/{wt-expansion-panel-Y3eYALow.js → wt-expansion-panel-B1ELycoD.js} +1 -1
- package/dist/{wt-icon-oMc-wpjH.js → wt-icon-DcUiwhds.js} +3 -3
- package/dist/{wt-icon-action-CDlCgzR8.js → wt-icon-action-D81WgIrd.js} +1 -1
- package/dist/{wt-icon-btn-D0co3nt5.js → wt-icon-btn-nXKOrltT.js} +1 -1
- package/dist/{wt-notifications-bar-CC48Ce7a.js → wt-notifications-bar-PZDG_jxU.js} +2 -2
- package/dist/{wt-player-CjAl-XrU.js → wt-player-D8dtW7Vv.js} +3 -3
- package/dist/{wt-screen-recordings-action-Dwj649Zu.js → wt-screen-recordings-action-BSVE_Bnb.js} +1 -1
- package/dist/{wt-search-bar-B9iP5zrT.js → wt-search-bar-BHKUUhH-.js} +1 -1
- package/dist/{wt-send-message-popup-wiwWTIv_.js → wt-send-message-popup-CXPAarjJ.js} +3 -3
- package/dist/{wt-status-select-C5YdvKpM.js → wt-status-select-D73ufZVN.js} +2 -2
- package/dist/{wt-table-CsGUHe1D.js → wt-table-C_MUE0EP.js} +3 -3
- package/dist/{wt-timepicker-DcoIUiO-.js → wt-timepicker-D1dciWJ0.js} +4 -4
- package/dist/{wt-toast-DGtljpcq.js → wt-toast-C8mbYaNa.js} +10 -10
- package/dist/{wt-tree-table-DnvAUSXr.js → wt-tree-table-DluG-JAm.js} +1 -1
- package/dist/{wt-type-extension-value-input-Cq3jNp9q.js → wt-type-extension-value-input-C2A0Pk2o.js} +1846 -1774
- package/dist/{wt-vidstack-player-CSartekd.js → wt-vidstack-player-CQOGC3TS.js} +5 -5
- package/package.json +1 -1
- package/src/components/wt-app-header/__tests__/WtAppNavigator.spec.js +47 -0
- package/src/components/wt-app-header/assets/wfm-dark.svg +118 -0
- package/src/components/wt-app-header/assets/wfm-light.svg +118 -0
- package/src/components/wt-app-header/wt-app-navigator.vue +9 -0
- package/src/enums/WebitelApplications/WfmSections.ts +6 -1
- package/src/locale/en/en.js +7 -0
- package/src/locale/es/es.js +7 -0
- package/src/locale/kz/kz.js +7 -0
- package/src/locale/pl/pl.js +7 -0
- package/src/locale/ro/ro.js +7 -0
- package/src/locale/ru/ru.js +7 -0
- package/src/locale/uk/uk.js +7 -0
- package/src/locale/uz/uz.js +7 -0
- package/src/locale/vi/vi.js +7 -0
- package/src/modules/Userinfo/classes/ApplicationsAccess.ts +20 -0
- package/src/modules/Userinfo/classes/__tests__/ApplicationsAccess.spec.ts +54 -0
- package/src/modules/Userinfo/mappings/__tests__/mappings.spec.ts +32 -0
- package/src/modules/Userinfo/mappings/mappings.ts +8 -2
- package/src/modules/Userinfo/stores/accessStore.ts +6 -8
- package/src/modules/Userinfo/types/UserAccess.ts +24 -3
- package/types/.tsbuildinfo +1 -1
- package/types/enums/WebitelApplications/WfmSections.d.ts +4 -1
- package/types/locale/en/en.d.ts +6 -0
- package/types/locale/es/es.d.ts +8 -0
- package/types/locale/i18n.d.ts +54 -0
- package/types/locale/index.d.ts +54 -0
- package/types/locale/kz/kz.d.ts +8 -0
- package/types/locale/pl/pl.d.ts +8 -0
- package/types/locale/ro/ro.d.ts +8 -0
- package/types/locale/ru/ru.d.ts +8 -0
- package/types/locale/uk/uk.d.ts +8 -0
- package/types/locale/uz/uz.d.ts +8 -0
- package/types/locale/vi/vi.d.ts +8 -0
- package/types/modules/Userinfo/classes/ApplicationsAccess.d.ts +3 -1
- package/types/modules/Userinfo/mappings/mappings.d.ts +3 -2
- package/types/modules/Userinfo/stores/userinfoStore.d.ts +3 -3
- package/types/modules/Userinfo/types/UserAccess.d.ts +16 -4
- package/dist/clients-BXD-NjhU.js +0 -42442
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
AuditorSections,
|
|
8
8
|
CrmSections,
|
|
9
9
|
SupervisorSections,
|
|
10
|
+
WfmSections,
|
|
10
11
|
WtApplication,
|
|
11
12
|
} from '../../../enums';
|
|
12
13
|
|
|
@@ -33,6 +34,9 @@ export type ApplicationsAccessSchema = {
|
|
|
33
34
|
} & {
|
|
34
35
|
[WtApplication.Crm]: BaseAccessSchema &
|
|
35
36
|
Partial<Record<CrmSections, BaseAccessSchema>>;
|
|
37
|
+
} & {
|
|
38
|
+
[WtApplication.Wfm]: BaseAccessSchema &
|
|
39
|
+
Partial<Record<WfmSections, BaseAccessSchema>>;
|
|
36
40
|
};
|
|
37
41
|
|
|
38
42
|
const applicationsAccess = (value = true): ApplicationsAccessSchema => ({
|
|
@@ -280,6 +284,22 @@ const applicationsAccess = (value = true): ApplicationsAccessSchema => ({
|
|
|
280
284
|
_locale: `WtApplication.overrideApplicationsAccess.${WtApplication.Crm}.sections.${CrmSections.CustomLookups}`,
|
|
281
285
|
},
|
|
282
286
|
},
|
|
287
|
+
[WtApplication.Wfm]: {
|
|
288
|
+
_enabled: value,
|
|
289
|
+
_locale: `WtApplication.${WtApplication.Wfm}.name`,
|
|
290
|
+
[WfmSections.Agents]: {
|
|
291
|
+
_enabled: value,
|
|
292
|
+
_locale: `WtApplication.${WtApplication.Wfm}.sections.${WfmSections.Agents}`,
|
|
293
|
+
},
|
|
294
|
+
[WfmSections.Schedules]: {
|
|
295
|
+
_enabled: value,
|
|
296
|
+
_locale: `WtApplication.${WtApplication.Wfm}.sections.${WfmSections.Schedules}`,
|
|
297
|
+
},
|
|
298
|
+
[WfmSections.ForecastCalculation]: {
|
|
299
|
+
_enabled: value,
|
|
300
|
+
_locale: `WtApplication.${WtApplication.Wfm}.sections.${WfmSections.ForecastCalculation}`,
|
|
301
|
+
},
|
|
302
|
+
},
|
|
283
303
|
});
|
|
284
304
|
|
|
285
305
|
/**
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { WfmSections, WtApplication } from '../../../../enums';
|
|
4
|
+
import ApplicationsAccess from '../ApplicationsAccess';
|
|
5
|
+
|
|
6
|
+
const wfmSections = [
|
|
7
|
+
WfmSections.Agents,
|
|
8
|
+
WfmSections.Schedules,
|
|
9
|
+
WfmSections.ForecastCalculation,
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
describe('ApplicationsAccess', () => {
|
|
13
|
+
it('includes WFM application with its sections', () => {
|
|
14
|
+
const { access } = new ApplicationsAccess();
|
|
15
|
+
|
|
16
|
+
expect(access[WtApplication.Wfm]._enabled).toBe(true);
|
|
17
|
+
expect(access[WtApplication.Wfm]._locale).toBe(
|
|
18
|
+
`WtApplication.${WtApplication.Wfm}.name`,
|
|
19
|
+
);
|
|
20
|
+
wfmSections.forEach((section) => {
|
|
21
|
+
expect(access[WtApplication.Wfm][section]).toEqual({
|
|
22
|
+
_enabled: true,
|
|
23
|
+
_locale: `WtApplication.${WtApplication.Wfm}.sections.${section}`,
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('does not include lookups that are not moved to WFM yet', () => {
|
|
29
|
+
const { access } = new ApplicationsAccess();
|
|
30
|
+
|
|
31
|
+
expect(
|
|
32
|
+
access[WtApplication.Wfm][WfmSections.ShiftTemplates],
|
|
33
|
+
).toBeUndefined();
|
|
34
|
+
expect(
|
|
35
|
+
access[WtApplication.Wfm][WfmSections.PauseTemplates],
|
|
36
|
+
).toBeUndefined();
|
|
37
|
+
expect(
|
|
38
|
+
access[WtApplication.Wfm][WfmSections.WorkingConditions],
|
|
39
|
+
).toBeUndefined();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('restores WFM as disabled when it is missing from saved access', () => {
|
|
43
|
+
const { access } = new ApplicationsAccess({
|
|
44
|
+
access: {
|
|
45
|
+
[WtApplication.Crm]: {
|
|
46
|
+
_enabled: true,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
expect(access[WtApplication.Wfm]._enabled).toBe(false);
|
|
52
|
+
expect(access[WtApplication.Wfm][WfmSections.Agents]?._enabled).toBe(false);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
AdminSections,
|
|
5
|
+
WfmSections,
|
|
6
|
+
WtApplication,
|
|
7
|
+
WtObject,
|
|
8
|
+
} from '../../../../enums';
|
|
9
|
+
import { castWtObjectToUiSection } from '../../scripts/utils';
|
|
10
|
+
|
|
11
|
+
describe('mapWtObjectToUiSection', () => {
|
|
12
|
+
it('maps agents to WFM Agents section', () => {
|
|
13
|
+
expect(castWtObjectToUiSection(WtApplication.Wfm, WtObject.Agent)).toBe(
|
|
14
|
+
WfmSections.Agents,
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('keeps Admin mapping for lookups that are not moved to WFM yet', () => {
|
|
19
|
+
expect(
|
|
20
|
+
castWtObjectToUiSection(WtApplication.Admin, WtObject.ShiftTemplate),
|
|
21
|
+
).toBe(AdminSections.ShiftTemplates);
|
|
22
|
+
expect(
|
|
23
|
+
castWtObjectToUiSection(WtApplication.Admin, WtObject.PauseTemplate),
|
|
24
|
+
).toBe(AdminSections.PauseTemplates);
|
|
25
|
+
expect(
|
|
26
|
+
castWtObjectToUiSection(WtApplication.Admin, WtObject.WorkingCondition),
|
|
27
|
+
).toBe(AdminSections.WorkingConditions);
|
|
28
|
+
expect(
|
|
29
|
+
castWtObjectToUiSection(WtApplication.Wfm, WtObject.ShiftTemplate),
|
|
30
|
+
).toBeUndefined();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
CrmSections,
|
|
7
7
|
CrudAction,
|
|
8
8
|
SupervisorSections,
|
|
9
|
+
WfmSections,
|
|
9
10
|
WtApplication,
|
|
10
11
|
WtObject,
|
|
11
12
|
} from '../../../enums';
|
|
@@ -202,7 +203,8 @@ type UiSection =
|
|
|
202
203
|
| AdminSections
|
|
203
204
|
| AuditorSections
|
|
204
205
|
| CrmSections
|
|
205
|
-
| SupervisorSections
|
|
206
|
+
| SupervisorSections
|
|
207
|
+
| WfmSections;
|
|
206
208
|
export const mapWtObjectToUiSection: Partial<
|
|
207
209
|
Record<WtApplication, Partial<Record<WtObject, UiSection>>>
|
|
208
210
|
> = {
|
|
@@ -274,7 +276,10 @@ export const mapWtObjectToUiSection: Partial<
|
|
|
274
276
|
[WtObject.Communication]: SupervisorSections.ActiveCalls,
|
|
275
277
|
},
|
|
276
278
|
|
|
277
|
-
|
|
279
|
+
// Wfm sections
|
|
280
|
+
[WtApplication.Wfm]: {
|
|
281
|
+
[WtObject.Agent]: WfmSections.Agents,
|
|
282
|
+
},
|
|
278
283
|
};
|
|
279
284
|
|
|
280
285
|
export const mapUiSectionToWtObject = invert(mapWtObjectToUiSection);
|
|
@@ -283,3 +288,4 @@ export const AdminSectionsValues = invert(AdminSections);
|
|
|
283
288
|
export const AuditorSectionsValues = invert(AuditorSections);
|
|
284
289
|
export const CrmSectionsValues = invert(CrmSections);
|
|
285
290
|
export const SupervisorSectionsValues = invert(SupervisorSections);
|
|
291
|
+
export const WfmSectionsValues = invert(WfmSections);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { defineStore } from 'pinia';
|
|
2
2
|
import { ref } from 'vue';
|
|
3
|
-
import type { NavigationGuard, RouteLocationNormalized } from 'vue-router';
|
|
4
|
-
|
|
5
3
|
import { CrudAction, type WtApplication, type WtObject } from '../../../enums';
|
|
6
4
|
import type { SpecialGlobalAction, WebitelLicense } from '../enums';
|
|
7
5
|
import { wtObjectsWithGlobalSpecialActionAccessAsChecksSource } from '../mappings/mappings';
|
|
@@ -14,11 +12,13 @@ import {
|
|
|
14
12
|
shouldUseGlobalCrudActionAccessAsChecksSource,
|
|
15
13
|
} from '../scripts/utils';
|
|
16
14
|
import type {
|
|
15
|
+
AccessGuardRoute,
|
|
17
16
|
AppVisibilityMap,
|
|
18
17
|
CreateUserAccessStoreConfig,
|
|
19
18
|
CreateUserAccessStoreRawAccess,
|
|
20
19
|
FullUiSectionName,
|
|
21
20
|
GlobalActionAccessMap,
|
|
21
|
+
RouteAccessGuard,
|
|
22
22
|
ScopeAccessMap,
|
|
23
23
|
SectionVisibilityMap,
|
|
24
24
|
UiSection,
|
|
@@ -110,23 +110,21 @@ export const createUserAccessStore = ({
|
|
|
110
110
|
return allowAppVisibility && allowObjectAccess && allowSectionVisibility;
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
const routeAccessGuard:
|
|
113
|
+
const routeAccessGuard: RouteAccessGuard = (to) => {
|
|
114
114
|
let wtApplication = to.matched
|
|
115
115
|
.toReversed()
|
|
116
116
|
.find(({ meta }) => meta.WtApplication)?.meta?.WtApplication as
|
|
117
117
|
| WtApplication
|
|
118
|
-
| ((route:
|
|
118
|
+
| ((route: AccessGuardRoute) => WtApplication);
|
|
119
119
|
|
|
120
120
|
/* find last because "matched" has top=>bottom routes order */
|
|
121
121
|
let uiSection = to.matched.toReversed().find(({ meta }) => meta.UiSection)
|
|
122
122
|
?.meta?.UiSection as
|
|
123
123
|
| UiSection
|
|
124
|
-
| ((route:
|
|
124
|
+
| ((route: AccessGuardRoute) => UiSection);
|
|
125
125
|
/* find last because "matched" has top=>bottom routes order */
|
|
126
126
|
let wtObject = to.matched.toReversed().find(({ meta }) => meta.UiSection)
|
|
127
|
-
?.meta?.WtObject as
|
|
128
|
-
| WtObject
|
|
129
|
-
| ((route: RouteLocationNormalized) => WtObject);
|
|
127
|
+
?.meta?.WtObject as WtObject | ((route: AccessGuardRoute) => WtObject);
|
|
130
128
|
|
|
131
129
|
// if, then compute fn
|
|
132
130
|
if (typeof wtApplication === 'function') {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
RouteLocationNormalized,
|
|
3
|
+
RouteLocationResolved,
|
|
4
|
+
} from 'vue-router';
|
|
2
5
|
|
|
3
6
|
import type {
|
|
4
7
|
AdminSections,
|
|
@@ -6,6 +9,7 @@ import type {
|
|
|
6
9
|
CrmSections,
|
|
7
10
|
CrudAction,
|
|
8
11
|
SupervisorSections,
|
|
12
|
+
WfmSections,
|
|
9
13
|
WtApplication,
|
|
10
14
|
WtObject,
|
|
11
15
|
} from '../../../enums';
|
|
@@ -25,7 +29,8 @@ export type UiSection =
|
|
|
25
29
|
| AdminSections
|
|
26
30
|
| AuditorSections
|
|
27
31
|
| SupervisorSections
|
|
28
|
-
| CrmSections
|
|
32
|
+
| CrmSections
|
|
33
|
+
| WfmSections;
|
|
29
34
|
|
|
30
35
|
export type FullUiSectionName = `${WtApplication}/${UiSection}`;
|
|
31
36
|
|
|
@@ -108,6 +113,22 @@ export type AppVisibilityMap = Map<WtApplication, boolean>;
|
|
|
108
113
|
* */
|
|
109
114
|
export type SectionVisibilityMap = Map<FullUiSectionName, boolean>;
|
|
110
115
|
|
|
116
|
+
/**
|
|
117
|
+
* [Claude] Route that access is checked for: a navigation target or a result of
|
|
118
|
+
* [Claude] `router.resolve()` (its `name` may be `null`).
|
|
119
|
+
*/
|
|
120
|
+
export type AccessGuardRoute = RouteLocationNormalized | RouteLocationResolved;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* [Claude] Checks route access by `to` only, so it can be called directly to get
|
|
124
|
+
* [Claude] a verdict (`=== true`) and still be passed to `router.beforeEach`.
|
|
125
|
+
*/
|
|
126
|
+
export type RouteAccessGuard = (to: AccessGuardRoute) =>
|
|
127
|
+
| true
|
|
128
|
+
| {
|
|
129
|
+
path: string;
|
|
130
|
+
};
|
|
131
|
+
|
|
111
132
|
export interface UserAccessStore {
|
|
112
133
|
initialize: (rawAccess: CreateUserAccessStoreRawAccess) => void;
|
|
113
134
|
|
|
@@ -116,7 +137,7 @@ export interface UserAccessStore {
|
|
|
116
137
|
hasUpdateAccess: (object?: WtObject) => boolean;
|
|
117
138
|
hasDeleteAccess: (object?: WtObject) => boolean;
|
|
118
139
|
|
|
119
|
-
routeAccessGuard:
|
|
140
|
+
routeAccessGuard: RouteAccessGuard;
|
|
120
141
|
|
|
121
142
|
hasSpecialGlobalActionAccess: (id: SpecialGlobalAction) => boolean;
|
|
122
143
|
hasGlobalCrudActionAccess: (action: CrudAction) => boolean;
|