mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
New panel edit: field overrides ui (#22036)
* Add title editor * Wip * FIeld config overrides UI (v1) * Basic property override editors * name to prop * use prop not path Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
@@ -24,8 +24,8 @@ describe('FieldOverrides', () => {
|
||||
{
|
||||
matcher: { id: FieldMatcherID.numeric },
|
||||
properties: [
|
||||
{ path: 'decimals', value: 1 }, // Numeric
|
||||
{ path: 'title', value: 'Kittens' }, // Text
|
||||
{ prop: 'decimals', value: 1 }, // Numeric
|
||||
{ prop: 'title', value: 'Kittens' }, // Text
|
||||
],
|
||||
},
|
||||
],
|
||||
|
@@ -218,8 +218,8 @@ function prepareConfigValue(key: string, input: any, options?: DynamicConfigValu
|
||||
|
||||
export function setDynamicConfigValue(config: FieldConfig, options: DynamicConfigValueOptions) {
|
||||
const { value } = options;
|
||||
const v = prepareConfigValue(value.path, value.value, options);
|
||||
set(config, value.path, v);
|
||||
const v = prepareConfigValue(value.prop, value.value, options);
|
||||
set(config, value.prop, v);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -5,8 +5,9 @@ import { InterpolateFunction } from './panel';
|
||||
import { DataFrame } from 'apache-arrow';
|
||||
|
||||
export interface DynamicConfigValue {
|
||||
path: string;
|
||||
value: any;
|
||||
prop: string;
|
||||
value?: any;
|
||||
custom?: boolean;
|
||||
}
|
||||
|
||||
export interface ConfigOverrideRule {
|
||||
|
Reference in New Issue
Block a user