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

linkTo has incorrect behavior on call with one parameter #5950

Closed
Armanio opened this issue Mar 7, 2019 · 5 comments
Closed

linkTo has incorrect behavior on call with one parameter #5950

Armanio opened this issue Mar 7, 2019 · 5 comments
Assignees
Milestone

Comments

@Armanio
Copy link
Member

Armanio commented Mar 7, 2019

Describe the bug
linkTo from links addon has incorrect behaviour when it calls without second parameter

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://storybooks-official.netlify.com/?path=/story/other-demo-welcome--to-storybook
  2. Click on "stories" in description welcome component
  3. App will be redirect to https://storybooks-official.netlify.com/?path=/story/Button and you see broken markup
    Expected behavior
    Welcome component has linkTo function call linkTo('Button') from links addon. In addon doc i found this:
    "Second (optional) parameter is the story name (what you named with .add). If the second parameter is omitted, the link will point to the first story in the given kind."

Screenshots
2019-03-07 17 36 14

System:

  • OS: MacOS 10.14.3
  • Device: Macbook Pro 2017
  • Browser: Chrome 72.0.3626.119
  • Addons: link
  • Version: 5.0.0

Additional context
I inspect this problem. Like a problem in selectStory from storybook/lib/ui/src/core/stories.js.
If call function without second parameter app will simple redirect to /story/{PARAM} despite PARAM is valid kind name.

@Armanio
Copy link
Member Author

Armanio commented Mar 7, 2019

If i understand it right i can take this issue and fix it?

@shilman
Copy link
Member

shilman commented Mar 7, 2019

@Armanio Awesome!! Would love a fix for this!! 🥇 Feel free to hit us up on Discord if you have any q's about dev setup 👍

@shilman
Copy link
Member

shilman commented Mar 7, 2019

Related: #5925

@shilman
Copy link
Member

shilman commented Mar 9, 2019

Yowza!! I just released https://github.com/storybooks/storybook/releases/tag/v5.1.0-alpha.3 containing PR #5983 that references this issue. Upgrade today to try it out!

Because it's a pre-release you can find it on the @next NPM tag.

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Mar 9, 2019
@shilman
Copy link
Member

shilman commented Mar 17, 2019

ZOMG!! I just released https://github.com/storybooks/storybook/releases/tag/v5.0.2 containing PR #5983 that references this issue. Upgrade today to try it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants