diff --git a/frontend/pages/hosts/details/cards/Software/InstallStatusCell/InstallStatusCell.tests.tsx b/frontend/pages/hosts/details/cards/Software/InstallStatusCell/InstallStatusCell.tests.tsx index 1ea7ff7012..821da2a590 100644 --- a/frontend/pages/hosts/details/cards/Software/InstallStatusCell/InstallStatusCell.tests.tsx +++ b/frontend/pages/hosts/details/cards/Software/InstallStatusCell/InstallStatusCell.tests.tsx @@ -134,6 +134,7 @@ describe("InstallStatusCell - component", () => { software_package: createMockHostSoftwarePackage({ name: "mock software.sh", }), + source: "sh_packages", }), ui_status: "ran_script", }} diff --git a/frontend/pages/hosts/details/cards/Software/InstallStatusCell/InstallStatusCell.tsx b/frontend/pages/hosts/details/cards/Software/InstallStatusCell/InstallStatusCell.tsx index 23fdb61fbe..3d298e9980 100644 --- a/frontend/pages/hosts/details/cards/Software/InstallStatusCell/InstallStatusCell.tsx +++ b/frontend/pages/hosts/details/cards/Software/InstallStatusCell/InstallStatusCell.tsx @@ -9,6 +9,7 @@ import { IVPPHostSoftware, SoftwareUninstallStatus, IAppLastInstall, + SCRIPT_PACKAGE_SOURCES, } from "interfaces/software"; import { Colors } from "styles/var/colors"; @@ -497,15 +498,17 @@ const InstallStatusCell = ({ (software.status === "failed_install" || isInstalledInFleetAndUI)) || recentlyTakenAction; + const isScriptPackage = SCRIPT_PACKAGE_SOURCES.includes(software.source); + // Status groups and their click handlers const displayStatusConfig = [ { - condition: true, // Allow click even if no last install to see details modal + condition: isScriptPackage, // Still allows click even if no last install to see details modal statuses: ["Failed", "Run (pending)", "Ran"], onClick: onClickScriptStatus, }, { - condition: true, // Allow click even if no last install to see details modal + condition: !isScriptPackage, // Still allows click even if no last install to see details modal statuses: ["Failed", "Install (pending)", "Installed"], onClick: onClickInstallStatus, }, @@ -522,6 +525,7 @@ const InstallStatusCell = ({ ]; // Find a matching config for the current display text + // Given the condition is met and the display text is in the statuses array const match = displayStatusConfig.find( ({ condition, statuses }) => condition && statuses.includes(resolvedDisplayText as string)