-
-
-
{{permission.userGroup}}
-
{{permission.permissions}}
-
+
+
+
+
+
{{permission.userGroup}}
+
{{permission.permissions}}
+
diff --git a/public/app/features/dashboard/acl/acl.ts b/public/app/features/dashboard/acl/acl.ts
index f211c8bceaf..9c0ab8f5a79 100644
--- a/public/app/features/dashboard/acl/acl.ts
+++ b/public/app/features/dashboard/acl/acl.ts
@@ -6,7 +6,7 @@ import _ from 'lodash';
export class AclCtrl {
tabIndex: any;
- dashboardId: number;
+ dashboard: any;
userPermissions: Permission[];
userGroupPermissions: Permission[];
@@ -15,7 +15,7 @@ export class AclCtrl {
this.tabIndex = 0;
this.userPermissions = [];
this.userGroupPermissions = [];
- this.get(this.$scope.dashboardId);
+ this.get(this.dashboard.id);
}
get(dashboardId: number) {
@@ -43,13 +43,14 @@ export class AclCtrl {
}
}
-export function aclModal() {
+export function aclSettings() {
return {
restrict: 'E',
templateUrl: 'public/app/features/dashboard/acl/acl.html',
controller: AclCtrl,
bindToController: true,
- controllerAs: 'ctrl'
+ controllerAs: 'ctrl',
+ scope: { dashboard: "=" }
};
}
@@ -67,4 +68,4 @@ export interface Permission {
permissions: number[];
}
-coreModule.directive('aclModal', aclModal);
+coreModule.directive('aclSettings', aclSettings);
diff --git a/public/app/features/dashboard/all.js b/public/app/features/dashboard/all.js
index 3599cd05238..addc9837b18 100644
--- a/public/app/features/dashboard/all.js
+++ b/public/app/features/dashboard/all.js
@@ -25,4 +25,5 @@ define([
'./row/row_ctrl',
'./repeat_option/repeat_option',
'./acl/acl',
+ './folder_picker/picker',
], function () {});
diff --git a/public/app/features/dashboard/dashnav/dashnav.ts b/public/app/features/dashboard/dashnav/dashnav.ts
index 02e2457fd7e..5f51cf9d66e 100644
--- a/public/app/features/dashboard/dashnav/dashnav.ts
+++ b/public/app/features/dashboard/dashnav/dashnav.ts
@@ -47,14 +47,14 @@ export class DashNavCtrl {
appEvents.emit('show-modal', {templateHtml: '
'});
}
- showAclModal() {
- var modalScope = this.$scope.$new();
- modalScope.dashboardId = this.dashboard.id;
- appEvents.emit('show-modal', {
- templateHtml: '
',
- scope: modalScope
- });
- }
+ // $scope.showAclModal = function() {
+ // var modalScope = $scope.$new();
+ // modalScope.dashboardId = $scope.dashboard.id;
+ // $scope.appEvent('show-modal', {
+ // templateHtml: '
',
+ // scope: modalScope
+ // });
+ // };
starDashboard() {
if (this.dashboard.meta.isStarred) {
diff --git a/public/app/features/dashboard/folder_picker/picker.html b/public/app/features/dashboard/folder_picker/picker.html
new file mode 100644
index 00000000000..cb0c68ae884
--- /dev/null
+++ b/public/app/features/dashboard/folder_picker/picker.html
@@ -0,0 +1,6 @@
+
diff --git a/public/app/features/dashboard/folder_picker/picker.ts b/public/app/features/dashboard/folder_picker/picker.ts
new file mode 100644
index 00000000000..8140743f78a
--- /dev/null
+++ b/public/app/features/dashboard/folder_picker/picker.ts
@@ -0,0 +1,46 @@
+///
+
+import coreModule from 'app/core/core_module';
+import appEvents from 'app/core/app_events';
+import _ from 'lodash';
+
+export class FolderPickerCtrl {
+ dashboard: any;
+ folders: any[];
+ selectedFolder: number;
+
+ /** @ngInject */
+ constructor(private backendSrv, private $scope, $sce) {
+ this.get(this.dashboard.id);
+ this.selectedFolder = this.dashboard.meta.parentId;
+ }
+
+ get(dashboardId: number) {
+ var params = {
+ type: 'dash-folder',
+ };
+
+ return this.backendSrv.search(params).then(result => {
+ this.folders = result;
+ });
+ }
+
+ folderChanged() {
+ if (this.selectedFolder > 0) {
+ this.dashboard.parentId = this.selectedFolder;
+ }
+ }
+}
+
+export function folderPicker() {
+ return {
+ restrict: 'E',
+ templateUrl: 'public/app/features/dashboard/folder_picker/picker.html',
+ controller: FolderPickerCtrl,
+ bindToController: true,
+ controllerAs: 'ctrl',
+ scope: { dashboard: "=" }
+ };
+}
+
+coreModule.directive('folderPicker', folderPicker);
diff --git a/public/app/features/dashboard/partials/settings.html b/public/app/features/dashboard/partials/settings.html
index b8d8303a51b..b451139fd8b 100644
--- a/public/app/features/dashboard/partials/settings.html
+++ b/public/app/features/dashboard/partials/settings.html
@@ -4,7 +4,7 @@