@webitel/ui-sdk 26.8.111 → 26.8.113
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/{caseConverters-6cy_SaV5.js → caseConverters-DGri4uJo.js} +1 -1
- package/dist/{clients-CCAhrWQ1.js → clients-CWniSi77.js} +1294 -246
- package/dist/{components-Du718UrL.js → components-DJVzkzrr.js} +302 -302
- package/dist/{composables-Vg-QfE_2.js → composables-BeyROIj_.js} +2 -2
- package/dist/{convertDuration-heRoQzks.js → convertDuration-BOe9PsRT.js} +1 -1
- package/dist/{deep-copy-7O5ej7vT.js → deep-copy-BJdHBMNZ.js} +1 -1
- package/dist/{dist-DJZOILzq.js → dist-CnyqtIg9.js} +1 -1
- package/dist/{dist-DB8lC4KJ.js → dist-EXdgfpvN.js} +44 -44
- package/dist/{enums-BDtfwdQu.js → enums-CsINFPBu.js} +133 -11
- package/dist/{genClient-5JkKKac8.js → genClient-CvWlQ0TZ.js} +2 -2
- package/dist/{sortQueryAdapters-CyYXvnDN.js → sortQueryAdapters-Bb1yt_LD.js} +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +16 -16
- package/dist/ui-sdk.umd.cjs +865 -744
- package/dist/{useValidation-B4q8qUvG.js → useValidation-KcXmMBtR.js} +2 -2
- package/dist/{useWtTable-CUpN0LZ5.js → useWtTable-AYb1yHre.js} +1 -1
- package/dist/{utils-DaacyMAw.js → utils-DHSDTqJG.js} +1 -1
- package/dist/vue-i18n-VBiROMZ4.js +3031 -0
- package/dist/{vue-router-CobN9tLi.js → vue-router-C9sRzLyg.js} +1 -1
- package/dist/{wt-action-bar-ChLl_-jR.js → wt-action-bar-TwclxZyb.js} +3 -3
- package/dist/{wt-badge-C8O4Oarp.js → wt-badge-DbplVXor.js} +1 -1
- package/dist/{wt-button-BmBqpEkp.js → wt-button-rUZKbswL.js} +4 -4
- package/dist/{wt-chat-emoji-B1THVkoV.js → wt-chat-emoji-BATwPh2q.js} +4 -4
- package/dist/{wt-datepicker-C1kACub3.js → wt-datepicker-C4wrYXt9.js} +11 -11
- package/dist/{wt-display-chip-items-DyGS9NUo.js → wt-display-chip-items-N20vx27z.js} +2 -2
- package/dist/{wt-dual-panel-D5TCilWN.js → wt-dual-panel-CjWwG7y6.js} +7 -7
- package/dist/{wt-expansion-card-2wdr_Hpi.js → wt-expansion-card-vv5ctpfw.js} +2 -2
- package/dist/{wt-expansion-panel-DP8zz2tS.js → wt-expansion-panel-3tx3DGUp.js} +1 -1
- package/dist/{wt-galleria-iRpRiDc6.js → wt-galleria-DcZRuekj.js} +2 -2
- package/dist/{wt-icon-CZlhT7Yb.js → wt-icon-B4wxzcVG.js} +4 -4
- package/dist/{wt-icon-action-g26vM7fD.js → wt-icon-action-CTPCemTs.js} +3 -3
- package/dist/{wt-icon-btn-C8xuTCJR.js → wt-icon-btn-D3lG7Acn.js} +1 -1
- package/dist/{wt-notifications-bar-BDOKlHao.js → wt-notifications-bar-BMV-0Vmo.js} +2 -2
- package/dist/{wt-player-Dqlccj2F.js → wt-player-DBsbjt_l.js} +5 -5
- package/dist/{wt-popover-DuZFw3bg.js → wt-popover-BI6YyXy0.js} +1 -1
- package/dist/{wt-screen-recordings-action-biHVl6lR.js → wt-screen-recordings-action-D2PKGnNl.js} +1 -1
- package/dist/{wt-search-bar-ByF2Wjsg.js → wt-search-bar-CFANAMNQ.js} +1 -1
- package/dist/{wt-selection-popup-Bd4EuLl-.js → wt-selection-popup-Dei_JZah.js} +1 -1
- package/dist/{wt-send-message-popup-hQXe6TDx.js → wt-send-message-popup-DSZ7srx4.js} +7 -7
- package/dist/{wt-slider-Co6hZQu_.js → wt-slider-x-Tch7RT.js} +1 -1
- package/dist/{wt-start-page-Bp7b0ir-.js → wt-start-page-2Bdzg5V5.js} +1 -1
- package/dist/{wt-status-select-BOmAd__4.js → wt-status-select-Bgtu5WrX.js} +11 -11
- package/dist/{wt-table-D6pqHeiy.js → wt-table-DMEjT0xF.js} +8 -8
- package/dist/{wt-table-column-select-BtFhZKPT.js → wt-table-column-select-DzXaRs03.js} +3 -3
- package/dist/{wt-timepicker-C4kMPkNd.js → wt-timepicker-B-ZZUyDZ.js} +5 -5
- package/dist/{wt-toast-DbYB-u-k.js → wt-toast-pXV44Y3v.js} +10 -10
- package/dist/{wt-tree-BH2o2iCt.js → wt-tree-Cu_yRDjp.js} +98 -98
- package/dist/{wt-tree-table-BCyo4w2x.js → wt-tree-table-BET1GUgf.js} +3 -3
- package/dist/wt-type-extension-value-input-B1-ScgJm.js +14743 -0
- package/dist/{wt-vidstack-player-DEoNCYM4.js → wt-vidstack-player-C_EdEZ8v.js} +6 -6
- package/package.json +109 -28
- package/src/components/on-demand/wt-type-extension-value-input/wt-type-extension-value-input.vue +19 -5
- package/src/components/wt-icon-action/__tests__/WtIconAction.spec.js +1 -1
- package/src/components/wt-icon-action/wt-icon-action.vue +1 -1
- package/src/components/wt-table/wt-table.vue +1 -1
- package/src/locale/en/en.js +1 -1
- package/src/locale/es/es.js +1 -1
- package/src/locale/kz/kz.js +1 -1
- package/src/locale/pl/pl.js +1 -1
- package/src/locale/ro/ro.js +1 -1
- package/src/locale/ru/ru.js +1 -1
- package/src/locale/uk/uk.js +1 -1
- package/src/locale/uz/uz.js +1 -1
- package/src/locale/vi/vi.js +1 -1
- package/src/modules/QueryFilters/mixins/sortFilterMixin.js +1 -1
- package/src/modules/TableStoreModule/store/TableStoreModule.js +1 -1
- package/src/modules/TableStoreModule/store/__tests__/TableStoreModule.spec.js +1 -1
- package/src/modules/Userinfo/composables/useLookupFieldReadAccess.ts +54 -0
- package/src/modules/Userinfo/index.ts +10 -0
- package/src/modules/Userinfo/injection/filterReadAccess.ts +21 -0
- package/src/modules/Userinfo/mappings/lookupPathToScopeClass.ts +53 -0
- package/src/modules/Userinfo/scripts/typeObjectClass.ts +55 -0
- package/src/modules/Userinfo/stores/userinfoStore.ts +13 -2
- package/src/scripts/__tests__/{sortQueryAdapters.spec.js → sortQueryAdapters.spec.ts} +6 -1
- package/src/scripts/sortQueryAdapters.ts +45 -0
- package/src/store/new/modules/tableStoreModule/__tests__/tableStoreModule.spec.js +1 -1
- package/src/store/new/modules/tableStoreModule/tableStoreModule.js +1 -1
- package/types/.tsbuildinfo +1 -1
- package/types/components/on-demand/wt-type-extension-value-input/wt-type-extension-value-input.vue.d.ts +11 -4
- package/types/components/wt-inline-add-panel/wt-inline-add-panel.vue.d.ts +1 -1
- package/types/modules/Flow/lookups/FlowTypeApplications.lookup.d.ts +5 -5
- package/types/modules/Userinfo/composables/useLookupFieldReadAccess.d.ts +14 -0
- package/types/modules/Userinfo/index.d.ts +2 -0
- package/types/modules/Userinfo/injection/filterReadAccess.d.ts +7 -0
- package/types/modules/Userinfo/mappings/lookupPathToScopeClass.d.ts +3 -0
- package/types/modules/Userinfo/scripts/typeObjectClass.d.ts +2 -0
- package/types/modules/Userinfo/stores/userinfoStore.d.ts +25 -15
- package/types/scripts/sortQueryAdapters.d.ts +9 -7
- package/dist/vue-i18n-B88GcHzn.js +0 -2275
- package/dist/wt-type-extension-value-input-iYTsO1em.js +0 -109
- package/src/scripts/sortQueryAdapters.js +0 -38
- package/types/scripts/__tests__/sortQueryAdapters.spec.d.ts +0 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ObjectsAPI } from '@webitel/api-services/api';
|
|
2
|
+
import type { ProtoDataStruct } from '@webitel/api-services/gen-wire/models';
|
|
3
|
+
import { reactive } from 'vue';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Type-registry `lookup.path` often has no RBAC class on the field itself.
|
|
7
|
+
* `/types/{path}` returns `objclass`; we cache it so lookup Read checks can
|
|
8
|
+
* fail closed while the request is in flight and re-enable when it lands.
|
|
9
|
+
*/
|
|
10
|
+
const objectClassByPath = reactive(new Map<string, string | undefined>());
|
|
11
|
+
const inflightByPath = new Map<string, Promise<string | undefined>>();
|
|
12
|
+
|
|
13
|
+
export const normalizeLookupPath = (path?: string) =>
|
|
14
|
+
path?.replace(/^\//, '') || undefined;
|
|
15
|
+
|
|
16
|
+
const fetchTypeObjectClass = async (
|
|
17
|
+
path: string,
|
|
18
|
+
): Promise<string | undefined> => {
|
|
19
|
+
if (objectClassByPath.has(path)) {
|
|
20
|
+
return objectClassByPath.get(path);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const inflight = inflightByPath.get(path);
|
|
24
|
+
if (inflight) return inflight;
|
|
25
|
+
|
|
26
|
+
const request = ObjectsAPI.get({
|
|
27
|
+
itemId: path,
|
|
28
|
+
})
|
|
29
|
+
.then((type: ProtoDataStruct) => {
|
|
30
|
+
const objectClass = type?.objclass;
|
|
31
|
+
objectClassByPath.set(path, objectClass);
|
|
32
|
+
return objectClass;
|
|
33
|
+
})
|
|
34
|
+
.catch(() => {
|
|
35
|
+
objectClassByPath.set(path, undefined);
|
|
36
|
+
return undefined;
|
|
37
|
+
})
|
|
38
|
+
.finally(() => {
|
|
39
|
+
inflightByPath.delete(path);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
inflightByPath.set(path, request);
|
|
43
|
+
return request;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const peekTypeObjectClass = (path?: string) => {
|
|
47
|
+
const normalized = normalizeLookupPath(path);
|
|
48
|
+
if (!normalized) return undefined;
|
|
49
|
+
|
|
50
|
+
if (!objectClassByPath.has(normalized)) {
|
|
51
|
+
void fetchTypeObjectClass(normalized);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return objectClassByPath.get(normalized);
|
|
55
|
+
};
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { pick } from 'lodash-es';
|
|
2
2
|
import { defineStore, storeToRefs } from 'pinia';
|
|
3
3
|
import { ref } from 'vue';
|
|
4
|
+
|
|
5
|
+
import type { WtObject } from '../../../enums';
|
|
4
6
|
import { createUserNotificationsStore } from '../../UserNotifications/stores/userNotificationsStore';
|
|
5
7
|
import { getSession, getUiVisibilityAccess, logout } from '../api/UserinfoAPI';
|
|
6
8
|
import { createUserAccessStore } from './accessStore';
|
|
7
9
|
import { createSettingsStore } from './settingsStore';
|
|
8
10
|
|
|
11
|
+
type UserinfoStoreApi = {
|
|
12
|
+
hasReadAccess: (object?: WtObject) => boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
9
15
|
export const createUserinfoStore = () => {
|
|
10
16
|
const namespace = 'userinfo';
|
|
11
17
|
const useAccessStore = createUserAccessStore({
|
|
@@ -106,8 +112,13 @@ export const createUserinfoStore = () => {
|
|
|
106
112
|
};
|
|
107
113
|
});
|
|
108
114
|
|
|
109
|
-
|
|
110
|
-
window._userinfoStore = store;
|
|
115
|
+
window._userinfoStore = store as Window['_userinfoStore'];
|
|
111
116
|
|
|
112
117
|
return store;
|
|
113
118
|
};
|
|
119
|
+
|
|
120
|
+
declare global {
|
|
121
|
+
interface Window {
|
|
122
|
+
_userinfoStore?: () => UserinfoStoreApi;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as sortQueryAdapters from '../sortQueryAdapters
|
|
1
|
+
import * as sortQueryAdapters from '../sortQueryAdapters';
|
|
2
2
|
|
|
3
3
|
test('sortToQueryAdapter', () => {
|
|
4
4
|
expect(sortQueryAdapters.sortToQueryAdapter('asc')).toBe('+');
|
|
@@ -10,3 +10,8 @@ test('queryToSortAdapter', () => {
|
|
|
10
10
|
expect(sortQueryAdapters.queryToSortAdapter('-')).toBe('desc');
|
|
11
11
|
expect(sortQueryAdapters.queryToSortAdapter('')).toBe(null);
|
|
12
12
|
});
|
|
13
|
+
test('getNextSortOrder', () => {
|
|
14
|
+
expect(sortQueryAdapters.getNextSortOrder('asc')).toBe('desc');
|
|
15
|
+
expect(sortQueryAdapters.getNextSortOrder('desc')).toBe(null);
|
|
16
|
+
expect(sortQueryAdapters.getNextSortOrder(null)).toBe('asc');
|
|
17
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export const SortSymbols = Object.freeze({
|
|
2
|
+
ASC: 'asc',
|
|
3
|
+
DESC: 'desc',
|
|
4
|
+
NONE: null,
|
|
5
|
+
} as const);
|
|
6
|
+
|
|
7
|
+
export type SortOrder = (typeof SortSymbols)[keyof typeof SortSymbols];
|
|
8
|
+
|
|
9
|
+
// query-string prefix the API sorts by: `+field` ascending, `-field` descending
|
|
10
|
+
export type SortQueryPrefix = '+' | '-' | '';
|
|
11
|
+
|
|
12
|
+
export const sortToQueryAdapter = (order?: SortOrder): SortQueryPrefix => {
|
|
13
|
+
switch (order) {
|
|
14
|
+
case SortSymbols.ASC:
|
|
15
|
+
return '+';
|
|
16
|
+
case SortSymbols.DESC:
|
|
17
|
+
return '-';
|
|
18
|
+
default:
|
|
19
|
+
return '';
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const queryToSortAdapter = (order?: string): SortOrder => {
|
|
24
|
+
switch (order) {
|
|
25
|
+
case '+':
|
|
26
|
+
return SortSymbols.ASC;
|
|
27
|
+
case '-':
|
|
28
|
+
return SortSymbols.DESC;
|
|
29
|
+
default:
|
|
30
|
+
return SortSymbols.NONE;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// cycles a column through asc -> desc -> none -> asc; a boolean `sort` is the
|
|
35
|
+
// back-compat "sortable, not sorted yet" header flag and starts at asc
|
|
36
|
+
export const getNextSortOrder = (sort?: SortOrder | boolean): SortOrder => {
|
|
37
|
+
switch (sort) {
|
|
38
|
+
case SortSymbols.ASC:
|
|
39
|
+
return SortSymbols.DESC;
|
|
40
|
+
case SortSymbols.DESC:
|
|
41
|
+
return SortSymbols.NONE;
|
|
42
|
+
default:
|
|
43
|
+
return SortSymbols.ASC;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
@@ -3,7 +3,7 @@ import { createStore } from 'vuex';
|
|
|
3
3
|
|
|
4
4
|
import FilterEvent from '../../../../../modules/Filters/enums/FilterEvent.enum.js';
|
|
5
5
|
import FiltersStoreModule from '../../../../../modules/Filters/store/FiltersStoreModule.js';
|
|
6
|
-
import { SortSymbols } from '../../../../../scripts/sortQueryAdapters
|
|
6
|
+
import { SortSymbols } from '../../../../../scripts/sortQueryAdapters';
|
|
7
7
|
import { createTableStoreModule } from '../../../helpers/createTableStoreModule.js';
|
|
8
8
|
|
|
9
9
|
describe('TableStoreModule', () => {
|
|
@@ -2,7 +2,7 @@ import FilterEvent from '../../../../modules/Filters/enums/FilterEvent.enum.js';
|
|
|
2
2
|
import {
|
|
3
3
|
queryToSortAdapter,
|
|
4
4
|
sortToQueryAdapter,
|
|
5
|
-
} from '../../../../scripts/sortQueryAdapters
|
|
5
|
+
} from '../../../../scripts/sortQueryAdapters';
|
|
6
6
|
|
|
7
7
|
const state = () => ({
|
|
8
8
|
headers: [],
|