mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -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 });
|
this.setState({ homeDashboardId: dashboardId });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
getFullDashName = (dashboard: DashboardSearchHit) => {
|
||||||
|
if (typeof dashboard.folderTitle === 'undefined' || dashboard.folderTitle === '') {
|
||||||
|
return dashboard.title;
|
||||||
|
}
|
||||||
|
return dashboard.folderTitle + ' / ' + dashboard.title;
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { theme, timezone, homeDashboardId, dashboards } = this.state;
|
const { theme, timezone, homeDashboardId, dashboards } = this.state;
|
||||||
|
|
||||||
@ -123,7 +130,7 @@ export class SharedPreferences extends PureComponent<Props, State> {
|
|||||||
<Select
|
<Select
|
||||||
value={dashboards.find(dashboard => dashboard.id === homeDashboardId)}
|
value={dashboards.find(dashboard => dashboard.id === homeDashboardId)}
|
||||||
getOptionValue={i => i.id}
|
getOptionValue={i => i.id}
|
||||||
getOptionLabel={i => i.title}
|
getOptionLabel={this.getFullDashName}
|
||||||
onChange={(dashboard: DashboardSearchHit) => this.onHomeDashboardChanged(dashboard.id)}
|
onChange={(dashboard: DashboardSearchHit) => this.onHomeDashboardChanged(dashboard.id)}
|
||||||
options={dashboards}
|
options={dashboards}
|
||||||
placeholder="Choose default dashboard"
|
placeholder="Choose default dashboard"
|
||||||
|
Loading…
Reference in New Issue
Block a user