Skip to content
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

feat: mrf dashboard send reminders #8134

Open
wants to merge 25 commits into
base: develop
Choose a base branch
from
Open

Conversation

kevin9foong
Copy link
Contributor

@kevin9foong kevin9foong commented Feb 26, 2025

Problem

Admins want a way to send reminders for pending MRF forms, especially for cases when the email is lost. This emulates the real life scenario where you can remind someone to fill in a form.

Closes FRM-1963

Solution

Implement a action column with send reminder buttons in the hawkeye dashboard which admins can click to send these reminders.

Note: For backwards compatibility, the reminders button will not appear for pending MRF steps submitted before the release of reminders (since the nextStepRecipientEmails is not yet recorded)

Breaking Changes

No - this PR is backwards compatible

Before & After Screenshots

AFTER:

image New column added for reminders

Tests

TC1: Reminders work for step 2

  • Create a new MRF form with 4 steps. Let step 2 be static email, step 3 be dynamic email field routing and step 4 be conditional routing based on a dropdown (where each dropdown has multiple emails tied to it). Set up a valid configuration.
  • Submit step 1. Assert that a next step is send to step 2.
  • Click on send reminder for the submission on the hawkeye dashboard.
  • Assert that you have received an email address with subject [Reminder] and can click on the link, fill it in and submit step 2.
  • Assert non-reminder step 3 email notification arrives.

TC2: Reminders work for step 3

  • Continue from TC1.
  • Click on send reminder for step 3.
  • Assert that you have received an email to the correct mail address with subject [Reminder] and can click on the link, fill it in and submit step 3.
  • Assert non-reminder step 4 email notification arrives.

TC3: Reminders work for last step (eg, step 4 of 4-step MRF workflow) and multiple emails work

  • Continue from TC2.
  • Click on send reminder for step 4.
  • Assert that you have received an email to the correct mail addresses (check there are multiple based on your dropdown option mapping for conditional routing) with subject [Reminder] and can click on the link, fill it in and submit step 4.
  • Assert that the dashboard now displays the form is completed.

TC4: Back ward compatibility -- should not be able to trigger send reminder for pre-existing pending submissions.

  • Open some existing pending MRF submissions before reminders.
  • Ensure that the send reminder button does not exist.

TC5: Regression test -- Csv and individual submissions are unaffected

  • From TC4, download your form responses for the MRF form.
  • Assert that the CSV does not include any column related to reminders.
  • Assert that individual submission page (ie click on a row in the dashboard) does not show reminder information either.

TC6: Rejected is considered completed

  • Make a 3 step MRF with approvals on step 2.
  • Reject at step 2.
  • Assert that the send reminder button does not show up even though it is only at step 2.

@kevin9foong kevin9foong self-assigned this Feb 26, 2025
@datadog-opengovsg
Copy link

datadog-opengovsg bot commented Feb 26, 2025

Datadog Report

Branch report: feat/reminders
Commit report: c78fca1
Test service: formsg

❌ 2 Failed (0 Known Flaky), 3072 Passed, 1 Skipped, 7m 2.39s Total duration (695ms time saved)

❌ Failed Tests (2)

  • multiresponodent-submision.controller sendPendingMrfSubmissionReminderForTest returns 200 ok when recipient email found and reminder email is sent successfully - src/app/modules/submission/multirespondent-submission/__tests__/multirespondent-submission.controller.spec.ts

  • multiresponodent-submision.controller sendPendingMrfSubmissionReminderForTest returns 500 when sendNextStepReminderEmail encounters MailSendError - src/app/modules/submission/multirespondent-submission/__tests__/multirespondent-submission.controller.spec.ts - Details

    Expand for error
     Cannot read properties of undefined (reading 'findByIdAndUpdate')
    

@kevin9foong
Copy link
Contributor Author

kevin9foong commented Feb 27, 2025

Pending items:

  • Implementing of skeleton TCs
  • Fix failing TCs
  • Create linear ticket and update PR body
  • Add Manual Tests to the PR body
  • Run the manual tests on local
  • Add beta flags if necessary
  • Add usage tracking if necessary

Copy link

linear bot commented Feb 27, 2025

FRM-1963 MRF | Reminders

@kevin9foong kevin9foong marked this pull request as ready for review February 27, 2025 16:54
@kevin9foong kevin9foong requested a review from a team as a code owner February 27, 2025 16:54
@kevin9foong
Copy link
Contributor Author

kevin9foong commented Feb 27, 2025

Facing issues with playwright again -- seems to be affecting develop as well.

@kevin9foong kevin9foong marked this pull request as draft February 27, 2025 17:08
@kevin9foong kevin9foong marked this pull request as ready for review February 28, 2025 03:24
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.

1 participant