Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Input Provider with Storybook knobs not working #1598

Closed
sareh opened this issue Aug 5, 2019 · 4 comments · Fixed by #1679
Closed

Input Provider with Storybook knobs not working #1598

sareh opened this issue Aug 5, 2019 · 4 comments · Fixed by #1679
Labels
bug Something isn't working shared-components simorgh-core-stream ws-articles Tasks for the WS Articles Team ws-home Tasks for the WS Home Team ws-media The World Service media stream

Comments

@sareh
Copy link
Contributor

sareh commented Aug 5, 2019

Describe the bug
The input provider drop-down is broken on latest
Screen Shot input provider broken

To Reproduce
Steps to reproduce the behaviour:

  1. Go to
    https://bbc.github.io/psammead/?path=/story/components-headline--default
    https://bbc.github.io/psammead/?path=/story/components-inlinelink--default
  2. On the 'knobs' panel, select a service that is not 'news'. e.g arabic.
  3. See just right-aligned english copy.

This is the case for all stories that use knobs and the inputProvider in psammead-storybook-helpers

Expected behaviour
When you select a service that is not news, you should get copy written in the relevant language.

Screenshots
Pasted above.

Additional context
Way to see it working again: Pin to version 5.0.6.
However, it should be fixed forwards instead of pinned to this older version.

@sareh sareh added bug Something isn't working simorgh-core-stream labels Aug 5, 2019
@sareh sareh added ws-articles Tasks for the WS Articles Team shared-components ws-home Tasks for the WS Home Team ws-media The World Service media stream labels Aug 5, 2019
@ghost ghost self-assigned this Aug 7, 2019
@ghost
Copy link

ghost commented Aug 7, 2019

This seem to be caused by storybook knobs not being updated. It can be reproduced without inputProvider

.add('the bug', () => {
    const contents = { news: 'this is news', arabic: 'this is arabic' };
    const options = ['news', 'arabic'];

    const selected = select('Select', options, 'news');
    const value = text('Contents', contents[selected]);

    return <span> {value} </span>;
  })

@ghost
Copy link

ghost commented Aug 7, 2019

Option 1: Not to render value and render contents[selected] but then we loose the ability to edit the text.

@ghost ghost removed their assignment Aug 7, 2019
@sareh
Copy link
Contributor Author

sareh commented Aug 7, 2019

@sadickisaac Since we rarely edit the text, I think it'd be a good option. It'd give us visibility of the text in the various languages and scripts, which we currently do not have.

@ghost ghost mentioned this issue Aug 8, 2019
3 tasks
@ghost ghost self-assigned this Aug 8, 2019
@andrew-nowak
Copy link
Contributor

:( Looks like this functionality got removed from storybook in the minor version increase to 5.1.0

This looks like the PR where it was removed https://github.com/storybookjs/storybook/pull/6486/files#diff-0f0ba9ed2031f812b0f6abbd2b80b14dL55

And this looks like the issue to follow for bringing the functionality back into storybook storybookjs/storybook#7150

I have found it useful in the past to be able to edit the text, but that functionality can be approximated in the browser dev console, so let's move forward with this until the functionality is readded to storybook

@ghost ghost closed this as completed in #1679 Aug 9, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working shared-components simorgh-core-stream ws-articles Tasks for the WS Articles Team ws-home Tasks for the WS Home Team ws-media The World Service media stream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants