From 5793db031af6fddf45d9f486ea3c0d265174ad6b Mon Sep 17 00:00:00 2001 From: Paul Sebastian Date: Fri, 20 Oct 2023 10:33:13 -0700 Subject: [PATCH] pr requested changes Signed-off-by: Paul Sebastian --- .../explorer/sidebar/sidebar.tsx | 19 ++++--------------- .../data_configurations_panel.tsx | 1 - 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/public/components/event_analytics/explorer/sidebar/sidebar.tsx b/public/components/event_analytics/explorer/sidebar/sidebar.tsx index 687815f6e6..71049987fd 100644 --- a/public/components/event_analytics/explorer/sidebar/sidebar.tsx +++ b/public/components/event_analytics/explorer/sidebar/sidebar.tsx @@ -54,13 +54,13 @@ export const Sidebar = (props: ISidebarProps) => { const [showFields, setShowFields] = useState(false); const [searchTerm, setSearchTerm] = useState(''); - // list of every single field object - const [allFields, setAllFields] = useState([]); - // method to return the type of a field from its name const getFieldTypes = (newFieldName: string) => { let fieldType: string = ''; - allFields.map((field) => { + explorerFields.availableFields.map((field) => { + if (field.name === newFieldName) fieldType = field.type; + }); + explorerFields.selectedFields.map((field) => { if (field.name === newFieldName) fieldType = field.type; }); return fieldType; @@ -129,17 +129,6 @@ export const Sidebar = (props: ISidebarProps) => { [explorerFields, tabId] ); - // this useEffect will set allFields when the page is rendered - useEffect(() => { - if ( - explorerFields.availableFields.length > 0 && - explorerFields.selectedFields.length === 0 && - allFields.length === 0 - ) { - setAllFields(explorerFields.availableFields); - } - }, [explorerFields.availableFields]); - const onDragEnd = ({ destination, source, diff --git a/public/components/event_analytics/explorer/visualizations/config_panel/config_panes/config_controls/data_configurations_panel.tsx b/public/components/event_analytics/explorer/visualizations/config_panel/config_panes/config_controls/data_configurations_panel.tsx index 24e10d5d3b..d55fedc850 100644 --- a/public/components/event_analytics/explorer/visualizations/config_panel/config_panes/config_controls/data_configurations_panel.tsx +++ b/public/components/event_analytics/explorer/visualizations/config_panel/config_panes/config_controls/data_configurations_panel.tsx @@ -577,7 +577,6 @@ export const DataConfigPanelItem = ({ {getNumberField('bucketOffset')} )} - {/* */}