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

addon-options: Make shortcuts in storybook optional #3237

Merged
merged 11 commits into from
Mar 20, 2018

Conversation

PunitGr
Copy link
Contributor

@PunitGr PunitGr commented Mar 19, 2018

Issue: #3196

What I did

I've added an option for enabling/disabling keyboard shortcuts.

How to test

One can try this feature by updating the storybook config.js as:

setOptions({
    ...
    enableShortcuts: false, // true by default
})

This will disable the shortcuts.

@Hypnosphi
Copy link
Member

Should we remove shortcuts help button and popup when shortcuts are disabled?

@PunitGr
Copy link
Contributor Author

PunitGr commented Mar 19, 2018

Yeah, that makes sense to disable it. Or we can add a text saying that shortcuts have been disabled.

@codecov
Copy link

codecov bot commented Mar 20, 2018

Codecov Report

Merging #3237 into master will decrease coverage by 0.04%.
The diff coverage is 10%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3237      +/-   ##
==========================================
- Coverage    35.9%   35.86%   -0.05%     
==========================================
  Files         440      440              
  Lines        9669     9682      +13     
  Branches      904      912       +8     
==========================================
  Hits         3472     3472              
+ Misses       5626     5625       -1     
- Partials      571      585      +14
Impacted Files Coverage Δ
lib/ui/src/modules/shortcuts/index.js 0% <ø> (ø) ⬆️
lib/ui/src/modules/shortcuts/actions/shortcuts.js 18.84% <0%> (-3.58%) ⬇️
...i/src/modules/ui/components/stories_panel/index.js 21.66% <10%> (ø) ⬆️
.../src/modules/ui/components/stories_panel/header.js 28.57% <50%> (-1.06%) ⬇️
lib/ui/src/modules/ui/containers/stories_panel.js 26.31% <50%> (-0.72%) ⬇️
app/polymer/src/server/utils.js 0% <0%> (-100%) ⬇️
addons/jest/src/hoc/provideJestResult.js 0% <0%> (ø) ⬆️
... and 68 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 d8278c7...2a331d6. Read the comment docs.

@PunitGr
Copy link
Contributor Author

PunitGr commented Mar 20, 2018

Hey @Hypnosphi, Removed the shortcut help button when enableShortcuts: false.

screen shot 2018-03-20 at 6 24 21 pm

@@ -84,6 +97,16 @@ StoriesPanel.propTypes = {
openShortcutsHelp: PropTypes.func,
name: PropTypes.string,
url: PropTypes.string,
shortcutOptions: PropTypes.objectof(
Copy link
Member

Choose a reason for hiding this comment

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

typo: objectOf

But it's actually not needed here, it should be just shape

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