From 705084f65ee6a953a3ff6e0b90543d2904c3268f Mon Sep 17 00:00:00 2001 From: Kathleen Koh Date: Wed, 27 Mar 2024 16:34:20 +0800 Subject: [PATCH 1/2] fix: set submission limit to null for MRF --- src/app/modules/form/admin-form/admin-form.service.ts | 6 ++++++ src/app/modules/form/admin-form/admin-form.types.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/src/app/modules/form/admin-form/admin-form.service.ts b/src/app/modules/form/admin-form/admin-form.service.ts index a2466c32b3..d1d0bdfdb9 100644 --- a/src/app/modules/form/admin-form/admin-form.service.ts +++ b/src/app/modules/form/admin-form/admin-form.service.ts @@ -600,6 +600,12 @@ export const duplicateForm = ( overrideProps.endPage = omit(originalForm.endPage, 'buttonLink') } + // if MRF, set submissionLimit (i.e. response limit) = null + + if (overrideProps.responseMode === FormResponseMode.Multirespondent) { + overrideProps.submissionLimit = null + } + const duplicateParams = originalForm.getDuplicateParams(overrideProps) if (workspaceId) diff --git a/src/app/modules/form/admin-form/admin-form.types.ts b/src/app/modules/form/admin-form/admin-form.types.ts index 28ec42a8c2..c4e20b0558 100644 --- a/src/app/modules/form/admin-form/admin-form.types.ts +++ b/src/app/modules/form/admin-form/admin-form.types.ts @@ -30,6 +30,7 @@ export type OverrideProps = { responseMode: FormResponseMode emails?: string | string[] publicKey?: string + submissionLimit?: number | null } export type EditFormFieldResult = Result From 4ff6082d56bc0231f7e93e91314bd2d9f29fd0c9 Mon Sep 17 00:00:00 2001 From: Kathleen Koh Date: Wed, 27 Mar 2024 21:57:51 +0800 Subject: [PATCH 2/2] chore: improve explanation comments on reasons for removing submission limit --- src/app/modules/form/admin-form/admin-form.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/modules/form/admin-form/admin-form.service.ts b/src/app/modules/form/admin-form/admin-form.service.ts index d1d0bdfdb9..393d028466 100644 --- a/src/app/modules/form/admin-form/admin-form.service.ts +++ b/src/app/modules/form/admin-form/admin-form.service.ts @@ -600,7 +600,8 @@ export const duplicateForm = ( overrideProps.endPage = omit(originalForm.endPage, 'buttonLink') } - // if MRF, set submissionLimit (i.e. response limit) = null + // if MRF, set submissionLimit = null + // this is because MRF does not support submission limit (i.e. response limit) if (overrideProps.responseMode === FormResponseMode.Multirespondent) { overrideProps.submissionLimit = null