dashfolders: rename Root folder to General. Closes #10692

This commit is contained in:
Daniel Lee 2018-02-02 10:33:31 +01:00
parent f158a604a0
commit 512f6992f1
6 changed files with 22 additions and 19 deletions

View File

@ -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 {

View File

@ -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),

View File

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

View File

@ -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,

View File

@ -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 });
}

View File

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