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

Validation global error #2743

Merged
merged 7 commits into from
Jul 8, 2024
Merged

Validation global error #2743

merged 7 commits into from
Jul 8, 2024

Conversation

balanza
Copy link
Member

@balanza balanza commented Jul 3, 2024

Description

Add getGlobalError utility to map server validation error that not relate to a field. The use case is to render failures coming from the server when fetching/saving data.

This PR also applies the error handling as an improvement of #2727.

See unit tests for expected usage.

@balanza balanza requested review from a team, nelsonkopliku and gagandeepb and removed request for a team July 3, 2024 14:26
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.

Super, thanks!

Just a few paths to adjust, if you want, for the rest LGTM.

I am now realizing that in SUMA credentials modal there is no generic failure handling afaik, so this change could be beneficial there as well.
(I mean, you don't have to do that. Just saying that we now have the opportunity to improve other parts of the app 😉 )

assets/js/state/sagas/activityLogsSettings.js Outdated Show resolved Hide resolved
assets/js/state/sagas/activityLogsSettings.test.js Outdated Show resolved Hide resolved
@balanza
Copy link
Member Author

balanza commented Jul 4, 2024

@nelsonkopliku super thanks for the suggestion, I actually used the automatic import but it's not that savvy... I'll find out if there are any eslint rules we can enforce, though

balanza and others added 7 commits July 4, 2024 12:26
Co-authored-by: Nelson Kopliku <nelson.kopliku@suse.com>
* Return CVEs from `v1/software_updates/errata_details/:advisory_name`

* Create CVE factory
Co-authored-by: Nelson Kopliku <nelson.kopliku@suse.com>
@nelsonkopliku nelsonkopliku merged commit ae5ba8f into main Jul 8, 2024
26 checks passed
@nelsonkopliku nelsonkopliku deleted the global-error branch July 8, 2024 09:17
nelsonkopliku added a commit that referenced this pull request Jul 8, 2024
balanza added a commit that referenced this pull request Jul 9, 2024
* global error

* Apply suggestions from code review

Co-authored-by: Nelson Kopliku <nelson.kopliku@suse.com>

* format

* Return CVEs from `Errata Details` endpoint (#2733)

* Return CVEs from `v1/software_updates/errata_details/:advisory_name`

* Create CVE factory

* global error

* Apply suggestions from code review

Co-authored-by: Nelson Kopliku <nelson.kopliku@suse.com>

* format

---------

Co-authored-by: Nelson Kopliku <nelson.kopliku@suse.com>
Co-authored-by: Jamie Rodríguez <jamie.rodriguez@suse.com>
@nelsonkopliku nelsonkopliku added enhancement New feature or request javascript Pull requests that update Javascript code labels Aug 6, 2024
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.

3 participants