From 7cfd979cc110cc5a557fb718cbe8618eb4462638 Mon Sep 17 00:00:00 2001 From: Giordano Ricci Date: Tue, 4 May 2021 16:23:19 +0100 Subject: [PATCH] Chore: remove usages of FunctionComponent in elasticsearch plugin (#33175) --- .../elasticsearch/components/AddRemove.tsx | 4 ++-- .../elasticsearch/components/IconButton.tsx | 6 +++--- .../elasticsearch/components/MetricPicker.tsx | 4 ++-- .../BucketAggregationEditor.tsx | 4 ++-- .../SettingsEditor/FiltersSettingsEditor/index.tsx | 4 ++-- .../SettingsEditor/index.tsx | 4 ++-- .../QueryEditor/BucketAggregationsEditor/index.tsx | 4 ++-- .../QueryEditor/ElasticsearchQueryContext.test.tsx | 4 ++-- .../QueryEditor/ElasticsearchQueryContext.tsx | 6 +++--- .../MetricAggregationsEditor/MetricEditor.test.tsx | 6 +++--- .../MetricAggregationsEditor/MetricEditor.tsx | 4 ++-- .../BucketScriptSettingsEditor/index.tsx | 4 ++-- .../SettingsEditor/MovingAverageSettingsEditor.tsx | 4 ++-- .../SettingsEditor/index.tsx | 6 +++--- .../QueryEditor/MetricAggregationsEditor/index.tsx | 4 ++-- .../components/QueryEditor/QueryEditorRow.tsx | 6 +++--- .../QueryEditor/SettingsEditorContainer.tsx | 4 ++-- .../elasticsearch/components/QueryEditor/index.tsx | 12 +++--------- .../elasticsearch/hooks/useFields.test.tsx | 4 ++-- .../elasticsearch/hooks/useNextId.test.tsx | 4 ++-- .../elasticsearch/hooks/useStatelessReducer.test.tsx | 4 ++-- 21 files changed, 48 insertions(+), 54 deletions(-) diff --git a/public/app/plugins/datasource/elasticsearch/components/AddRemove.tsx b/public/app/plugins/datasource/elasticsearch/components/AddRemove.tsx index db7c398497d..4e210830ea0 100644 --- a/public/app/plugins/datasource/elasticsearch/components/AddRemove.tsx +++ b/public/app/plugins/datasource/elasticsearch/components/AddRemove.tsx @@ -1,5 +1,5 @@ import { css } from '@emotion/css'; -import React, { FunctionComponent } from 'react'; +import React from 'react'; import { IconButton } from './IconButton'; interface Props { @@ -13,7 +13,7 @@ interface Props { * A component used to show add & remove buttons for mutable lists of values. Wether to show or not the add or the remove buttons * depends on the `index` and `elements` props. This enforces a consistent experience whenever this pattern is used. */ -export const AddRemove: FunctionComponent = ({ index, onAdd, onRemove, elements }) => { +export const AddRemove = ({ index, onAdd, onRemove, elements }: Props) => { return (
> = ({ +export const IconButton = ({ iconName, onClick, className, label, ...buttonProps -}) => ( +}: Props & ButtonHTMLAttributes) => (