mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
FieldMatchers: Add match by value (reducer) (#64477)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
DynamicConfigValue,
|
||||
ConfigOverrideRule,
|
||||
GrafanaTheme2,
|
||||
fieldMatchers,
|
||||
} from '@grafana/data';
|
||||
import { fieldMatchersUI, useStyles2, ValuePicker } from '@grafana/ui';
|
||||
import { getDataLinksVariableSuggestions } from 'app/features/panel/panellinks/link_srv';
|
||||
@@ -46,13 +47,19 @@ export function getFieldOverrideCategories(
|
||||
};
|
||||
|
||||
const onOverrideAdd = (value: SelectableValue<string>) => {
|
||||
const info = fieldMatchers.get(value.value!);
|
||||
if (!info) {
|
||||
return;
|
||||
}
|
||||
|
||||
props.onFieldConfigsChange({
|
||||
...currentFieldConfig,
|
||||
overrides: [
|
||||
...currentFieldConfig.overrides,
|
||||
{
|
||||
matcher: {
|
||||
id: value.value!,
|
||||
id: info.id,
|
||||
options: info.defaultOptions,
|
||||
},
|
||||
properties: [],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user