fleet/frontend/pages/hosts/details/cards/HostSoftwareLibrary/HostSoftwareLibraryTable/HostSoftwareLibraryTableConfig.tsx

206 lines
6.9 KiB
TypeScript
Raw Normal View History

import React from "react";
import { InjectedRouter } from "react-router";
import { CellProps, Column } from "react-table";
import {
IHostSoftwareWithUiStatus,
IHostAppStoreApp,
IHostSoftware,
UI: Make consistent and update the Install and Uninstall detail modals for VPP and non-VPP apps across the Fleet UI (#31420) # #30860 ## Summary * **New Features** * Introduced dedicated modals for viewing install and uninstall details for both VPP and non-VPP software, providing clearer and more consistent information. * Added support for displaying detailed install information for VPP host software and improved handling of install status actions. * Added an Inventory Versions modal to display detailed version history for installed software on a host. * **Improvements** * Standardized and improved the design and behavior of install/uninstall detail modals across the app. * Refined callbacks and state management for launching modals from host and self-service software tables. * **Bug Fixes** * Addressed issues with property naming and callback signatures in install status handling. * Addressed inconsistencies in displaying software details and status across different components. * **Refactor** * Streamlined component props, callback signatures, and data models for improved maintainability. * Updated test cases and interfaces to align with the new modal and callback structure. * Removed legacy software details modal and related code, streamlining the user interface. * **Style** * Updated modal and table styles for improved readability and consistency. ## *Important note: Host software library modals for VPP apps currently show only installed versions due to [an API bug that is being addressed](https://github.com/fleetdm/fleet/issues/31459) ## Install details modal in various locations and states : ### Activity feeds (global, host details), non-VPP: ![ezgif-7af8221d19cd91](https://github.com/user-attachments/assets/bb90dcb6-6d99-455b-8e70-0cd905dd7b2d) ### Device user page self-service, non-VPP (with Retry functionality): ![ezgif-7d1b107f56dc16](https://github.com/user-attachments/assets/e4b91bf6-01bf-423e-9542-3ae4d2d17422) ### Host software library, non-VPP: ![ezgif-76c029bd028544](https://github.com/user-attachments/assets/931b6076-87d5-4e77-92ab-86fad323d396) ### Activity feeds (global, host details), VPP apps: ![ezgif-75eb0ebecb1893](https://github.com/user-attachments/assets/084eca68-4cf7-423a-8cb9-b14ea6d4c2d3) ### Device user page self-service, VPP apps (with Retry functionality): ![ezgif-728e4e8c2a595e](https://github.com/user-attachments/assets/969d1d49-b014-49a2-9c64-3c0dd88b05cc) ### Uninstall modal samples - TODO - [x] Changes file added for user-visible changes in `changes/` ## Testing - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: RachelElysia <rachel@fleetdm.com>
2025-08-01 19:45:09 +00:00
IVPPHostSoftware,
} from "interfaces/software";
import { IHeaderProps, IStringCellProps } from "interfaces/datatable_config";
import PATHS from "router/paths";
import { getPathWithQueryParams } from "utilities/url";
import { getAutomaticInstallPoliciesCount } from "pages/SoftwarePage/helpers";
import HeaderCell from "components/TableContainer/DataTable/HeaderCell/HeaderCell";
UI: Make consistent and update the Install and Uninstall detail modals for VPP and non-VPP apps across the Fleet UI (#31420) # #30860 ## Summary * **New Features** * Introduced dedicated modals for viewing install and uninstall details for both VPP and non-VPP software, providing clearer and more consistent information. * Added support for displaying detailed install information for VPP host software and improved handling of install status actions. * Added an Inventory Versions modal to display detailed version history for installed software on a host. * **Improvements** * Standardized and improved the design and behavior of install/uninstall detail modals across the app. * Refined callbacks and state management for launching modals from host and self-service software tables. * **Bug Fixes** * Addressed issues with property naming and callback signatures in install status handling. * Addressed inconsistencies in displaying software details and status across different components. * **Refactor** * Streamlined component props, callback signatures, and data models for improved maintainability. * Updated test cases and interfaces to align with the new modal and callback structure. * Removed legacy software details modal and related code, streamlining the user interface. * **Style** * Updated modal and table styles for improved readability and consistency. ## *Important note: Host software library modals for VPP apps currently show only installed versions due to [an API bug that is being addressed](https://github.com/fleetdm/fleet/issues/31459) ## Install details modal in various locations and states : ### Activity feeds (global, host details), non-VPP: ![ezgif-7af8221d19cd91](https://github.com/user-attachments/assets/bb90dcb6-6d99-455b-8e70-0cd905dd7b2d) ### Device user page self-service, non-VPP (with Retry functionality): ![ezgif-7d1b107f56dc16](https://github.com/user-attachments/assets/e4b91bf6-01bf-423e-9542-3ae4d2d17422) ### Host software library, non-VPP: ![ezgif-76c029bd028544](https://github.com/user-attachments/assets/931b6076-87d5-4e77-92ab-86fad323d396) ### Activity feeds (global, host details), VPP apps: ![ezgif-75eb0ebecb1893](https://github.com/user-attachments/assets/084eca68-4cf7-423a-8cb9-b14ea6d4c2d3) ### Device user page self-service, VPP apps (with Retry functionality): ![ezgif-728e4e8c2a595e](https://github.com/user-attachments/assets/969d1d49-b014-49a2-9c64-3c0dd88b05cc) ### Uninstall modal samples - TODO - [x] Changes file added for user-visible changes in `changes/` ## Testing - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: RachelElysia <rachel@fleetdm.com>
2025-08-01 19:45:09 +00:00
import { ISWUninstallDetailsParentState } from "components/ActivityDetails/InstallDetails/SoftwareUninstallDetailsModal/SoftwareUninstallDetailsModal";
import SoftwareNameCell from "components/TableContainer/DataTable/SoftwareNameCell";
UI: Make consistent and update the Install and Uninstall detail modals for VPP and non-VPP apps across the Fleet UI (#31420) # #30860 ## Summary * **New Features** * Introduced dedicated modals for viewing install and uninstall details for both VPP and non-VPP software, providing clearer and more consistent information. * Added support for displaying detailed install information for VPP host software and improved handling of install status actions. * Added an Inventory Versions modal to display detailed version history for installed software on a host. * **Improvements** * Standardized and improved the design and behavior of install/uninstall detail modals across the app. * Refined callbacks and state management for launching modals from host and self-service software tables. * **Bug Fixes** * Addressed issues with property naming and callback signatures in install status handling. * Addressed inconsistencies in displaying software details and status across different components. * **Refactor** * Streamlined component props, callback signatures, and data models for improved maintainability. * Updated test cases and interfaces to align with the new modal and callback structure. * Removed legacy software details modal and related code, streamlining the user interface. * **Style** * Updated modal and table styles for improved readability and consistency. ## *Important note: Host software library modals for VPP apps currently show only installed versions due to [an API bug that is being addressed](https://github.com/fleetdm/fleet/issues/31459) ## Install details modal in various locations and states : ### Activity feeds (global, host details), non-VPP: ![ezgif-7af8221d19cd91](https://github.com/user-attachments/assets/bb90dcb6-6d99-455b-8e70-0cd905dd7b2d) ### Device user page self-service, non-VPP (with Retry functionality): ![ezgif-7d1b107f56dc16](https://github.com/user-attachments/assets/e4b91bf6-01bf-423e-9542-3ae4d2d17422) ### Host software library, non-VPP: ![ezgif-76c029bd028544](https://github.com/user-attachments/assets/931b6076-87d5-4e77-92ab-86fad323d396) ### Activity feeds (global, host details), VPP apps: ![ezgif-75eb0ebecb1893](https://github.com/user-attachments/assets/084eca68-4cf7-423a-8cb9-b14ea6d4c2d3) ### Device user page self-service, VPP apps (with Retry functionality): ![ezgif-728e4e8c2a595e](https://github.com/user-attachments/assets/969d1d49-b014-49a2-9c64-3c0dd88b05cc) ### Uninstall modal samples - TODO - [x] Changes file added for user-visible changes in `changes/` ## Testing - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: RachelElysia <rachel@fleetdm.com>
2025-08-01 19:45:09 +00:00
import VersionCell from "pages/SoftwarePage/components/tables/VersionCell";
import HostInstallerActionCell from "../HostInstallerActionCell";
import InstallStatusCell from "../../Software/InstallStatusCell";
import { installStatusSortType } from "../../Software/helpers";
type ISoftwareTableConfig = Column<IHostSoftwareWithUiStatus>;
type ITableHeaderProps = IHeaderProps<IHostSoftwareWithUiStatus>;
type ITableStringCellProps = IStringCellProps<IHostSoftwareWithUiStatus>;
type IInstalledStatusCellProps = CellProps<
IHostSoftwareWithUiStatus,
IHostSoftwareWithUiStatus["ui_status"]
>;
type IVersionsCellProps = CellProps<
IHostSoftwareWithUiStatus,
IHostSoftwareWithUiStatus["installed_versions"]
>;
type IActionCellProps = CellProps<
IHostSoftwareWithUiStatus,
IHostSoftwareWithUiStatus["status"]
>;
interface IHostSWLibraryTableHeaders {
userHasSWWritePermission: boolean;
hostScriptsEnabled?: boolean;
router: InjectedRouter;
teamId: number;
hostMDMEnrolled?: boolean;
baseClass: string;
UI: Make consistent and update the Install and Uninstall detail modals for VPP and non-VPP apps across the Fleet UI (#31420) # #30860 ## Summary * **New Features** * Introduced dedicated modals for viewing install and uninstall details for both VPP and non-VPP software, providing clearer and more consistent information. * Added support for displaying detailed install information for VPP host software and improved handling of install status actions. * Added an Inventory Versions modal to display detailed version history for installed software on a host. * **Improvements** * Standardized and improved the design and behavior of install/uninstall detail modals across the app. * Refined callbacks and state management for launching modals from host and self-service software tables. * **Bug Fixes** * Addressed issues with property naming and callback signatures in install status handling. * Addressed inconsistencies in displaying software details and status across different components. * **Refactor** * Streamlined component props, callback signatures, and data models for improved maintainability. * Updated test cases and interfaces to align with the new modal and callback structure. * Removed legacy software details modal and related code, streamlining the user interface. * **Style** * Updated modal and table styles for improved readability and consistency. ## *Important note: Host software library modals for VPP apps currently show only installed versions due to [an API bug that is being addressed](https://github.com/fleetdm/fleet/issues/31459) ## Install details modal in various locations and states : ### Activity feeds (global, host details), non-VPP: ![ezgif-7af8221d19cd91](https://github.com/user-attachments/assets/bb90dcb6-6d99-455b-8e70-0cd905dd7b2d) ### Device user page self-service, non-VPP (with Retry functionality): ![ezgif-7d1b107f56dc16](https://github.com/user-attachments/assets/e4b91bf6-01bf-423e-9542-3ae4d2d17422) ### Host software library, non-VPP: ![ezgif-76c029bd028544](https://github.com/user-attachments/assets/931b6076-87d5-4e77-92ab-86fad323d396) ### Activity feeds (global, host details), VPP apps: ![ezgif-75eb0ebecb1893](https://github.com/user-attachments/assets/084eca68-4cf7-423a-8cb9-b14ea6d4c2d3) ### Device user page self-service, VPP apps (with Retry functionality): ![ezgif-728e4e8c2a595e](https://github.com/user-attachments/assets/969d1d49-b014-49a2-9c64-3c0dd88b05cc) ### Uninstall modal samples - TODO - [x] Changes file added for user-visible changes in `changes/` ## Testing - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: RachelElysia <rachel@fleetdm.com>
2025-08-01 19:45:09 +00:00
onShowInventoryVersions?: (software?: IHostSoftware) => void;
onShowUpdateDetails: (software?: IHostSoftware) => void;
UI: Make consistent and update the Install and Uninstall detail modals for VPP and non-VPP apps across the Fleet UI (#31420) # #30860 ## Summary * **New Features** * Introduced dedicated modals for viewing install and uninstall details for both VPP and non-VPP software, providing clearer and more consistent information. * Added support for displaying detailed install information for VPP host software and improved handling of install status actions. * Added an Inventory Versions modal to display detailed version history for installed software on a host. * **Improvements** * Standardized and improved the design and behavior of install/uninstall detail modals across the app. * Refined callbacks and state management for launching modals from host and self-service software tables. * **Bug Fixes** * Addressed issues with property naming and callback signatures in install status handling. * Addressed inconsistencies in displaying software details and status across different components. * **Refactor** * Streamlined component props, callback signatures, and data models for improved maintainability. * Updated test cases and interfaces to align with the new modal and callback structure. * Removed legacy software details modal and related code, streamlining the user interface. * **Style** * Updated modal and table styles for improved readability and consistency. ## *Important note: Host software library modals for VPP apps currently show only installed versions due to [an API bug that is being addressed](https://github.com/fleetdm/fleet/issues/31459) ## Install details modal in various locations and states : ### Activity feeds (global, host details), non-VPP: ![ezgif-7af8221d19cd91](https://github.com/user-attachments/assets/bb90dcb6-6d99-455b-8e70-0cd905dd7b2d) ### Device user page self-service, non-VPP (with Retry functionality): ![ezgif-7d1b107f56dc16](https://github.com/user-attachments/assets/e4b91bf6-01bf-423e-9542-3ae4d2d17422) ### Host software library, non-VPP: ![ezgif-76c029bd028544](https://github.com/user-attachments/assets/931b6076-87d5-4e77-92ab-86fad323d396) ### Activity feeds (global, host details), VPP apps: ![ezgif-75eb0ebecb1893](https://github.com/user-attachments/assets/084eca68-4cf7-423a-8cb9-b14ea6d4c2d3) ### Device user page self-service, VPP apps (with Retry functionality): ![ezgif-728e4e8c2a595e](https://github.com/user-attachments/assets/969d1d49-b014-49a2-9c64-3c0dd88b05cc) ### Uninstall modal samples - TODO - [x] Changes file added for user-visible changes in `changes/` ## Testing - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: RachelElysia <rachel@fleetdm.com>
2025-08-01 19:45:09 +00:00
onSetSelectedHostSWInstallDetails: (details?: IHostSoftware) => void;
onSetSelectedHostSWUninstallDetails: (
details?: ISWUninstallDetailsParentState
) => void;
onSetSelectedVPPInstallDetails: (s: IVPPHostSoftware) => void;
onClickInstallAction: (softwareId: number) => void;
onClickUninstallAction: (softwareId: number) => void;
isHostOnline: boolean;
hostName: string;
}
// NOTE: cellProps come from react-table
// more info here https://react-table.tanstack.com/docs/api/useTable#cell-properties
export const generateHostSWLibraryTableHeaders = ({
userHasSWWritePermission,
hostScriptsEnabled = false,
router,
teamId,
hostMDMEnrolled,
baseClass,
UI: Make consistent and update the Install and Uninstall detail modals for VPP and non-VPP apps across the Fleet UI (#31420) # #30860 ## Summary * **New Features** * Introduced dedicated modals for viewing install and uninstall details for both VPP and non-VPP software, providing clearer and more consistent information. * Added support for displaying detailed install information for VPP host software and improved handling of install status actions. * Added an Inventory Versions modal to display detailed version history for installed software on a host. * **Improvements** * Standardized and improved the design and behavior of install/uninstall detail modals across the app. * Refined callbacks and state management for launching modals from host and self-service software tables. * **Bug Fixes** * Addressed issues with property naming and callback signatures in install status handling. * Addressed inconsistencies in displaying software details and status across different components. * **Refactor** * Streamlined component props, callback signatures, and data models for improved maintainability. * Updated test cases and interfaces to align with the new modal and callback structure. * Removed legacy software details modal and related code, streamlining the user interface. * **Style** * Updated modal and table styles for improved readability and consistency. ## *Important note: Host software library modals for VPP apps currently show only installed versions due to [an API bug that is being addressed](https://github.com/fleetdm/fleet/issues/31459) ## Install details modal in various locations and states : ### Activity feeds (global, host details), non-VPP: ![ezgif-7af8221d19cd91](https://github.com/user-attachments/assets/bb90dcb6-6d99-455b-8e70-0cd905dd7b2d) ### Device user page self-service, non-VPP (with Retry functionality): ![ezgif-7d1b107f56dc16](https://github.com/user-attachments/assets/e4b91bf6-01bf-423e-9542-3ae4d2d17422) ### Host software library, non-VPP: ![ezgif-76c029bd028544](https://github.com/user-attachments/assets/931b6076-87d5-4e77-92ab-86fad323d396) ### Activity feeds (global, host details), VPP apps: ![ezgif-75eb0ebecb1893](https://github.com/user-attachments/assets/084eca68-4cf7-423a-8cb9-b14ea6d4c2d3) ### Device user page self-service, VPP apps (with Retry functionality): ![ezgif-728e4e8c2a595e](https://github.com/user-attachments/assets/969d1d49-b014-49a2-9c64-3c0dd88b05cc) ### Uninstall modal samples - TODO - [x] Changes file added for user-visible changes in `changes/` ## Testing - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: RachelElysia <rachel@fleetdm.com>
2025-08-01 19:45:09 +00:00
onShowInventoryVersions,
onShowUpdateDetails,
UI: Make consistent and update the Install and Uninstall detail modals for VPP and non-VPP apps across the Fleet UI (#31420) # #30860 ## Summary * **New Features** * Introduced dedicated modals for viewing install and uninstall details for both VPP and non-VPP software, providing clearer and more consistent information. * Added support for displaying detailed install information for VPP host software and improved handling of install status actions. * Added an Inventory Versions modal to display detailed version history for installed software on a host. * **Improvements** * Standardized and improved the design and behavior of install/uninstall detail modals across the app. * Refined callbacks and state management for launching modals from host and self-service software tables. * **Bug Fixes** * Addressed issues with property naming and callback signatures in install status handling. * Addressed inconsistencies in displaying software details and status across different components. * **Refactor** * Streamlined component props, callback signatures, and data models for improved maintainability. * Updated test cases and interfaces to align with the new modal and callback structure. * Removed legacy software details modal and related code, streamlining the user interface. * **Style** * Updated modal and table styles for improved readability and consistency. ## *Important note: Host software library modals for VPP apps currently show only installed versions due to [an API bug that is being addressed](https://github.com/fleetdm/fleet/issues/31459) ## Install details modal in various locations and states : ### Activity feeds (global, host details), non-VPP: ![ezgif-7af8221d19cd91](https://github.com/user-attachments/assets/bb90dcb6-6d99-455b-8e70-0cd905dd7b2d) ### Device user page self-service, non-VPP (with Retry functionality): ![ezgif-7d1b107f56dc16](https://github.com/user-attachments/assets/e4b91bf6-01bf-423e-9542-3ae4d2d17422) ### Host software library, non-VPP: ![ezgif-76c029bd028544](https://github.com/user-attachments/assets/931b6076-87d5-4e77-92ab-86fad323d396) ### Activity feeds (global, host details), VPP apps: ![ezgif-75eb0ebecb1893](https://github.com/user-attachments/assets/084eca68-4cf7-423a-8cb9-b14ea6d4c2d3) ### Device user page self-service, VPP apps (with Retry functionality): ![ezgif-728e4e8c2a595e](https://github.com/user-attachments/assets/969d1d49-b014-49a2-9c64-3c0dd88b05cc) ### Uninstall modal samples - TODO - [x] Changes file added for user-visible changes in `changes/` ## Testing - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: RachelElysia <rachel@fleetdm.com>
2025-08-01 19:45:09 +00:00
onSetSelectedHostSWInstallDetails,
onSetSelectedHostSWUninstallDetails,
onSetSelectedVPPInstallDetails,
onClickInstallAction,
onClickUninstallAction,
isHostOnline,
}: IHostSWLibraryTableHeaders): ISoftwareTableConfig[] => {
const tableHeaders: ISoftwareTableConfig[] = [
{
Header: (cellProps: ITableHeaderProps) => (
<HeaderCell value="Name" isSortedDesc={cellProps.column.isSortedDesc} />
),
accessor: "name",
disableSortBy: false,
Cell: (cellProps: ITableStringCellProps) => {
const {
id,
name,
source,
icon_url,
app_store_app,
software_package,
} = cellProps.row.original;
const softwareTitleDetailsPath = getPathWithQueryParams(
PATHS.SOFTWARE_TITLE_DETAILS(id.toString()),
{ team_id: teamId }
);
const hasInstaller = !!app_store_app || !!software_package;
const isSelfService =
app_store_app?.self_service || software_package?.self_service;
const automaticInstallPoliciesCount = getAutomaticInstallPoliciesCount(
cellProps.row.original
);
return (
<SoftwareNameCell
name={name}
source={source}
iconUrl={icon_url}
path={softwareTitleDetailsPath}
router={router}
hasInstaller={hasInstaller}
isSelfService={isSelfService}
automaticInstallPoliciesCount={automaticInstallPoliciesCount}
pageContext="hostDetailsLibrary"
/>
);
},
},
{
Header: () => <HeaderCell disableSortBy value="Status" />,
disableSortBy: true,
accessor: "ui_status",
sortType: installStatusSortType,
Cell: ({ row: { original } }: IInstalledStatusCellProps) => {
return (
<InstallStatusCell
software={original}
UI: Make consistent and update the Install and Uninstall detail modals for VPP and non-VPP apps across the Fleet UI (#31420) # #30860 ## Summary * **New Features** * Introduced dedicated modals for viewing install and uninstall details for both VPP and non-VPP software, providing clearer and more consistent information. * Added support for displaying detailed install information for VPP host software and improved handling of install status actions. * Added an Inventory Versions modal to display detailed version history for installed software on a host. * **Improvements** * Standardized and improved the design and behavior of install/uninstall detail modals across the app. * Refined callbacks and state management for launching modals from host and self-service software tables. * **Bug Fixes** * Addressed issues with property naming and callback signatures in install status handling. * Addressed inconsistencies in displaying software details and status across different components. * **Refactor** * Streamlined component props, callback signatures, and data models for improved maintainability. * Updated test cases and interfaces to align with the new modal and callback structure. * Removed legacy software details modal and related code, streamlining the user interface. * **Style** * Updated modal and table styles for improved readability and consistency. ## *Important note: Host software library modals for VPP apps currently show only installed versions due to [an API bug that is being addressed](https://github.com/fleetdm/fleet/issues/31459) ## Install details modal in various locations and states : ### Activity feeds (global, host details), non-VPP: ![ezgif-7af8221d19cd91](https://github.com/user-attachments/assets/bb90dcb6-6d99-455b-8e70-0cd905dd7b2d) ### Device user page self-service, non-VPP (with Retry functionality): ![ezgif-7d1b107f56dc16](https://github.com/user-attachments/assets/e4b91bf6-01bf-423e-9542-3ae4d2d17422) ### Host software library, non-VPP: ![ezgif-76c029bd028544](https://github.com/user-attachments/assets/931b6076-87d5-4e77-92ab-86fad323d396) ### Activity feeds (global, host details), VPP apps: ![ezgif-75eb0ebecb1893](https://github.com/user-attachments/assets/084eca68-4cf7-423a-8cb9-b14ea6d4c2d3) ### Device user page self-service, VPP apps (with Retry functionality): ![ezgif-728e4e8c2a595e](https://github.com/user-attachments/assets/969d1d49-b014-49a2-9c64-3c0dd88b05cc) ### Uninstall modal samples - TODO - [x] Changes file added for user-visible changes in `changes/` ## Testing - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: RachelElysia <rachel@fleetdm.com>
2025-08-01 19:45:09 +00:00
onShowInventoryVersions={onShowInventoryVersions}
onShowUpdateDetails={onShowUpdateDetails}
UI: Make consistent and update the Install and Uninstall detail modals for VPP and non-VPP apps across the Fleet UI (#31420) # #30860 ## Summary * **New Features** * Introduced dedicated modals for viewing install and uninstall details for both VPP and non-VPP software, providing clearer and more consistent information. * Added support for displaying detailed install information for VPP host software and improved handling of install status actions. * Added an Inventory Versions modal to display detailed version history for installed software on a host. * **Improvements** * Standardized and improved the design and behavior of install/uninstall detail modals across the app. * Refined callbacks and state management for launching modals from host and self-service software tables. * **Bug Fixes** * Addressed issues with property naming and callback signatures in install status handling. * Addressed inconsistencies in displaying software details and status across different components. * **Refactor** * Streamlined component props, callback signatures, and data models for improved maintainability. * Updated test cases and interfaces to align with the new modal and callback structure. * Removed legacy software details modal and related code, streamlining the user interface. * **Style** * Updated modal and table styles for improved readability and consistency. ## *Important note: Host software library modals for VPP apps currently show only installed versions due to [an API bug that is being addressed](https://github.com/fleetdm/fleet/issues/31459) ## Install details modal in various locations and states : ### Activity feeds (global, host details), non-VPP: ![ezgif-7af8221d19cd91](https://github.com/user-attachments/assets/bb90dcb6-6d99-455b-8e70-0cd905dd7b2d) ### Device user page self-service, non-VPP (with Retry functionality): ![ezgif-7d1b107f56dc16](https://github.com/user-attachments/assets/e4b91bf6-01bf-423e-9542-3ae4d2d17422) ### Host software library, non-VPP: ![ezgif-76c029bd028544](https://github.com/user-attachments/assets/931b6076-87d5-4e77-92ab-86fad323d396) ### Activity feeds (global, host details), VPP apps: ![ezgif-75eb0ebecb1893](https://github.com/user-attachments/assets/084eca68-4cf7-423a-8cb9-b14ea6d4c2d3) ### Device user page self-service, VPP apps (with Retry functionality): ![ezgif-728e4e8c2a595e](https://github.com/user-attachments/assets/969d1d49-b014-49a2-9c64-3c0dd88b05cc) ### Uninstall modal samples - TODO - [x] Changes file added for user-visible changes in `changes/` ## Testing - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com> Co-authored-by: RachelElysia <rachel@fleetdm.com>
2025-08-01 19:45:09 +00:00
onShowInstallDetails={onSetSelectedHostSWInstallDetails}
onShowVPPInstallDetails={onSetSelectedVPPInstallDetails}
onShowUninstallDetails={onSetSelectedHostSWUninstallDetails}
isHostOnline={isHostOnline}
/>
);
},
},
{
Header: "Installed version",
id: "version",
disableSortBy: true,
// we use function as accessor because we have two columns that
// need to access the same data. This is not supported with a string
// accessor.
accessor: (originalRow) => originalRow.installed_versions,
Cell: (cellProps: IVersionsCellProps) => {
return <VersionCell versions={cellProps.cell.value} />;
},
},
{
Header: "Library version",
id: "library_version",
disableSortBy: true,
// we use function as accessor because we have two columns that
// need to access the same data. This is not supported with a string
// accessor.
accessor: (originalRow) =>
originalRow.software_package || originalRow.app_store_app,
Cell: (cellProps: IVersionsCellProps) => {
const softwareTitle = cellProps.row.original;
const installerData = softwareTitle.software_package
? softwareTitle.software_package
: (softwareTitle.app_store_app as IHostAppStoreApp);
return (
<VersionCell versions={[{ version: installerData?.version || "" }]} />
);
},
},
{
Header: "Actions",
accessor: (originalRow) => originalRow.ui_status,
disableSortBy: true,
Cell: (cellProps: IActionCellProps) => {
return (
<HostInstallerActionCell
software={cellProps.row.original}
onClickInstallAction={onClickInstallAction}
onClickUninstallAction={() =>
onClickUninstallAction(cellProps.row.original.id)
}
baseClass={baseClass}
hostScriptsEnabled={hostScriptsEnabled}
hostMDMEnrolled={hostMDMEnrolled}
/>
);
},
},
];
// Hide the install/uninstall actions if the user doesn't have write permission
if (!userHasSWWritePermission) {
tableHeaders.pop();
}
return tableHeaders;
};
export default {
generateHostSWLibraryTableHeaders,
};