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

Option to select an addon panel && rename selectedDownPanel to selectedAddonPanel #1641

Merged
merged 8 commits into from
Aug 12, 2017

Conversation

usulpro
Copy link
Member

@usulpro usulpro commented Aug 11, 2017

Issue: #811

we had selectedDownPanel option in our UI module but it wasn't available by setOptions

What I did

Allow to set selectedDownPanel by setOptions.

Now it's possible to select the spesific addon panel this way:

setOptions({ selectedAddonPanel: 'storybook/notes/panel' })

You need to pass a panel ID to select a panel (same value that you pass to addons.addPanel())

If you don't know the ID you can pass anything and find in the console output the list of all registered
panels

How to test

run cra-kitchen-sink
Check out "Button" section. Selecting stories with different addons you'll see appropriate addon panels auto selected
Try to pass null or something else.

@codecov
Copy link

codecov bot commented Aug 11, 2017

Codecov Report

Merging #1641 into master will increase coverage by 0.11%.
The diff coverage is 68.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1641      +/-   ##
==========================================
+ Coverage    21.3%   21.41%   +0.11%     
==========================================
  Files         244      244              
  Lines        5384     5402      +18     
  Branches      665      667       +2     
==========================================
+ Hits         1147     1157      +10     
- Misses       3732     3735       +3     
- Partials      505      510       +5
Impacted Files Coverage Δ
lib/ui/src/modules/ui/configs/handle_routing.js 28.04% <100%> (ø) ⬆️
lib/ui/src/modules/ui/actions/ui.js 30% <100%> (ø) ⬆️
lib/ui/src/modules/ui/containers/down_panel.js 23.52% <100%> (ø) ⬆️
lib/ui/src/modules/api/actions/api.js 50.47% <63.15%> (+1.05%) ⬆️
lib/ui/src/libs/key_events.js 23.25% <0%> (ø) ⬆️
.../src/manager/containers/CommentsPanel/dataStore.js 34.78% <0%> (ø) ⬆️
addons/info/src/components/Props.js 37.2% <0%> (ø) ⬆️
lib/ui/src/modules/ui/configs/handle_keyevents.js 33.33% <0%> (ø) ⬆️
lib/ui/src/modules/ui/libs/filters.js 53.33% <0%> (ø) ⬆️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9d4732e...2a2787e. Read the comment docs.

@Hypnosphi
Copy link
Member

selectedAddonPanel maybe?

@usulpro usulpro changed the title Option to select an addon panel Option to select an addon panel && rename selectedDownPanel to selectedAddonPanel Aug 12, 2017
@usulpro
Copy link
Member Author

usulpro commented Aug 12, 2017

Done!
I guess in glamorous components we'll rename all "down" to "addon" and "left" -> "stories"

Copy link
Member

@Hypnosphi Hypnosphi left a comment

Choose a reason for hiding this comment

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

LGTM

@Hypnosphi Hypnosphi merged commit b4968af into master Aug 12, 2017
@ndelangen ndelangen deleted the option-to-select-downpanel branch August 12, 2017 23:40
amacleay added a commit to amacleay/DefinitelyTyped that referenced this pull request Jun 18, 2018
amacleay added a commit to amacleay/DefinitelyTyped that referenced this pull request Jun 18, 2018
@matheo
Copy link
Member

matheo commented May 5, 2020

For the record (for those googling selectedAddonPanel)
it was moved to addons.setConfig({ selectedPanel }) on v5:
https://storybook.js.org/docs/configurations/options-parameter/

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.

3 participants