@equinor/subsurface-app-management 1.1.4 → 1.1.6
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/dist/api/models/GraphAppRole.d.ts +9 -0
- package/dist/api/services/AmplifyApplicationService.d.ts +5 -4
- package/dist/api/services/AmplifyApplicationService.js +1 -1
- package/dist/providers/TutorialProvider/TutorialProvider.d.ts +11 -0
- package/dist/providers/TutorialProvider/TutorialProvider.js +1 -1
- package/package.json +1 -1
- package/dist/api/models/JToken.d.ts +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AmplifyApplication } from '../models/AmplifyApplication';
|
|
2
2
|
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
3
|
-
import {
|
|
3
|
+
import { GraphAppRole } from '../models/GraphAppRole';
|
|
4
4
|
export declare class AmplifyApplicationService {
|
|
5
5
|
/**
|
|
6
6
|
* Get all applications that user has access to
|
|
@@ -9,9 +9,10 @@ export declare class AmplifyApplicationService {
|
|
|
9
9
|
*/
|
|
10
10
|
static userApplications(): CancelablePromise<Array<AmplifyApplication>>;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @
|
|
12
|
+
* Get all roles for an application
|
|
13
|
+
* @param applicationId
|
|
14
|
+
* @returns GraphAppRole Success
|
|
14
15
|
* @throws ApiError
|
|
15
16
|
*/
|
|
16
|
-
static getAllAppRoles(
|
|
17
|
+
static getAllAppRoles(applicationId: string): CancelablePromise<Array<GraphAppRole>>;
|
|
17
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{OpenAPI_Portal_Prod as p,OpenAPI_Portal as r}from"../core/OpenAPI.js";import{request as
|
|
1
|
+
import{OpenAPI_Portal_Prod as p,OpenAPI_Portal as r}from"../core/OpenAPI.js";import{request as i}from"../core/request.js";class t{static userApplications(){return i(p,{method:"GET",url:"/api/v1/AmplifyApplication/userapplications",errors:{400:"Bad Request",500:"Server Error"}})}static getAllAppRoles(p){return i(r,{method:"GET",url:"/api/v1/AmplifyApplication/application/{applicationId}/appRoles",path:{applicationId:p}})}}export{t as AmplifyApplicationService};
|
|
@@ -30,6 +30,17 @@ interface TutorialProviderProps {
|
|
|
30
30
|
overrideEnvironmentName?: EnvironmentType;
|
|
31
31
|
customStepComponents?: CustomTutorialComponent[];
|
|
32
32
|
tutorials?: Tutorial[];
|
|
33
|
+
ignoredQueryKeys?: string[];
|
|
33
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Tutorial provider expects to be within a QueryClientProvider
|
|
37
|
+
* @param children Expects to wrap the application globally, typically in a providers file with multiple providers
|
|
38
|
+
* @param overrideAppName Overrides the "NAME" env variable, which is used to fetch the relevant tutorials for your app
|
|
39
|
+
* @param overrideEnvironmentName Overrides the "ENVIRONMENT_NAME" env variable, which is used for the possibility to hide tutorials in "production"
|
|
40
|
+
* @param customStepComponents Adds custom steps components with a key that can be used to link it to a step in a tutorial
|
|
41
|
+
* @param tutorials Passing tutorial object directly. This does not replace any tutorials found from API call, but rather is appended to them
|
|
42
|
+
* @param ignoredQueryKeys An array of query keys TutorialProviders will not wait to finish loading before looking for elements to highlight
|
|
43
|
+
* @constructor
|
|
44
|
+
*/
|
|
34
45
|
export declare const TutorialProvider: FC<TutorialProviderProps>;
|
|
35
46
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{createContext as r,useState as o,useRef as i,useMemo as n,useCallback as s,useEffect as
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{createContext as r,useState as o,useRef as i,useMemo as n,useCallback as s,useEffect as a}from"react";import{useSearchParams as l}from"react-router-dom";import{useIsFetching as m}from"@tanstack/react-query";import{TUTORIAL_SEARCH_PARAM_KEY as u}from"./TutorialProvider.const.js";import{getAllElementsToHighlight as c}from"./TutorialProvider.utils.js";import d from"./TutorialProviderInner.js";import{getAppName as p,getEnvironmentName as h}from"../../utils/environment.js";const v=r(void 0),f=({children:r,overrideAppName:f,overrideEnvironmentName:y,customStepComponents:g,tutorials:E,ignoredQueryKeys:T})=>{const[w,N]=o(void 0),[P,k]=o(!1),[S,j]=l(),[C,A]=o(void 0),[x,I]=o(0),[F,H]=o(void 0),[L,M]=o(window.innerWidth),V=m({predicate:e=>!T?.some((t=>e.queryKey.includes(t)))})>0,W=i(null),_=f??p(import.meta.env.VITE_NAME),q=y??h(import.meta.env.VITE_ENVIRONMENT_NAME),z=n((()=>{if(w)return w.steps.at(x)}),[w,x]),K=n((()=>!!w&&x>=w?.steps.length-1),[w,x]),O=s((()=>{S.delete(u),j(S),A(void 0)}),[S,j]);return a((()=>{if(C)return;const e=S.get(u);e&&A(e)}),[S,C]),a((()=>{const e=()=>{M(window.innerWidth)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),a((()=>{if(!w||P||V)return;const e=c(w);e.every((e=>null!==e))?H(e):(async()=>{await new Promise((e=>setTimeout(e,300)));const e=c(w);e.every((e=>null!==e))?H(e):(console.error("Could not find all elements to highlight for the tutorial. \n This is a list of elements that were found for each step: ",e),k(!0))})().catch((e=>{console.error("Error trying to get elements to highlight",e)}))}),[w,x,P,C,V]),a((()=>{if(!w||P||V)return;const e=w.steps.filter((e=>void 0!==e.key&&null!==e.key)).map((e=>e.key));if(0===e.length)return;const t=g?.map((e=>e.key));if(!t||0===t.length)return console.error("Could not find any custom components passed to the TutorialProvider \nExpected these keys for the active tutorial: ",e),void k(!0);e.map((e=>e&&t?.includes(e))).some((e=>!0!==e))&&(console.error("Could not find the custom components related to the active tutorial. \n The active tutorial expected to find these keys: ",e,"\n However in the custom components we only found these keys: ",t),k(!0))}),[w,V,g,P]),e(v.Provider,{value:{currentStepObject:z,activeTutorial:w,setActiveTutorial:N,currentStep:x,setCurrentStep:I,allElementsToHighlight:F,setAllElementsToHighlight:H,customStepComponents:g,isLastStep:K,dialogRef:W,clearSearchParam:O,shortNameFromParams:C,setShortNameFromParams:A,tutorialsFromProps:E??[],tutorialError:P,setTutorialError:k,viewportWidth:L,appName:_,environmentName:q},children:[t(d,{}),r]})};export{v as TutorialContext,f as TutorialProvider};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type JToken = Array<JToken>;
|