From 65bed38c3bead455975d005da790e8a92058e68e Mon Sep 17 00:00:00 2001 From: RachelElysia Date: Wed, 8 Jan 2025 13:57:44 -0500 Subject: [PATCH] Update to isDisabled class, fix width, fix tooltip not showing on disabled --- .../forms/fields/DropdownWrapper/DropdownWrapper.tsx | 1 - .../SoftwareVulnerabilitiesTable.tests.tsx | 7 ++----- .../SoftwareVulnerabilitiesTable/_styles.scss | 2 +- .../SoftwareVulnerabilitiesTable/helpers.ts | 4 ++-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/frontend/components/forms/fields/DropdownWrapper/DropdownWrapper.tsx b/frontend/components/forms/fields/DropdownWrapper/DropdownWrapper.tsx index 4a194d41d9f8..1b8e51f50941 100644 --- a/frontend/components/forms/fields/DropdownWrapper/DropdownWrapper.tsx +++ b/frontend/components/forms/fields/DropdownWrapper/DropdownWrapper.tsx @@ -280,7 +280,6 @@ const DropdownWrapper = ({ color: COLORS["ui-fleet-black-50"], fontStyle: "italic", cursor: "not-allowed", - pointerEvents: "none", }), // Styles for custom option ".dropdown-wrapper__option": { diff --git a/frontend/pages/SoftwarePage/SoftwareVulnerabilities/SoftwareVulnerabilitiesTable/SoftwareVulnerabilitiesTable.tests.tsx b/frontend/pages/SoftwarePage/SoftwareVulnerabilities/SoftwareVulnerabilitiesTable/SoftwareVulnerabilitiesTable.tests.tsx index 2e869892d182..5c115465934c 100644 --- a/frontend/pages/SoftwarePage/SoftwareVulnerabilities/SoftwareVulnerabilitiesTable/SoftwareVulnerabilitiesTable.tests.tsx +++ b/frontend/pages/SoftwarePage/SoftwareVulnerabilities/SoftwareVulnerabilitiesTable/SoftwareVulnerabilitiesTable.tests.tsx @@ -2,10 +2,7 @@ import React from "react"; import { screen, waitFor } from "@testing-library/react"; import { createCustomRenderer } from "test/test-utils"; -import { - createMockVulnerabilitiesResponse, - createMockVulnerability, -} from "__mocks__/vulnerabilitiesMock"; +import { createMockVulnerabilitiesResponse } from "__mocks__/vulnerabilitiesMock"; import createMockUser from "__mocks__/userMock"; import SoftwareVulnerabilitiesTable from "./SoftwareVulnerabilitiesTable"; @@ -353,7 +350,7 @@ describe("Software Vulnerabilities table", () => { expect( screen.getByText("Exploited vulnerabilities").parentElement?.parentElement ?.parentElement - ).toHaveClass("is-disabled"); + ).toHaveClass("react-select__option--is-disabled"); await waitFor(() => { waitFor(() => { diff --git a/frontend/pages/SoftwarePage/SoftwareVulnerabilities/SoftwareVulnerabilitiesTable/_styles.scss b/frontend/pages/SoftwarePage/SoftwareVulnerabilities/SoftwareVulnerabilitiesTable/_styles.scss index 78d5fbeafa71..7cb91b208d01 100644 --- a/frontend/pages/SoftwarePage/SoftwareVulnerabilities/SoftwareVulnerabilitiesTable/_styles.scss +++ b/frontend/pages/SoftwarePage/SoftwareVulnerabilities/SoftwareVulnerabilitiesTable/_styles.scss @@ -1,6 +1,6 @@ .software-vulnerabilities-table { &__exploited-vulnerabilities-dropdown { - min-width: 234px; + min-width: 250px; } &__count { diff --git a/frontend/pages/SoftwarePage/SoftwareVulnerabilities/SoftwareVulnerabilitiesTable/helpers.ts b/frontend/pages/SoftwarePage/SoftwareVulnerabilities/SoftwareVulnerabilitiesTable/helpers.ts index c9d428e1aa45..08f06bed6e0a 100644 --- a/frontend/pages/SoftwarePage/SoftwareVulnerabilities/SoftwareVulnerabilitiesTable/helpers.ts +++ b/frontend/pages/SoftwarePage/SoftwareVulnerabilities/SoftwareVulnerabilitiesTable/helpers.ts @@ -5,13 +5,13 @@ export const getExploitedVulnerabilitiesDropdownOptions = ( return [ { - disabled: false, + isDisabled: false, label: "All vulnerabilities", value: "false", helpText: "All vulnerabilities detected on your hosts.", }, { - disabled: !isPremiumTier, + isDisabled: !isPremiumTier, label: "Exploited vulnerabilities", value: "true", helpText: