Skip to content
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

Merged
merged 16 commits into from
May 10, 2024

Conversation

mjkkirschner
Copy link
Member

@mjkkirschner mjkkirschner commented May 9, 2024

This PR adds some new state to the LibraryContainer and some conditional rendering to the LibraryItem based on props from the LoadedType 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 hook UNSAFE_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.

Copy link
Contributor

@RobertGlobant20 RobertGlobant20 left a 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

src/entry-point.tsx Outdated Show resolved Hide resolved
src/components/LibraryContainer.tsx Outdated Show resolved Hide resolved
src/sharedTypes.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@pinzart90 pinzart90 left a 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

Copy link

Quality Gate Passed Quality Gate passed

Issues
2 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@mjkkirschner mjkkirschner merged commit ea43d0b into DynamoDS:master May 10, 2024
11 checks passed
@mjkkirschner mjkkirschner deleted the dyn6893 branch May 10, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants