Skip to content

Commit

Permalink
Rename disableSave to disableSaveFromUI in ControlsPanel
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed Jul 29, 2024
1 parent cc0f779 commit 7452e1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions code/addons/controls/src/ControlsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ interface ControlsParameters {
sort?: SortType;
expanded?: boolean;
presetColors?: PresetColor[];
disableSave?: boolean;
disableSaveFromUI?: boolean;
}

interface ControlsPanelProps {
Expand All @@ -51,7 +51,7 @@ export const ControlsPanel = ({ saveStory, createStory }: ControlsPanelProps) =>
expanded,
sort,
presetColors,
disableSave = false,
disableSaveFromUI = false,
} = useParameter<ControlsParameters>(PARAM_KEY, {});
const { path, previewInitialized } = useStorybookState();

Expand Down Expand Up @@ -93,7 +93,7 @@ export const ControlsPanel = ({ saveStory, createStory }: ControlsPanelProps) =>
{hasControls &&
hasUpdatedArgs &&
global.CONFIG_TYPE === 'DEVELOPMENT' &&
disableSave !== true && <SaveStory {...{ resetArgs, saveStory, createStory }} />}
disableSaveFromUI !== true && <SaveStory {...{ resetArgs, saveStory, createStory }} />}
</AddonWrapper>
);
};
4 changes: 2 additions & 2 deletions docs/essentials/controls.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ You can also update a control's value, then save the changes to the story. The s

### Disable creating and editing of stories

If you don't want to allow the creation or editing of stories from the Controls panel, you can disable this feature by setting the `disableSave` parameter to `true` in the `parameters.controls` parameter in your `.storybook/preview.js` file.
If you don't want to allow the creation or editing of stories from the Controls panel, you can disable this feature by setting the `disableSaveFromUI` parameter to `true` in the `parameters.controls` parameter in your `.storybook/preview.js` file.

## Configuration

Expand Down Expand Up @@ -489,7 +489,7 @@ Specifies how the controls are sorted.
* **alpha**: Sorted alphabetically, by the arg type's name
* **requiredFirst**: Same as `alpha`, with any required arg types displayed first

#### `disableSave`
#### `disableSaveFromUI`

Type: `boolean`

Expand Down

0 comments on commit 7452e1e

Please sign in to comment.