From e5f979d10674d451de02286708449fc87c7adf36 Mon Sep 17 00:00:00 2001 From: Pablo Lara Date: Thu, 20 Feb 2025 09:33:03 +0100 Subject: [PATCH] chore(findings): add 'Status Extended' attribute to finding details (#6997) --- ui/actions/users/users.ts | 2 +- .../findings/table/finding-detail.tsx | 8 +- .../table/finding-detail.tsx | 227 ------------------ 3 files changed, 7 insertions(+), 230 deletions(-) delete mode 100644 ui/components/overview/new-findings-table/table/finding-detail.tsx diff --git a/ui/actions/users/users.ts b/ui/actions/users/users.ts index f77e7c3ab1..793389b353 100644 --- a/ui/actions/users/users.ts +++ b/ui/actions/users/users.ts @@ -4,7 +4,7 @@ import { revalidatePath } from "next/cache"; import { redirect } from "next/navigation"; import { auth } from "@/auth.config"; -import { getErrorMessage, parseStringify, wait } from "@/lib"; +import { getErrorMessage, parseStringify } from "@/lib"; export const getUsers = async ({ page = 1, diff --git a/ui/components/findings/table/finding-detail.tsx b/ui/components/findings/table/finding-detail.tsx index bc1d9e6992..ee2a399cb6 100644 --- a/ui/components/findings/table/finding-detail.tsx +++ b/ui/components/findings/table/finding-detail.tsx @@ -102,7 +102,7 @@ export const FindingDetail = ({
{attributes.check_id} @@ -116,7 +116,7 @@ export const FindingDetail = ({ {attributes.status === "FAIL" && ( + + {renderValue(attributes.status_extended)} + + {attributes.check_metadata.remediation && (

diff --git a/ui/components/overview/new-findings-table/table/finding-detail.tsx b/ui/components/overview/new-findings-table/table/finding-detail.tsx deleted file mode 100644 index 71927e520b..0000000000 --- a/ui/components/overview/new-findings-table/table/finding-detail.tsx +++ /dev/null @@ -1,227 +0,0 @@ -"use client"; - -import { Snippet } from "@nextui-org/react"; -import Link from "next/link"; - -import { SnippetId } from "@/components/ui/entities"; -import { DateWithTime } from "@/components/ui/entities/date-with-time"; -import { SeverityBadge } from "@/components/ui/table/severity-badge"; -import { FindingProps } from "@/types"; - -export const FindingDetail = ({ - findingDetails, -}: { - findingDetails: FindingProps; -}) => { - const finding = findingDetails; - const attributes = finding.attributes; - const resource = finding.relationships.resource.attributes; - - const remediation = attributes.check_metadata.remediation; - - return ( -
- {/* Header */} -
-
-

- {attributes.check_metadata.checktitle} -

-

- {resource.service} -

-
-
- {attributes.status} -
-
- - {/* Check Metadata */} -
-
-

- Finding details -

- -
- {attributes.status === "FAIL" && ( - -

- Risk -

-

- {attributes.check_metadata.risk} -

-
- )} - -
-

- Description -

-

- {attributes.check_metadata.description} -

-
- -
-

- Remediation -

-
- {remediation.recommendation && ( - <> -

Recommendation:

-

{remediation.recommendation.text}

- - Learn more - - - )} - {remediation.code && - Object.values(remediation.code).some(Boolean) && ( -
-

- Reference Information: -

-
- {remediation.code.cli && ( -
-

CLI Command:

- -

- {remediation.code.cli} -

-
-
- )} -
- {Object.entries(remediation.code) - .filter(([key]) => key !== "cli") - .map(([key, value]) => - value ? ( - - {key === "other" - ? "External doc" - : key.charAt(0).toUpperCase() + - key.slice(1).toLowerCase()} - - ) : null, - )} -
-
-
- )} -
-
-
- - {/* Resources Section */} -
-

- Resource Details -

-
-
-

- Resource ID -

- -

{resource.uid}

-
-
-
-

- Resource Name -

-

- {resource.name} -

-
-
-

- Region -

-

- {resource.region} -

-
-
-

- Resource Type -

-

- {resource.type} -

-
-
-

- Severity -

- -
- {resource.tags && - Object.entries(resource.tags).map(([key, value]) => ( -
-

- Tag: {key} -

- -

{value}

-
-
- ))} -
-
-

- First seen -

- -
-
-

- Last seen -

- -
-
-
-
-
- ); -};