@equinor/subsurface-app-management 4.4.2-beta.0 → 4.4.3

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.
@@ -1,9 +1,14 @@
1
+ import type { UserImpersonationRoleSnapshot } from './UserImpersonationRoleSnapshot';
1
2
  export type ImpersonateUserDto = {
2
3
  id?: string | null;
3
4
  firstName: string;
4
5
  lastName: string;
6
+ fullName: string;
5
7
  uniqueName: string;
6
8
  email?: string | null;
9
+ field?: string | null;
10
+ well?: string | null;
11
+ internalApplicationRoleSnapshots?: Array<UserImpersonationRoleSnapshot> | null;
7
12
  appName: string;
8
13
  roles: Array<string>;
9
14
  activeUsers: Array<string>;
@@ -1,9 +1,13 @@
1
+ import type { UserImpersonationRoleSnapshot } from './UserImpersonationRoleSnapshot';
1
2
  export type ImpersonateUserUpdateDto = {
2
3
  id?: string | null;
3
4
  firstName: string;
4
5
  lastName: string;
5
6
  uniqueName: string;
6
7
  email?: string | null;
8
+ field?: string | null;
9
+ well?: string | null;
10
+ internalApplicationRoleSnapshots?: Array<UserImpersonationRoleSnapshot> | null;
7
11
  appName: string;
8
12
  roles: Array<string>;
9
13
  activeUsers: Array<string>;
@@ -0,0 +1,10 @@
1
+ export type UserImpersonationRoleSnapshot = {
2
+ id?: string | null;
3
+ username: string;
4
+ field: string;
5
+ well?: string | null;
6
+ roleName?: string | null;
7
+ environment?: string | null;
8
+ removedQaFieldIds?: Array<string> | null;
9
+ removedWellLeaderWells?: Array<string> | null;
10
+ };
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{Navigate as r}from"@tanstack/react-router";import{useFeatureToggling as e}from"../../hooks/useFeatureToggling.js";const o=({element:o,...n})=>{const{showContent:a}=e({...n});if(a)return o;if("fallback"in n)return n.fallback;const c="redirectPath"in n&&n.redirectPath?n.redirectPath:"/";return t(r,{replace:!0,to:c})};export{o as FeatureRoute};
1
+ import{jsx as r}from"react/jsx-runtime";import{Navigate as t}from"react-router-dom";import{useFeatureToggling as e}from"../../hooks/useFeatureToggling.js";const o=({element:o,...n})=>{const{showContent:i}=e({...n});if(i)return o;if("fallback"in n)return n.fallback;const a="redirectPath"in n&&n.redirectPath?n.redirectPath:"/";return r(t,{replace:!0,to:a})};export{o as FeatureRoute};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{createContext as r,useState as i,useMemo as t,useContext as e}from"react";import{useMatchRoute as s}from"@tanstack/react-router";import{useSeenTutorials as a}from"./useSeenTutorials.js";import"../FeatureToggleProvider.js";import"@tanstack/react-query";import"../../api/core/OpenAPI.js";import{useTutorialsQuery as n}from"../../hooks/useTutorialsQuery.js";import"@microsoft/signalr";import"../../api/models/ApplicationCategory.js";import"../../api/models/ServiceNowUrgency.js";import"../../api/models/TutorialPosition.js";import"../../types/Environment.js";import{usePrefetchTutorialStepImages as u}from"./hooks/usePrefetchTutorialStepImages.js";const p=r(void 0);function d(){const o=e(p);if(void 0===o)throw new Error("'useTutorials' must be used within provider");return o}const l=({children:r})=>{const{data:e=[]}=n(),[d,l]=i(void 0),[c,m]=i(void 0),[v,f]=a();u();const T=s(),h=t((()=>e?.filter((o=>T({to:o.path})))),[T,e]),w=t((()=>h?.filter((o=>!v.includes(o.id)&&o.willPopUp))),[v,h]);return o(p.Provider,{value:{allTutorials:e,tutorialsOnThisPage:h,unseenTutorialsOnThisPage:w,activeTutorial:d,activeStep:c,seenTutorialIDs:v,startTutorial:o=>{if(!e?.some((r=>o===r.id)))throw new Error("Tutorial not found");l(e.find((r=>o===r.id))),m(0)},skipTutorial:o=>{d&&d.id===o&&(l(void 0),m(void 0)),f(o)},goToNextStep:()=>{if(!d)throw new Error("No currently active tutorial!");if(void 0===c)throw new Error("activeStep is undefined!");c+1>=d.steps.length?(f(d.id),l(void 0),m(void 0)):m(c+1)},goToPreviousStep:()=>{if(!d)throw new Error("No currently active tutorial!");if(void 0===c)throw new Error("activeStep is undefined!");0===c?(l(void 0),m(void 0)):m(c-1)}},children:r})};export{p as TutorialDataContext,l as TutorialProvider,d as useTutorials};
1
+ import{jsx as o}from"react/jsx-runtime";import{createContext as r,useState as i,useMemo as t,useContext as e}from"react";import{useLocation as s,matchPath as n}from"react-router";import{useSeenTutorials as a}from"./useSeenTutorials.js";import"../FeatureToggleProvider.js";import"@tanstack/react-query";import"../../api/core/OpenAPI.js";import{useTutorialsQuery as u}from"../../hooks/useTutorialsQuery.js";import"@microsoft/signalr";import"../../api/models/ApplicationCategory.js";import"../../api/models/ServiceNowUrgency.js";import"../../api/models/TutorialPosition.js";import"../../types/Environment.js";import{usePrefetchTutorialStepImages as l}from"./hooks/usePrefetchTutorialStepImages.js";const p=r(void 0);function d(){const o=e(p);if(void 0===o)throw new Error("'useTutorials' must be used within provider");return o}const m=({children:r})=>{const{pathname:e}=s(),{data:d=[]}=u(),[m,c]=i(void 0),[v,f]=i(void 0),[h,T]=a();l();const w=t((()=>d?.filter((o=>null!==n(o.path,e)))),[e,d]),g=t((()=>w?.filter((o=>!h.includes(o.id)&&o.willPopUp))),[h,w]);return o(p.Provider,{value:{allTutorials:d,tutorialsOnThisPage:w,unseenTutorialsOnThisPage:g,activeTutorial:m,activeStep:v,seenTutorialIDs:h,startTutorial:o=>{if(!d?.some((r=>o===r.id)))throw new Error("Tutorial not found");c(d.find((r=>o===r.id))),f(0)},skipTutorial:o=>{m&&m.id===o&&(c(void 0),f(void 0)),T(o)},goToNextStep:()=>{if(!m)throw new Error("No currently active tutorial!");if(void 0===v)throw new Error("activeStep is undefined!");v+1>=m.steps.length?(T(m.id),c(void 0),f(void 0)):f(v+1)},goToPreviousStep:()=>{if(!m)throw new Error("No currently active tutorial!");if(void 0===v)throw new Error("activeStep is undefined!");0===v?(c(void 0),f(void 0)):f(v-1)}},children:r})};export{p as TutorialDataContext,m as TutorialProvider,d as useTutorials};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/subsurface-app-management",
3
- "version": "4.4.2-beta.0",
3
+ "version": "4.4.3",
4
4
  "description": "React Typescript components/hooks to communicate with equinor/sam",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -73,6 +73,7 @@
73
73
  "@types/node": "^22.10.2",
74
74
  "@types/react": "^19.0.1",
75
75
  "@types/react-dom": "^19.0.2",
76
+ "@types/react-router-dom": "^5.3.3",
76
77
  "@vitejs/plugin-react": "^4.3.4",
77
78
  "@vitest/coverage-v8": "^2.1.8",
78
79
  "eslint": "^9.17.0",
@@ -86,12 +87,15 @@
86
87
  "prettier": "^3.4.2",
87
88
  "react": "^18.3.1",
88
89
  "react-dom": "^18.3.1",
90
+ "react-router": "^6.27.0",
91
+ "react-router-dom": "^6.27.0",
89
92
  "resolve-tspaths": "^0.8.23",
90
93
  "rollup": "^4.28.1",
91
94
  "rollup-plugin-delete": "^2.1.0",
92
95
  "rollup-plugin-import-css": "^3.5.8",
93
96
  "storybook": "^8.4.7",
94
97
  "storybook-addon-react-docgen": "^1.2.44",
98
+ "storybook-addon-remix-react-router": "^3.0.2",
95
99
  "typescript": "^5.7.2",
96
100
  "typescript-eslint": "^8.18.1",
97
101
  "vite": "^5.4.10",
@@ -100,9 +104,10 @@
100
104
  },
101
105
  "peerDependencies": {
102
106
  "@tanstack/react-query": "*",
103
- "@tanstack/react-router": "*",
104
107
  "react": "^19.0.0",
105
- "react-dom": "^19.0.0"
108
+ "react-dom": "^19.0.0",
109
+ "react-router": "^6.11.1",
110
+ "react-router-dom": "^6.11.1"
106
111
  },
107
112
  "dependencies": {
108
113
  "@microsoft/applicationinsights-clickanalytics-js": "^3.3.6",