Rename sidebarName to sidebarLabel

This commit is contained in:
Junghyun Colin Kim 2021-11-30 01:09:29 +09:00
parent bd41e3e18b
commit cbd182a74f
4 changed files with 9 additions and 9 deletions

View File

@ -45,8 +45,8 @@ export class MenuItem extends React.Component<MenuItemProps> {
<OperationMenuItemContent {...this.props} item={item as OperationModel} /> <OperationMenuItemContent {...this.props} item={item as OperationModel} />
) : ( ) : (
<MenuItemLabel depth={item.depth} active={item.active} type={item.type} ref={this.ref}> <MenuItemLabel depth={item.depth} active={item.active} type={item.type} ref={this.ref}>
<MenuItemTitle title={item.sidebarName}> <MenuItemTitle title={item.sidebarLabel}>
{item.sidebarName} {item.sidebarLabel}
{this.props.children} {this.props.children}
</MenuItemTitle> </MenuItemTitle>
{(item.depth > 0 && item.items.length > 0 && ( {(item.depth > 0 && item.items.length > 0 && (
@ -96,7 +96,7 @@ export class OperationMenuItemContent extends React.Component<OperationMenuItemC
<OperationBadge type={item.httpVerb}>{shortenHTTPVerb(item.httpVerb)}</OperationBadge> <OperationBadge type={item.httpVerb}>{shortenHTTPVerb(item.httpVerb)}</OperationBadge>
)} )}
<MenuItemTitle width="calc(100% - 38px)"> <MenuItemTitle width="calc(100% - 38px)">
{item.sidebarName} {item.sidebarLabel}
{this.props.children} {this.props.children}
</MenuItemTitle> </MenuItemTitle>
</MenuItemLabel> </MenuItemLabel>

View File

@ -16,7 +16,7 @@ export interface IMenuItem {
id: string; id: string;
absoluteIdx?: number; absoluteIdx?: number;
name: string; name: string;
sidebarName: string; sidebarLabel: string;
description?: string; description?: string;
depth: number; depth: number;
active: boolean; active: boolean;

View File

@ -14,7 +14,7 @@ export class GroupModel implements IMenuItem {
id: string; id: string;
absoluteIdx?: number; absoluteIdx?: number;
name: string; name: string;
sidebarName: string; sidebarLabel: string;
description?: string; description?: string;
type: MenuItemGroupType; type: MenuItemGroupType;
@ -44,7 +44,7 @@ export class GroupModel implements IMenuItem {
this.name = tagOrGroup['x-displayName'] || tagOrGroup.name; this.name = tagOrGroup['x-displayName'] || tagOrGroup.name;
this.level = (tagOrGroup as MarkdownHeading).level || 1; this.level = (tagOrGroup as MarkdownHeading).level || 1;
this.sidebarName = this.name; this.sidebarLabel = this.name;
// remove sections from markdown, same as in ApiInfo // remove sections from markdown, same as in ApiInfo
this.description = tagOrGroup.description || ''; this.description = tagOrGroup.description || '';

View File

@ -49,7 +49,7 @@ export class OperationModel implements IMenuItem {
id: string; id: string;
absoluteIdx?: number; absoluteIdx?: number;
name: string; name: string;
sidebarName: string; sidebarLabel: string;
description?: string; description?: string;
type = 'operation' as const; type = 'operation' as const;
@ -105,8 +105,8 @@ export class OperationModel implements IMenuItem {
this.name = getOperationSummary(operationSpec); this.name = getOperationSummary(operationSpec);
this.sidebarName = this.name; this.sidebarLabel = this.name;
if (options.sideNavStyle === 'path-only') this.sidebarName = this.path; if (options.sideNavStyle === 'path-only') this.sidebarLabel = this.path;
if (this.isCallback) { if (this.isCallback) {
// NOTE: Callbacks by default should not inherit the specification's global `security` definition. // NOTE: Callbacks by default should not inherit the specification's global `security` definition.