diff --git a/public/components/event_analytics/explorer/events_views/doc_flyout.tsx b/public/components/event_analytics/explorer/events_views/doc_flyout.tsx index beba69089c..e7183cc4a0 100644 --- a/public/components/event_analytics/explorer/events_views/doc_flyout.tsx +++ b/public/components/event_analytics/explorer/events_views/doc_flyout.tsx @@ -123,14 +123,16 @@ export const DocFlyout = ({ const flyoutBody = ( - {populateDataGrid( - explorerFields, - getHeaders(explorerFields.queriedFields, DEFAULT_COLUMNS.slice(1), true), - {memorizedTds}, - getHeaders(explorerFields.selectedFields, DEFAULT_COLUMNS.slice(1), true), - {memorizedTds} - )} - +
+ {populateDataGrid( + explorerFields, + getHeaders(explorerFields.queriedFields, DEFAULT_COLUMNS.slice(1), true), + {memorizedTds}, + getHeaders(explorerFields.selectedFields, DEFAULT_COLUMNS.slice(1), true), + {memorizedTds} + )} + +
); diff --git a/public/components/event_analytics/explorer/events_views/surrounding_flyout.tsx b/public/components/event_analytics/explorer/events_views/surrounding_flyout.tsx index 4c67c3e199..e7fe8d9899 100644 --- a/public/components/event_analytics/explorer/events_views/surrounding_flyout.tsx +++ b/public/components/event_analytics/explorer/events_views/surrounding_flyout.tsx @@ -124,9 +124,11 @@ export const SurroundingFlyout = ({ }; const loadButton = (typeOfDocs: 'new' | 'old') => { - typeOfDocs === 'new' - ? loadData(typeOfDocs, numNewEvents + 5) - : loadData(typeOfDocs, valueOldEvents + 5); + if (typeOfDocs === 'new') { + loadData(typeOfDocs, numNewEvents + 5); + } else { + loadData(typeOfDocs, valueOldEvents + 5); + } }; const handleKeyDown = ( @@ -139,11 +141,11 @@ export const SurroundingFlyout = ({ }; const onChangeNewEvents = (e: React.ChangeEvent) => { - setNumNewEvents(parseInt(e.target.value)); + setNumNewEvents(parseInt(e.target.value, 10)); }; const onChangeOldEvents = (e: React.ChangeEvent) => { - setNumOldEvents(parseInt(e.target.value)); + setNumOldEvents(parseInt(e.target.value, 10)); }; const flyoutHeader = ( @@ -227,35 +229,37 @@ export const SurroundingFlyout = ({ const flyoutBody = ( - {getInputForm('arrowUp', onChangeNewEvents, numNewEvents, 'new')} - -
- {newEventsError !== '' && ( - - )} -
- {populateDataGrid( - explorerFields, - getHeaders(explorerFields.queriedFields, DEFAULT_COLUMNS.slice(1), true), - <> - {newEventsData} - {memorizedTds} - {oldEventsData} - , - getHeaders(explorerFields.selectedFields, DEFAULT_COLUMNS.slice(1), true), - <> - {newEventsData} - {memorizedTds} - {oldEventsData} - - )} -
- {oldEventsError !== '' && ( - +
+ {getInputForm('arrowUp', onChangeNewEvents, numNewEvents, 'new')} + +
+ {newEventsError !== '' && ( + + )} +
+ {populateDataGrid( + explorerFields, + getHeaders(explorerFields.queriedFields, DEFAULT_COLUMNS.slice(1), true), + <> + {newEventsData} + {memorizedTds} + {oldEventsData} + , + getHeaders(explorerFields.selectedFields, DEFAULT_COLUMNS.slice(1), true), + <> + {newEventsData} + {memorizedTds} + {oldEventsData} + )} +
+ {oldEventsError !== '' && ( + + )} +
+ + {getInputForm('arrowDown', onChangeOldEvents, valueOldEvents, 'old')}
- - {getInputForm('arrowDown', onChangeOldEvents, valueOldEvents, 'old')} );