mirror of
https://github.com/grafana/grafana.git
synced 2025-01-16 11:42:35 -06:00
Frontend: adds folder name in home dash choose menu (#18346)
* Frontend:adds folder name in choose home dash menu(#18293) * Frontend:adds folder name in choose home dash menu(#18293)
This commit is contained in:
parent
832b67db38
commit
54f3e873a4
@ -97,6 +97,13 @@ export class SharedPreferences extends PureComponent<Props, State> {
|
||||
this.setState({ homeDashboardId: dashboardId });
|
||||
};
|
||||
|
||||
getFullDashName = (dashboard: DashboardSearchHit) => {
|
||||
if (typeof dashboard.folderTitle === 'undefined' || dashboard.folderTitle === '') {
|
||||
return dashboard.title;
|
||||
}
|
||||
return dashboard.folderTitle + ' / ' + dashboard.title;
|
||||
};
|
||||
|
||||
render() {
|
||||
const { theme, timezone, homeDashboardId, dashboards } = this.state;
|
||||
|
||||
@ -123,7 +130,7 @@ export class SharedPreferences extends PureComponent<Props, State> {
|
||||
<Select
|
||||
value={dashboards.find(dashboard => dashboard.id === homeDashboardId)}
|
||||
getOptionValue={i => i.id}
|
||||
getOptionLabel={i => i.title}
|
||||
getOptionLabel={this.getFullDashName}
|
||||
onChange={(dashboard: DashboardSearchHit) => this.onHomeDashboardChanged(dashboard.id)}
|
||||
options={dashboards}
|
||||
placeholder="Choose default dashboard"
|
||||
|
Loading…
Reference in New Issue
Block a user