From 95ff0f9ec10c68308f87452a91385a240eebb8ae Mon Sep 17 00:00:00 2001 From: aslakihle Date: Wed, 23 Oct 2024 10:22:04 +0200 Subject: [PATCH 1/3] :bug: Make tutorials from params have precedence over tutorials that should pop up --- .../TutorialProviderInner.tsx | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/providers/TutorialProvider/TutorialProviderInner.tsx b/src/providers/TutorialProvider/TutorialProviderInner.tsx index bb5bb53..9492cb3 100644 --- a/src/providers/TutorialProvider/TutorialProviderInner.tsx +++ b/src/providers/TutorialProvider/TutorialProviderInner.tsx @@ -92,16 +92,19 @@ const TutorialProviderInner: FC = () => { useEffect(() => { if (tutorialsForPath.length < 1) return; - const tutorialToRun = tutorialsForPath.find( - (item) => - !window.localStorage.getItem(item.shortName) || - (shortNameFromParams && - tutorialsForPath.some( - (item) => item.shortName === shortNameFromParams - )) + + const tutorialToRunFromParams = tutorialsForPath.find( + (item) => item.shortName === shortNameFromParams ); - if (tutorialToRun) { - runTutorial(tutorialToRun); + + const tutorialThatShouldPopUp = tutorialsForPath.find((item) => { + !window.localStorage.getItem(item.shortName) && item.willPopUp; + }); + + if (tutorialToRunFromParams) { + runTutorial(tutorialToRunFromParams); + } else if (tutorialThatShouldPopUp) { + runTutorial(tutorialThatShouldPopUp); } }, [runTutorial, shortNameFromParams, tutorialsForPath]); From fc398c012ab0abe62a05215bd4650d3fab16d98d Mon Sep 17 00:00:00 2001 From: aslakihle Date: Wed, 23 Oct 2024 12:54:39 +0200 Subject: [PATCH 2/3] :bug: fixed missing return --- src/providers/TutorialProvider/TutorialProviderInner.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/providers/TutorialProvider/TutorialProviderInner.tsx b/src/providers/TutorialProvider/TutorialProviderInner.tsx index 9492cb3..ec6625f 100644 --- a/src/providers/TutorialProvider/TutorialProviderInner.tsx +++ b/src/providers/TutorialProvider/TutorialProviderInner.tsx @@ -97,9 +97,9 @@ const TutorialProviderInner: FC = () => { (item) => item.shortName === shortNameFromParams ); - const tutorialThatShouldPopUp = tutorialsForPath.find((item) => { - !window.localStorage.getItem(item.shortName) && item.willPopUp; - }); + const tutorialThatShouldPopUp = tutorialsForPath.find( + (item) => !window.localStorage.getItem(item.shortName) && item.willPopUp + ); if (tutorialToRunFromParams) { runTutorial(tutorialToRunFromParams); From 96d345e90e545378dfb32482cc31776ec4720d2a Mon Sep 17 00:00:00 2001 From: aslakihle Date: Wed, 23 Oct 2024 12:56:52 +0200 Subject: [PATCH 3/3] :bookmark: 1.1.17 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b73e787..649c9f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@equinor/subsurface-app-management", - "version": "1.1.16", + "version": "1.1.17", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@equinor/subsurface-app-management", - "version": "1.1.16", + "version": "1.1.17", "license": "ISC", "dependencies": { "@azure/msal-browser": "3.26.1", diff --git a/package.json b/package.json index 8db64ed..7dea214 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@equinor/subsurface-app-management", - "version": "1.1.16", + "version": "1.1.17", "description": "React Typescript components/hooks to communicate with equinor/sam", "types": "dist/index.d.ts", "type": "module",