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

UI: Include full URL in the "Copy Canvas Link" button #17498

Merged
merged 3 commits into from
Jul 15, 2022

Conversation

sosomuse
Copy link
Contributor

@sosomuse sosomuse commented Feb 13, 2022

Issue: #15509

What I did

Add location.origin before iframe.html

test

How to test

  • 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 Feb 13, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 5a5c646. As they complete they will appear below. 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.

Thank you so much! Minor comment inline

lib/ui/src/components/preview/tools/copy.tsx Outdated Show resolved Hide resolved
@domyen
Copy link
Member

domyen commented Apr 8, 2022

Can we get a review on this? It affects all Storybook users in a pretty obvious way. cc @yannbf

Also, do we need the iframe.html here? I'd expect the copy button in Storybook's manager UI to replicate the state of the story + controls in the manager and not in the iframe-only mode.

Copy link
Member

@yannbf yannbf left a comment

Choose a reason for hiding this comment

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

Hey @soso-15315 thank you so much for your contribution! It works great in all scenarios:

  • Running Storybook in a local directory like localhost:4000/storybook
  • Running in dev mode
  • Running in served static from storybook-build

Thanks for making Storybook better 🚀

@yannbf yannbf changed the title UI: Fix The "Copy Canvas Link" leaves out the base url and only gives the iframe information making it useless UI: Include full URL in the "Copy Canvas Link" button Jul 14, 2022
@ndelangen ndelangen merged commit 7cad10b into storybookjs:next Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants