@webitel/ui-sdk 26.2.90 → 26.2.91
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webitel/ui-sdk",
|
|
3
|
-
"version": "26.2.
|
|
3
|
+
"version": "26.2.91",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"make-all": "npm version patch --git-tag-version false && npm run build && (npm run build:types || true) && (npm run biome:format:all || true) && npm run publish-lib",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"biome:format:all": "npx biome check --write ./src",
|
|
11
11
|
"build:types": "vue-tsc -p ./tsconfig.build.json",
|
|
12
12
|
"publish-lib": " npm publish --access public --tag latest",
|
|
13
|
-
"docs:dev": "vitepress dev docs
|
|
13
|
+
"docs:dev": "vitepress dev docs",
|
|
14
14
|
"docs:build": "vitepress build docs",
|
|
15
15
|
"lint:fix-staged": "npx lint-staged",
|
|
16
16
|
"lint:package": "publint",
|
|
@@ -211,6 +211,14 @@ const {
|
|
|
211
211
|
closeDelete,
|
|
212
212
|
} = useDeleteConfirmationPopup();
|
|
213
213
|
|
|
214
|
+
const tabFilters = computed(() =>
|
|
215
|
+
filtersManager.value.getAllValues({
|
|
216
|
+
exclude: [
|
|
217
|
+
props.entityIdKey,
|
|
218
|
+
],
|
|
219
|
+
}),
|
|
220
|
+
);
|
|
221
|
+
|
|
214
222
|
const {
|
|
215
223
|
showEmpty,
|
|
216
224
|
image: imageEmpty,
|
|
@@ -218,7 +226,7 @@ const {
|
|
|
218
226
|
} = useTableEmpty({
|
|
219
227
|
dataList,
|
|
220
228
|
error,
|
|
221
|
-
filters:
|
|
229
|
+
filters: tabFilters.value,
|
|
222
230
|
isLoading,
|
|
223
231
|
});
|
|
224
232
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createPinia, setActivePinia, storeToRefs } from 'pinia';
|
|
2
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
3
|
+
|
|
4
|
+
import { createUserinfoStore } from '../userinfoStore';
|
|
5
|
+
|
|
6
|
+
describe('UserinfoAccessControl', () => {
|
|
7
|
+
let useUserinfoStore: ReturnType<typeof createUserinfoStore>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
const pinia = createPinia();
|
|
11
|
+
setActivePinia(pinia);
|
|
12
|
+
useUserinfoStore = createUserinfoStore();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('should be defined', async () => {
|
|
16
|
+
vi.mock(import('../../api/UserinfoAPI'), () => ({
|
|
17
|
+
getSession: vi.fn().mockResolvedValue({
|
|
18
|
+
userId: 1,
|
|
19
|
+
username: 'test',
|
|
20
|
+
permissions: [],
|
|
21
|
+
scope: [],
|
|
22
|
+
access: {},
|
|
23
|
+
license: [],
|
|
24
|
+
}),
|
|
25
|
+
getUiVisibilityAccess: vi.fn().mockResolvedValue({}),
|
|
26
|
+
}));
|
|
27
|
+
const userinfoStore = useUserinfoStore();
|
|
28
|
+
const { initialize } = userinfoStore;
|
|
29
|
+
const { userId } = storeToRefs(userinfoStore);
|
|
30
|
+
await initialize();
|
|
31
|
+
|
|
32
|
+
expect(userId.value).toBe(1);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -3,8 +3,7 @@ import { beforeEach, describe, expect, it } from 'vitest';
|
|
|
3
3
|
import { createApp, h } from 'vue';
|
|
4
4
|
import { createRouter, createWebHistory, type Router } from 'vue-router';
|
|
5
5
|
|
|
6
|
-
import { AdminSections, WtApplication, WtObject } from '
|
|
7
|
-
import { CrudGlobalAction } from '../../enums';
|
|
6
|
+
import { AdminSections, WtApplication, WtObject } from '../../../../enums';
|
|
8
7
|
import { createUserAccessStore } from '../accessStore';
|
|
9
8
|
|
|
10
9
|
describe('AccessStore', () => {
|
|
@@ -25,6 +24,7 @@ describe('AccessStore', () => {
|
|
|
25
24
|
name: 'users',
|
|
26
25
|
component: () => h('div', 'users'),
|
|
27
26
|
meta: {
|
|
27
|
+
WtApplication: WtApplication.Admin,
|
|
28
28
|
WtObject: WtObject.User,
|
|
29
29
|
UiSection: AdminSections.Users,
|
|
30
30
|
},
|
|
@@ -48,6 +48,7 @@ describe('AccessStore', () => {
|
|
|
48
48
|
permissions: [],
|
|
49
49
|
scope: [],
|
|
50
50
|
access: {},
|
|
51
|
+
license: [],
|
|
51
52
|
});
|
|
52
53
|
|
|
53
54
|
await router.push({
|
|
@@ -59,26 +60,6 @@ describe('AccessStore', () => {
|
|
|
59
60
|
expect(router.currentRoute.value.name).not.toBe('users');
|
|
60
61
|
});
|
|
61
62
|
|
|
62
|
-
it('allows route access if has global permission', async () => {
|
|
63
|
-
const { initialize, routeAccessGuard } = useAccessStore();
|
|
64
|
-
router.beforeEach(routeAccessGuard);
|
|
65
|
-
|
|
66
|
-
initialize({
|
|
67
|
-
permissions: [
|
|
68
|
-
{
|
|
69
|
-
id: CrudGlobalAction.Read,
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
scope: [],
|
|
73
|
-
access: {},
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
await router.push({
|
|
77
|
-
name: 'users',
|
|
78
|
-
});
|
|
79
|
-
expect(router.currentRoute.value.name).toBe('users');
|
|
80
|
-
});
|
|
81
|
-
|
|
82
63
|
it('allows route access if has scope permission, app visibility and section visibility', async () => {
|
|
83
64
|
const { initialize, routeAccessGuard } = useAccessStore();
|
|
84
65
|
router.beforeEach(routeAccessGuard);
|
|
@@ -99,6 +80,7 @@ describe('AccessStore', () => {
|
|
|
99
80
|
},
|
|
100
81
|
},
|
|
101
82
|
},
|
|
83
|
+
license: [],
|
|
102
84
|
});
|
|
103
85
|
|
|
104
86
|
await router.push({
|
|
@@ -127,6 +109,7 @@ describe('AccessStore', () => {
|
|
|
127
109
|
},
|
|
128
110
|
},
|
|
129
111
|
},
|
|
112
|
+
license: [],
|
|
130
113
|
});
|
|
131
114
|
|
|
132
115
|
await router.push({
|
|
@@ -155,6 +138,7 @@ describe('AccessStore', () => {
|
|
|
155
138
|
},
|
|
156
139
|
},
|
|
157
140
|
},
|
|
141
|
+
license: [],
|
|
158
142
|
});
|
|
159
143
|
|
|
160
144
|
await router.push({
|