Fix color of tooltip text for run script dropdown action (#19505)

This commit is contained in:
Sarah Gillespie 2024-06-12 13:49:40 -05:00 committed by GitHub
parent e5316331f0
commit 60f7c3d03c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 46 deletions

View file

@ -37,40 +37,10 @@ interface IDropdownCellProps {
};
}
const ScriptRunActionDropdownLabel = ({
scriptId,
disabled,
}: {
scriptId: number;
disabled: boolean;
}) => {
const tipId = `run-script-${scriptId}`;
return disabled ? (
<>
<span data-tip data-for={tipId}>
Run
</span>
<ReactTooltip
place="bottom"
type="dark"
effect="solid"
id={tipId}
backgroundColor={COLORS["tooltip-bg"]}
delayHide={100}
delayUpdate={500}
>
Script is already running.
</ReactTooltip>
</>
) : (
<>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: (
<ScriptRunActionDropdownLabel
scriptId={script_id}
disabled={last_execution?.status === "pending"}
/>
),
label: "Run",
disabled: last_execution?.status === "pending",
value: "run",
tooltipContent: "Script is already running.",
},
];
return hasRunPermission ? options : options.slice(0, 1);

View file

@ -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 {