mirror of
https://github.com/grafana/grafana.git
synced 2025-09-27 09:03:49 +08:00

* add support for code editor and builder * refactor cloudwatch migration * Add tooltip to editor field (#56) * add tooltip * add old tooltips * Bug bash feedback fixes (#58) * make ASC the default option * update sql preview whenever sql changes * don't allow queries without aggregation * set default value for aggregation * use new input field * cleanup * pr feedback * prevent unnecessary rerenders * use frame error instead of main error * remove not used snapshot * Use dimension filter in schema picker (#63) * use dimension key filter in group by and schema labels * add dimension filter also to code editor * add tests * fix build error * fix strict error * remove debug code * fix annotation editor (#64) * fix annotation editor * fix broken test * revert annotation backend change * PR feedback (#67) * pr feedback * removed dimension filter from group by * add spacing between common fields and rest * do not generate deep link for metric queries (#70) * update docs (#69) Co-authored-by: Erik Sundell <erik.sundell87@gmail.com> * fix lint problem caused by merge conflict Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
67 lines
1.8 KiB
TypeScript
67 lines
1.8 KiB
TypeScript
export enum QueryEditorPropertyType {
|
|
String = 'string',
|
|
}
|
|
|
|
export interface QueryEditorProperty {
|
|
type: QueryEditorPropertyType;
|
|
name?: string;
|
|
}
|
|
|
|
export type QueryEditorOperatorType = string | boolean | number;
|
|
type QueryEditorOperatorValueType = QueryEditorOperatorType | QueryEditorOperatorType[];
|
|
|
|
export interface QueryEditorOperator<T extends QueryEditorOperatorValueType> {
|
|
name?: string;
|
|
value?: T;
|
|
}
|
|
|
|
export interface QueryEditorOperatorExpression {
|
|
type: QueryEditorExpressionType.Operator;
|
|
property: QueryEditorProperty;
|
|
operator: QueryEditorOperator<QueryEditorOperatorValueType>;
|
|
}
|
|
|
|
export interface QueryEditorArrayExpression {
|
|
type: QueryEditorExpressionType.And | QueryEditorExpressionType.Or;
|
|
expressions: QueryEditorExpression[] | QueryEditorArrayExpression[];
|
|
}
|
|
|
|
export interface QueryEditorPropertyExpression {
|
|
type: QueryEditorExpressionType.Property;
|
|
property: QueryEditorProperty;
|
|
}
|
|
|
|
export enum QueryEditorExpressionType {
|
|
Property = 'property',
|
|
Operator = 'operator',
|
|
Or = 'or',
|
|
And = 'and',
|
|
GroupBy = 'groupBy',
|
|
Function = 'function',
|
|
FunctionParameter = 'functionParameter',
|
|
}
|
|
|
|
export type QueryEditorExpression =
|
|
| QueryEditorArrayExpression
|
|
| QueryEditorPropertyExpression
|
|
| QueryEditorGroupByExpression
|
|
| QueryEditorFunctionExpression
|
|
| QueryEditorFunctionParameterExpression
|
|
| QueryEditorOperatorExpression;
|
|
|
|
export interface QueryEditorGroupByExpression {
|
|
type: QueryEditorExpressionType.GroupBy;
|
|
property: QueryEditorProperty;
|
|
}
|
|
|
|
export interface QueryEditorFunctionExpression {
|
|
type: QueryEditorExpressionType.Function;
|
|
name?: string;
|
|
parameters?: QueryEditorFunctionParameterExpression[];
|
|
}
|
|
|
|
export interface QueryEditorFunctionParameterExpression {
|
|
type: QueryEditorExpressionType.FunctionParameter;
|
|
name?: string;
|
|
}
|