Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/45729-self-service-show-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Added installed version and available version columns to the self-service software table on the My device page.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { IHeaderProps, IStringCellProps } from "interfaces/datatable_config";
import HeaderCell from "components/TableContainer/DataTable/HeaderCell/HeaderCell";

import SoftwareNameCell from "components/TableContainer/DataTable/SoftwareNameCell";
import VersionCell from "pages/SoftwarePage/components/tables/VersionCell";
Comment thread
spalmesano0 marked this conversation as resolved.
import { ISWUninstallDetailsParentState } from "components/ActivityDetails/InstallDetails/SoftwareUninstallDetailsModal/SoftwareUninstallDetailsModal";

import InstallStatusCell from "../../../InstallStatusCell/InstallStatusCell";
Expand All @@ -25,6 +26,15 @@ type IStatusCellProps = CellProps<
IDeviceSoftwareWithUiStatus,
IDeviceSoftwareWithUiStatus["ui_status"]
>;
type IVersionsCellProps = CellProps<
IDeviceSoftwareWithUiStatus,
IDeviceSoftwareWithUiStatus["installed_versions"]
>;
type IAvailableVersionCellProps = CellProps<
IDeviceSoftwareWithUiStatus,
| IDeviceSoftwareWithUiStatus["software_package"]
| IDeviceSoftwareWithUiStatus["app_store_app"]
>;
type IActionCellProps = CellProps<
IDeviceSoftwareWithUiStatus,
IDeviceSoftwareWithUiStatus["status"]
Expand Down Expand Up @@ -114,6 +124,33 @@ export const generateSoftwareTableHeaders = ({
/>
),
},
{
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,
Comment thread
spalmesano0 marked this conversation as resolved.
Cell: (cellProps: IVersionsCellProps) => {
return <VersionCell versions={cellProps.cell.value} />;
},
},
{
Header: "Available version",
id: "available_version",
disableSortBy: true,
accessor: (originalRow) =>
originalRow.software_package || originalRow.app_store_app,
Cell: (cellProps: IAvailableVersionCellProps) => {
const softwareTitle = cellProps.row.original;
const installerData =
softwareTitle.software_package ?? softwareTitle.app_store_app;
return (
<VersionCell versions={[{ version: installerData?.version || "" }]} />
);
},
Comment thread
spalmesano0 marked this conversation as resolved.
},
{
Header: "Actions",
accessor: "status",
Expand Down
Loading