-
Notifications
You must be signed in to change notification settings - Fork 1
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
🥅(frontend) improve add member form error handling #387
Conversation
ae7e281
to
094579d
Compare
572f468
to
08336f2
Compare
08336f2
to
87ec255
Compare
src/frontend/apps/desk/src/features/mail-domains/api/useAddMailDomain.tsx
Outdated
Show resolved
Hide resolved
src/frontend/apps/desk/src/features/teams/team-management/components/InputTeamName.tsx
Outdated
Show resolved
Hide resolved
227a942
to
4053508
Compare
4053508
to
df0ecd6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still find parseAPIError
very complicated to replace a string by another string.
I am not sure what is the answer to that: #387 (comment)
@AntoLC, thanks for the remarks. I thought of creating this function to reuse it everywhere on APIErrors handling, whether the developer wants to replace an error cause with another message, and/or execute a callback at its detection, and/or show a custom message on 500 error detection. At the moment, we directly display the 500 error messages on the UI, which may not be the most user-friendly way to explain to the end users that the error is not their fault and that they'd do well reaching out to us so we fix the error. I used parseAPIError on InputTeamName.tsx to replace a string with another one, as you say, for one of the client errors we already know. I especially wanted to show a custom error message for 500 types of errors. If I treated only the client error, I would use a more straightforward function. We should display a message for all forms that helps the user know the next step to fix the error. This is especially true for server errors, which we are responsible for and can only fix if we are contacted. |
35afca4
to
e4a73f1
Compare
- translate known errors, including already existing group error, and directly display the other ones - add component tests - update translations - add parseAPIError, a reusable function to catch errors on the whole frontend app Closes issue #293 ♻️(frontend) improve general error catching - change parseAPIError to make it reusable on all requests - update components depending on it
- remove link wrapping cancel button and tabIndex=-1 to button
e4a73f1
to
0fdbfe8
Compare
Purpose
The error cause displayed when group creation fails because it already exists uses technical wording as it comes directly from the backend. The front end should capture this error and replace it with a message appealing to the end users.
Proposal
api/v1.0.0/teams/
to show 'This name is already used for another group. Please enter another one.' instead.Before
Before.mp4
After
After.mp4
Closes #293.