fix(app): display study not found message for all modes#5752
fix(app): display study not found message for all modes#5752GhadeerAlbattarni wants to merge 10 commits intoOHIF:masterfrom
Conversation
✅ Deploy Preview for ohif-dev canceled.
|
jbocce
left a comment
There was a problem hiding this comment.
Thank you. See my comment. Also please add a Playwright test for this, but instead of using screen shots, let's use assertion/expect statements by querying the DOM. Also we should think about whether we want some type of error page object in the tests for this or not.
- Moved validation from defaultRouteInit.ts to Mode.tsx - Added dedicated useEffect hook for study validation
|
I'll work next on writing the Playwright test |
jbocce
left a comment
There was a problem hiding this comment.
Great thus far. See my comments. Looking forward to the test that you are adding.
jbocce
left a comment
There was a problem hiding this comment.
Almost there... just a few touch ups. Thanks so much.
| const modes = ['viewer', 'segmentation', 'microscopy', 'tmtv']; | ||
|
|
||
| modes.forEach(mode => { | ||
| test(`should display error page when study UID is not found in ${mode} mode`, async ({ |
There was a problem hiding this comment.
Let's also add a series of tests where one study is valid and the other is not valid. Funny that I added this comment yesterday, but may github ate it. 🤣🤣
There was a problem hiding this comment.
Just to be clear the goto URL should have two studies: one valid and one invalid.
| className="mt-2" | ||
| data-cy="return-to-study-list-message" | ||
| > | ||
| Return to the{' '} |
jbocce
left a comment
There was a problem hiding this comment.
Just one set of tests and I think you are good to go.
|
Thanks Joe for your review! |
Context
Fixes #5705
This PR fixes an issue where the study-not-found message was not displayed for
tmtv,microscopy, anddynamic-volumemodes.Root Cause
The study validation logic lives in
PanelStudyBrowser.tsx, which is not rendered whenleftPanelClosedis true (tmtv,microscopy) or when a different panel is used (dynamic-volume). As a result, the validation logic does not run in these cases, causing users to see an infinite loading screen instead of the error message.Changes & Results
This PR adds an early validation step in
defaultRouteInit.tsthat:/notfoundstudyif any study is not foundThis ensures validation runs for all modes during route initialization, before layout rendering.
Testing
tmtv,microscopy, anddynamic-volumethen modify theStudyInstanceUIDsnotfoundstudypageChecklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment