Commit 7381d256 by Daniel Lee

WIP: adds folder-picker to save as dialog

parent d081f852
......@@ -117,6 +117,9 @@ export class DashboardSrv {
newScope.clone = this.dash.getSaveModelClone();
newScope.clone.editable = true;
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', {
templateHtml: '<save-dashboard-as-modal dismiss="dismiss()"></save-dashboard-as-modal>',
......
......@@ -42,8 +42,10 @@ export class FolderPickerCtrl {
folderChanged() {
const selected = _.find(this.folders, {title: this.selectedFolderSegment.value});
if (selected) {
this.dashboard.parentId = selected.id;
}
}
}
export interface Folder {
......
......@@ -45,7 +45,7 @@
</div>
</div>
<folder-picker ng-hide="dashboardMeta.isFolder" dashboard="dashboard"></folder-picker>
<folder-picker ng-if="!dashboardMeta.isFolder" dashboard="dashboard"></folder-picker>
</div>
<div class="section">
......
......@@ -3,7 +3,7 @@
import coreModule from 'app/core/core_module';
const template = `
<div class="modal-body">
<div class="modal-body modal-body--with-overflow">
<div class="modal-header">
<h2 class="modal-header-title">
<i class="fa fa-copy"></i>
......@@ -21,6 +21,9 @@ const template = `
<label class="gf-form-label">New name</label>
<input type="text" class="gf-form-input" ng-model="ctrl.clone.title" give-focus="true" required>
</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 class="gf-form-button-row text-center">
......
......@@ -87,6 +87,10 @@
max-width: 500px;
}
.modal-body--with-overflow {
overflow-y: visible;
}
.confirm-modal {
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