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): add static workflow routing #6968

Merged
merged 53 commits into from
Jan 3, 2024
Merged

Conversation

wanlingt
Copy link
Contributor

@wanlingt wanlingt commented Dec 19, 2023

Problem

We want to add static routing to MRF

Closes FRM-1577

Solution

This PR allows static routing for steps 2 and 3 of the workflow. It emails the respective respondent when the form has been submitted at each step.

Backend

  • Add workflowStep property to the submission schema.
  • Add workflow property to the form schema. This is an array of objects, where each object contains the workflow_type and emails. More properties (e.g. form field IDs) can be added in the future.
  • Trigger MRF email to be sent to the email addresses saved in the form's workflow step

Frontend

  • Add workflow settings tab to the settings page

Breaking Changes

  • No - this PR is backwards compatible

Features

Before & After Screenshots

AFTER:
image

chrome-capture-2023-11-21 (1)

Tests

  • Create an MRF form
  • In the form's settings, navigate to the workflow tab
  • Key in an email address in respondent 2 and respondent 3's email inputs
  • Submit the MRF form once
  • The email address associated with respondent 2 should receive an email asking them to fill in the form
  • Click the link in the form, you should be brought to the unlocked MRF form
  • Submit the form
  • Repeat the steps for respondent 3, submit the form
  • Respondent 3's response should be reflected in the form's results page

@wanlingt wanlingt changed the title feat: add workflowStep to submission schema feat(mrf): add static routing Dec 19, 2023
@wanlingt wanlingt changed the title feat(mrf): add static routing feat(mrf): add static workflow routing Dec 19, 2023
Copy link

linear bot commented Dec 20, 2023

Base automatically changed from feat/mrf-links to develop December 21, 2023 02:15
message: 'Please provide valid email addresses',
},
},
//TODO: add form fields
Copy link
Contributor

Choose a reason for hiding this comment

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

What are these form fields to be added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These form fields refer to the next stage of static routing, where we specify which fields the respondent should fill in. I'll remove it haha (053fd8d), it might be confusing. And whoever works on it next should be able to figure it out anyway!

@@ -365,6 +475,7 @@ export const handleUpdateMultirespondentSubmission = [
MultirespondentSubmissionMiddleware.createFormsgAndRetrieveForm,
MultirespondentSubmissionMiddleware.scanAndRetrieveAttachments,
// EncryptSubmissionMiddleware.validateStorageSubmission,
MultirespondentSubmissionMiddleware.setCurrentWorkflowStep,
Copy link
Contributor

Choose a reason for hiding this comment

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

/nit For discussion, non-blocking

I recall that we have logs disabled for middlewares, i.e., makes debugging difficult

Copy link
Contributor

@KenLSM KenLSM left a comment

Choose a reason for hiding this comment

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

LGTM aside from the question on form fields

@wanlingt wanlingt merged commit fc322d2 into develop Jan 3, 2024
23 of 24 checks passed
@wanlingt wanlingt deleted the feat/static-workflow branch January 3, 2024 03:11
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.

3 participants