The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/core/components/NestedFolderPicker/useFoldersQuery.ts

19 lines
794 B

import { config } from '@grafana/runtime';
import { PermissionLevelString } from '../../../types';
import { useFoldersQueryAppPlatform } from './useFoldersQueryAppPlatform';
import { useFoldersQueryLegacy } from './useFoldersQueryLegacy';
export function useFoldersQuery(
isBrowsing: boolean,
openFolders: Record<string, boolean>,
permission?: PermissionLevelString
) {
const resultLegacy = useFoldersQueryLegacy(isBrowsing, openFolders, permission);
const resultAppPlatform = useFoldersQueryAppPlatform(isBrowsing, openFolders);
// Running the hooks themselves don't have any side effects, so we can just conditionally use one or the other
// requestNextPage function from the result
return config.featureToggles.foldersAppPlatformAPI ? resultAppPlatform : resultLegacy;
}