From 512f6992f162bebce444486c1cacb85995b1eebc Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Fri, 2 Feb 2018 10:33:31 +0100 Subject: [PATCH] dashfolders: rename Root folder to General. Closes #10692 --- pkg/api/dashboard.go | 4 ++-- public/app/core/services/search_srv.ts | 2 +- public/app/core/specs/manage_dashboards.jest.ts | 14 +++++++------- public/app/core/specs/search.jest.ts | 4 ++-- .../dashboard/folder_picker/folder_picker.ts | 13 ++++++++----- public/app/features/dashboard/validation_srv.ts | 4 ++-- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/pkg/api/dashboard.go b/pkg/api/dashboard.go index 0e38a7587dc..6376b842192 100644 --- a/pkg/api/dashboard.go +++ b/pkg/api/dashboard.go @@ -88,8 +88,8 @@ func GetDashboard(c *middleware.Context) Response { HasAcl: dash.HasAcl, IsFolder: dash.IsFolder, FolderId: dash.FolderId, - FolderTitle: "Root", Url: dash.GetUrl(), + FolderTitle: "General", } // lookup folder title @@ -309,7 +309,7 @@ func GetHomeDashboard(c *middleware.Context) Response { dash := dtos.DashboardFullWithMeta{} dash.Meta.IsHome = true dash.Meta.CanEdit = c.SignedInUser.HasRole(m.ROLE_EDITOR) - dash.Meta.FolderTitle = "Root" + dash.Meta.FolderTitle = "General" jsonParser := json.NewDecoder(file) if err := jsonParser.Decode(&dash.Dashboard); err != nil { diff --git a/public/app/core/services/search_srv.ts b/public/app/core/services/search_srv.ts index cb9862f8cce..7bee5cdfec6 100644 --- a/public/app/core/services/search_srv.ts +++ b/public/app/core/services/search_srv.ts @@ -161,7 +161,7 @@ export class SearchSrv { } else { section = { id: 0, - title: 'Root', + title: 'General', items: [], icon: 'fa fa-folder-open', toggle: this.toggleFolder.bind(this), diff --git a/public/app/core/specs/manage_dashboards.jest.ts b/public/app/core/specs/manage_dashboards.jest.ts index b79c4fa06a3..8c640bc0630 100644 --- a/public/app/core/specs/manage_dashboards.jest.ts +++ b/public/app/core/specs/manage_dashboards.jest.ts @@ -30,7 +30,7 @@ describe('ManageDashboards', () => { }, { id: 0, - title: 'Root', + title: 'General', icon: 'fa fa-folder-open', uri: 'db/something-else', type: 'dash-db', @@ -363,7 +363,7 @@ describe('ManageDashboards', () => { }, { id: 0, - title: 'Root', + title: 'General', items: [{ id: 3, checked: true }], checked: false, }, @@ -391,7 +391,7 @@ describe('ManageDashboards', () => { }, { id: 0, - title: 'Root', + title: 'General', items: [{ id: 3, checked: false }], checked: false, }, @@ -420,7 +420,7 @@ describe('ManageDashboards', () => { }, { id: 0, - title: 'Root', + title: 'General', items: [{ id: 3, checked: true }], checked: false, }, @@ -455,7 +455,7 @@ describe('ManageDashboards', () => { }, { id: 0, - title: 'Root', + title: 'General', items: [{ id: 3, checked: false }], checked: false, }, @@ -497,7 +497,7 @@ describe('ManageDashboards', () => { }, { id: 0, - title: 'Root', + title: 'General', items: [{ id: 3, checked: true, uid: 'root-dash' }], checked: true, }, @@ -541,7 +541,7 @@ describe('ManageDashboards', () => { }, { id: 0, - title: 'Root', + title: 'General', items: [{ id: 3, checked: true, uid: 'dash-2' }], checked: false, }, diff --git a/public/app/core/specs/search.jest.ts b/public/app/core/specs/search.jest.ts index 2457d71a48d..2c1172bcf55 100644 --- a/public/app/core/specs/search.jest.ts +++ b/public/app/core/specs/search.jest.ts @@ -49,7 +49,7 @@ describe('SearchCtrl', () => { }, { id: 0, - title: 'Root', + title: 'General', items: [{ id: 3, selected: false }, { id: 5, selected: false }], selected: false, expanded: true, @@ -146,7 +146,7 @@ describe('SearchCtrl', () => { }, { id: 0, - title: 'Root', + title: 'General', items: [{ id: 3, selected: false }, { id: 5, selected: false }], selected: false, expanded: true, diff --git a/public/app/features/dashboard/folder_picker/folder_picker.ts b/public/app/features/dashboard/folder_picker/folder_picker.ts index 74b13c5c2a5..5eb3d094641 100644 --- a/public/app/features/dashboard/folder_picker/folder_picker.ts +++ b/public/app/features/dashboard/folder_picker/folder_picker.ts @@ -12,7 +12,7 @@ export class FolderPickerCtrl { enterFolderCreation: any; exitFolderCreation: any; enableCreateNew: boolean; - rootName = 'Root'; + rootName = 'General'; folder: any; createNewFolder: boolean; newFolderName: string; @@ -33,10 +33,13 @@ export class FolderPickerCtrl { return this.backendSrv.get('api/dashboards/folders', { query: query }).then(result => { if ( query === '' || - query.toLowerCase() === 'r' || - query.toLowerCase() === 'ro' || - query.toLowerCase() === 'roo' || - query.toLowerCase() === 'root' + query.toLowerCase() === 'g' || + query.toLowerCase() === 'ge' || + query.toLowerCase() === 'gen' || + query.toLowerCase() === 'gene' || + query.toLowerCase() === 'gener' || + query.toLowerCase() === 'genera' || + query.toLowerCase() === 'general' ) { result.unshift({ title: this.rootName, id: 0 }); } diff --git a/public/app/features/dashboard/validation_srv.ts b/public/app/features/dashboard/validation_srv.ts index e70bb0c426d..8460f4efa71 100644 --- a/public/app/features/dashboard/validation_srv.ts +++ b/public/app/features/dashboard/validation_srv.ts @@ -1,7 +1,7 @@ import coreModule from 'app/core/core_module'; export class ValidationSrv { - rootName = 'root'; + rootName = 'general'; /** @ngInject */ constructor(private $q, private backendSrv) {} @@ -19,7 +19,7 @@ export class ValidationSrv { if (name.toLowerCase() === this.rootName) { return this.$q.reject({ type: 'EXISTING', - message: 'A folder or dashboard with the same name already exists', + message: 'This is a reserved name and cannot be used for a folder.', }); }