From ee6c3b6255af8404ff8880249107957962edbac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ida=20=C5=A0tambuk?= Date: Thu, 10 Apr 2025 14:56:13 +0200 Subject: [PATCH] ElasticSearch: Make script field input a text area (#103708) --- .betterer.results | 3 --- .../BucketScriptSettingsEditor/index.tsx | 1 + .../SettingsEditor/SettingField.tsx | 25 +++++++++++++------ .../SettingsEditor/index.tsx | 10 ++++++-- .../QueryEditor/SettingsEditorContainer.tsx | 14 +++++++++-- 5 files changed, 39 insertions(+), 14 deletions(-) diff --git a/.betterer.results b/.betterer.results index e358c837c8c..d032dca6159 100644 --- a/.betterer.results +++ b/.betterer.results @@ -4433,9 +4433,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/elasticsearch/components/QueryEditor/SettingsEditorContainer.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/elasticsearch/configuration/DataLinks.tsx: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/elasticsearch/components/QueryEditor/MetricAggregationsEditor/SettingsEditor/BucketScriptSettingsEditor/index.tsx b/public/app/plugins/datasource/elasticsearch/components/QueryEditor/MetricAggregationsEditor/SettingsEditor/BucketScriptSettingsEditor/index.tsx index bbd855d3f86..62f38e2820b 100644 --- a/public/app/plugins/datasource/elasticsearch/components/QueryEditor/MetricAggregationsEditor/SettingsEditor/BucketScriptSettingsEditor/index.tsx +++ b/public/app/plugins/datasource/elasticsearch/components/QueryEditor/MetricAggregationsEditor/SettingsEditor/BucketScriptSettingsEditor/index.tsx @@ -101,6 +101,7 @@ export const BucketScriptSettingsEditor = ({ value, previousMetrics }: Props) => ['placeholder']; tooltip?: ComponentProps['tooltip']; + inputType?: 'input' | 'textarea'; } export function SettingField>({ @@ -23,6 +24,7 @@ export function SettingField) { const dispatch = useDispatch(); const [id] = useState(uniqueId(`es-field-id-`)); @@ -36,12 +38,21 @@ export function SettingField - dispatch(changeMetricSetting({ metric, settingName, newValue: e.target.value }))} - defaultValue={defaultValue} - /> + {inputType === 'textarea' ? ( +