Commit 4846125e by Marcus Efraimsson

dashfolders: support creating new folder when moving dashboards. #10197

parent 2d0f5f06
...@@ -18,12 +18,15 @@ ...@@ -18,12 +18,15 @@
<folder-picker <folder-picker
on-load="ctrl.onFolderChange($folder)" on-load="ctrl.onFolderChange($folder)"
on-change="ctrl.onFolderChange($folder)" on-change="ctrl.onFolderChange($folder)"
enter-folder-creation="ctrl.onEnterFolderCreation()"
exit-folder-creation="ctrl.onExitFolderCreation()"
enable-create-new="true"
label-class="width-7"> label-class="width-7">
</folder-picker> </folder-picker>
</div> </div>
</div> </div>
<div class="gf-form-button-row text-center"> <div class="gf-form-button-row text-center">
<button type="submit" class="btn btn-success" ng-disabled="ctrl.saveForm.$invalid">Move</button> <button type="submit" class="btn btn-success" ng-disabled="ctrl.saveForm.$invalid || !ctrl.isValidFolderSelection">Move</button>
<a class="btn-text" ng-click="ctrl.dismiss();">Cancel</a> <a class="btn-text" ng-click="ctrl.dismiss();">Cancel</a>
</div> </div>
</form> </form>
......
...@@ -6,6 +6,7 @@ export class MoveToFolderCtrl { ...@@ -6,6 +6,7 @@ export class MoveToFolderCtrl {
folder: any; folder: any;
dismiss: any; dismiss: any;
afterSave: any; afterSave: any;
isValidFolderSelection = true;
/** @ngInject */ /** @ngInject */
constructor(private backendSrv) {} constructor(private backendSrv) {}
...@@ -39,6 +40,14 @@ export class MoveToFolderCtrl { ...@@ -39,6 +40,14 @@ export class MoveToFolderCtrl {
return this.afterSave(); return this.afterSave();
}); });
} }
onEnterFolderCreation() {
this.isValidFolderSelection = false;
}
onExitFolderCreation() {
this.isValidFolderSelection = true;
}
} }
export function moveToFolderModal() { export function moveToFolderModal() {
......
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