disable deletion of EULA from UI when gitops mode enabled (#30555)

relates to [#28143](https://github.com/fleetdm/fleet/issues/28143)

quick fix to not allow deleting EULA when gitops mode is enabled.

- [x] Manual QA for all new/changed functionality


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* The delete button in the EULA list is now conditionally disabled based
on GitOps mode, with an explanatory tooltip.

* **Chores**
  * Removed an unused import from a test file.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Gabriel Hernandez
2025-07-07 15:32:33 +01:00
committed by GitHub
parent 01108c898e
commit 782b522cd1
2 changed files with 13 additions and 8 deletions
@@ -1,6 +1,5 @@
import React from "react";
import { noop } from "lodash";
import { screen } from "@testing-library/react";
import { createCustomRenderer } from "test/test-utils";
@@ -7,6 +7,7 @@ import { IEulaMetadataResponse } from "services/entities/mdm";
import Icon from "components/Icon";
import Button from "components/buttons/Button";
import Graphic from "components/Graphic";
import GitOpsModeTooltipWrapper from "components/GitOpsModeTooltipWrapper";
const baseClass = "eula-list-item";
@@ -51,13 +52,18 @@ const EulaListItem = ({ eulaData, onDelete }: IEulaListItemProps) => {
color="ui-fleet-black-75"
/>
</Button>
<Button
className={`${baseClass}__list-item-button`}
variant="text-icon"
onClick={() => onDelete()}
>
<Icon name="trash" color="ui-fleet-black-75" />
</Button>
<GitOpsModeTooltipWrapper
renderChildren={(disableChildren) => (
<Button
className={`${baseClass}__list-item-button`}
variant="text-icon"
onClick={() => onDelete()}
disabled={disableChildren}
>
<Icon name="trash" color="ui-fleet-black-75" />
</Button>
)}
/>
</div>
</div>
);