-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Code] disable structure tab when necessary #34908
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ enum Tabs { | |
interface Props extends RouteComponentProps<MainRouteParams> { | ||
loadingFileTree: boolean; | ||
loadingStructureTree: boolean; | ||
hasStructure: boolean; | ||
} | ||
|
||
class CodeSideTabs extends React.PureComponent<Props> { | ||
|
@@ -73,7 +74,7 @@ class CodeSideTabs extends React.PureComponent<Props> { | |
name: 'Structure', | ||
content: structureTabContent, | ||
isSelected: Tabs.structure === this.sideTab, | ||
disabled: this.props.match.params.pathType === PathTypes.tree, | ||
disabled: this.props.match.params.pathType === PathTypes.tree || !this.props.hasStructure, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
'data-test-subj': 'codeStructureTreeTab', | ||
}, | ||
]; | ||
|
@@ -95,6 +96,7 @@ class CodeSideTabs extends React.PureComponent<Props> { | |
initialSelectedTab={this.tabs.find(t => t.id === this.sideTab)} | ||
onTabClick={tab => this.switchTab(tab.id as Tabs)} | ||
expand={true} | ||
selectedTab={this.tabs.find(t => t.id === this.sideTab)} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mw-ding Code intelligence doesn't carry over tab in the url, but we have to control the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what do you mean by code intelligence? We want to make sure if the |
||
/> | ||
<Shortcut | ||
keyCode="t" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the change of
SideTabs
withhasStructure
in this PR though?