mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Fix color of tooltip text for run script dropdown action (#19505)
This commit is contained in:
parent
e5316331f0
commit
60f7c3d03c
2 changed files with 3 additions and 46 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue