[unreleased bugs] Fleet UI: Missing vulnerability filter block / incorrect link param (#17473)

This commit is contained in:
RachelElysia
2024-03-08 09:22:25 -05:00
committed by GitHub
parent 563aa1e9bf
commit cbce4621ec
6 changed files with 13 additions and 16 deletions
@@ -172,7 +172,7 @@ const SoftwareVulnerabilitiesTable = ({
const handleRowSelect = (row: IRowProps) => {
const hostsByVulnerabilityParams = {
cve: row.original.cve,
vulnerability: row.original.cve,
team_id: teamId,
};
@@ -29,7 +29,7 @@ import DetailsNoHosts from "../components/DetailsNoHosts";
const baseClass = "software-vulnerability-details-page";
interface ISoftwareVulnerabilityDetailsRouteParams {
cve: string;
vulnerability: string;
team_id?: string;
}
@@ -71,7 +71,7 @@ const SoftwareVulnerabilityDetailsPage = ({
[
{
scope: "softwareVulnByCVE",
cve: routeParams.cve,
vulnerability: routeParams.vulnerability,
teamId: teamIdForApi,
},
],
@@ -74,7 +74,7 @@ const SoftwareVulnerabilitiesTable = ({
const handleRowSelect = (row: IRowProps) => {
const hostsBySoftwareParams = {
cve: row.original.cve,
vulnerability: row.original.cve,
team_id: teamIdForApi,
};
@@ -876,6 +876,7 @@ const ManageHostsPage = ({
osSettingsStatus,
diskEncryptionStatus,
bootstrapPackageStatus,
vulnerability,
]
);
@@ -1664,6 +1665,7 @@ const ManageHostsPage = ({
osSettingsStatus,
diskEncryptionStatus,
bootstrapPackageStatus,
vulnerability,
}}
selectedLabel={selectedLabel}
isOnlyObserver={isOnlyObserver}
@@ -208,16 +208,10 @@ const HostsFilterBlock = ({
const renderVulnerabilityFilterBlock = () => {
if (!vulnerability) return null;
// TODO: Move formatOperatingSystemDisplayName into utils file
const label = formatOperatingSystemDisplayName(vulnerability);
const TooltipDescription = (
<span>Hosts affected by the specified CVE.</span>
);
return (
<FilterPill
label={label}
tooltipDescription={TooltipDescription}
label={vulnerability}
tooltipDescription={<span>Hosts affected by the specified CVE.</span>}
onClear={() => handleClearFilter(["vulnerability"])}
/>
);
@@ -479,7 +473,8 @@ const HostsFilterBlock = ({
munkiIssueId ||
osSettingsStatus ||
diskEncryptionStatus ||
bootstrapPackageStatus
bootstrapPackageStatus ||
vulnerability
) {
const renderFilterPill = () => {
switch (true) {
@@ -20,7 +20,7 @@ export interface IGetVulnerabilitiesQueryKey
}
interface IGetVulnerabilityOptions {
cve: string;
vulnerability: string;
teamId?: number;
}
@@ -70,10 +70,10 @@ export const getVulnerabilities = ({
};
const getVulnerability = ({
cve,
vulnerability,
teamId,
}: IGetVulnerabilityOptions): Promise<IVulnerabilityResponse> => {
const endpoint = endpoints.VULNERABILITY(cve);
const endpoint = endpoints.VULNERABILITY(vulnerability);
const path = teamId ? `${endpoint}?team_id=${teamId}` : endpoint;
return sendRequest("GET", path);