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

Remove deprecated flags and properties #21852

Merged
merged 4 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions code/addons/toolbars/src/components/ToolbarMenuList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const ToolbarMenuList: FC<ToolbarMenuListProps> = withKeyboardCycle(
id,
name,
description,
toolbar: { icon: _icon, items, title: _title, showName, preventDynamicIcon, dynamicTitle },
toolbar: { icon: _icon, items, title: _title, preventDynamicIcon, dynamicTitle },
}) => {
const [globals, updateGlobals] = useGlobals();
const [isTooltipVisible, setIsTooltipVisible] = useState(false);
Expand All @@ -32,12 +32,12 @@ export const ToolbarMenuList: FC<ToolbarMenuListProps> = withKeyboardCycle(
}

// Deprecation support for old "name of global arg used as title"
if (showName && !title) {
if (!title) {
title = name;
deprecate(
'`showName` is deprecated as `name` will stop having dual purposes in the future. Please specify a `title` in `globalTypes` instead.'
);
} else if (!showName && !icon && !title) {
} else if (!icon && !title) {
Copy link

Choose a reason for hiding this comment

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

This branch never gets executed.

title = name;
deprecate(
`Using the \`name\` "${name}" as toolbar title for backward compatibility. \`name\` will stop having dual purposes in the future. Please specify either a \`title\` or an \`icon\` in \`globalTypes\` instead.`
Expand Down
2 changes: 0 additions & 2 deletions code/addons/toolbars/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ export interface NormalizedToolbarConfig {
preventDynamicIcon?: boolean;
items: ToolbarItem[];
shortcuts?: ToolbarShortcuts;
/** @deprecated "name" no longer dual purposes as title - use "title" if a title is wanted */
showName?: boolean;
/** Change title based on selected value */
dynamicTitle?: boolean;
}
Expand Down
1 change: 0 additions & 1 deletion code/lib/preview-api/src/modules/store/StoryStore.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Renderer, ProjectAnnotations, StoryIndex } from '@storybook/types';
import { global } from '@storybook/global';
import { expect } from '@jest/globals';

import { prepareStory } from './csf/prepareStory';
Expand Down