mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Fleet UI: Shows right status for vpp apps installed manually (#31674)
This commit is contained in:
parent
e37e14f78d
commit
974bc00862
1 changed files with 21 additions and 3 deletions
|
|
@ -29,6 +29,8 @@ import {
|
|||
|
||||
interface IGetStatusMessageProps {
|
||||
isDUP?: boolean;
|
||||
/** "pending" is an edge case here where VPP install activities that were added to the feed prior to v4.57
|
||||
* (when we split pending into pending_install/pending_uninstall) will list the status as "pending" rather than "pending_install" */
|
||||
displayStatus: SoftwareInstallStatus | "pending";
|
||||
isMDMStatusNotNow: boolean;
|
||||
isMDMStatusAcknowledged: boolean;
|
||||
|
|
@ -56,6 +58,21 @@ export const getStatusMessage = ({
|
|||
})})`
|
||||
: null;
|
||||
|
||||
// Handles "pending" value prior to 4.57
|
||||
const isPendingInstall = ["pending_install", "pending"].includes(
|
||||
displayStatus
|
||||
);
|
||||
|
||||
// Handles the case where software is installed manually by the user and not through Fleet
|
||||
// This app_store_app modal matches software_packages installed manually shown with SoftwareInstallDetailsModal
|
||||
if (displayStatus === "installed" && !commandUpdatedAt) {
|
||||
return (
|
||||
<>
|
||||
<b>{appName}</b> is installed.
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
// Handle NotNow case separately
|
||||
if (isMDMStatusNotNow) {
|
||||
return (
|
||||
|
|
@ -75,7 +92,7 @@ export const getStatusMessage = ({
|
|||
}
|
||||
|
||||
// VPP Verify command pending state
|
||||
if (displayStatus === "pending_install" && isMDMStatusAcknowledged) {
|
||||
if (isPendingInstall && isMDMStatusAcknowledged) {
|
||||
return (
|
||||
<>
|
||||
The MDM command (request) to install <b>{appName}</b>
|
||||
|
|
@ -117,7 +134,7 @@ export const getStatusMessage = ({
|
|||
<>
|
||||
{" "}
|
||||
on {formattedHost}
|
||||
{displayStatus === "pending_install" && " when it comes online"}
|
||||
{isPendingInstall && " when it comes online"}
|
||||
{displayTimeStamp && <> {displayTimeStamp}</>}
|
||||
</>
|
||||
);
|
||||
|
|
@ -216,8 +233,9 @@ export const VppInstallDetailsModal = ({
|
|||
}
|
||||
);
|
||||
|
||||
// Fallback to "installed" if no status is provided as Installed
|
||||
const displayStatus =
|
||||
(fleetInstallStatus as SoftwareInstallStatus) || "pending_install";
|
||||
(fleetInstallStatus as SoftwareInstallStatus) || "installed";
|
||||
const iconName = INSTALL_DETAILS_STATUS_ICONS[displayStatus];
|
||||
|
||||
// Note: We need to reconcile status values from two different sources. From props, we
|
||||
|
|
|
|||
Loading…
Reference in a new issue