eui icon indicating copy to clipboard operation
eui copied to clipboard

[Storybook] Update utils to ensure properly merged story configs

Open mgadewoll opened this issue 1 year ago • 0 comments

Summary

Our storybook utils to disable/hide/move component props in the controls table are currently generating and returning objects without context of any existing entries on the config it adds to (component or story level). While Storybook does merge configs (component and story level - story level overwrites component level) this can still result in the utils output potentially overwriting existing prop control definitions - e.g. when we call multiple utils on the same prop and in the same level (e.g. story level).

We want to update the utils to ensure they update the existing config instead of overwriting it.

💬 See this conversation for more information.

Acceptance criterea

  • utils (hideStorybookControls, disableStorybookControls and moveStorybookControlsToCategory) don't overwrite other config entries but mutate the existing config while respecting existing entries
  • props that are adjusted in the controls panel via utils are properly output (e.g. moved and disabled)

mgadewoll avatar Mar 14 '24 17:03 mgadewoll