mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
New panel edit: data links edit (#22077)
* Move data links suggestions to grafana-data
* Data links - field config and overrides
* Lint
* Fix test
* Add variable suggestions to field override context
* Revert "Move data links suggestions to grafana-data"
This reverts commit 5d8d01a65e
.
* Move FieldConfigEditor to core
This commit is contained in:
@@ -52,3 +52,23 @@ export interface LinkModel<T> {
|
||||
export interface LinkModelSupplier<T extends object> {
|
||||
getLinks(scopedVars?: any): Array<LinkModel<T>>;
|
||||
}
|
||||
|
||||
export enum VariableOrigin {
|
||||
Series = 'series',
|
||||
Field = 'field',
|
||||
Fields = 'fields',
|
||||
Value = 'value',
|
||||
BuiltIn = 'built-in',
|
||||
Template = 'template',
|
||||
}
|
||||
|
||||
export interface VariableSuggestion {
|
||||
value: string;
|
||||
label: string;
|
||||
documentation?: string;
|
||||
origin: VariableOrigin;
|
||||
}
|
||||
|
||||
export enum VariableSuggestionsScope {
|
||||
Values = 'values',
|
||||
}
|
||||
|
@@ -1,8 +1,7 @@
|
||||
import { MatcherConfig, FieldConfig, Field } from '../types';
|
||||
import { Registry, RegistryItem } from '../utils';
|
||||
import { ComponentType } from 'react';
|
||||
import { MatcherConfig, FieldConfig, Field, DataFrame, VariableSuggestion, VariableSuggestionsScope } from '../types';
|
||||
import { Registry, RegistryItem } from '../utils';
|
||||
import { InterpolateFunction } from './panel';
|
||||
import { DataFrame } from 'apache-arrow';
|
||||
|
||||
export interface DynamicConfigValue {
|
||||
prop: string;
|
||||
@@ -26,18 +25,20 @@ export interface FieldConfigSource {
|
||||
export interface FieldConfigEditorProps<TValue, TSettings> {
|
||||
item: FieldPropertyEditorItem<TValue, TSettings>; // The property info
|
||||
value: TValue;
|
||||
context: FieldOverrideContext;
|
||||
onChange: (value?: TValue) => void;
|
||||
}
|
||||
|
||||
export interface FieldOverrideContext {
|
||||
field: Field;
|
||||
data: DataFrame;
|
||||
replaceVariables: InterpolateFunction;
|
||||
data: DataFrame[];
|
||||
field?: Field;
|
||||
replaceVariables?: InterpolateFunction;
|
||||
getSuggestions?: (scope?: VariableSuggestionsScope) => VariableSuggestion[];
|
||||
}
|
||||
|
||||
export interface FieldOverrideEditorProps<TValue, TSettings> {
|
||||
item: FieldPropertyEditorItem<TValue, TSettings>;
|
||||
value: any;
|
||||
value: TValue;
|
||||
context: FieldOverrideContext;
|
||||
onChange: (value?: any) => void;
|
||||
}
|
||||
|
Reference in New Issue
Block a user