mirror of
https://github.com/grafana/grafana.git
synced 2025-01-24 15:27:01 -06:00
AdHocFilters: Use queries in ad hoc filters api calls (#87624)
This commit is contained in:
parent
fa95b41715
commit
39aafde8cb
@ -126,6 +126,9 @@ describe('transformSaveModelToScene', () => {
|
||||
expect(scene.state?.$variables?.state.variables).toHaveLength(2);
|
||||
expect(scene.state?.$variables?.getByName('constant')).toBeInstanceOf(ConstantVariable);
|
||||
expect(scene.state?.$variables?.getByName('CoolFilters')).toBeInstanceOf(AdHocFiltersVariable);
|
||||
expect(
|
||||
(scene.state?.$variables?.getByName('CoolFilters') as AdHocFiltersVariable).state.useQueriesAsFilterForOptions
|
||||
).toBe(true);
|
||||
expect(dashboardControls).toBeDefined();
|
||||
|
||||
expect(dashboardControls.state.refreshPicker.state.intervals).toEqual(defaultTimePickerConfig.refresh_intervals);
|
||||
@ -936,6 +939,7 @@ describe('transformSaveModelToScene', () => {
|
||||
baseFilters: [{ key: 'baseFilterTest', operator: '=', value: 'test' }],
|
||||
datasource: { uid: 'gdev-prometheus', type: 'prometheus' },
|
||||
applyMode: 'auto',
|
||||
useQueriesAsFilterForOptions: true,
|
||||
});
|
||||
});
|
||||
|
||||
@ -1018,6 +1022,7 @@ describe('transformSaveModelToScene', () => {
|
||||
value: '3',
|
||||
},
|
||||
],
|
||||
useQueriesAsFilterForOptions: true,
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -319,6 +319,7 @@ export function createSceneVariableFromVariableModel(variable: TypedVariableMode
|
||||
filters: variable.filters ?? [],
|
||||
baseFilters: variable.baseFilters ?? [],
|
||||
defaultKeys: variable.defaultKeys,
|
||||
useQueriesAsFilterForOptions: true,
|
||||
});
|
||||
}
|
||||
if (variable.type === 'custom') {
|
||||
|
Loading…
Reference in New Issue
Block a user