Skip to content

Commit

Permalink
Merge pull request #25417 from storybookjs/yann/remove-unsed-addon-co…
Browse files Browse the repository at this point in the history
…ntrols-prop

Addon Controls: Remove unused hideNoControlsWarning type
  • Loading branch information
valentinpalkovic authored Jan 11, 2024
2 parents b607d49 + b14b4d6 commit 84b9131
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 131 deletions.
18 changes: 18 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
- [Methods and properties from PreviewAPI](#methods-and-properties-from-previewapi)
- [Removals in @storybook/types](#removals-in-storybooktypes)
- [--use-npm flag in storybook CLI](#--use-npm-flag-in-storybook-cli)
- [hideNoControlsWarning parameter from addon controls](#hidenocontrolswarning-parameter-from-addon-controls)
- [`setGlobalConfig` from `@storybook/react`](#setglobalconfig-from-storybookreact)
- [StorybookViteConfig type from @storybook/builder-vite](#storybookviteconfig-type-from-storybookbuilder-vite)
- [props from WithTooltipComponent from @storybook/components](#props-from-withtooltipcomponent-from-storybookcomponents)
Expand All @@ -71,6 +72,7 @@
- [`storyIndexers` is replaced with `experimental_indexers`](#storyindexers-is-replaced-with-experimental_indexers)
- [From version 7.0.0 to 7.2.0](#from-version-700-to-720)
- [Addon API is more type-strict](#addon-api-is-more-type-strict)
- [Addon-controls hideNoControlsWarning parameter is deprecated](#addon-controls-hidenocontrolswarning-parameter-is-deprecated)
- [From version 6.5.x to 7.0.0](#from-version-65x-to-700)
- [7.0 breaking changes](#70-breaking-changes)
- [Dropped support for Node 15 and below](#dropped-support-for-node-15-and-below)
Expand Down Expand Up @@ -832,6 +834,10 @@ The following exports from `@storybook/types` are now removed:

The `--use-npm` is now removed. Use `--package-manager=npm` instead. [More info here](#cli-option---use-npm-deprecated).

#### hideNoControlsWarning parameter from addon controls

The `hideNoControlsWarning` parameter is now removed. [More info here](#addon-controls-hidenocontrolswarning-parameter-is-deprecated).

#### `setGlobalConfig` from `@storybook/react`

The `setGlobalConfig` (used for reusing stories in your tests) is now removed in favor of `setProjectAnnotations`.
Expand Down Expand Up @@ -1134,6 +1140,18 @@ The API: `addons.addPanel()` is now deprecated, and will be removed in 8.0. Plea

The `render` method can now be a `React.FunctionComponent` (without the `children` prop). Storybook will now render it, rather than calling it as a function.

#### Addon-controls hideNoControlsWarning parameter is deprecated

The `hideNoControlsWarning` parameter is now unused and deprecated, given that the UI of the Controls addon changed in a way that does not display that message anymore.

```ts
export const Primary = {
parameters: {
controls: { hideNoControlsWarning: true }, // this parameter is now unnecessary
},
};
```

## From version 6.5.x to 7.0.0

A number of these changes can be made automatically by the Storybook CLI. To take advantage of these "automigrations", run `npx storybook@latest upgrade --prerelease` or `pnpx dlx storybook@latest upgrade --prerelease`.
Expand Down
3 changes: 0 additions & 3 deletions code/addons/controls/src/ControlsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ interface ControlsParameters {
sort?: SortType;
expanded?: boolean;
presetColors?: PresetColor[];

/** @deprecated No longer used, will be removed in Storybook 8.0 */
hideNoControlsWarning?: boolean;
}

export const ControlsPanel: FC = () => {
Expand Down
20 changes: 0 additions & 20 deletions docs/essentials/controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,26 +409,6 @@ Consider the following snippet to force required args first:

<!-- prettier-ignore-end -->

#### Hide NoControls warning

If you don't plan to handle the control args inside your story, you can remove the warning with:

<!-- prettier-ignore-start -->

<CodeSnippets
paths={[
'angular/button-story-hide-nocontrols-warning.ts.mdx',
'web-components/button-story-hide-nocontrols-warning.js.mdx',
'web-components/button-story-hide-nocontrols-warning.ts.mdx',
'common/button-story-hide-nocontrols-warning.js.mdx',
'common/button-story-hide-nocontrols-warning.ts.mdx',
]}
usesCsf3
csf2Path="essentials/controls#snippet-button-story-hide-nocontrols-warning"
/>

<!-- prettier-ignore-end -->

### Disable controls for specific properties

Aside from the features already documented here, Controls can also be disabled for individual properties.
Expand Down
20 changes: 0 additions & 20 deletions docs/snippets/angular/button-story-hide-nocontrols-warning.ts.mdx

This file was deleted.

15 changes: 0 additions & 15 deletions docs/snippets/common/button-story-hide-nocontrols-warning.js.mdx

This file was deleted.

This file was deleted.

21 changes: 0 additions & 21 deletions docs/snippets/common/button-story-hide-nocontrols-warning.ts.mdx

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 84b9131

Please sign in to comment.