Search: Bring back open search by clicking dashboard name (#24151)

This commit is contained in:
Torkel Ödegaard
2020-05-01 14:13:22 +02:00
committed by GitHub
parent e7d906d445
commit 4f81125af0

View File

@@ -106,6 +106,13 @@ class DashNav extends PureComponent<Props> {
this.forceUpdate();
};
onDashboardNameClick = () => {
this.props.updateLocation({
query: { search: 'open' },
partial: true,
});
};
addCustomContent(actions: DashNavButtonModel[], buttons: ReactNode[]) {
actions.map((action, index) => {
const Component = action.component;
@@ -186,7 +193,7 @@ class DashNav extends PureComponent<Props> {
</a>
</>
)}
<span>{dashboard.title}</span>
<a onClick={this.onDashboardNameClick}>{dashboard.title}</a>
</div>
</div>
<div className="navbar-buttons navbar-buttons--actions">{this.renderLeftActionsButton()}</div>