Add massmailer field clearing - #118
Conversation
Deploying rp-web-sponsor with
|
| Latest commit: |
6b907ea
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://125f3013.rp-web-sponsor.pages.dev |
| Branch Preview URL: | https://fix-admin-notifications.rp-web-sponsor.pages.dev |
There was a problem hiding this comment.
Pull Request Overview
This PR adds a confirmation dialog and field clearing functionality to the mass mailer. When users attempt to send emails or notifications, they'll now see a confirmation dialog, and upon successful submission, all form fields will be automatically cleared.
- Added a confirmation dialog using
window.confirmbefore sending emails/notifications - Implemented form field clearing after successful API requests using
helpers.resetForm() - Applied consistent formatting improvements to the component's JSX
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| {/* <Modal isOpen={} onClose={onClose}> | ||
| <ModalOverlay /> | ||
| <ModalContent> | ||
| <ModalHeader>Modal Title</ModalHeader> | ||
| <ModalCloseButton /> | ||
| <ModalBody> | ||
| </ModalBody> | ||
|
|
||
| <ModalFooter> | ||
| <Button colorScheme='blue' mr={3} onClick={onClose}> | ||
| Close | ||
| </Button> | ||
| <Button variant='ghost'>Secondary Action</Button> | ||
| </ModalFooter> | ||
| </ModalContent> | ||
| </Modal> */} |
There was a problem hiding this comment.
This commented-out modal code appears to be leftover development code that should be removed. It doesn't serve any purpose and clutters the codebase.
| {/* <Modal isOpen={} onClose={onClose}> | |
| <ModalOverlay /> | |
| <ModalContent> | |
| <ModalHeader>Modal Title</ModalHeader> | |
| <ModalCloseButton /> | |
| <ModalBody> | |
| </ModalBody> | |
| <ModalFooter> | |
| <Button colorScheme='blue' mr={3} onClick={onClose}> | |
| Close | |
| </Button> | |
| <Button variant='ghost'>Secondary Action</Button> | |
| </ModalFooter> | |
| </ModalContent> | |
| </Modal> */} |
| if ( | ||
| !window.confirm( | ||
| `Are you sure you want to send this ${values.isMobileNotification ? "notification" : "email"}?` | ||
| ) | ||
| ) { | ||
| helpers.setSubmitting(false); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Using window.confirm creates accessibility issues as it's not screen reader friendly and doesn't follow modern UI patterns. Consider implementing a proper modal dialog component for better accessibility and user experience.
Deploying rp-web-site with
|
| Latest commit: |
6b907ea
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b77d7dc2.rp-web-site.pages.dev |
| Branch Preview URL: | https://fix-admin-notifications.rp-web-site.pages.dev |
|
The diff got screwed up, I'll open a new one |
requestpromises withsetTimeoutcalls: