diff --git a/public/app/features/org/OrgPreferences.tsx b/public/app/features/org/OrgPreferences.tsx index a8133ba4a1c..f4ab06ac080 100644 --- a/public/app/features/org/OrgPreferences.tsx +++ b/public/app/features/org/OrgPreferences.tsx @@ -42,7 +42,10 @@ export class OrgPreferences extends PureComponent { setOrganizationTheme, } = this.props; - starredDashboards.unshift({ id: 0, title: 'Default', tags: [], type: '', uid: '', uri: '', url: '' }); + const dashboards: DashboardSearchHit[] = [ + { id: 0, title: 'Default', tags: [], type: '', uid: '', uri: '', url: '' }, + ...starredDashboards, + ]; return (
@@ -66,11 +69,11 @@ export class OrgPreferences extends PureComponent { Home Dashboard dashboard.id === preferences.homeDashboardId)} + defaultValue={dashboards.find(dashboard => dashboard.id === preferences.homeDashboardId)} getOptionValue={i => i.id} getOptionLabel={i => i.title} onSelected={(dashboard: DashboardSearchHit) => setOrganizationHomeDashboard(dashboard.id)} - options={starredDashboards} + options={dashboards} placeholder="Chose default dashboard" width={20} /> diff --git a/public/app/features/teams/TeamPreferences.tsx b/public/app/features/teams/TeamPreferences.tsx index e9b6af3dc72..a6b8547c4db 100644 --- a/public/app/features/teams/TeamPreferences.tsx +++ b/public/app/features/teams/TeamPreferences.tsx @@ -31,7 +31,10 @@ export class TeamPreferences extends PureComponent { render() { const { preferences, starredDashboards, setTeamHomeDashboard, setTeamTimezone, setTeamTheme } = this.props; - starredDashboards.unshift({ id: 0, title: 'Default', tags: [], type: '', uid: '', uri: '', url: '' }); + const dashboards: DashboardSearchHit[] = [ + { id: 0, title: 'Default', tags: [], type: '', uid: '', uri: '', url: '' }, + ...starredDashboards, + ]; return ( @@ -55,11 +58,11 @@ export class TeamPreferences extends PureComponent { Home Dashboard dashboard.id === preferences.homeDashboardId)} + defaultValue={dashboards.find(dashboard => dashboard.id === preferences.homeDashboardId)} getOptionValue={i => i.id} getOptionLabel={i => i.title} onSelected={(dashboard: DashboardSearchHit) => setTeamHomeDashboard(dashboard.id)} - options={starredDashboards} + options={dashboards} placeholder="Chose default dashboard" width={20} />