Browse Source

dashfolders: rename Root folder to General. Closes #10692

Daniel Lee 8 years ago
parent
commit
512f6992f1

+ 2 - 2
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 {

+ 1 - 1
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),

+ 7 - 7
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,
         },

+ 2 - 2
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,

+ 8 - 5
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 });
       }

+ 2 - 2
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.',
       });
     }