fix: fix the build, and run prettier

This commit is contained in:
Pablo Lara
2024-11-13 08:21:13 +01:00
parent 2378b01ea9
commit db36cdf379
7 changed files with 130 additions and 107 deletions
+2 -4
View File
@@ -2,10 +2,10 @@
import { revalidatePath } from "next/cache";
import { redirect } from "next/navigation";
import { parse } from "path";
import { auth } from "@/auth.config";
import { getErrorMessage, parseStringify } from "@/lib";
import { parse } from "path";
export const getServices = async ({}) => {
const session = await auth();
@@ -63,10 +63,8 @@ export const getServices = async ({}) => {
{ id: "trustedadvisor", alias: "AWS Trusted Advisor" },
{ id: "vpc", alias: "Amazon VPC" },
{ id: "wafv2", alias: "AWS WAF" },
{ id: "wellarchitected", alias: "AWS Well-Architected Tool" }
{ id: "wellarchitected", alias: "AWS Well-Architected Tool" },
];
const parsedData = [];
@@ -2,12 +2,13 @@
import { ColumnDef } from "@tanstack/react-table";
import { DataTableRowDetails } from "@/components/findings/table";
import { PlusIcon } from "@/components/icons";
import { TriggerSheet } from "@/components/ui/sheet";
import { SeverityBadge, Status, StatusBadge } from "@/components/ui/table";
import { FindingProps } from "@/types";
import { TriggerSheet } from "@/components/ui/sheet";
import { DataTableRowActions } from "./data-table-row-actions";
import { PlusIcon } from "@/components/icons";
import { DataTableRowDetails } from "@/components/findings/table";
const statusMap: Record<"PASS" | "FAIL" | "MANUAL" | "MUTED", Status> = {
PASS: "completed",
@@ -1,11 +1,8 @@
"use client";
import { useEffect, useState } from "react";
import { FindingDetail } from "@/components/findings/table";
import { FindingProps } from "@/types";
export const DataTableRowDetails = ({ finding }: { finding: FindingProps }) => {
console.log(finding);
return <FindingDetail findingDetails={finding} />;
};
+112 -84
View File
@@ -1,97 +1,125 @@
"use client";
import { Card, CardBody, CardHeader, Divider } from "@nextui-org/react";
import {
Table,
TableBody,
TableCell,
TableColumn,
TableHeader,
TableRow,
} from "@nextui-org/react";
import { DateWithTime, SnippetId } from "@/components/ui/entities";
import { StatusBadge } from "@/components/ui/table/status-badge";
import { FindingProps } from "@/types";
import {Table, TableHeader, TableColumn, TableBody, TableRow, TableCell} from "@nextui-org/react";
export const FindingDetail = ({ findingDetails }: { findingDetails: FindingProps }) => {
export const FindingDetail = ({
findingDetails,
}: {
findingDetails: FindingProps;
}) => {
const finding = findingDetails;
console.log(finding)
return (
<div className="space-y-4">
<div className="flex items-center justify-between">
<Table aria-label="Example static collection table">
<TableHeader>
<TableColumn>Name </TableColumn>
<TableColumn>Value</TableColumn>
</TableHeader>
<TableBody>
<TableRow key="1">
<TableCell>Resource ID</TableCell>
<TableCell>{finding.relationships.resource.id}</TableCell>
</TableRow>
<TableRow key="2">
<TableCell>Resource ARN</TableCell>
<TableCell>{finding.relationships.resource.attributes.uid}</TableCell>
</TableRow>
<TableRow key="3">
<TableCell>Check ID</TableCell>
<TableCell>{finding.attributes.check_id}</TableCell>
</TableRow>
<TableRow key="4">
<TableCell>Types</TableCell>
<TableCell>{finding.attributes.check_metadata.checktype}</TableCell>
</TableRow>
<TableRow key="5">
<TableCell>Scan time</TableCell>
<TableCell>{finding.attributes.inserted_at}</TableCell>
</TableRow>
<TableRow key="6">
<TableCell>Prowler Finding ID</TableCell>
<TableCell>{finding.relationships.resource.attributes.uid}</TableCell>
</TableRow>
<TableRow key="7">
<TableCell>Severity</TableCell>
<TableCell>{finding.id}</TableCell>
</TableRow>
<TableRow key="8">
<TableCell>Status</TableCell>
<TableCell>{finding.attributes.status}</TableCell>
</TableRow>
<TableRow key="9">
<TableCell>Region</TableCell>
<TableCell>{finding.relationships.resource.attributes.region}</TableCell>
</TableRow>
<TableRow key="10">
<TableCell>Service</TableCell>
<TableCell>{finding.relationships.resource.attributes.service}</TableCell>
</TableRow>
<TableRow key="11">
<TableCell>Account</TableCell>
<TableCell>{finding.relationships.provider.attributes.uid}</TableCell>
</TableRow>
<TableRow key="12">
<TableCell>Details</TableCell>
<TableCell>{finding.attributes.status_extended}</TableCell>
</TableRow>
<TableRow key="13">
<TableCell>Risk</TableCell>
<TableCell>{finding.attributes.check_metadata.risk}</TableCell>
</TableRow>
<TableRow key="14">
<TableCell>Recommendation</TableCell>
<TableCell>{finding.attributes.check_metadata.remediation.recommendation.text}</TableCell>
</TableRow>
<TableRow key="15">
<TableCell>CLI</TableCell>
<TableCell>{finding.attributes.check_metadata.remediation.code.cli}</TableCell>
</TableRow>
<TableRow key="16">
<TableCell>Other</TableCell>
<TableCell>{finding.attributes.check_metadata.remediation.code.other}</TableCell>
</TableRow>
<TableRow key="17">
<TableCell>Terraform</TableCell>
<TableCell>{finding.attributes.check_metadata.remediation.code.terraform}</TableCell>
</TableRow>
</TableBody>
</Table>
</div>
<TableHeader>
<TableColumn>Name </TableColumn>
<TableColumn>Value</TableColumn>
</TableHeader>
<TableBody>
<TableRow key="1">
<TableCell>Resource ID</TableCell>
<TableCell>{finding.relationships.resource.id}</TableCell>
</TableRow>
<TableRow key="2">
<TableCell>Resource ARN</TableCell>
<TableCell>
{finding.relationships.resource.attributes.uid}
</TableCell>
</TableRow>
<TableRow key="3">
<TableCell>Check ID</TableCell>
<TableCell>{finding.attributes.check_id}</TableCell>
</TableRow>
<TableRow key="4">
<TableCell>Types</TableCell>
<TableCell>
{finding.attributes.check_metadata.checktype}
</TableCell>
</TableRow>
<TableRow key="5">
<TableCell>Scan time</TableCell>
<TableCell>{finding.attributes.inserted_at}</TableCell>
</TableRow>
<TableRow key="6">
<TableCell>Prowler Finding ID</TableCell>
<TableCell>
{finding.relationships.resource.attributes.uid}
</TableCell>
</TableRow>
<TableRow key="7">
<TableCell>Severity</TableCell>
<TableCell>{finding.id}</TableCell>
</TableRow>
<TableRow key="8">
<TableCell>Status</TableCell>
<TableCell>{finding.attributes.status}</TableCell>
</TableRow>
<TableRow key="9">
<TableCell>Region</TableCell>
<TableCell>
{finding.relationships.resource.attributes.region}
</TableCell>
</TableRow>
<TableRow key="10">
<TableCell>Service</TableCell>
<TableCell>
{finding.relationships.resource.attributes.service}
</TableCell>
</TableRow>
<TableRow key="11">
<TableCell>Account</TableCell>
<TableCell>
{finding.relationships.provider.attributes.uid}
</TableCell>
</TableRow>
<TableRow key="12">
<TableCell>Details</TableCell>
<TableCell>{finding.attributes.status_extended}</TableCell>
</TableRow>
<TableRow key="13">
<TableCell>Risk</TableCell>
<TableCell>{finding.attributes.check_metadata.risk}</TableCell>
</TableRow>
<TableRow key="14">
<TableCell>Recommendation</TableCell>
<TableCell>
{
finding.attributes.check_metadata.remediation.recommendation
.text
}
</TableCell>
</TableRow>
<TableRow key="15">
<TableCell>CLI</TableCell>
<TableCell>
{finding.attributes.check_metadata.remediation.code.cli}
</TableCell>
</TableRow>
<TableRow key="16">
<TableCell>Other</TableCell>
<TableCell>
{finding.attributes.check_metadata.remediation.code.other}
</TableCell>
</TableRow>
<TableRow key="17">
<TableCell>Terraform</TableCell>
<TableCell>
{finding.attributes.check_metadata.remediation.code.terraform}
</TableCell>
</TableRow>
</TableBody>
</Table>
</div>
</div>
);
};
+1 -1
View File
@@ -1,5 +1,5 @@
export * from "./column-findings";
export * from "./data-table-row-actions";
export * from "./data-table-row-details";
export * from "./skeleton-table-findings";
export * from "./finding-detail";
export * from "./skeleton-table-findings";
@@ -45,17 +45,16 @@ export const ColumnGetScans: ColumnDef<ScanProps>[] = [
);
},
},
{
accessorKey: "scanner_args",
header: "Scanner Args",
cell: ({ row }) => {
const {
attributes: { scanner_args },
} = getScanData(row);
return <p className="font-medium">{scanner_args?.only_logs}</p>;
},
},
// {
// accessorKey: "scanner_args",
// header: "Scanner Args",
// cell: ({ row }) => {
// const {
// attributes: { scanner_args },
// } = getScanData(row);
// return <p className="font-medium">{scanner_args?.only_logs}</p>;
// },
// },
{
accessorKey: "resources",
header: "Resources",
+1 -1
View File
@@ -81,7 +81,7 @@
"build": "next build",
"start": "next start",
"typecheck": "tsc",
"healthcheck": "npm run typecheck && npm run lint:check",
"healthcheck": "npm run typecheck && npm run lint:check && npm run build",
"lint:check": "./node_modules/.bin/eslint ./app",
"lint:fix": "eslint . --ext .ts,.tsx -c .eslintrc.cjs --fix",
"format:check": "./node_modules/.bin/prettier --check ./app",