From 6d7f227a60b78e9a89ec572ce3569be9ce0eea09 Mon Sep 17 00:00:00 2001 From: RachelElysia <71795832+RachelElysia@users.noreply.github.com> Date: Tue, 20 Jan 2026 12:49:18 -0500 Subject: [PATCH] Fleet UI: Clarify delete VPP app pending install nuance (#38376) --- ...72-delete-software-pending-installs-nuance | 1 + .../DeleteSoftwareModal.tests.tsx | 66 +++++++++++++++++ .../DeleteSoftwareModal.tsx | 70 ++++++++++++------- .../SoftwareInstallerCard.tsx | 6 +- 4 files changed, 117 insertions(+), 26 deletions(-) create mode 100644 changes/33272-delete-software-pending-installs-nuance create mode 100644 frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/DeleteSoftwareModal/DeleteSoftwareModal.tests.tsx diff --git a/changes/33272-delete-software-pending-installs-nuance b/changes/33272-delete-software-pending-installs-nuance new file mode 100644 index 0000000000..c7ff232c75 --- /dev/null +++ b/changes/33272-delete-software-pending-installs-nuance @@ -0,0 +1 @@ +- Fleet UI: Clarify what happens to pending software installs when deleting VPP apps diff --git a/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/DeleteSoftwareModal/DeleteSoftwareModal.tests.tsx b/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/DeleteSoftwareModal/DeleteSoftwareModal.tests.tsx new file mode 100644 index 0000000000..1393c14963 --- /dev/null +++ b/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/DeleteSoftwareModal/DeleteSoftwareModal.tests.tsx @@ -0,0 +1,66 @@ +import React from "react"; +import { render, screen } from "@testing-library/react"; + +import { noop } from "lodash"; + +import DeleteSoftwareModal from "./DeleteSoftwareModal"; + +const renderModal = ( + props: Partial> = {} +) => { + return render( + + ); +}; + +describe("DeleteSoftwareModal", () => { + beforeEach(() => { + jest.resetAllMocks(); + }); + + it("renders GitOps banner when gitOpsModeEnabled is true", () => { + renderModal({ gitOpsModeEnabled: true }); + + expect( + screen.getByText( + "You are currently in GitOps mode. If the package is defined in GitOps, it will reappear when GitOps runs." + ) + ).toBeVisible(); + }); + + it("renders default platform message when not VPP app or Android app", () => { + renderModal(); + + expect(screen.getByText(/won't be uninstalled/i)).toBeVisible(); + expect( + screen.getByText(/Pending installs and uninstalls will be canceled\./i) + ).toBeVisible(); + }); + + it("renders App Store message when isAppStoreApp is true", () => { + renderModal({ isAppStoreApp: true }); + + expect(screen.getByText(/won't be uninstalled/i)).toBeVisible(); + expect( + screen.getByText( + /Pending or already started installs and uninstalls won't be canceled/i + ) + ).toBeVisible(); + }); + + it("renders Android message when isAndroidApp is true", () => { + renderModal({ isAndroidApp: true }); + + expect( + screen.getByText( + /Currently, software won't be deleted from self-service \(managed Google Play\) and won't be uninstalled from the hosts\./i + ) + ).toBeVisible(); + }); +}); diff --git a/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/DeleteSoftwareModal/DeleteSoftwareModal.tsx b/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/DeleteSoftwareModal/DeleteSoftwareModal.tsx index 37f6b60927..8639f41359 100644 --- a/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/DeleteSoftwareModal/DeleteSoftwareModal.tsx +++ b/frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/DeleteSoftwareModal/DeleteSoftwareModal.tsx @@ -16,24 +16,64 @@ const DELETE_SW_USED_BY_POLICY_ERROR_MSG = const DELETE_SW_INSTALLED_DURING_SETUP_ERROR_MSG = "Couldn't delete. This software is installed during new host setup. Please remove software in Controls > Setup experience and try again."; +const getPlatformMessage = (isAppStoreApp: boolean, isAndroidApp: boolean) => { + // Android apps do not have pending installs/uninstalls as they are initiated through setup experience or by user + if (isAndroidApp) { + return ( +

+ Currently, software won't be deleted from self-service (managed + Google Play) and won't be uninstalled from the hosts. +

+ ); + } + + // VPP apps pending installs/uninstalls commands are not cancelled (future story #25912) but results only show in activity feed, as software is removed from host's software library + if (isAppStoreApp) { + return ( + <> +

+ Software won't be uninstalled from hosts. +

+

+ Pending or already started installs and uninstalls won't be + canceled, and the results won't appear in Fleet. +

+ + ); + } + + return ( + <> +

+ Software won't be uninstalled from hosts. +

+

+ Pending installs and uninstalls will be canceled. If they have already + started, they won' be canceled, and the results won't appear + in Fleet. +

+ + ); +}; + interface IDeleteSoftwareModalProps { softwareId: number; teamId: number; - softwareTitleName?: string; - softwareDisplayName?: string; onExit: () => void; onSuccess: () => void; gitOpsModeEnabled?: boolean; + isAppStoreApp?: boolean; + isAndroidApp?: boolean; } const DeleteSoftwareModal = ({ softwareId, teamId, - softwareTitleName, - softwareDisplayName, onExit, onSuccess, gitOpsModeEnabled, + isAppStoreApp = false, + isAndroidApp = false, }: IDeleteSoftwareModalProps) => { const { renderFlash } = useContext(NotificationContext); const [isDeleting, setIsDeleting] = useState(false); @@ -72,26 +112,8 @@ const DeleteSoftwareModal = ({ GitOps, it will reappear when GitOps runs. )} -

- Are you sure you want to delete{" "} - {softwareDisplayName || softwareTitleName}? -

- -

You cannot undo this action.

+ {getPlatformMessage(isAppStoreApp, isAndroidApp)} +

Custom icon and display name will be deleted.