diff --git a/components/findings/table/column-findings.tsx b/components/findings/table/column-findings.tsx index 20d7d6198b..d8d02ae9c2 100644 --- a/components/findings/table/column-findings.tsx +++ b/components/findings/table/column-findings.tsx @@ -4,21 +4,20 @@ import { ColumnDef } from "@tanstack/react-table"; import { DateWithTime } from "@/components/ui/entities"; import { DataTableColumnHeader, StatusBadge } from "@/components/ui/table"; -import { FindingsProps } from "@/types"; +import { FindingProps } from "@/types"; import { DataTableRowActions } from "./data-table-row-actions"; -const getFindingsData = (row: { original: FindingsProps }) => { +const getFindingsData = (row: { original: FindingProps }) => { console.log(row.original); - return row.original; }; -const getFindingsMetadata = (row: { original: FindingsProps }) => { - return row.original.attributes.check_metadata.metadata; +const getFindingsMetadata = (row: { original: FindingProps }) => { + return row.original.attributes.check_metadata; }; -export const ColumnFindings: ColumnDef[] = [ +export const ColumnFindings: ColumnDef[] = [ // { // header: " ", // cell: ({ row }) =>

{row.index + 1}

, @@ -29,8 +28,8 @@ export const ColumnFindings: ColumnDef[] = [ ), cell: ({ row }) => { - const { CheckTitle } = getFindingsMetadata(row); - return

{CheckTitle}

; + const { checktitle } = getFindingsMetadata(row); + return

{checktitle}

; }, }, // { @@ -79,8 +78,8 @@ export const ColumnFindings: ColumnDef[] = [ /> ), cell: ({ row }) => { - const { ServiceName } = getFindingsMetadata(row); - return

{ServiceName}

; + const { servicename } = getFindingsMetadata(row); + return

{servicename}

; }, }, { diff --git a/types/components.ts b/types/components.ts index 392a252335..3164bcf3c9 100644 --- a/types/components.ts +++ b/types/components.ts @@ -107,7 +107,7 @@ export interface ScanProps { }; } -export interface FindingsProps { +export interface FindingProps { type: "Findings"; id: string; attributes: { @@ -118,43 +118,38 @@ export interface FindingsProps { severity: "informational" | "low" | "medium" | "high" | "critical"; check_id: string; check_metadata: { - check_id: string; - metadata: { - Risk: string; - Notes: string; - CheckID: string; - Provider: string; - Severity: "informational" | "low" | "medium" | "high" | "critical"; - CheckType: string[]; - DependsOn: string[]; - RelatedTo: string[]; - Categories: string[]; - CheckTitle: string; - RelatedUrl: string; - Description: string; - Remediation: { - Code: { - CLI: string; - Other: string; - NativeIaC: string; - Terraform: string; - }; - Recommendation: { - Url: string; - Text: string; - }; - }; - ServiceName: string; - ResourceType: string; - SubServiceName: string; - ResourceIdTemplate: string; - }; - }; - raw_result: { - impact: string; - status: "PASS" | "FAIL" | "MANUAL" | "MUTED"; + risk: string; + notes: string; + checkid: string; + provider: string; severity: "informational" | "low" | "medium" | "high" | "critical"; + checktype: string[]; + dependson: string[]; + relatedto: string[]; + categories: string[]; + checktitle: string; + compliance: string | null; + relatedurl: string; + description: string; + remediation: { + code: { + cli: string; + other: string; + nativeiac: string; + terraform: string; + }; + recommendation: { + url: string; + text: string; + }; + }; + servicename: string; + checkaliases: string[]; + resourcetype: string; + subservicename: string; + resourceidtemplate: string; }; + raw_result: object | null; inserted_at: string; updated_at: string; };