mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
WIP: adds folder-picker to save as dialog
This commit is contained in:
@@ -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>',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<label class="gf-form-label width-7">Folder</label>
|
||||
<div class="dropdown">
|
||||
<metric-segment segment="ctrl.selectedFolderSegment"
|
||||
get-options="ctrl.getOptions()"
|
||||
on-change="ctrl.folderChanged()"></metric-segment>
|
||||
get-options="ctrl.getOptions()"
|
||||
on-change="ctrl.folderChanged()"></metric-segment>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -42,7 +42,9 @@ export class FolderPickerCtrl {
|
||||
|
||||
folderChanged() {
|
||||
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 @@
|
||||
</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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user