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:
Dominik Prokop
2020-02-09 14:34:42 +01:00
committed by GitHub
parent 25431f32f0
commit 1728742096
9 changed files with 215 additions and 41 deletions

View File

@@ -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
],
},
],

View File

@@ -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);
}
/**

View File

@@ -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 {