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

Extend error handling of AvailableSoftwareUpdates component #2538

Merged
merged 9 commits into from
Apr 26, 2024

Conversation

jamie-suse
Copy link
Contributor

@jamie-suse jamie-suse commented Apr 22, 2024

Description

This PR extends error handling for the AvailableSoftwareUpdates component.

On initial load, the Host Details page will display a loading spinner while the software updates settings are being retrieved.

image

If once the response is received, no SUSE Manager settings are saved, display the following to the user:

image

If some SUSE Manager settings have been saved, we enter the second loading state:

image

If we get any error response from SUSE Manager, we display it to the user as follows:

image

Finally, there is a catch-all unknown state. Where if for some reason we receive a 2XX response but there is no data in the response, we display the following:

image

How was this tested?

Added unit tests for the new states

@jamie-suse jamie-suse added enhancement New feature or request javascript Pull requests that update Javascript code labels Apr 22, 2024
@jamie-suse jamie-suse self-assigned this Apr 22, 2024
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.

Hey @jamie-suse, I guess there is something we need to address:

In a host detail page, even if there are settings, the Settings CTA is shown
How to reproduce:

  • configure suma settings
  • browse to any host detail (you should see what expected)
  • refresh host detail page (you should see the CTA even though settings are available)

This is happening because we are selecting from a piece of state that gets populated only if we browse settings page.

If we want to rely on that piece of state we might want to load suma settings at application startup (I initially understood you would have relied on the result from /api/v1/hosts/:host_id/software_updates, but I actually prefer the other approach)

@jagabomb
Copy link
Contributor

@jamie-suse for the loading state can we remove the word, "Loading..." and just keep the preloading spinner. I think the space is small and the preloader should be enough to convey the loading state. Please see the attachment for reference,
Screenshot 2024-04-19 at 11 24 29

Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

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

Some changes to do but the overall design looks good, keep it up!

Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

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

Apart from what @nelsonkopliku mentioned, everything fine 👍

@jamie-suse jamie-suse force-pushed the avail-sw-updates-error-handling branch from 639c93b to d1075c0 Compare April 23, 2024 15:42
@jamie-suse jamie-suse requested a review from jagabomb April 23, 2024 15:44
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.

Definitely a step forward, thanks @jamie-suse!

Back on the very initial feedback shared offline: I guess we're missing a loading state for the whole Available software updates section.

The API that tells us whether we have settings or not (/api/v1/settings/suma_credentials) might take a while to load and the ux transition feels a bit cumbersome: we show by default the section with the CTA which might get suddenly replaced by indicators.

In the attached gif I faked a 5s delay in the controller to give a sense of what I mean.
Besides this the endpoint we rely on might even fail, but I believe we can safely fallback to the no-settings-available state in order to not add a failure option.

@jagabomb what do you think?

loading-software-updates-section

Besides this a tiny visual thing: the section with the CTA (when settings are not available) seems to need a bit of padding/margin adjustment

image

@jagabomb
Copy link
Contributor

Thanks for this @nelsonkopliku and @jamie-suse. I still wonder why we show the Available Software Updates (No Settings state) by default if a user has saved SUMA settings? Would it not be better to start with a loading state (refer to image below) just showing the Available Patches and Upgradable Packages sections as the default state, if we know you have saved SUMA settings. Basically switching between the two states above can be misleading to the user since they may believe the settings had not saved correctly.

Screenshot 2024-04-19 at 11 24 29

@jamie-suse jamie-suse force-pushed the avail-sw-updates-error-handling branch from 8222bf2 to 0dcbcf0 Compare April 24, 2024 14:45
@jagabomb
Copy link
Contributor

@jamie-suse As per our huddle review, can we please change the loading state for the Patches and Packages section to text saying just "Loading..." with not pre loader icon. Rationale is that the multiple pre loaders seems to be visually confusing.
Screenshot 2024-04-25 at 16 14 32

Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

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

LGTM

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.

LGTM

Copy link
Contributor

@jagabomb jagabomb left a comment

Choose a reason for hiding this comment

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

LGTM!

@jamie-suse jamie-suse merged commit 9957156 into main Apr 26, 2024
26 checks passed
@jamie-suse jamie-suse deleted the avail-sw-updates-error-handling branch April 26, 2024 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request javascript Pull requests that update Javascript code
Development

Successfully merging this pull request may close these issues.

4 participants