From 073789324062a4578a1a653e684159f59d252d8a Mon Sep 17 00:00:00 2001 From: Prowler Bot Date: Tue, 28 Jan 2025 13:29:39 +0100 Subject: [PATCH] fix(scans): filters and sorting for scan table (#6714) Co-authored-by: Pablo Lara --- ui/app/(prowler)/scans/page.tsx | 4 +++- ui/components/filters/data-filters.ts | 4 ++-- ui/components/scans/table/scans/column-get-scans.tsx | 12 ++---------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/ui/app/(prowler)/scans/page.tsx b/ui/app/(prowler)/scans/page.tsx index 7bd1317c12..9781627118 100644 --- a/ui/app/(prowler)/scans/page.tsx +++ b/ui/app/(prowler)/scans/page.tsx @@ -3,7 +3,7 @@ import { Suspense } from "react"; import { getProvider, getProviders } from "@/actions/providers"; import { getScans } from "@/actions/scans"; -import { filterScans } from "@/components/filters"; +import { FilterControls, filterScans } from "@/components/filters"; import { ButtonRefreshData, NoProvidersAdded, @@ -83,6 +83,8 @@ export default async function Scans({
+ + { "use server"; diff --git a/ui/components/filters/data-filters.ts b/ui/components/filters/data-filters.ts index 4b40aff8e6..9cf93fb392 100644 --- a/ui/components/filters/data-filters.ts +++ b/ui/components/filters/data-filters.ts @@ -14,8 +14,8 @@ export const filterScans = [ values: ["aws", "azure", "gcp", "kubernetes"], }, { - key: "state", - labelCheckboxGroup: "State", + key: "state__in", + labelCheckboxGroup: "Status", values: [ "available", "scheduled", diff --git a/ui/components/scans/table/scans/column-get-scans.tsx b/ui/components/scans/table/scans/column-get-scans.tsx index 1fec3742f0..87113c21fa 100644 --- a/ui/components/scans/table/scans/column-get-scans.tsx +++ b/ui/components/scans/table/scans/column-get-scans.tsx @@ -81,9 +81,7 @@ export const ColumnGetScans: ColumnDef[] = [ }, { accessorKey: "status", - header: ({ column }) => ( - - ), + header: "Status", cell: ({ row }) => { const { attributes: { state }, @@ -126,13 +124,7 @@ export const ColumnGetScans: ColumnDef[] = [ }, { accessorKey: "next_scan_at", - header: ({ column }) => ( - - ), + header: "Scheduled at", cell: ({ row }) => { const { attributes: { next_scan_at },