mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +00:00
Implements patch policies #31914 - https://github.com/fleetdm/fleet/pull/40816 - https://github.com/fleetdm/fleet/pull/41248 - https://github.com/fleetdm/fleet/pull/41276 - https://github.com/fleetdm/fleet/pull/40948 - https://github.com/fleetdm/fleet/pull/40837 - https://github.com/fleetdm/fleet/pull/40956 - https://github.com/fleetdm/fleet/pull/41168 - https://github.com/fleetdm/fleet/pull/41171 - https://github.com/fleetdm/fleet/pull/40691 - https://github.com/fleetdm/fleet/pull/41524 - https://github.com/fleetdm/fleet/pull/41674 --------- Co-authored-by: Jonathan Katz <44128041+jkatz01@users.noreply.github.com> Co-authored-by: jkatz01 <yehonatankatz@gmail.com> Co-authored-by: RachelElysia <71795832+RachelElysia@users.noreply.github.com> Co-authored-by: Jahziel Villasana-Espinoza <jahziel@fleetdm.com>
52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
import React from "react";
|
|
|
|
import TooltipWrapper from "components/TooltipWrapper";
|
|
import Icon from "components/Icon";
|
|
|
|
import { SoftwareInstallPolicyTypeSet } from "interfaces/software";
|
|
import PillBadge from "components/PillBadge";
|
|
|
|
const baseClass = "software-install-policy-badges";
|
|
|
|
export const PATCH_TOOLTIP_CONTENT = (
|
|
<>
|
|
Hosts will fail this policy if they're <br />
|
|
running an older version.
|
|
</>
|
|
);
|
|
interface IPatchBadgesProps {
|
|
policyType?: SoftwareInstallPolicyTypeSet;
|
|
}
|
|
|
|
const SoftwareInstallPolicyBadges = ({ policyType }: IPatchBadgesProps) => {
|
|
const renderPatchBadge = () => (
|
|
<PillBadge text="Patch" tipContent={PATCH_TOOLTIP_CONTENT} />
|
|
);
|
|
|
|
const renderAutomaticInstallBadge = () => (
|
|
<TooltipWrapper
|
|
className={`${baseClass}__dynamic-policy-tooltip`}
|
|
tipContent={
|
|
<>
|
|
Software will be automatically installed <br />
|
|
when hosts fail this policy.
|
|
</>
|
|
}
|
|
tipOffset={14}
|
|
position="top"
|
|
showArrow
|
|
underline={false}
|
|
>
|
|
<Icon name="refresh" color="ui-fleet-black-75" />
|
|
</TooltipWrapper>
|
|
);
|
|
|
|
return (
|
|
<>
|
|
{policyType?.has("patch") && renderPatchBadge()}
|
|
{policyType?.has("dynamic") && renderAutomaticInstallBadge()}
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default SoftwareInstallPolicyBadges;
|