fleet/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/AdvancedOptionsModal/AdvancedOptionsModal.tsx
kilo-code-bot[bot] e1fc1b08a8
Update modal 'Done' buttons to say 'Close' (#41751)
## Summary

- Changed all modal "Done" dismiss/close button labels to "Close" across
48 frontend component files
- Updated instructional text in `AutoEnrollMdmModal` that referenced the
"Done" button to say "Close" instead
- Updated 7 test files to assert "Close" instead of "Done" for modal
button names

## Excluded (intentionally not changed)

- `LiveResultsHeading.tsx` — "Done" button is a page-level navigation
action, not a modal dismiss
- `AddAbmModal.tsx` — Instructional text referencing Apple Business
Manager's "Done" button
- `Calendars.tsx` — Instructional text referencing Google Calendar's
"Done" button
- `ModalFooter.stories.tsx` — Storybook demo example

Built for
[Mel](https://fleetdm.slack.com/archives/D0AKX7DJFCN/p1773674157011109?thread_ts=1773673149.649299&cid=D0AKX7DJFCN)
by [Kilo for Slack](https://kilo.ai/features/slack-integration)

---------

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
Co-authored-by: melpike <mel@fleetdm.com>
Co-authored-by: melpike <79950145+melpike@users.noreply.github.com>
2026-03-23 09:59:18 -06:00

85 lines
2.5 KiB
TypeScript

import React from "react";
import Modal from "components/Modal";
import Button from "components/buttons/Button";
import SQLEditor from "components/SQLEditor";
import CustomLink from "components/CustomLink";
import Editor from "components/Editor";
const baseClass = "advanced-options-modal";
interface IAdvancedOptionsModalProps {
installScript: string;
preInstallQuery?: string;
postInstallScript?: string;
onExit: () => void;
}
const AdvancedOptionsModal = ({
installScript,
preInstallQuery,
postInstallScript,
onExit,
}: IAdvancedOptionsModalProps) => {
return (
<Modal className={baseClass} title="Advanced options" onExit={onExit}>
<p>
Advanced options are read-only. To change options, delete software and
add again.
</p>
<div className={`${baseClass}__form-inputs`}>
<Editor
readOnly
wrapEnabled
maxLines={10}
name="install-script"
value={installScript}
helpText="Fleet will run this command on hosts to install software."
label="Install script"
labelTooltip="For security agents, add the script provided by the vendor."
/>
{preInstallQuery && (
<div className={`${baseClass}__input-field`}>
<span>Pre-install condition:</span>
<SQLEditor
readOnly
value={preInstallQuery}
label="Query"
name="preInstallQuery"
maxLines={10}
helpText={
<>
Software will be installed only if the{" "}
<CustomLink
className={`${baseClass}__table-link`}
text="query returns results"
url="https://fleetdm.com/tables"
newTab
/>
</>
}
/>
</div>
)}
{postInstallScript && (
<div className={`${baseClass}__input-field`}>
<span>Post-install script:</span>
<Editor
readOnly
wrapEnabled
name="post-install-script-editor"
maxLines={10}
value={postInstallScript}
helpText="Shell (macOS and Linux) or PowerShell (Windows)."
/>
</div>
)}
</div>
<div className="modal-cta-wrap">
<Button onClick={onExit}>Close</Button>
</div>
</Modal>
);
};
export default AdvancedOptionsModal;