Skip to content

Add massmailer field clearing - #118

Closed
miguelaenlle wants to merge 1 commit into
mainfrom
fix-admin-notifications
Closed

Add massmailer field clearing#118
miguelaenlle wants to merge 1 commit into
mainfrom
fix-admin-notifications

Conversation

@miguelaenlle

Copy link
Copy Markdown
Contributor
  • Added functionality to show "Are you sure you want to send this notification?" alert before actually sending
  • Clears fields when the user sends
  • Tested this by replacing the request promises with setTimeout calls:
new Promise((resolve, reject) => {
   setTimeout(() => {
      resolve(true);
   }, 2000);
 });

Copilot AI review requested due to automatic review settings September 18, 2025 21:04
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying rp-web-sponsor with  Cloudflare Pages  Cloudflare Pages

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

View logs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.confirm before 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.

Comment on lines +601 to +616
{/* <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> */}

Copilot AI Sep 18, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
{/* <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> */}

Copilot uses AI. Check for mistakes.
Comment on lines +158 to +165
if (
!window.confirm(
`Are you sure you want to send this ${values.isMobileNotification ? "notification" : "email"}?`
)
) {
helpers.setSubmitting(false);
return;
}

Copilot AI Sep 18, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying rp-web-site with  Cloudflare Pages  Cloudflare Pages

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

View logs

@miguelaenlle

Copy link
Copy Markdown
Contributor Author

The diff got screwed up, I'll open a new one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants