Skip to content

Commit

Permalink
chore: apply v5 feedback changes (finding changes)
Browse files Browse the repository at this point in the history
  • Loading branch information
paabloLC committed Nov 30, 2024
1 parent a3d850a commit 7b02964
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 8 deletions.
33 changes: 29 additions & 4 deletions ui/components/findings/table/column-findings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useSearchParams } from "next/navigation";

import { DataTableRowDetails } from "@/components/findings/table";
import { InfoIcon } from "@/components/icons";
import { DateWithTime } from "@/components/ui/entities";
import { TriggerSheet } from "@/components/ui/sheet";
import {
DataTableColumnHeader,
Expand Down Expand Up @@ -87,7 +88,11 @@ export const ColumnFindings: ColumnDef<FindingProps>[] = [
),
cell: ({ row }) => {
const { checktitle } = getFindingsMetadata(row);
return <p className="max-w-96 truncate text-small">{checktitle}</p>;
return (
<p className="max-w-[450px] whitespace-normal break-words text-small">
{checktitle}
</p>
);
},
},
{
Expand Down Expand Up @@ -119,6 +124,26 @@ export const ColumnFindings: ColumnDef<FindingProps>[] = [
return <StatusFindingBadge size="sm" status={status} />;
},
},
{
accessorKey: "updated_at",
header: ({ column }) => (
<DataTableColumnHeader
column={column}
title={"Last seen"}
param="updated_at"
/>
),
cell: ({ row }) => {
const {
attributes: { updated_at },
} = getFindingsData(row);
return (
<div className="w-[100px]">
<DateWithTime dateTime={updated_at} />
</div>
);
},
},
// {
// accessorKey: "scanName",
// header: "Scan Name",
Expand All @@ -141,9 +166,9 @@ export const ColumnFindings: ColumnDef<FindingProps>[] = [
const region = getResourceData(row, "region");

return (
<>
<div>{typeof region === "string" ? region : "Invalid region"}</div>
</>
<div className="w-[80px]">
{typeof region === "string" ? region : "Invalid region"}
</div>
);
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useSearchParams } from "next/navigation";

import { DataTableRowDetails } from "@/components/findings/table";
import { InfoIcon } from "@/components/icons";
import { DateWithTime } from "@/components/ui/entities";
import { TriggerSheet } from "@/components/ui/sheet";
import { SeverityBadge, StatusFindingBadge } from "@/components/ui/table";
import { FindingProps } from "@/types";
Expand Down Expand Up @@ -68,7 +69,7 @@ export const ColumnNewFindingsToDate: ColumnDef<FindingProps>[] = [
cell: ({ row }) => {
const { checktitle } = getFindingsMetadata(row);
return (
<p className="max-w-[600px] whitespace-normal break-words text-small">
<p className="max-w-[450px] whitespace-normal break-words text-small">
{checktitle}
</p>
);
Expand All @@ -95,16 +96,30 @@ export const ColumnNewFindingsToDate: ColumnDef<FindingProps>[] = [
return <StatusFindingBadge size="sm" status={status} />;
},
},
{
accessorKey: "updated_at",
header: "Last seen",
cell: ({ row }) => {
const {
attributes: { updated_at },
} = getFindingsData(row);
return (
<div className="w-[100px]">
<DateWithTime dateTime={updated_at} />
</div>
);
},
},
{
accessorKey: "region",
header: "Region",
cell: ({ row }) => {
const region = getResourceData(row, "region");

return (
<>
<div>{typeof region === "string" ? region : "Invalid region"}</div>
</>
<div className="w-[80px]">
{typeof region === "string" ? region : "Invalid region"}
</div>
);
},
},
Expand Down

0 comments on commit 7b02964

Please sign in to comment.