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

Core: Disable sidebar and don't load refs when singleStory=true #15201

Merged
merged 7 commits into from Jun 11, 2021

Conversation

ghengeveld
Copy link
Member

@ghengeveld ghengeveld commented Jun 11, 2021

Issue: #15171

What I did

This retrieves the singleStory query param and passes it as a boolean to initializing modules.

  • The layout module uses it to prevent showNav from ever becoming true (i.e. ignore the toggle).
  • The url module uses it to set showNav: false when creating the initial layout state.
  • The refs module uses it to not initialize any refs and prevent refs from being added.

I also refactored the url params handling to be more straightforward with less if/else and a consistent way to handle boolean params.

How to test

  • Is this testable with Jest or Chromatic screenshots? no
  • Does this need a new example in the kitchen sink apps? no
  • Does this need an update to the documentation? no

If your answer is yes to any of these, please make sure to include it in your PR.

@nx-cloud
Copy link

nx-cloud bot commented Jun 11, 2021

Nx Cloud Report

CI ran the following commands for commit d0b533d. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

Status Command
#000000 nx run-many --target=prepare --all --parallel --max-parallel=15

Sent with 💌 from NxCloud.

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

viewMode,
storyId,
refId,
singleStory: singleStory === 'true',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parseBoolean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's in a different module, so I can't directly access it. Also singleStory is a new param which is not supposed to support '1', but only 'true'.

@shilman shilman merged commit 37f182c into next Jun 11, 2021
@shilman shilman deleted the no-refs-or-sidebar-with-singleStory branch June 11, 2021 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants