From 1394b3341fd729db069d244aec227b9b2cd070dc Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Wed, 21 Feb 2024 20:07:40 +0530 Subject: [PATCH] Chore: Remove gf-form from datasource/loki and datasource/cloud-monitoring (#80117) * Chore: Remove gf-form from datasource/loki * remove query field * update betterer --- .betterer.results | 15 --------- .../components/AnnotationsHelp.tsx | 2 +- .../components/AnnotationsQueryEditor.tsx | 11 +++---- .../loki/components/LokiOptionFields.tsx | 33 ++++--------------- 4 files changed, 13 insertions(+), 48 deletions(-) diff --git a/.betterer.results b/.betterer.results index bc20a910898..5c20e6abc90 100644 --- a/.betterer.results +++ b/.betterer.results @@ -5231,10 +5231,6 @@ exports[`better eslint`] = { [0, 0, 0, "Styles should be written using objects.", "12"], [0, 0, 0, "Styles should be written using objects.", "13"] ], - "public/app/plugins/datasource/loki/components/LokiOptionFields.tsx:5381": [ - [0, 0, 0, "Styles should be written using objects.", "0"], - [0, 0, 0, "Styles should be written using objects.", "1"] - ], "public/app/plugins/datasource/loki/components/monaco-query-field/MonacoQueryField.tsx:5381": [ [0, 0, 0, "Styles should be written using objects.", "0"], [0, 0, 0, "Styles should be written using objects.", "1"] @@ -6843,9 +6839,6 @@ exports[`no gf-form usage`] = { [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"], [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"] ], - "public/app/plugins/datasource/cloud-monitoring/components/AnnotationsHelp.tsx:5381": [ - [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"] - ], "public/app/plugins/datasource/cloudwatch/components/ConfigEditor/ConfigEditor.tsx:5381": [ [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"] ], @@ -6935,14 +6928,6 @@ exports[`no gf-form usage`] = { [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"], [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"] ], - "public/app/plugins/datasource/loki/components/AnnotationsQueryEditor.tsx:5381": [ - [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"] - ], - "public/app/plugins/datasource/loki/components/LokiOptionFields.tsx:5381": [ - [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"], - [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"], - [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"] - ], "public/app/plugins/datasource/loki/components/LokiQueryField.tsx:5381": [ [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"], [0, 0, 0, "gf-form usage has been deprecated. Use a component from @grafana/ui or custom CSS instead.", "5381"], diff --git a/public/app/plugins/datasource/cloud-monitoring/components/AnnotationsHelp.tsx b/public/app/plugins/datasource/cloud-monitoring/components/AnnotationsHelp.tsx index a9ba642e397..8970adbe0a2 100644 --- a/public/app/plugins/datasource/cloud-monitoring/components/AnnotationsHelp.tsx +++ b/public/app/plugins/datasource/cloud-monitoring/components/AnnotationsHelp.tsx @@ -2,7 +2,7 @@ import React from 'react'; export const AnnotationsHelp = () => { return ( -
+
Annotation Query Format

diff --git a/public/app/plugins/datasource/loki/components/AnnotationsQueryEditor.tsx b/public/app/plugins/datasource/loki/components/AnnotationsQueryEditor.tsx index 3970e45497a..670288224aa 100644 --- a/public/app/plugins/datasource/loki/components/AnnotationsQueryEditor.tsx +++ b/public/app/plugins/datasource/loki/components/AnnotationsQueryEditor.tsx @@ -3,7 +3,7 @@ import React, { memo } from 'react'; import { AnnotationQuery } from '@grafana/data'; import { EditorField, EditorRow } from '@grafana/experimental'; -import { Input } from '@grafana/ui'; +import { Input, Stack } from '@grafana/ui'; // Types import { getNormalizedLokiQuery } from '../queryUtils'; @@ -49,8 +49,8 @@ export const LokiAnnotationsQueryEditor = memo(function LokiAnnotationQueryEdito queryType: annotation.queryType, }; return ( - <> -

+ + } /> -
- + - + ); }); diff --git a/public/app/plugins/datasource/loki/components/LokiOptionFields.tsx b/public/app/plugins/datasource/loki/components/LokiOptionFields.tsx index 9b025f29b53..8bada9ae24e 100644 --- a/public/app/plugins/datasource/loki/components/LokiOptionFields.tsx +++ b/public/app/plugins/datasource/loki/components/LokiOptionFields.tsx @@ -1,12 +1,11 @@ // Libraries -import { css, cx } from '@emotion/css'; import { map } from 'lodash'; import React, { memo } from 'react'; // Types import { SelectableValue } from '@grafana/data'; import { config } from '@grafana/runtime'; -import { InlineFormLabel, RadioButtonGroup, InlineField, Input, Select } from '@grafana/ui'; +import { InlineFormLabel, RadioButtonGroup, InlineField, Input, Select, Stack } from '@grafana/ui'; import { getLokiQueryType } from '../queryUtils'; import { LokiQuery, LokiQueryType } from '../types'; @@ -82,18 +81,9 @@ export function LokiOptionFields(props: LokiOptionFieldsProps) { } return ( -
+ {/*Query type field*/} -
+ Query type -
+
{/*Line limit field*/} -
+ -
-
+ + ); }