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: Retain iframe.html query parameters #17136

Merged
merged 4 commits into from
Jan 10, 2022

Conversation

ittaibaratz
Copy link
Contributor

Issue:

Retain iframe.html query parameters coming from PREVIEW_URL

What I did

This is a follow up to my previous PR, #16773.

The previous PR allowed the docs add on to use a specific iframe source configured via PREVIEW_URL. However we realized that even with doing that, Storybook always overrides any pre-existing query parameters when it sets its own query parameters (id, viewMode, etc).

This PR adds a utility function (getStoryHref) that will add the storybook query params without removing the existing params in the process.

How to test

TBD

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

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 Jan 5, 2022

☁️ Nx Cloud Report

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

📂 See all runs for this branch


✅ Successfully ran 1 target

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.

Thanks @ittaibaratz ! The concept sounds reasonable, but the code has some weird dependencies. Would be great to fix that before merging.

lib/components/src/blocks/Story.tsx Outdated Show resolved Hide resolved
@ittaibaratz
Copy link
Contributor Author

Thanks @ittaibaratz ! The concept sounds reasonable, but the code has some weird dependencies. Would be great to fix that before merging.

Sure thing! That's done now, please check.

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.

Great stuff @ittaibaratz 🎸

@shilman shilman changed the title Retain iframe.html query parameters Core: Retain iframe.html query parameters Jan 10, 2022
@shilman shilman merged commit e72dcab into storybookjs:next Jan 10, 2022
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.

2 participants