@aarhus-university/au-lib-react-components 11.2.0 → 11.3.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/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.2.0",
4
+ "version": "11.3.0",
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.4",
77
+ "@aarhus-university/types": "^0.17.8",
78
78
  "@reduxjs/toolkit": "^1.8.3",
79
79
  "@types/google.analytics": "^0.0.42",
80
80
  "@types/history": "^5.0.0",
@@ -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);
@@ -14,6 +14,7 @@ declare global {
14
14
  IMPERSONATE_VALUE: string;
15
15
  IMPERSONATE_TYPE: string;
16
16
  PHASE: string;
17
+ REAL_PHASE: string;
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
  {