Commit 54f3e873 by Elykov Alexandr Committed by Torkel Ödegaard

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)
parent 832b67db
......@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment