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): dynamic routing #7078

Merged
merged 9 commits into from
Feb 19, 2024
Merged

feat(mrf): dynamic routing #7078

merged 9 commits into from
Feb 19, 2024

Conversation

justynoh
Copy link
Contributor

@justynoh justynoh commented Feb 13, 2024

Problem

On top of the workflow builder, we want to build dynamic routing as a feature.

Closes FRM-1621

Solution

This PR adds instrumentation for dynamic routing in the frontend and backend. Importantly, this builds on top of #7072.

On the frontend, we add a radio toggle for admins to select whether they want to do static or dynamic routing. If static, the original text box is shown. If dynamic, we display a dropdown of all the email fields in the form for their selection.

On the backend, Joi validation for the settings PATCH endpoint is updated. Additionally, the schema and model for multirespondent form workflows is updated with a discriminator on the workflow_type to accommodate the two types of data now needed to be stored mutually exclusively - emails for static, and field for dynamic. Finally, on the MRF submission endpoint, the email retrieval computation is updated to include the case where the routing is dynamic.

Breaking Changes

  • No - this PR is backwards compatible

Screenshots

Screen.Recording.2024-02-13.at.5.09.54.PM.mov

Copy link

linear bot commented Feb 13, 2024

FRM-1621 Dynamic routing

@justynoh justynoh changed the base branch from develop to feat/mrf-workflow-builder February 13, 2024 09:13
@justynoh justynoh requested a review from KenLSM February 13, 2024 09:13
Base automatically changed from feat/mrf-workflow-builder to develop February 14, 2024 02:27
@justynoh justynoh marked this pull request as ready for review February 14, 2024 03:10
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 except for one question on Joi validation on email field type

Copy link
Contributor Author

@justynoh justynoh left a comment

Choose a reason for hiding this comment

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

969cc00

oh this is quite cool! I didn't know this was a thing

@justynoh justynoh merged commit 7897bef into develop Feb 19, 2024
24 checks passed
@justynoh justynoh deleted the feat/dynamic-routing branch February 19, 2024 08:34
@justynoh justynoh mentioned this pull request Feb 21, 2024
30 tasks
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.

None yet

2 participants