Dashboards: Add values recommendations support for AdHocFilters and GroupBy variables (#114849)
* drilldown recommendations * cleanup + tests * refactor * canary scenes * update type * canary scenes * refactor types * refactor * do not pass userId * canary scenes * canary scenes * bump scenes * export recomendation type
This commit is contained in:
@@ -664,6 +664,7 @@ export {
|
||||
type DataSourceGetTagKeysOptions,
|
||||
type DataSourceGetTagValuesOptions,
|
||||
type DataSourceGetDrilldownsApplicabilityOptions,
|
||||
type DataSourceGetRecommendedDrilldownsOptions,
|
||||
type MetadataInspectorProps,
|
||||
type LegacyMetricFindQueryOptions,
|
||||
type QueryEditorProps,
|
||||
@@ -681,6 +682,7 @@ export {
|
||||
type QueryHint,
|
||||
type MetricFindValue,
|
||||
type DrilldownsApplicability,
|
||||
type DrilldownRecommendation,
|
||||
type DataSourceJsonData,
|
||||
type DataSourceSettings,
|
||||
type DataSourceInstanceSettings,
|
||||
|
||||
@@ -313,6 +313,13 @@ abstract class DataSourceApi<
|
||||
options?: DataSourceGetDrilldownsApplicabilityOptions<TQuery>
|
||||
): Promise<DrilldownsApplicability[]>;
|
||||
|
||||
/**
|
||||
* Get recommended drilldowns for a dashboard
|
||||
*/
|
||||
getRecommendedDrilldowns?(
|
||||
options?: DataSourceGetRecommendedDrilldownsOptions<TQuery>
|
||||
): Promise<DrilldownRecommendation>;
|
||||
|
||||
/**
|
||||
* Get tag keys for adhoc filters
|
||||
*/
|
||||
@@ -398,13 +405,9 @@ abstract class DataSourceApi<
|
||||
}
|
||||
|
||||
/**
|
||||
* Options argument to DataSourceAPI.getTagKeys
|
||||
* Base options shared across datasource filtering operations.
|
||||
*/
|
||||
export interface DataSourceGetTagKeysOptions<TQuery extends DataQuery = DataQuery> {
|
||||
/**
|
||||
* The other existing filters or base filters. New in v10.3
|
||||
*/
|
||||
filters: AdHocVariableFilter[];
|
||||
export interface DataSourceFilteringRequestOptions<TQuery extends DataQuery = DataQuery> {
|
||||
/**
|
||||
* Context time range. New in v10.3
|
||||
*/
|
||||
@@ -413,21 +416,27 @@ export interface DataSourceGetTagKeysOptions<TQuery extends DataQuery = DataQuer
|
||||
scopes?: Scope[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options argument to DataSourceAPI.getTagKeys
|
||||
*/
|
||||
export interface DataSourceGetTagKeysOptions<TQuery extends DataQuery = DataQuery>
|
||||
extends DataSourceFilteringRequestOptions<TQuery> {
|
||||
/**
|
||||
* The other existing filters or base filters. New in v10.3
|
||||
*/
|
||||
filters: AdHocVariableFilter[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Options argument to DataSourceAPI.getTagValues
|
||||
*/
|
||||
export interface DataSourceGetTagValuesOptions<TQuery extends DataQuery = DataQuery> {
|
||||
export interface DataSourceGetTagValuesOptions<TQuery extends DataQuery = DataQuery>
|
||||
extends DataSourceFilteringRequestOptions<TQuery> {
|
||||
key: string;
|
||||
/**
|
||||
* The other existing filters or base filters. New in v10.3
|
||||
*/
|
||||
filters: AdHocVariableFilter[];
|
||||
/**
|
||||
* Context time range. New in v10.3
|
||||
*/
|
||||
timeRange?: TimeRange;
|
||||
queries?: TQuery[];
|
||||
scopes?: Scope[] | undefined;
|
||||
}
|
||||
|
||||
export interface MetadataInspectorProps<
|
||||
@@ -646,12 +655,22 @@ export interface MetricFindValue {
|
||||
properties?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface DataSourceGetDrilldownsApplicabilityOptions<TQuery extends DataQuery = DataQuery> {
|
||||
export interface DataSourceGetDrilldownsApplicabilityOptions<TQuery extends DataQuery = DataQuery>
|
||||
extends DataSourceFilteringRequestOptions<TQuery> {
|
||||
filters?: AdHocVariableFilter[];
|
||||
groupByKeys?: string[];
|
||||
}
|
||||
|
||||
export interface DataSourceGetRecommendedDrilldownsOptions<TQuery extends DataQuery = DataQuery>
|
||||
extends DataSourceFilteringRequestOptions<TQuery> {
|
||||
dashboardUid?: string;
|
||||
filters?: AdHocVariableFilter[];
|
||||
groupByKeys?: string[];
|
||||
}
|
||||
|
||||
export interface DrilldownRecommendation {
|
||||
filters?: AdHocVariableFilter[];
|
||||
groupByKeys?: string[];
|
||||
timeRange?: TimeRange;
|
||||
queries?: TQuery[];
|
||||
scopes?: Scope[] | undefined;
|
||||
}
|
||||
|
||||
export interface DrilldownsApplicability {
|
||||
|
||||
@@ -373,6 +373,10 @@ export interface FeatureToggles {
|
||||
*/
|
||||
unlimitedLayoutsNesting?: boolean;
|
||||
/**
|
||||
* Enables showing recently used drilldowns or recommendations given by the datasource in the AdHocFilters and GroupBy variables
|
||||
*/
|
||||
drilldownRecommendations?: boolean;
|
||||
/**
|
||||
* Enables viewing non-applicable drilldowns on a panel level
|
||||
*/
|
||||
perPanelNonApplicableDrilldowns?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user