@legalplace/wizardx-core 2.9.0 → 2.10.0
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.10.0](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.9.0...@legalplace/wizardx-core@2.10.0) (2022-04-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* fixed failed test ([4ffb37b](https://git.legalplace.eu/legalplace/monorepo/commits/4ffb37b7b4cdd47b410949a99dc21723ce47fb0a)), closes [api#5253](https://git.legalplace.eu/legalplace/monorepo/issues/5253)
|
|
12
|
+
* fixed order enum role user ([33d9c72](https://git.legalplace.eu/legalplace/monorepo/commits/33d9c727f029347ac1fce94b47feb7637bfc8973)), closes [api#5253](https://git.legalplace.eu/legalplace/monorepo/issues/5253)
|
|
13
|
+
* organize order role user ([78c4a37](https://git.legalplace.eu/legalplace/monorepo/commits/78c4a37104d234eaeae3ae080c8a737c4f3b1d8f)), closes [api#5253](https://git.legalplace.eu/legalplace/monorepo/issues/5253)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* added role OPS ([2578040](https://git.legalplace.eu/legalplace/monorepo/commits/2578040d296abaf5f6740ae5d555c2947b357b82)), closes [api#5253](https://git.legalplace.eu/legalplace/monorepo/issues/5253)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
# [2.9.0](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.8.0...@legalplace/wizardx-core@2.9.0) (2022-04-06)
|
|
7
25
|
|
|
8
26
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as inputs from "./inputs";
|
|
2
2
|
export declare const selectorsLibrary: {
|
|
3
|
-
selectCurrentUserLevel: () => Readonly<"ADMIN" | "MANAGER" | "USER" | "GUEST" | "SUPER" | undefined>;
|
|
3
|
+
selectCurrentUserLevel: () => Readonly<"ADMIN" | "MANAGER" | "USER" | "GUEST" | "SUPER" | "OPS" | undefined>;
|
|
4
4
|
selectUserStatus: () => Readonly<"failed" | "authenticated" | "unauthenticated" | "inprogress">;
|
|
5
5
|
selectUserValidToken: () => Readonly<boolean>;
|
|
6
6
|
selectUserEmail: () => string;
|
|
7
|
-
isLevelAccessibleForUser: (level: "ADMIN" | "MANAGER" | "USER" | "GUEST" | "SUPER") => Readonly<boolean>;
|
|
7
|
+
isLevelAccessibleForUser: (level: "ADMIN" | "MANAGER" | "USER" | "GUEST" | "SUPER" | "OPS") => Readonly<boolean>;
|
|
8
8
|
selectIsSmartscriptOptionIndexHidden: (id: number, index: number) => Readonly<boolean>;
|
|
9
9
|
selectIsSmartscriptVariableIndexHidden: (id: number, index: number) => Readonly<boolean>;
|
|
10
10
|
selectReferences: () => Readonly<import("@legalplace/referencesparser/dist/libs/References.type").ReferencesType>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const selectCurrentUserLevel: () => Readonly<"ADMIN" | "MANAGER" | "USER" | "GUEST" | "SUPER" | undefined>;
|
|
1
|
+
export declare const selectCurrentUserLevel: () => Readonly<"ADMIN" | "MANAGER" | "USER" | "GUEST" | "SUPER" | "OPS" | undefined>;
|
|
2
2
|
export declare const selectUserStatus: () => Readonly<"failed" | "authenticated" | "unauthenticated" | "inprogress">;
|
|
3
3
|
export declare const selectUserValidToken: () => Readonly<boolean>;
|
|
4
4
|
export declare const selectUserEmail: () => string;
|
|
5
|
-
export declare const isLevelAccessibleForUser: (level: "ADMIN" | "MANAGER" | "USER" | "GUEST" | "SUPER") => Readonly<boolean>;
|
|
5
|
+
export declare const isLevelAccessibleForUser: (level: "ADMIN" | "MANAGER" | "USER" | "GUEST" | "SUPER" | "OPS") => Readonly<boolean>;
|
|
@@ -9,6 +9,6 @@ export const selectUserEmail = createSelector((state) => state.user && state.use
|
|
|
9
9
|
: false);
|
|
10
10
|
export const isLevelAccessibleForUser = createSelector((state, level) => {
|
|
11
11
|
const currentUserLevel = state.user ? state.user.level : "GUEST";
|
|
12
|
-
const levelEnum = ["GUEST", "USER", "MANAGER", "ADMIN", "SUPER"];
|
|
12
|
+
const levelEnum = ["GUEST", "USER", "MANAGER", "OPS", "ADMIN", "SUPER"];
|
|
13
13
|
return levelEnum.indexOf(level) <= levelEnum.indexOf(currentUserLevel);
|
|
14
|
-
}, (state, level) => state.user ? `${state.user.level}-${level}` : false);
|
|
14
|
+
}, (state, level) => (state.user ? `${state.user.level}-${level}` : false));
|
|
@@ -22,6 +22,7 @@ describe('User selectors test suit', () => {
|
|
|
22
22
|
expect(isLevelAccessibleForUser('GUEST')).toBeTruthy();
|
|
23
23
|
expect(isLevelAccessibleForUser('USER')).toBeTruthy();
|
|
24
24
|
expect(isLevelAccessibleForUser('MANAGER')).toBeTruthy();
|
|
25
|
+
expect(isLevelAccessibleForUser('OPS')).toBeFalsy();
|
|
25
26
|
expect(isLevelAccessibleForUser('ADMIN')).toBeFalsy();
|
|
26
27
|
expect(isLevelAccessibleForUser('SUPER')).toBeFalsy();
|
|
27
28
|
});
|
|
@@ -191,7 +191,7 @@ export interface UserType {
|
|
|
191
191
|
status: "authenticated" | "unauthenticated" | "inprogress" | "failed";
|
|
192
192
|
email: string;
|
|
193
193
|
displayName: string;
|
|
194
|
-
level: "ADMIN" | "
|
|
194
|
+
level: "SUPER" | "ADMIN" | "OPS" | "MANAGER" | "USER" | "GUEST";
|
|
195
195
|
validToken?: boolean;
|
|
196
196
|
}
|
|
197
197
|
export interface InputsType {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legalplace/wizardx-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"author": "Moncef Hammou (moncef@legalplace.fr)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"*.test.ts",
|
|
93
93
|
"*.test.tsx"
|
|
94
94
|
],
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "edcdffc91089957236baed872a7dd42e826f0067"
|
|
96
96
|
}
|