-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(fix) O3-3691: The workspace family store shouldn't reset if workspace of same family is launched #1103
Conversation
Size Change: -79 kB (-1.43%) Total Size: 5.46 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vasharma05! A couple of minor things. Overall question though: doesn't this remove the check for existing open workspaces while fixing a bug when opening a new workspace?
packages/framework/esm-styleguide/src/workspaces/container/workspace-renderer.test.tsx
Outdated
Show resolved
Hide resolved
I would rather the family workspace store stayed out of the API entirely. There's no reason that workspace client code should know about family workspace stores, and if you expose that in the API, you have to explain the whole thing. We can avoid that by creating a new function, called something like |
…same sidebar family as of the workspace to be closed
…the dependency array for the props
Co-authored-by: Brandon Istenes <bistenes@gmail.com>
Hi @brandones @ibacher, requesting your review here. |
Co-authored-by: Ian <52504170+ibacher@users.noreply.github.com>
packages/framework/esm-styleguide/src/workspaces/workspaces.test.ts
Outdated
Show resolved
Hide resolved
packages/framework/esm-styleguide/src/workspaces/workspaces.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Brandon Istenes <bistenes@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @vasharma05 !
Requirements
feat
,fix
, orchore
, among others). See existing PR titles for inspiration.For changes to apps
If applicable
Summary
The issue comes from this line which does check that the workspaces remaining do have the same sidebar family name and doesn’t check the fact that the new workspace to be opened is of the same family, hence it shouldn’t clear the workspace.
The reason behind this is that when we launch 2nd workspace, it will first close the 1st workspace and as per the condition linked above, it will reset the store, which is not ideal. We need a condition that if the new workspace is opened of the same sidebar family and the previous workspace is closing, the store shouldn't clear itself.
Addition: Added tests for workspace renderer to test if the valid props are being passed into the workspace or not.
Screenshots
None
Related Issue
https://issues.openmrs.org/browse/O3-3691
Other
Fun fact:
This issue would've been caught earlier by my unit tests if I hadn't added this line in a test case in my previous PR #1094