From 60f7c3d03cb84ee7e74099a4eaab23d22917e56f Mon Sep 17 00:00:00 2001
From: Sarah Gillespie <73313222+gillespi314@users.noreply.github.com>
Date: Wed, 12 Jun 2024 13:49:40 -0500
Subject: [PATCH] Fix color of tooltip text for run script dropdown action
(#19505)
---
.../RunScriptModal/ScriptsTableConfig.tsx | 40 ++-----------------
.../modals/RunScriptModal/_styles.scss | 9 -----
2 files changed, 3 insertions(+), 46 deletions(-)
diff --git a/frontend/pages/hosts/details/HostDetailsPage/modals/RunScriptModal/ScriptsTableConfig.tsx b/frontend/pages/hosts/details/HostDetailsPage/modals/RunScriptModal/ScriptsTableConfig.tsx
index 344c0c8b36..c870ab55e4 100644
--- a/frontend/pages/hosts/details/HostDetailsPage/modals/RunScriptModal/ScriptsTableConfig.tsx
+++ b/frontend/pages/hosts/details/HostDetailsPage/modals/RunScriptModal/ScriptsTableConfig.tsx
@@ -37,40 +37,10 @@ interface IDropdownCellProps {
};
}
-const ScriptRunActionDropdownLabel = ({
- scriptId,
- disabled,
-}: {
- scriptId: number;
- disabled: boolean;
-}) => {
- const tipId = `run-script-${scriptId}`;
- return disabled ? (
- <>
-
- Run
-
-
- Script is already running.
-
- >
- ) : (
- <>Run>
- );
-};
-
const generateActionDropdownOptions = (
currentUser: IUser | null,
teamId: number | null,
- { script_id, last_execution }: IHostScript
+ { last_execution }: IHostScript
): IDropdownOption[] => {
const hasRunPermission =
!!currentUser &&
@@ -89,14 +59,10 @@ const generateActionDropdownOptions = (
value: "showDetails",
},
{
- label: (
-
- ),
+ label: "Run",
disabled: last_execution?.status === "pending",
value: "run",
+ tooltipContent: "Script is already running.",
},
];
return hasRunPermission ? options : options.slice(0, 1);
diff --git a/frontend/pages/hosts/details/HostDetailsPage/modals/RunScriptModal/_styles.scss b/frontend/pages/hosts/details/HostDetailsPage/modals/RunScriptModal/_styles.scss
index 78a4e7d7ca..89c4c4213b 100644
--- a/frontend/pages/hosts/details/HostDetailsPage/modals/RunScriptModal/_styles.scss
+++ b/frontend/pages/hosts/details/HostDetailsPage/modals/RunScriptModal/_styles.scss
@@ -25,15 +25,6 @@
}
}
- .Select-option {
- .dropdown__option {
- [data-id="tooltip"] {
- font-size: $xx-small;
- font-style: normal;
- }
- }
- }
-
// style a basic span that doesn't use the dropdown component (which relies on react-select
// and makes it difficult for us to style the disabled tooltip underline on the placeholder text.
.run-script-action--disabled {