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-docs: Fix ArgsTable sorting when using of={Component} #14669

Merged
merged 1 commit into from Apr 21, 2021

Conversation

patricklafrance
Copy link
Member

@patricklafrance patricklafrance commented Apr 20, 2021

The following PR https://github.com/storybookjs/storybook/pull/13125/files added sorting to ArgsTable however the following was not working.

<ArgsTable of={PropsSort} sort="alpha" />

What I did

Added code to docs/blocks/ArgsTable to forward the sort prop to the underlying ArgsTable component when using ComponentsTable.

For alpha sorting...

Before:

image

After:

image

How to test

I added 2 ArgsTable (alpha, requiredFirst) to cra-ts-kitchen-sink at ?path=/story/propssort--page

  • 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.

@patricklafrance patricklafrance changed the title Forward sort prop to pure ArgsTable when specifying from docs ArgsTa… Forward sort prop to underlying ArgsTable when using of={Component} Apr 20, 2021
@patricklafrance
Copy link
Member Author

Not sure what to do with this error

2:55:23 PM: --------------------------
2:55:23 PM: ▶️  building: vue-3-cli
2:55:23 PM: --------------------------
2:55:26 PM: internal/modules/cjs/loader.js:818
2:55:26 PM:   throw err;
2:55:26 PM:   ^
2:55:26 PM: Error: Cannot find module '/opt/build/repo/app/vue3/bin/build.js'
2:55:26 PM:     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
2:55:26 PM:     at Function.Module._load (internal/modules/cjs/loader.js:667:27)
2:55:26 PM:     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
2:55:26 PM:     at internal/main/run_main_module.js:17:47 {
2:55:26 PM:   code: 'MODULE_NOT_FOUND',
2:55:26 PM:   requireStack: []
2:55:26 PM: }
2:55:26 PM: undefined
2:55:27 PM: Execution timed out after 1h0m0s

@shilman shilman changed the title Forward sort prop to underlying ArgsTable when using of={Component} Addon-docs: Fix ArgsTable sorting when using of={Component} Apr 21, 2021
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.

LGTM! 👍

@shilman shilman added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Apr 21, 2021
@shilman shilman merged commit 70fa87e into next Apr 21, 2021
@shilman shilman deleted the fix-args-table-sort-prop-when-using-of branch April 21, 2021 02:30
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Apr 23, 2021
shilman added a commit that referenced this pull request Apr 23, 2021
…hen-using-of

Addon-docs: Fix ArgsTable sorting when using of={Component}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: docs bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants