From c9732d083579777a1a1ba5021458b14f6c4c63f3 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 09:42:32 -0700 Subject: [PATCH] Quiet react-dnd draggableId/droppableId warnings. (#1147) (#1167) * Quiet react-dnd draggableId/droppableId warnings. Fix countDistribution access error when countDistribution not available. --------- (cherry picked from commit ddb697a180091d98a91f876065eb1a9ff2c27f65) Signed-off-by: Peter Fitzgibbons Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- .../event_analytics/explorer/explorer.tsx | 4 +- .../__snapshots__/sidebar.test.tsx.snap | 380 +++++++++--------- .../explorer/sidebar/sidebar.tsx | 10 +- 3 files changed, 197 insertions(+), 197 deletions(-) diff --git a/public/components/event_analytics/explorer/explorer.tsx b/public/components/event_analytics/explorer/explorer.tsx index 0f60b71c51..5053c38ebb 100644 --- a/public/components/event_analytics/explorer/explorer.tsx +++ b/public/components/event_analytics/explorer/explorer.tsx @@ -496,7 +496,7 @@ export const Explorer = ({ {countDistribution?.data && !isLiveTailOnRef.current && ( <> {}} /> @@ -577,7 +577,7 @@ export const Explorer = ({ explorerFields={explorerFields} timeStampField={queryRef.current![SELECTED_TIMESTAMP]} rawQuery={appBasedRef.current || queryRef.current![RAW_QUERY]} - totalHits={_.sum(countDistribution.data['count()'])} + totalHits={_.sum(countDistribution.data?.['count()'])} requestParams={requestParams} startTime={appLogEvents ? startTime : dateRange[0]} endTime={appLogEvents ? endTime : dateRange[1]} diff --git a/public/components/event_analytics/explorer/sidebar/__tests__/__snapshots__/sidebar.test.tsx.snap b/public/components/event_analytics/explorer/sidebar/__tests__/__snapshots__/sidebar.test.tsx.snap index fae58502a7..afc799306d 100644 --- a/public/components/event_analytics/explorer/sidebar/__tests__/__snapshots__/sidebar.test.tsx.snap +++ b/public/components/event_analytics/explorer/sidebar/__tests__/__snapshots__/sidebar.test.tsx.snap @@ -1048,21 +1048,21 @@ exports[`Siderbar component Renders sidebar component 1`] = `
{ data-attr-field={field.name} className="dscSidebar__item sidebar_content" index={index} - draggableId={field.name} + draggableId={`queriedField-${field.name}`} > { className="dscSidebarList explorerFieldList--selected" aria-labelledby="selected_fields" data-test-subj={`fieldList-selected`} - droppableId="" + droppableId="selectedFields-drop" spacing="m" > {explorerData && @@ -243,7 +243,7 @@ export const Sidebar = (props: ISidebarProps) => { data-attr-field={field.name} className="dscSidebar__item sidebar_content" index={index} - draggableId="" + draggableId={`selectedField-${field.name}`} > { }`} aria-labelledby="available_fields" data-test-subj={`fieldList-unpopular`} - droppableId="" + droppableId="unpopularFields-drop" spacing="m" > {storedExplorerFields?.availableFields && @@ -298,7 +298,7 @@ export const Sidebar = (props: ISidebarProps) => { data-attr-field={field.name} className="dscSidebar__item sidebar_content" index={index} - draggableId="" + draggableId={`availableField-field${field.name}`} >