-
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
Fix mail box creation error handling and mail domain addition form #355
Conversation
7a96b17
to
2ebd036
Compare
src/frontend/apps/desk/src/features/mail-domains/components/ModalAddMailDomain.tsx
Outdated
Show resolved
Hide resolved
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.
En attendant le sentry, est-ce qu'on pourrait pas avoir quelque soit le code d'erreur (tous les codes d'erreur) le code d'erreur récupéré et le message associé affiché sur l'interface ?
Dès qu'on aura sentry on aura des log clairs et on cachera tout ça à l'utilisateur.
Le but c'est de ne plus avoir d'interface/validation de formulaire qui ne fonctionne pas en silence.
Qu'est-ce que vous en dites ? @AntoLC @daproclaima
9847f15
to
011732b
Compare
@sdemagny, je suis du même avis. C'est ce que j'ai fait ici: add mail domain error handling et create mailbox error handling |
011732b
to
8625438
Compare
8625438
to
70c7c87
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.
useCreateMailboxApiError.tsx
and useAddMailDomainApiError.tsx
are very similar, I think you can merge them to have just one hook, no?
src/frontend/yarn.lock
Outdated
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.
You don't seem to add or update dependencies, this file should not have changes.
src/frontend/apps/e2e/__tests__/app-desk/mail-domains-add.spec.ts
Outdated
Show resolved
Hide resolved
src/frontend/apps/desk/src/features/mail-domains/components/useAddMailDomainApiError.tsx
Outdated
Show resolved
Hide resolved
0a3cdfd
to
2d94bc4
Compare
2d94bc4
to
baec47d
Compare
src/frontend/apps/desk/src/features/mail-domains/components/ModalCreateMailbox.tsx
Outdated
Show resolved
Hide resolved
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.
A bit more work, you will be a jest hero soon.
...rontend/apps/desk/src/features/mail-domains/components/__tests__/ModalCreateMailbox.test.tsx
Outdated
Show resolved
Hide resolved
...rontend/apps/desk/src/features/mail-domains/components/__tests__/ModalAddMailDomain.test.tsx
Outdated
Show resolved
Hide resolved
...rontend/apps/desk/src/features/mail-domains/components/__tests__/ModalCreateMailbox.test.tsx
Outdated
Show resolved
Hide resolved
...rontend/apps/desk/src/features/mail-domains/components/__tests__/ModalCreateMailbox.test.tsx
Outdated
Show resolved
Hide resolved
...rontend/apps/desk/src/features/mail-domains/components/__tests__/ModalAddMailDomain.test.tsx
Outdated
Show resolved
Hide resolved
ec9ee3a
to
813497a
Compare
813497a
to
ee47ec2
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.
👍
ee47ec2
to
12ce4d0
Compare
- allow to submit form by pressing "Enter" key - force focus on form when form is submited but is invalid - add error 500 handling - update related e2e tests
- add hook to handle api errors. - add related component tests
12ce4d0
to
13ac2d8
Compare
- rename CreateMailboxForm into ModalCreateMailbox, and useCreateMailDomain into useAddMailDomain - use useAPIError hook in ModalCreateMailbox.tsx and ModalAddMailDomain - update translations and tests (include removal of e2e test able to be asserted by component tests)
13ac2d8
to
fe967a6
Compare
Purpose
When we want to create a mailbox for a mail domain, it takes for this mail domain to have a valid secret configured. As far as I understand, this is done manually. So, this is a complex use case to cover with automated tests, which could not be tested with the e2e tests.
Concerning the form to add a mail domain, it could not be submitted when pressing the 'enter' key and would instead update the URL with a query and a page refresh.
Proposal
(watch video from 00:30 to 1:15)
before.fix.api.error.handling.mp4
after.fix.api.error.handling.mp4
before.form.add.mail.domain.fix.mp4
after.form.add.mail.domain.fix.mp4
Error catching and cause replacement were already done on the app, but not with a centralized method. Also, no error message used to be shown for the error 500 type (not shown in the video).
Fix #350, resolves #351