mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
## Issue Cerra #20404 ## Description - Add frontend/API backend for editing software packages. GitOps will be a separate PR. ## More - Please see subtasks for change lists - #21611 - #21613 # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information. - [x] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [x] Manual QA for all new/changed functionality Automated tests will follow in another PR. --------- Co-authored-by: Ian Littman <iansltx@gmail.com> Co-authored-by: Luke Heath <luke@fleetdm.com> Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: Victor Lyuboslavsky <victor.lyuboslavsky@gmail.com>
62 lines
1.5 KiB
TypeScript
62 lines
1.5 KiB
TypeScript
import React from "react";
|
||
|
||
import Button from "components/buttons/Button";
|
||
import Modal from "components/Modal";
|
||
|
||
import { IPackageFormData } from "pages/SoftwarePage/components/PackageForm/PackageForm";
|
||
|
||
const baseClass = "save-changes-modal";
|
||
|
||
export interface IConfirmSaveChangesModalProps {
|
||
onSaveChanges: () => void;
|
||
softwarePackageName?: string;
|
||
onClose: () => void;
|
||
}
|
||
|
||
const ConfirmSaveChangesModal = ({
|
||
onSaveChanges,
|
||
softwarePackageName,
|
||
onClose,
|
||
}: IConfirmSaveChangesModalProps) => {
|
||
const warningText = (
|
||
<>
|
||
The changes you are making will cancel any pending installs and uninstalls
|
||
{softwarePackageName ? (
|
||
<>
|
||
{" "}
|
||
for <b> {softwarePackageName}</b>
|
||
</>
|
||
) : (
|
||
""
|
||
)}
|
||
.
|
||
</>
|
||
);
|
||
return (
|
||
<Modal title="Save changes?" onExit={onClose}>
|
||
<form className={`${baseClass}__form`}>
|
||
<p>{warningText}</p>
|
||
<p>
|
||
Installs or uninstalls currently running on a host will still
|
||
complete, but results won’t appear in Fleet.
|
||
</p>
|
||
<p>You cannot undo this action.</p>
|
||
<div className="modal-cta-wrap">
|
||
<Button
|
||
type="button"
|
||
onClick={onSaveChanges}
|
||
variant="brand"
|
||
className="save-loading"
|
||
>
|
||
Save
|
||
</Button>
|
||
<Button onClick={onClose} variant="inverse">
|
||
Cancel
|
||
</Button>
|
||
</div>
|
||
</form>
|
||
</Modal>
|
||
);
|
||
};
|
||
|
||
export default ConfirmSaveChangesModal;
|