Skip to content

Commit

Permalink
Add Sbom count Column
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosthe19916 committed Oct 4, 2024
1 parent 9cc2697 commit ff3ef9c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
19 changes: 19 additions & 0 deletions client/src/app/components/SbomsByPackageCount.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from "react";

import { useFetchSbomsByPackageId } from "@app/queries/sboms";

export interface ISbomsByPackageCountProps {
packageId: string;
}

export const SbomsByPackageCount: React.FC<ISbomsByPackageCountProps> = ({
packageId,
}) => {
const {
result: { total },
} = useFetchSbomsByPackageId(packageId, {
page: { pageNumber: 1, itemsPerPage: 1 },
});

return <>{total}</>;
};
5 changes: 4 additions & 1 deletion client/src/app/pages/package-list/package-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { NavLink } from "react-router-dom";

import { Table, Tbody, Td, Th, Thead, Tr } from "@patternfly/react-table";

import { SbomsByPackageCount } from "@app/components/SbomsByPackageCount";
import { SimplePagination } from "@app/components/SimplePagination";
import {
ConditionalTableBody,
Expand Down Expand Up @@ -85,7 +86,9 @@ export const PackageTable: React.FC = () => {
width={15}
{...getTdProps({ columnKey: "vulnerabilities" })}
></Td>
<Td width={15} {...getTdProps({ columnKey: "sboms" })}></Td>
<Td width={15} {...getTdProps({ columnKey: "sboms" })}>
<SbomsByPackageCount packageId={item.uuid} />
</Td>
</TableRowContentWithControls>
</Tr>
</Tbody>
Expand Down

0 comments on commit ff3ef9c

Please sign in to comment.