diff --git a/changes/27533-move-view-all-host-link b/changes/27533-move-view-all-host-link new file mode 100644 index 0000000000..c9779b57fc --- /dev/null +++ b/changes/27533-move-view-all-host-link @@ -0,0 +1 @@ +- Fleet UI: Moved View all host link onto host count of software, OS, and vulnerability details pages diff --git a/frontend/components/LastUpdatedHostCount/LastUpdatedHostCount.tsx b/frontend/components/LastUpdatedHostCount/LastUpdatedHostCount.tsx index 8cd29f6d16..6245cf47f1 100644 --- a/frontend/components/LastUpdatedHostCount/LastUpdatedHostCount.tsx +++ b/frontend/components/LastUpdatedHostCount/LastUpdatedHostCount.tsx @@ -4,7 +4,7 @@ import LastUpdatedText from "components/LastUpdatedText"; const baseClass = "last-updated-host-count"; interface ILastUpdatedHostCount { - hostCount?: string | number; + hostCount?: string | number | JSX.Element; lastUpdatedAt?: string; } diff --git a/frontend/pages/SoftwarePage/SoftwareVulnerabilityDetailsPage/SoftwareVulnSummary/SoftwareVulnSummary.tsx b/frontend/pages/SoftwarePage/SoftwareVulnerabilityDetailsPage/SoftwareVulnSummary/SoftwareVulnSummary.tsx index c7cbef556e..5f687299ac 100644 --- a/frontend/pages/SoftwarePage/SoftwareVulnerabilityDetailsPage/SoftwareVulnSummary/SoftwareVulnSummary.tsx +++ b/frontend/pages/SoftwarePage/SoftwareVulnerabilityDetailsPage/SoftwareVulnSummary/SoftwareVulnSummary.tsx @@ -3,12 +3,13 @@ import React from "react"; import { IVulnerability } from "interfaces/vulnerability"; +import paths from "router/paths"; +import { getPathWithQueryParams } from "utilities/url"; import CustomLink from "components/CustomLink"; import Card from "components/Card"; import DataSet from "components/DataSet"; import TooltipWrapper from "components/TooltipWrapper"; -import ViewAllHostsLink from "components/ViewAllHostsLink"; import ProbabilityOfExploit from "components/ProbabilityOfExploit"; import { HumanTimeDiffWithDateTip } from "components/HumanTimeDiffWithDateTip"; import LastUpdatedHostCount from "components/LastUpdatedHostCount"; @@ -39,16 +40,17 @@ const SoftwareVulnSummary = ({ hosts_count_updated_at, } = vuln; + const hostCountPath = getPathWithQueryParams(paths.MANAGE_HOSTS, { + vulnerability: cve, + team_id: teamIdForApi, + }); + return (

{cve}

-
{isPremiumTier && cve_description && ( @@ -132,7 +134,14 @@ const SoftwareVulnSummary = ({ title="Affected hosts" value={ + + + } lastUpdatedAt={hosts_count_updated_at} /> } diff --git a/frontend/pages/SoftwarePage/components/SoftwareDetailsSummary/SoftwareDetailsSummary.tsx b/frontend/pages/SoftwarePage/components/SoftwareDetailsSummary/SoftwareDetailsSummary.tsx index 52222a5e7e..fd842d894c 100644 --- a/frontend/pages/SoftwarePage/components/SoftwareDetailsSummary/SoftwareDetailsSummary.tsx +++ b/frontend/pages/SoftwarePage/components/SoftwareDetailsSummary/SoftwareDetailsSummary.tsx @@ -6,11 +6,13 @@ software/os/:id > Top section import React from "react"; -import { QueryParams } from "utilities/url"; +import { getPathWithQueryParams, QueryParams } from "utilities/url"; +import paths from "router/paths"; -import ViewAllHostsLink from "components/ViewAllHostsLink"; import DataSet from "components/DataSet"; import LastUpdatedHostCount from "components/LastUpdatedHostCount"; +import TooltipWrapper from "components/TooltipWrapper"; +import CustomLink from "components/CustomLink"; import SoftwareIcon from "../icons/SoftwareIcon"; @@ -40,6 +42,8 @@ const SoftwareDetailsSummary = ({ versions, iconUrl, }: ISoftwareDetailsSummaryProps) => { + const hostCountPath = getPathWithQueryParams(paths.MANAGE_HOSTS, queryParams); + return (
@@ -53,19 +57,17 @@ const SoftwareDetailsSummary = ({ title="Hosts" value={ + + + } lastUpdatedAt={countsUpdatedAt} /> } /> -
- -
); };