fleet/frontend/pages/admin/components/HostStatusWebhookPreviewModal/HostStatusWebhookPreviewModal.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

64 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from "react";
import { syntaxHighlight } from "utilities/helpers";
import Button from "components/buttons/Button";
import Modal from "components/Modal";
const baseClass = "host-status-webhook-preview-modal";
const getHostStatusPreview = (teamScope?: boolean) => {
const data = {
unseen_hosts: 1,
total_hosts: 2,
days_unseen: 3,
team_id: 123,
} as Record<string, number>;
if (!teamScope) {
delete data.team_id;
}
return {
text:
"More than X% of your hosts have not checked into Fleet for more than Y days. Youve been sent this message because the Host status webhook is enabled in your Fleet instance.",
data,
};
};
interface IHostStatusWebhookPreviewModal {
isTeamScope?: boolean;
toggleModal: () => void;
}
const HostStatusWebhookPreviewModal = ({
isTeamScope = false,
toggleModal,
}: IHostStatusWebhookPreviewModal) => {
return (
<Modal
title="Host status webhook"
onExit={toggleModal}
onEnter={toggleModal}
className={baseClass}
>
<p>
An example request sent to your configured <b>Destination URL</b>.
</p>
<div className={baseClass}>
<pre
dangerouslySetInnerHTML={{
__html: syntaxHighlight(getHostStatusPreview(isTeamScope)),
}}
/>
</div>
<div className="modal-cta-wrap">
<Button type="button" onClick={toggleModal}>
Close
</Button>
</div>
</Modal>
);
};
export default HostStatusWebhookPreviewModal;