@aarhus-university/au-lib-react-components 11.2.1 → 11.3.1
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 +2 -2
- package/src/lib/context.tsx +7 -0
- package/src/lib/portals.tsx +3 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sideEffects": false,
|
|
3
3
|
"name": "@aarhus-university/au-lib-react-components",
|
|
4
|
-
"version": "11.
|
|
4
|
+
"version": "11.3.1",
|
|
5
5
|
"description": "Library for shared React components for various applications on au.dk",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "jest",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"@aarhus-university/au-designsystem-delphinus": "0.34.8",
|
|
76
76
|
"@aarhus-university/au-designsystem-delphinus-dev": "0.2.0",
|
|
77
|
-
"@aarhus-university/types": "^0.17.
|
|
77
|
+
"@aarhus-university/types": "^0.17.10",
|
|
78
78
|
"@reduxjs/toolkit": "^1.8.3",
|
|
79
79
|
"@types/google.analytics": "^0.0.42",
|
|
80
80
|
"@types/history": "^5.0.0",
|
package/src/lib/context.tsx
CHANGED
|
@@ -41,3 +41,10 @@ export const usePortalContext = (): AU.IPortalContext | null => {
|
|
|
41
41
|
const portal = useContext(PortalContext);
|
|
42
42
|
return portal;
|
|
43
43
|
};
|
|
44
|
+
|
|
45
|
+
export const ImpersonationContext = createContext<AU.IImpersonationContext>({
|
|
46
|
+
isImpersonating: false,
|
|
47
|
+
impersonatateError: false,
|
|
48
|
+
});
|
|
49
|
+
// eslint-disable-next-line max-len
|
|
50
|
+
export const useImpersonationContext = (): AU.IImpersonationContext => useContext(ImpersonationContext);
|
package/src/lib/portals.tsx
CHANGED
|
@@ -13,7 +13,8 @@ declare global {
|
|
|
13
13
|
IMPERSONATE_AUID: string;
|
|
14
14
|
IMPERSONATE_VALUE: string;
|
|
15
15
|
IMPERSONATE_TYPE: string;
|
|
16
|
-
PHASE:
|
|
16
|
+
PHASE: number;
|
|
17
|
+
REAL_PHASE: number;
|
|
17
18
|
authenticated: boolean;
|
|
18
19
|
}
|
|
19
20
|
}
|
|
@@ -58,6 +59,7 @@ const portals: (lang: string) => AU.IPortalContext[] = (lang: string) => [
|
|
|
58
59
|
value: window.IMPERSONATE_VALUE,
|
|
59
60
|
type: window.IMPERSONATE_TYPE,
|
|
60
61
|
phase: window.PHASE,
|
|
62
|
+
realPhase: window.REAL_PHASE,
|
|
61
63
|
},
|
|
62
64
|
impersonationOptions: [
|
|
63
65
|
{
|