mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
React Migration: Migrates FolderPicker from angular to react (#21088)
* Angular/React: Migrates FolderPicker from angular to react * move to core * snap * minor changes * more removes * Managing creating new and saving in movetofolderctrl * Do not use new forms.field, fix select menu * FolderPicker responsible to creating new folder * create new as prop * snap * remove unnecessary things * remove console log * snap * fix null checks * add search debouncing * set folder to state, null check * typing folder * adding case for loadOptions * snap Co-authored-by: Peter Holmberg <peterholmberg@users.noreply.github.com>
This commit is contained in:
@@ -22,9 +22,9 @@ const template = `
|
||||
<input type="text" class="gf-form-input" ng-model="ctrl.clone.title" give-focus="true" required aria-label="Save dashboard title field">
|
||||
</div>
|
||||
<folder-picker initial-folder-id="ctrl.folderId"
|
||||
on-change="ctrl.onFolderChange($folder)"
|
||||
enter-folder-creation="ctrl.onEnterFolderCreation()"
|
||||
exit-folder-creation="ctrl.onExitFolderCreation()"
|
||||
on-change="ctrl.onFolderChange"
|
||||
enter-folder-creation="ctrl.onEnterFolderCreation"
|
||||
exit-folder-creation="ctrl.onExitFolderCreation"
|
||||
enable-create-new="true"
|
||||
label-class="width-8"
|
||||
dashboard-id="ctrl.clone.id">
|
||||
@@ -97,17 +97,17 @@ export class SaveDashboardAsModalCtrl {
|
||||
}
|
||||
}
|
||||
|
||||
onFolderChange(folder: { id: any }) {
|
||||
onFolderChange = (folder: { id: any }) => {
|
||||
this.folderId = folder.id;
|
||||
}
|
||||
};
|
||||
|
||||
onEnterFolderCreation() {
|
||||
onEnterFolderCreation = () => {
|
||||
this.isValidFolderSelection = false;
|
||||
}
|
||||
};
|
||||
|
||||
onExitFolderCreation() {
|
||||
onExitFolderCreation = () => {
|
||||
this.isValidFolderSelection = true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function saveDashboardAsDirective() {
|
||||
|
||||
Reference in New Issue
Block a user