Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display SUMA updates in Host Details page #2430

Merged
merged 11 commits into from
Mar 19, 2024
Merged

Display SUMA updates in Host Details page #2430

merged 11 commits into from
Mar 19, 2024

Conversation

jamie-suse
Copy link
Contributor

@jamie-suse jamie-suse commented Mar 18, 2024

Description

This change mounts the AvailableSoftwareUpdates component in the Host Details page, allowing users to see the available updates and patches for a host, as instructed by SUMA.

How was this tested?

Added React component tests to validate that the Available Software Updates component is correctly being displayed in the Host Details page.

@jamie-suse jamie-suse added enhancement New feature or request javascript Pull requests that update Javascript code labels Mar 18, 2024
@jamie-suse jamie-suse self-assigned this Mar 18, 2024
@jamie-suse jamie-suse marked this pull request as ready for review March 19, 2024 13:06
@nelsonkopliku nelsonkopliku added the env Create an ephimeral environment for the pr branch label Mar 19, 2024
Comment on lines +106 to +108
relevantPatches={numRelevantPatches}
upgradablePackages={numUpgradablePackages}
softwareUpdatesLoading={softwareUpdatesLoading}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we wanna add a tooltip text as a prop here? I really don't know, and I really don't wanna block this PR just for this nit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Do you think it's worth testing this tooltip behaviour from HostDetails.test.jsx, as it's already being tested in AvailableSoftwareUpdates.test.jsx... 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think we can iterate over that, for example in the future we can have a selector to determine tooltip's text

@@ -66,6 +78,7 @@ function HostDetailsPage() {
getExportersStatus();
refreshCatalog();
dispatch(updateLastExecution(hostID));
dispatch(fetchSoftwareUpdates(hostID));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be like the following

Suggested change
dispatch(fetchSoftwareUpdates(hostID));
dispatch(fetchSoftwareUpdates({hostId: hostID}))

unless we change that action

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm just had a look through our codebase and we use a mix of hostID and hostId 🤔 I guess hostID is more popular though, so I'll change the action

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up to you, but the thing is we need to pass an object, not the plain id (whatever is called).
unless we do transformation in the action

export const createAction = createAction(
  FETCH_SOFTWARE_UPDATES,
  (hostId) => ({ payload: { hostId } })
);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see what you mean. I thought I was using the action-creator in @state/softwareUpdates. Instead, I was calling the Saga directly 😳

Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aaand yes!

@jamie-suse jamie-suse merged commit 54e94ff into main Mar 19, 2024
24 checks passed
@jamie-suse jamie-suse deleted the suma-updates branch March 19, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request env Create an ephimeral environment for the pr branch javascript Pull requests that update Javascript code
Development

Successfully merging this pull request may close these issues.

None yet

3 participants