File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
public/app/features/browse-dashboards/state Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,16 @@ export function createFlatTree(
193193 return mapItem ( item , folderUID , level ) ;
194194 } ) ;
195195
196- if ( ( level === 0 && ! collection ) || ( isOpen && collection && ! collection . isFullyLoaded ) ) {
196+ // this is very custom to the folder picker right now
197+ // we exclude dashboards, but if you have more than 1 page of dashboards collection.isFullyLoaded is false
198+ // so we need to check that we're ignoring dashboards and we've fetched all the folders
199+ // TODO generalize this properly (e.g. split state by kind?)
200+ const isConsideredLoaded = excludeKinds . includes ( 'dashboard' ) && collection ?. lastFetchedKind === 'dashboard' ;
201+
202+ const showPlaceholders =
203+ ( level === 0 && ! collection ) || ( isOpen && collection && ! ( collection . isFullyLoaded || isConsideredLoaded ) ) ;
204+
205+ if ( showPlaceholders ) {
197206 children = children . concat ( getPaginationPlaceholders ( PAGE_SIZE , folderUID , level ) ) ;
198207 }
199208
You can’t perform that action at this time.
0 commit comments