mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Correlations: Add transformation editor (#66217)
* There was an attempt * Change disabled state based on transformation type * Add validation to transformation type * Revert "Add validation to transformation type" This reverts commit 2188a3d9a93aec5eeafcdd40510391ba1a53671a. * Add validation to transformation type * Move transformations editor to a separate file * Make name more descriptive * Ensure type dropdown has always the same width * Add tooltips around transformation options * Slight style changes * Remove autofocus on append, integrate read only to transformationeditor, save values that disappear so they come back * Remove yaml changes * Have variable background color work with alternating colors on different themes * Make expression required for regular expressions * Remove unused empty form object * Fix bug about transformation’s values saved in memory * Better validation formatting for expression * Add labels and (for now) non working test, attempt to fix saved transformation delete/add bug * Fix datalink comment * Remove fancy CSS due to background change * Fix deleting saved transformation bug, finish tests * Consolidate transformation types * Double check aria labels * Change aria labels, fix tests * Add a transformation with the create correlation test --------- Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
This commit is contained in:
@@ -52,15 +52,20 @@ export interface DataLink<T extends DataQuery = any> {
|
||||
origin?: DataLinkConfigOrigin;
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export enum SupportedTransformationTypes {
|
||||
/**
|
||||
* We provide tooltips with information about these to guide the user, please
|
||||
* check for validity when adding more transformation types.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export enum SupportedTransformationType {
|
||||
Regex = 'regex',
|
||||
Logfmt = 'logfmt',
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export interface DataLinkTransformationConfig {
|
||||
type: SupportedTransformationTypes;
|
||||
type: SupportedTransformationType;
|
||||
field?: string;
|
||||
expression?: string;
|
||||
mapValue?: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { UseFormReturn, FieldValues, FieldErrors } from 'react-hook-form';
|
||||
import { UseFormReturn, FieldValues, FieldErrors, FieldArrayMethodProps } from 'react-hook-form';
|
||||
export type { SubmitHandler as FormsOnSubmit, FieldErrors as FormFieldErrors } from 'react-hook-form';
|
||||
|
||||
export type FormAPI<T extends FieldValues> = Omit<UseFormReturn<T>, 'trigger' | 'handleSubmit'> & {
|
||||
@@ -9,7 +9,7 @@ type FieldArrayValue = Partial<FieldValues> | Array<Partial<FieldValues>>;
|
||||
|
||||
export interface FieldArrayApi {
|
||||
fields: Array<Record<string, any>>;
|
||||
append: (value: FieldArrayValue) => void;
|
||||
append: (value: FieldArrayValue, options?: FieldArrayMethodProps) => void;
|
||||
prepend: (value: FieldArrayValue) => void;
|
||||
remove: (index?: number | number[]) => void;
|
||||
swap: (indexA: number, indexB: number) => void;
|
||||
|
||||
Reference in New Issue
Block a user