diff --git a/frontend/pages/hosts/details/cards/Software/SoftwareUpdateModal/SoftwareUpdateModal.tests.tsx b/frontend/pages/hosts/details/cards/Software/SoftwareUpdateModal/SoftwareUpdateModal.tests.tsx index 2622e875d4..66325b34ff 100644 --- a/frontend/pages/hosts/details/cards/Software/SoftwareUpdateModal/SoftwareUpdateModal.tests.tsx +++ b/frontend/pages/hosts/details/cards/Software/SoftwareUpdateModal/SoftwareUpdateModal.tests.tsx @@ -129,7 +129,7 @@ describe("SoftwareUpdateModal", () => { expect(screen.getByText("Current version:")).toBeInTheDocument(); }); - it("renders 'Current Versions' if more than one installed", () => { + it("renders 'Current versions' if more than one installed", () => { const mockSoftware = createMockHostSoftware({ installed_versions: [ { @@ -156,7 +156,7 @@ describe("SoftwareUpdateModal", () => { onUpdate={noop} /> ); - expect(screen.getByText("Current Versions:")).toBeInTheDocument(); + expect(screen.getByText("Current versions:")).toBeInTheDocument(); }); // Shouldn't happen, unless tarballs or weird edge case diff --git a/frontend/pages/hosts/details/cards/Software/SoftwareUpdateModal/SoftwareUpdateModal.tsx b/frontend/pages/hosts/details/cards/Software/SoftwareUpdateModal/SoftwareUpdateModal.tsx index f9640de226..4aee7649e7 100644 --- a/frontend/pages/hosts/details/cards/Software/SoftwareUpdateModal/SoftwareUpdateModal.tsx +++ b/frontend/pages/hosts/details/cards/Software/SoftwareUpdateModal/SoftwareUpdateModal.tsx @@ -116,16 +116,7 @@ const SoftwareUpdateModal = ({ installerName={installerName} installerVersion={installerVersion} /> - {showCurrentVersions && ( -
-
- {installed_versions.length === 1 - ? "Current version:" - : "Current Versions:"} -
- -
- )} + {showCurrentVersions && } { +const InventoryVersions = ({ + hostSoftware, + showLabel = true, +}: IInventoryVersionsProps) => { const installedVersions = hostSoftware.installed_versions; if (!installedVersions || installedVersions.length === 0) { return ( -
+
{ return (
- {installedVersions.map((installedVersion) => { - return ( - - ); - })} + {showLabel && ( +
+ Current version{installedVersions.length > 1 && "s"}: +
+ )} +
+ {installedVersions.map((installedVersion) => { + return ( + + ); + })} +
); }; diff --git a/frontend/pages/hosts/details/components/InventoryVersions/_styles.scss b/frontend/pages/hosts/details/components/InventoryVersions/_styles.scss index d8f19eb645..a3082bd118 100644 --- a/frontend/pages/hosts/details/components/InventoryVersions/_styles.scss +++ b/frontend/pages/hosts/details/components/InventoryVersions/_styles.scss @@ -1,12 +1,18 @@ .inventory-versions { display: flex; flex-direction: column; - gap: $pad-medium; + gap: $pad-small; .data-set dd { white-space: initial; } + &__versions { + display: flex; + flex-direction: column; + gap: $pad-medium; + } + &__version { display: flex; flex-direction: column;