From fd10bfbc15d860d1b52922dd154f49d1a1a4780f Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 4 Oct 2024 02:56:18 +0530 Subject: [PATCH] Bug fixes for threat intel, duplicate findings, and breadcrumbs path (#1176) (#1177) * fix spacing for threat intel * fix alienvault source details page crash * fix threat intel findings widget view view all url crash * fix security analtyics breadcrumbs link path crash * fix duplicate findings --------- (cherry picked from commit 0ce91fbe36e316516022e31baa5a77f4336f0f50) Signed-off-by: Joanne Wang Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- .../RecentThreatIntelFindingsWidget.tsx | 19 +++++++++---------- .../ThreatIntelSourceDetails.tsx | 13 +++++++++---- .../ThreatIntelSourcesList.tsx | 7 +++++-- public/store/FindingsStore.ts | 4 ++++ public/utils/constants.ts | 2 +- 5 files changed, 28 insertions(+), 17 deletions(-) diff --git a/public/pages/Overview/components/Widgets/RecentThreatIntelFindingsWidget.tsx b/public/pages/Overview/components/Widgets/RecentThreatIntelFindingsWidget.tsx index c4e48b66..f11dff12 100644 --- a/public/pages/Overview/components/Widgets/RecentThreatIntelFindingsWidget.tsx +++ b/public/pages/Overview/components/Widgets/RecentThreatIntelFindingsWidget.tsx @@ -16,7 +16,7 @@ import { TableWidget } from './TableWidget'; import { WidgetContainer } from './WidgetContainer'; import { renderTime } from '../../../../utils/helpers'; import { ThreatIntelFinding } from '../../../../../types'; -import { getApplication } from '../../../../services/utils/constants'; +import { getApplication, getUseUpdatedUx } from '../../../../services/utils/constants'; import { IocLabel, ThreatIntelIocType } from '../../../../../common/constants'; const columns: EuiBasicTableColumn[] = [ @@ -78,17 +78,16 @@ export const RecentThreatIntelFindingsWidget: React.FC [ - getApplication().navigateToUrl(threatIntelFindingsUrl)}> + const actions = React.useMemo(() => { + const baseUrl = getUseUpdatedUx() ? getApplication().getUrlForApp(FINDINGS_NAV_ID) : ''; + return [ + View all , - ], - [] - ); + ]; + }, []); return ( diff --git a/public/pages/ThreatIntel/components/ThreatIntelSourceDetails/ThreatIntelSourceDetails.tsx b/public/pages/ThreatIntel/components/ThreatIntelSourceDetails/ThreatIntelSourceDetails.tsx index d38f5994..2462d3d2 100644 --- a/public/pages/ThreatIntel/components/ThreatIntelSourceDetails/ThreatIntelSourceDetails.tsx +++ b/public/pages/ThreatIntel/components/ThreatIntelSourceDetails/ThreatIntelSourceDetails.tsx @@ -333,12 +333,12 @@ export const ThreatIntelSourceDetails: React.FC = )} {type === 'URL_DOWNLOAD' && ( - - + - + )} <> @@ -374,7 +374,12 @@ export const ThreatIntelSourceDetails: React.FC = Discard - + Save diff --git a/public/pages/ThreatIntel/components/ThreatIntelSourcesList/ThreatIntelSourcesList.tsx b/public/pages/ThreatIntel/components/ThreatIntelSourcesList/ThreatIntelSourcesList.tsx index 1c794786..86631ad7 100644 --- a/public/pages/ThreatIntel/components/ThreatIntelSourcesList/ThreatIntelSourcesList.tsx +++ b/public/pages/ThreatIntel/components/ThreatIntelSourcesList/ThreatIntelSourcesList.tsx @@ -34,7 +34,6 @@ export const ThreatIntelSourcesList: React.FC = ({ }) => { return ( - @@ -97,7 +96,11 @@ export const ThreatIntelSourcesList: React.FC = ({ {threatIntelSources.length === 0 && (

No threat intel source present

} + title={ + +

No threat intel source present

+
+ } actions={[ `notifications-dashboards#/channels-details/${channelId}`; export const BREADCRUMBS = Object.freeze({ - SECURITY_ANALYTICS: { text: 'Security Analytics', href: '#/' }, + SECURITY_ANALYTICS: { text: 'Security Analytics', href: `#${ROUTES.OVERVIEW}` }, OVERVIEW: { text: 'Overview', href: `#${ROUTES.OVERVIEW}` }, GETTING_STARTED: { text: 'Getting started', href: `#${ROUTES.GETTING_STARTED}` }, FINDINGS: { text: 'Findings', href: `#${ROUTES.FINDINGS}` },