TablePanel: Refactor to functional component and move add ad hoc filter action to PanelContext (#61360)

* FieldOptions: Add filterable as registry added field item

* Refactor to functional component, move ad hoc filter to PanelStateWrapper

* review tweaks
This commit is contained in:
Torkel Ödegaard
2023-01-19 14:03:13 +01:00
committed by GitHub
parent 29f8722c91
commit 9b82e65b7a
10 changed files with 178 additions and 157 deletions

View File

@@ -25,6 +25,7 @@ import {
StatsPickerConfigSettings,
displayNameOverrideProcessor,
FieldNamePickerConfigSettings,
booleanOverrideProcessor,
} from '@grafana/data';
import { RadioButtonGroup, TimeZonePicker, Switch } from '@grafana/ui';
import { FieldNamePicker } from '@grafana/ui/src/components/MatchersUI/FieldNamePicker';
@@ -381,5 +382,18 @@ export const getAllStandardFieldConfigs = () => {
getItemsCount: (value) => (value ? value.steps.length : 0),
};
return [unit, min, max, decimals, displayName, color, noValue, links, mappings, thresholds];
const filterable: FieldConfigPropertyItem<{}, boolean | undefined, {}> = {
id: 'filterable',
path: 'filterable',
name: 'Ad-hoc filterable',
hideFromDefaults: true,
editor: standardEditorsRegistry.get('boolean').editor as any,
override: standardEditorsRegistry.get('boolean').editor as any,
process: booleanOverrideProcessor,
shouldApply: () => true,
settings: {},
category,
};
return [unit, min, max, decimals, displayName, color, noValue, links, mappings, thresholds, filterable];
};