diff --git a/CHANGELOG.md b/CHANGELOG.md index 939f6c0f75..92f71ab51a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,10 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -#### [v6.127.0](https://github.com/opengovsg/FormSG/compare/v6.127.0...v6.127.0) +#### [v6.127.1](https://github.com/opengovsg/FormSG/compare/v6.127.0...v6.127.1) + +- build: release v6.127.0 [`#7413`](https://github.com/opengovsg/FormSG/pull/7413) +- fix: fix issue where duplicating forms fails [`a66cebf`](https://github.com/opengovsg/FormSG/commit/a66cebf8528675c5153ce9c57fe53bb3e0026fdd) #### [v6.127.0](https://github.com/opengovsg/FormSG/compare/v6.126.0...v6.127.0) @@ -20,7 +23,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - build: release v6.126.0 [`#7397`](https://github.com/opengovsg/FormSG/pull/7397) - chore(deps-dev): bump @types/jwk-to-pem from 2.0.1 to 2.0.3 [`#7400`](https://github.com/opengovsg/FormSG/pull/7400) - feat: email <> storage mode parity (#7350) [`#2264`](https://github.com/opengovsg/FormSG/issues/2264) -- chore: bump version to v6.127.0 [`fefe87b`](https://github.com/opengovsg/FormSG/commit/fefe87b2316523795a4080bc35099f08528154a4) +- chore: bump version to v6.127.0 [`cba2477`](https://github.com/opengovsg/FormSG/commit/cba2477cd464a3a1899d26d1e1df2b7051701b51) #### [v6.126.0](https://github.com/opengovsg/FormSG/compare/v6.125.0...v6.126.0) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 37b92264b4..a2ec365257 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "form-frontend", - "version": "6.127.0", + "version": "6.127.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "form-frontend", - "version": "6.127.0", + "version": "6.127.1", "hasInstallScript": true, "dependencies": { "@chakra-ui/react": "^1.8.6", diff --git a/frontend/package.json b/frontend/package.json index 7e7d1617a7..6565204b3c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "form-frontend", - "version": "6.127.0", + "version": "6.127.1", "homepage": ".", "private": true, "dependencies": { diff --git a/frontend/src/features/workspace/components/DuplicateFormModal/DupeFormWizardProvider.tsx b/frontend/src/features/workspace/components/DuplicateFormModal/DupeFormWizardProvider.tsx index 2580546d3e..485c704e0a 100644 --- a/frontend/src/features/workspace/components/DuplicateFormModal/DupeFormWizardProvider.tsx +++ b/frontend/src/features/workspace/components/DuplicateFormModal/DupeFormWizardProvider.tsx @@ -61,7 +61,8 @@ export const useDupeFormWizardContext = (): CreateFormWizardContextReturn => { const { dupeEmailModeFormMutation, - dupeStorageModeOrMultirespondentFormMutation, + dupeStorageModeFormMutation, + dupeMultirespondentModeFormMutation, } = useDuplicateFormMutations() const { activeWorkspace, isDefaultWorkspace } = useWorkspaceContext() @@ -72,23 +73,35 @@ export const useDupeFormWizardContext = (): CreateFormWizardContextReturn => { const handleCreateStorageModeOrMultirespondentForm = handleSubmit( ({ title, responseMode }) => { - if ( - !( - responseMode === FormResponseMode.Encrypt || - responseMode === FormResponseMode.Multirespondent - ) || - !activeFormMeta?._id - ) { + if (!activeFormMeta?._id) { return } - return dupeStorageModeOrMultirespondentFormMutation.mutate({ - formIdToDuplicate: activeFormMeta._id, - title, - responseMode, - publicKey: keypair.publicKey, - workspaceId, - }) + switch (responseMode) { + case FormResponseMode.Encrypt: + return dupeStorageModeFormMutation.mutate({ + formIdToDuplicate: activeFormMeta._id, + title, + responseMode, + publicKey: keypair.publicKey, + workspaceId, + }) + case FormResponseMode.Email: + return + case FormResponseMode.Multirespondent: + return dupeMultirespondentModeFormMutation.mutate({ + formIdToDuplicate: activeFormMeta._id, + title, + responseMode, + publicKey: keypair.publicKey, + workspaceId, + }) + default: { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const _: never = responseMode + throw new Error('Invalid response mode') + } + } }, ) @@ -110,7 +123,8 @@ export const useDupeFormWizardContext = (): CreateFormWizardContextReturn => { isFetching: isWorkspaceLoading || isPreviewFormLoading, isLoading: dupeEmailModeFormMutation.isLoading || - dupeStorageModeOrMultirespondentFormMutation.isLoading, + dupeStorageModeFormMutation.isLoading || + dupeMultirespondentModeFormMutation.isLoading, keypair, currentStep, direction, diff --git a/package-lock.json b/package-lock.json index 1c4945a16c..c6e32f9214 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "FormSG", - "version": "6.127.0", + "version": "6.127.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "FormSG", - "version": "6.127.0", + "version": "6.127.1", "hasInstallScript": true, "dependencies": { "@aws-sdk/client-cloudwatch-logs": "^3.536.0", diff --git a/package.json b/package.json index a19aaf168d..192c9b9f1c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "FormSG", "description": "Form Manager for Government", - "version": "6.127.0", + "version": "6.127.1", "homepage": "https://form.gov.sg", "authors": [ "FormSG "