Преглед изворни кода

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)
Daniel Lee пре 8 година
родитељ
комит
a0fc5383fd
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      public/app/features/dashboard/folder_picker/folder_picker.ts

+ 3 - 0
public/app/features/dashboard/folder_picker/folder_picker.ts

@@ -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 {