Commit a0fc5383 by Daniel Lee

dashfolders: fix for folder picker

If the selected folder is not in the options then manually create it. This
can happen in some edge cases (if an user has been given access to a
dashboard but does not have access to its parent folder)
parent 7e2e57c3
......@@ -115,6 +115,9 @@ export class FolderPickerCtrl {
if (this.initialFolderId && this.initialFolderId > 0) {
this.getOptions('').then(result => {
this.folder = _.find(result, { value: this.initialFolderId });
if (!this.folder) {
this.folder = { text: this.initialTitle, value: this.initialFolderId };
}
this.onFolderLoad();
});
} else {
......
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