From 23ad9c142718acc929b80e1421d2e75ca06e29c1 Mon Sep 17 00:00:00 2001 From: "EP\\qang2" Date: Mon, 18 Dec 2023 11:39:26 +0700 Subject: [PATCH] Add step index to multistep submission Fixes: AFORM-3800 --- src/@episerver/forms-react/src/components/FormBody.tsx | 3 ++- src/@episerver/forms-sdk/src/form-submit/formSubmit.ts | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/@episerver/forms-react/src/components/FormBody.tsx b/src/@episerver/forms-react/src/components/FormBody.tsx index 617f222..f5f1b8b 100644 --- a/src/@episerver/forms-react/src/components/FormBody.tsx +++ b/src/@episerver/forms-react/src/components/FormBody.tsx @@ -114,7 +114,8 @@ export const FormBody = (props: FormBodyProps) => { partialSubmissionKey: localFormCache.get(FormConstants.FormSubmissionId + form.key) ?? "", hostedPageUrl: window.location.pathname, submissionData: formSubmissions, - accessToken: formContext?.identityInfo?.accessToken + accessToken: formContext?.identityInfo?.accessToken, + currentStepIndex: currentStepIndex } dispatchFunctions.updateIsSubmitting(true); diff --git a/src/@episerver/forms-sdk/src/form-submit/formSubmit.ts b/src/@episerver/forms-sdk/src/form-submit/formSubmit.ts index 732a99f..7489221 100644 --- a/src/@episerver/forms-sdk/src/form-submit/formSubmit.ts +++ b/src/@episerver/forms-sdk/src/form-submit/formSubmit.ts @@ -33,6 +33,10 @@ export interface FormSubmitModel { * The access token to identify login user */ accessToken?: string; + /** + * The current index of submitted step + */ + currentStepIndex: number; } export interface FormSubmitResult { @@ -99,6 +103,7 @@ export class FormSubmitter { formData.append("IsFinalized", model.isFinalized.toString()); formData.append("PartialSubmissionKey", model.partialSubmissionKey); formData.append("HostedPageUrl", model.hostedPageUrl); + formData.append("CurrentStep", model.currentStepIndex.toString()); //append form submission to FormData object model.submissionData.forEach(data => {