-
Notifications
You must be signed in to change notification settings - Fork 80
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
Handle errors when adding user to group #346
Conversation
…d of loading screen errors during load pretty much mean we've finished loading added e.message where possible
so that renderModal can close itself
prevents groups being reselected when opening again
e3555e4
to
1ba8056
Compare
@ZitaNemeckova, @newswangerd can you review please? Do we have any whole screen error screen that could be used when loading the group fails? And we may want to consider making tasks to go through every file and find these API calls without catch if there's going to be more of us :) |
Also, I've been testing with network error (no webpack-dev-server), 504 (no api), 404 (no record), but not with any errors API could return, is there a convention? (As long as those end up in |
@himdel GET requests with 404 should redirect to NotFound page. I would prefer to add loading component |
Backport to stable-4.3: 💚 backport PR created✅ Backport PR branch: Backported as #373 🤖 @patchback |
* Handle errors when adding user to group Fixes https://issues.redhat.com/browse/AAH-209 * group-detail: drop unused `loading` * group-detail: add addAlert, use instead of direct setState alerts:... * group-detail: handle componentDidMount request errors, display instead of loading screen errors during load pretty much mean we've finished loading added e.message where possible * group-detail: handle errors for remaining UserAPI requests * addUserToGroup - don't close modal, return handled promise so that renderModal can close itself * Add Users modal - reset selected groups on close prevents groups being reselected when opening again * group-detail empty users: check permission before showing Add button (cherry picked from commit a01766f)
Merged for now, @ZitaNemeckova please ping me with the details of #346 (comment) once you're back from PTO :). I see some specific 404 handling (edit namespace, delete user modal), but that doesn't redirect anywhere. EDIT: 404 will be resolved as part of https://issues.redhat.com/browse/AAH-517, adding info there; loading is unrelated as this only removes a dead variable |
* Handle errors when adding user to group Fixes https://issues.redhat.com/browse/AAH-209 * group-detail: drop unused `loading` * group-detail: add addAlert, use instead of direct setState alerts:... * group-detail: handle componentDidMount request errors, display instead of loading screen errors during load pretty much mean we've finished loading added e.message where possible * group-detail: handle errors for remaining UserAPI requests * addUserToGroup - don't close modal, return handled promise so that renderModal can close itself * Add Users modal - reset selected groups on close prevents groups being reselected when opening again * group-detail empty users: check permission before showing Add button (cherry picked from commit a01766f) Co-authored-by: Martin Hradil <mhradil@redhat.com>
Fixes https://issues.redhat.com/browse/AAH-209
Added an
addAlert
method, used for all existing alerts, and added more request error handling togroup-detail
,Also unsetting the selected value in the add modal on close,
and add a permission check for Add on the empty state screen.
if loading data fails on the intial load, replaced infinispinner with an empty screen with alerts..

failure when autosuggesting groups

when saving from add modal

(modal now closes on failure, maybe it shouldn't?)
when removing user from group

(modal doesn't close on failure, maybe it should?)