Skip to content

Commit

Permalink
Add header to upgradable packages view (#2685)
Browse files Browse the repository at this point in the history
  • Loading branch information
dottorblaster committed Jun 27, 2024
1 parent fdfd7fa commit af9e959
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions assets/js/pages/UpgradablePackagesPage/UpgradablePackagesPage.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import React, { useEffect } from 'react';
import { useParams } from 'react-router-dom';
import { useSelector, useDispatch } from 'react-redux';
import { get } from 'lodash';

import { getHost } from '@state/selectors/host';
import { getUpgradablePackages } from '@state/selectors/softwareUpdates';
import { fetchSoftwareUpdatesSettings } from '@state/softwareUpdatesSettings';
import {
fetchSoftwareUpdates,
fetchUpgradablePackagesPatches,
} from '@state/softwareUpdates';

import PageHeader from '@common/PageHeader';
import BackButton from '@common/BackButton';
import UpgradablePackagesList from '@common/UpgradablePackagesList';

Expand All @@ -21,6 +24,10 @@ function UpgradablePackagesPage() {
dispatch(fetchSoftwareUpdatesSettings());
}, []);

const host = useSelector(getHost(hostID));

const hostname = get(host, 'hostname', '');

const upgradablePackages = useSelector((state) =>
getUpgradablePackages(state, hostID)
);
Expand All @@ -36,6 +43,9 @@ function UpgradablePackagesPage() {
return (
<>
<BackButton url={`/hosts/${hostID}`}>Back to Host Details</BackButton>
<PageHeader>
Upgradable packages: <span className="font-bold">{hostname}</span>
</PageHeader>
<UpgradablePackagesList upgradablePackages={upgradablePackages} />
</>
);
Expand Down

0 comments on commit af9e959

Please sign in to comment.