mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
NestedFolders: Basic item selection (#66843)
* NestedFolders: Item selection state * Select children in state * Unselect parents when children are unselected * remove unneeded comment * tests * tidy test a little bit * tidy test a little bit * tidy test a little bit * tidy test a little bit * tidy test a little bit
This commit is contained in:
@@ -51,6 +51,7 @@ async function getChildFolders(parentUid?: string, parentTitle?: string): Promis
|
||||
uid: item.uid,
|
||||
title: item.title,
|
||||
parentTitle,
|
||||
parentUID: parentUid,
|
||||
url: `/dashboards/f/${item.uid}/`,
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ export function queryResultToViewItem(
|
||||
if (parentInfo) {
|
||||
viewItem.parentTitle = parentInfo.name;
|
||||
viewItem.parentKind = parentInfo.kind;
|
||||
viewItem.parentUID = parentUid;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,11 +50,13 @@ export interface DashboardSearchItem {
|
||||
folderUrl?: string;
|
||||
}
|
||||
|
||||
export type DashboardViewItemKind = 'folder' | 'dashboard' | 'panel';
|
||||
|
||||
/**
|
||||
* Type used in the folder view components
|
||||
*/
|
||||
export interface DashboardViewItem {
|
||||
kind: 'folder' | 'dashboard' | 'panel';
|
||||
kind: DashboardViewItemKind;
|
||||
uid: string;
|
||||
title: string;
|
||||
url?: string;
|
||||
@@ -62,7 +64,7 @@ export interface DashboardViewItem {
|
||||
|
||||
icon?: string;
|
||||
|
||||
// Most commonly parent folder title, but can be dashboard if panelTitleSearch is enabled
|
||||
parentUID?: string;
|
||||
parentTitle?: string;
|
||||
parentKind?: string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user