From a87acf2883db7404e50a4e336ca6f02b9be42b4d Mon Sep 17 00:00:00 2001 From: Manan Vaghasiya Date: Mon, 24 Jun 2024 13:55:57 +0000 Subject: [PATCH] link registry image tag table scan status to the scan results --- .../components/RegistryImageTagsTable.tsx | 67 +++++++++++++++++-- 1 file changed, 63 insertions(+), 4 deletions(-) diff --git a/deepfence_frontend/apps/dashboard/src/features/registries/components/RegistryImageTagsTable.tsx b/deepfence_frontend/apps/dashboard/src/features/registries/components/RegistryImageTagsTable.tsx index e0ddb2f970..ed894e12a4 100644 --- a/deepfence_frontend/apps/dashboard/src/features/registries/components/RegistryImageTagsTable.tsx +++ b/deepfence_frontend/apps/dashboard/src/features/registries/components/RegistryImageTagsTable.tsx @@ -1,5 +1,5 @@ import { useMemo } from 'react'; -import { useSearchParams } from 'react-router-dom'; +import { generatePath, useSearchParams } from 'react-router-dom'; import { createColumnHelper, Dropdown, @@ -11,7 +11,9 @@ import { } from 'ui-components'; import { ModelContainerImage } from '@/api/generated'; +import { DFLink } from '@/components/DFLink'; import { EllipsisIcon } from '@/components/icons/common/Ellipsis'; +import { PopOutIcon } from '@/components/icons/common/PopOut'; import { ScanStatusBadge } from '@/components/ScanStatusBadge'; import { TruncatedText } from '@/components/TruncatedText'; import { @@ -164,19 +166,76 @@ export const RegistryImageTagsTable = ({ columnHelper.accessor('vulnerability_scan_status', { enableSorting: false, header: () => , - cell: (info) => , + cell: (info) => { + const badge = ; + if (info.row.original.vulnerability_latest_scan_id) { + return ( +
+
{badge}
+ + + +
+ ); + } + return badge; + }, maxSize: 50, }), columnHelper.accessor('secret_scan_status', { enableSorting: false, header: () => , - cell: (info) => , + cell: (info) => { + const badge = ; + if (info.row.original.secret_latest_scan_id) { + return ( +
+
{badge}
+ + + +
+ ); + } + return badge; + }, maxSize: 50, }), columnHelper.accessor('malware_scan_status', { enableSorting: false, header: () => , - cell: (info) => , + cell: (info) => { + const badge = ; + if (info.row.original.malware_latest_scan_id) { + return ( +
+
{badge}
+ + + +
+ ); + } + return badge; + }, maxSize: 50, }), ],