diff --git a/pkg/api/index.go b/pkg/api/index.go
index 174ac936c55..106b851116d 100644
--- a/pkg/api/index.go
+++ b/pkg/api/index.go
@@ -90,9 +90,9 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
Icon: "fa fa-fw fa-plus",
Url: setting.AppSubUrl + "/",
Children: []*dtos.NavLink{
- {Text: "Dashboard", Icon: "icon-gf icon-gf-dashboard", Url: setting.AppSubUrl + "/dashboard/new"},
- {Text: "Folder", Icon: "fa fa-fw fa-folder", Url: setting.AppSubUrl + "/dashboard/new"},
- {Text: "Import", Icon: "fa fa-fw fa-download", Url: setting.AppSubUrl + "/dashboard/new/?editview=import"},
+ {Text: "Dashboard", Icon: "fa fa-fw fa-plus", Url: setting.AppSubUrl + "/dashboard/new"},
+ {Text: "Folder", Icon: "fa fa-fw fa-plus", Url: setting.AppSubUrl + "/dashboard/new/?editview=new-folder"},
+ {Text: "Import", Icon: "fa fa-fw fa-plus", Url: setting.AppSubUrl + "/dashboard/new/?editview=import"},
},
})
}
diff --git a/public/app/core/components/search/search.ts b/public/app/core/components/search/search.ts
index 670b2a98587..e0c223d827c 100644
--- a/public/app/core/components/search/search.ts
+++ b/public/app/core/components/search/search.ts
@@ -158,13 +158,6 @@ export class SearchCtrl {
this.search();
}
- showNewFolderModal() {
- appEvents.emit('show-modal', {
- templateHtml: '',
- modalClass: 'modal--narrow'
- });
- }
-
search() {
this.showImport = false;
this.selectedIndex = 0;
diff --git a/public/app/core/directives/dash_edit_link.js b/public/app/core/directives/dash_edit_link.js
index d5fd80f9143..60eb0a19241 100644
--- a/public/app/core/directives/dash_edit_link.js
+++ b/public/app/core/directives/dash_edit_link.js
@@ -14,7 +14,12 @@ function ($, angular, coreModule, _) {
'history': { html: ''},
'timepicker': { src: 'public/app/features/dashboard/timepicker/dropdown.html' },
'import': { html: '', isModal: true },
- 'permissions': { html: '', isModal: true }
+ 'permissions': { html: '', isModal: true },
+ 'new-folder': {
+ isModal: true,
+ html: '',
+ modalClass: 'modal--narrow'
+ }
};
coreModule.default.directive('dashEditorView', function($compile, $location, $rootScope) {
@@ -87,7 +92,8 @@ function ($, angular, coreModule, _) {
$rootScope.appEvent('show-modal', {
templateHtml: options.html,
scope: modalScope,
- backdrop: 'static'
+ backdrop: 'static',
+ modalClass: options.modalClass,
});
return;
diff --git a/public/app/features/dashboard/folder_modal/folder.html b/public/app/features/dashboard/folder_modal/folder.html
index db62632423f..e875cc724c2 100644
--- a/public/app/features/dashboard/folder_modal/folder.html
+++ b/public/app/features/dashboard/folder_modal/folder.html
@@ -1,7 +1,8 @@
diff --git a/public/app/features/dashboard/folder_modal/folder.ts b/public/app/features/dashboard/folder_modal/folder.ts
index 81d3cc92566..b1071979ae1 100644
--- a/public/app/features/dashboard/folder_modal/folder.ts
+++ b/public/app/features/dashboard/folder_modal/folder.ts
@@ -6,9 +6,10 @@ import _ from 'lodash';
export class FolderCtrl {
title: string;
+ dismiss: any;
/** @ngInject */
- constructor(private backendSrv, private $scope, $sce) {
+ constructor(private backendSrv, private $scope, private $location) {
}
create() {
@@ -18,17 +19,13 @@ export class FolderCtrl {
const title = this.title.trim();
-
- return this.backendSrv.createDashboardFolder(title).then((result) => {
- appEvents.emit('alert-success', ['Dashboard saved', 'Saved as ' + title]);
-
- appEvents.emit('dashboard-saved', result);
+ return this.backendSrv.createDashboardFolder(title).then(result => {
+ appEvents.emit('alert-success', ['Folder Created', 'OK']);
this.dismiss();
- });
- }
- dismiss() {
- appEvents.emit('hide-modal');
+ var folderUrl = '/dashboard/db/' + result.slug;
+ this.$location.url(folderUrl);
+ });
}
}
@@ -39,6 +36,9 @@ export function folderModal() {
controller: FolderCtrl,
bindToController: true,
controllerAs: 'ctrl',
+ scope: {
+ dismiss: "&"
+ }
};
}
diff --git a/public/sass/components/_dropdown.scss b/public/sass/components/_dropdown.scss
index e9e8abe9c80..226801cc0b9 100644
--- a/public/sass/components/_dropdown.scss
+++ b/public/sass/components/_dropdown.scss
@@ -109,7 +109,7 @@
i {
display: inline-block;
- margin-right: 10px;
+ margin-right: 5px;
}
&:hover {