-
Notifications
You must be signed in to change notification settings - Fork 23
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
DYN-6956 - symbol nodes should not show in home workspace search/browse UI. #228
Conversation
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 with some comments
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.
COuple of question, then LGTM
Quality Gate passedIssues Measures |
This PR adds some new state to the
LibraryContainer
and some conditional rendering to theLibraryItem
based on props from theLoadedType
data.LibraryContainer.State.HostContext
is essentially an enum that can be used from the Dynamo side to let LibrarieJS know what context it's being displayed in (home workspace, custom node workspace etc)LibraryContainer.State.shouldOverideExpandedState
also controls the rendering behavior of LibraryItems - I found that LibraryItems today use a legacy life cycle hookUNSAFE_onWillRecieveProps
- to override state with props - specifically for the expanded state so that when interacting only one library item can be open at a time.This hook also makes it so that when the UI is rendered the currently open item will close. Sometimes this is not desirable like when switching between workspace contexts, so I added some new state which is essentially a mode to control this behavior - currently we turn off the behavior only when switching contexts, so that library items retain their expanded state during the context change render.
LoadedTypes now have
hiddenInWorkspaceContext
which determines if they are hidden in the home workspace context.I could not figure out how to add a test for this behavior but it seems straight forward for someone familiar with jest/enzyme - I am out of bandwidth and will file a task for it.