Commit 7381d256 by Daniel Lee

WIP: adds folder-picker to save as dialog

parent d081f852
...@@ -117,6 +117,9 @@ export class DashboardSrv { ...@@ -117,6 +117,9 @@ export class DashboardSrv {
newScope.clone = this.dash.getSaveModelClone(); newScope.clone = this.dash.getSaveModelClone();
newScope.clone.editable = true; newScope.clone.editable = true;
newScope.clone.hideControls = false; newScope.clone.hideControls = false;
newScope.clone.meta = {};
newScope.clone.meta.parentId = this.dash.meta.parentId;
newScope.clone.meta.isFolder = this.dash.meta.isFolder;
this.$rootScope.appEvent('show-modal', { this.$rootScope.appEvent('show-modal', {
templateHtml: '<save-dashboard-as-modal dismiss="dismiss()"></save-dashboard-as-modal>', templateHtml: '<save-dashboard-as-modal dismiss="dismiss()"></save-dashboard-as-modal>',
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<label class="gf-form-label width-7">Folder</label> <label class="gf-form-label width-7">Folder</label>
<div class="dropdown"> <div class="dropdown">
<metric-segment segment="ctrl.selectedFolderSegment" <metric-segment segment="ctrl.selectedFolderSegment"
get-options="ctrl.getOptions()" get-options="ctrl.getOptions()"
on-change="ctrl.folderChanged()"></metric-segment> on-change="ctrl.folderChanged()"></metric-segment>
</div> </div>
</div> </div>
...@@ -42,7 +42,9 @@ export class FolderPickerCtrl { ...@@ -42,7 +42,9 @@ export class FolderPickerCtrl {
folderChanged() { folderChanged() {
const selected = _.find(this.folders, {title: this.selectedFolderSegment.value}); const selected = _.find(this.folders, {title: this.selectedFolderSegment.value});
this.dashboard.parentId = selected.id; if (selected) {
this.dashboard.parentId = selected.id;
}
} }
} }
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</div> </div>
</div> </div>
<folder-picker ng-hide="dashboardMeta.isFolder" dashboard="dashboard"></folder-picker> <folder-picker ng-if="!dashboardMeta.isFolder" dashboard="dashboard"></folder-picker>
</div> </div>
<div class="section"> <div class="section">
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import coreModule from 'app/core/core_module'; import coreModule from 'app/core/core_module';
const template = ` const template = `
<div class="modal-body"> <div class="modal-body modal-body--with-overflow">
<div class="modal-header"> <div class="modal-header">
<h2 class="modal-header-title"> <h2 class="modal-header-title">
<i class="fa fa-copy"></i> <i class="fa fa-copy"></i>
...@@ -21,6 +21,9 @@ const template = ` ...@@ -21,6 +21,9 @@ const template = `
<label class="gf-form-label">New name</label> <label class="gf-form-label">New name</label>
<input type="text" class="gf-form-input" ng-model="ctrl.clone.title" give-focus="true" required> <input type="text" class="gf-form-input" ng-model="ctrl.clone.title" give-focus="true" required>
</div> </div>
<div class="gf-form">
<folder-picker ng-if="!clone.meta.isFolder" selected-folder="clone.meta.parentId" on-change="onFolderChange"></folder-picker>
</div>
</div> </div>
<div class="gf-form-button-row text-center"> <div class="gf-form-button-row text-center">
......
...@@ -87,6 +87,10 @@ ...@@ -87,6 +87,10 @@
max-width: 500px; max-width: 500px;
} }
.modal-body--with-overflow {
overflow-y: visible;
}
.confirm-modal { .confirm-modal {
max-width: 500px; max-width: 500px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment