Skip to content

Commit

Permalink
fix: Search Page wrong advisories count (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosthe19916 authored Dec 4, 2024
1 parent 08665bb commit ec828ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
20 changes: 11 additions & 9 deletions client/src/app/pages/search/components/SearchTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ import {
TabTitleText,
} from "@patternfly/react-core";

import { PackageTable } from "@app/pages/package-list/package-table";
import { FilterPanel } from "@app/components/FilterPanel";
import { AdvisoryTable } from "@app/pages/advisory-list/advisory-table";
import { PackageTable } from "@app/pages/package-list/package-table";
import { SbomTable } from "@app/pages/sbom-list/sbom-table";
import { VulnerabilityTable } from "@app/pages/vulnerability-list/vulnerability-table";
import HelpIcon from "@patternfly/react-icons/dist/esm/icons/help-icon";
import { FilterPanel } from "@app/components/FilterPanel";

export interface SearchTabsProps {
advisoryTable?: ReactNode;
filterPanelProps: {
advisoryFilterPanelProps?: any;
packageFilterPanelProps?: any;
Expand All @@ -34,24 +33,27 @@ export interface SearchTabsProps {
sbomTotalCount: number;
vulnerabilityTable?: ReactElement;
vulnerabilityTotalCount: number;
advisoryTable?: ReactNode;
advisoryTotalCount: number;
}

export const SearchTabs: React.FC<SearchTabsProps> = ({
advisoryTable,
filterPanelProps,
packageTable,
packageTotalCount,
sbomTable,
sbomTotalCount,
packageTable,
packageTotalCount,
vulnerabilityTable,
vulnerabilityTotalCount,
advisoryTable,
advisoryTotalCount,
}) => {
const [activeTabKey, setActiveTabKey] = React.useState<string | number>(0);
const {
advisoryFilterPanelProps,
packageFilterPanelProps,
sbomFilterPanelProps,
packageFilterPanelProps,
vulnerabilityFilterPanelProps,
advisoryFilterPanelProps,
} = filterPanelProps;

const handleTabClick = (
Expand Down Expand Up @@ -166,7 +168,7 @@ export const SearchTabs: React.FC<SearchTabsProps> = ({
<TabTitleText>
Advisories{" "}
<Badge screenReaderText="Advisory Result Count">
{vulnerabilityTotalCount}
{advisoryTotalCount}
</Badge>
</TabTitleText>
}
Expand Down
1 change: 1 addition & 0 deletions client/src/app/pages/search/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export const Search: React.FC<SearchPageProps> = ({ searchBodyOverride }) => {
packageTotalCount={packageTotalCount}
sbomTotalCount={sbomTotalCount}
vulnerabilityTotalCount={vulnerabilityTotalCount}
advisoryTotalCount={advisoryTotalCount}
/>
);

Expand Down

0 comments on commit ec828ed

Please sign in to comment.