From cfafb92c2d1eed1da3744cf1e3d505c71fed1b48 Mon Sep 17 00:00:00 2001 From: RachelElysia <71795832+RachelElysia@users.noreply.github.com> Date: Fri, 23 Aug 2024 12:02:21 -0400 Subject: [PATCH] [unreleased bug] Fleet UI: Hide exploit/severity vuln filters for fleet free (#21511) --- frontend/pages/SoftwarePage/SoftwarePage.tsx | 2 +- .../SoftwareFiltersModal.tsx | 50 +++++++++++-------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/frontend/pages/SoftwarePage/SoftwarePage.tsx b/frontend/pages/SoftwarePage/SoftwarePage.tsx index 2e904e912b..574c053678 100644 --- a/frontend/pages/SoftwarePage/SoftwarePage.tsx +++ b/frontend/pages/SoftwarePage/SoftwarePage.tsx @@ -37,7 +37,6 @@ import AddSoftwareModal from "./components/AddSoftwareModal"; import { buildSoftwareFilterQueryParams, getSoftwareFilterFromQueryParams, - buildSoftwareVulnFiltersQueryParams, getSoftwareVulnFiltersFromQueryParams, ISoftwareVulnFilters, } from "./SoftwareTitles/SoftwareTable/helpers"; @@ -485,6 +484,7 @@ const SoftwarePage = ({ children, router, location }: ISoftwarePageProps) => { onExit={toggleSoftwareFiltersModal} onSubmit={onApplyVulnFilters} vulnFilters={softwareVulnFilters} + isPremiumTier={isPremiumTier || false} /> )} diff --git a/frontend/pages/SoftwarePage/components/SoftwareFiltersModal/SoftwareFiltersModal.tsx b/frontend/pages/SoftwarePage/components/SoftwareFiltersModal/SoftwareFiltersModal.tsx index bac446d918..0c9ec70b35 100644 --- a/frontend/pages/SoftwarePage/components/SoftwareFiltersModal/SoftwareFiltersModal.tsx +++ b/frontend/pages/SoftwarePage/components/SoftwareFiltersModal/SoftwareFiltersModal.tsx @@ -20,12 +20,14 @@ interface ISoftwareFiltersModalProps { onExit: () => void; onSubmit: (vulnFilters: ISoftwareVulnFilters) => void; vulnFilters: ISoftwareVulnFiltersParams; + isPremiumTier: boolean; } const SoftwareFiltersModal = ({ onExit, onSubmit, vulnFilters, + isPremiumTier, }: ISoftwareFiltersModalProps) => { const [vulnSoftwareFilterEnabled, setVulnSoftwareFilterEnabled] = useState( vulnFilters.vulnerable || false @@ -50,7 +52,7 @@ const SoftwareFiltersModal = ({ const onApplyFilters = () => { onSubmit({ vulnerable: vulnSoftwareFilterEnabled, - exploit: hasKnownExploit, + exploit: hasKnownExploit || undefined, min_cvss_score: severity?.minSeverity || undefined, max_cvss_score: severity?.maxSeverity || undefined, }); @@ -78,27 +80,31 @@ const SoftwareFiltersModal = ({ inactiveText="Vulnerable software" activeText="Vulnerable software" /> - - - setHasKnownExploit(value) - } - name="hasKnownExploit" - value={hasKnownExploit} - parseTarget - helpText="Software has vulnerabilities that have been actively exploited in the wild." - disabled={!vulnSoftwareFilterEnabled} - > - Has known exploit - + {isPremiumTier && ( + + )} + {isPremiumTier && ( + + setHasKnownExploit(value) + } + name="hasKnownExploit" + value={hasKnownExploit} + parseTarget + helpText="Software has vulnerabilities that have been actively exploited in the wild." + disabled={!vulnSoftwareFilterEnabled} + > + Has known exploit + + )}