diff --git a/samples/ManagementSite/Controllers/ReactController.cs b/samples/ManagementSite/Controllers/ReactController.cs index 034fe2e..6dbaef2 100644 --- a/samples/ManagementSite/Controllers/ReactController.cs +++ b/samples/ManagementSite/Controllers/ReactController.cs @@ -1,3 +1,4 @@ +using EPiServer.Cms.Shell; using EPiServer.Web; using EPiServer.Web.Routing; using Microsoft.AspNetCore.Mvc; @@ -34,6 +35,8 @@ public async Task GetFormInPageByUrl(string url) var contentHeadless = await _contentRepositoryInteApi.GetAsync(new ContentReference(key), new GetContentOptions()); pageModel.Title = contentHeadless.DisplayName; + pageModel.PageUrl = UrlResolver.Current.GetUrl(content.ContentLink); + if (contentHeadless.Properties.ContainsKey("MainContentArea")) { pageModel.Childrens.AddRange(contentHeadless.Properties["MainContentArea"] as IList); @@ -46,5 +49,6 @@ public async Task GetFormInPageByUrl(string url) public class PageModel { public string Title { get; set; } + public string PageUrl { get; set; } public List Childrens { get; set; } = new List(); } diff --git a/samples/sample-react-app/src/App.tsx b/samples/sample-react-app/src/App.tsx index 959936d..b5f4a62 100644 --- a/samples/sample-react-app/src/App.tsx +++ b/samples/sample-react-app/src/App.tsx @@ -41,6 +41,7 @@ function App() { baseUrl={process.env.REACT_APP_HEADLESS_FORM_BASE_URL ?? "/"} identityInfo={identityInfo} history={history} + currentPageUrl={pageData.pageUrl} /> ))} diff --git a/src/@episerver/forms-react/src/Form.tsx b/src/@episerver/forms-react/src/Form.tsx index 3cb0753..e43a288 100644 --- a/src/@episerver/forms-react/src/Form.tsx +++ b/src/@episerver/forms-react/src/Form.tsx @@ -8,29 +8,35 @@ interface FormProps { /** * The form key that identifies the form */ - formKey: string, + formKey: string; /** * The code of the form language */ - language?: string, + language?: string; /** * The base url of Headless Form API */ - baseUrl: string, + baseUrl: string; /** * Access token for form submit */ - identityInfo?: IdentityInfo - - history? : any + identityInfo?: IdentityInfo; + /** + * The instance of useHistory() received from react-router-dom + */ + history?: any; + /** + * The public url of current page + */ + currentPageUrl?: string; } -export const Form = ({formKey, language, baseUrl, identityInfo, history}: FormProps) => { +export const Form = ({formKey, language, baseUrl, identityInfo, history, currentPageUrl}: FormProps) => { const {data: formData } = useFormLoader({ formKey, language, baseUrl } as UseFormLoaderProps) return ( <> - {formData && } + {formData && } ); } \ No newline at end of file diff --git a/src/@episerver/forms-react/src/components/FormBody.tsx b/src/@episerver/forms-react/src/components/FormBody.tsx index cb3c5ff..2f28617 100644 --- a/src/@episerver/forms-react/src/components/FormBody.tsx +++ b/src/@episerver/forms-react/src/components/FormBody.tsx @@ -1,21 +1,27 @@ -import React, { useEffect, useRef } from "react"; +import React, { useEffect, useMemo, useRef } from "react"; import { useForms } from "../context/store"; -import { FormContainer, FormSubmitter, IdentityInfo, equals, isInArray, isNull, isNullOrEmpty, FormSubmitModel, FormSubmitResult, SubmitButton, FormValidationResult, FormCache, FormConstants, ProblemDetail } from "@episerver/forms-sdk"; +import { FormContainer, FormSubmitter, IdentityInfo, equals, isInArray, isNull, isNullOrEmpty, FormSubmitModel, FormSubmitResult, SubmitButton, FormValidationResult, FormCache, FormConstants, ProblemDetail, StepDependCondition } from "@episerver/forms-sdk"; import { RenderElementInStep } from "./RenderElementInStep"; import { DispatchFunctions } from "../context/dispatchFunctions"; import { FormStepNavigation } from "./FormStepNavigation"; +import { StepHelper } from "@episerver/forms-sdk/dist/form-step/stepHelper"; interface FormBodyProps { identityInfo?: IdentityInfo; baseUrl: string; - history?: any + history?: any; + currentPageUrl?: string; } export const FormBody = (props: FormBodyProps) => { const formContext = useForms(); const form = formContext?.formContainer ?? {} as FormContainer; + const inactiveElements = formContext?.dependencyInactiveElements ?? []; const formSubmitter = new FormSubmitter(formContext?.formContainer ?? {} as FormContainer, props.baseUrl); const dispatchFunctions = new DispatchFunctions(); + const stepDependCondition = new StepDependCondition(form, inactiveElements); + const stepHelper = new StepHelper(form); + const currentPageUrl = props.currentPageUrl ?? window.location.pathname; const formTitleId = `${form.key}_label`; const statusMessage = useRef(""); @@ -23,27 +29,29 @@ export const FormBody = (props: FormBodyProps) => { const formCache = new FormCache(); const localFormCache = new FormCache(window.localStorage); + const currentStepIndex = useMemo(()=>{ + return stepHelper.getCurrentStepIndex(currentPageUrl); + },[currentPageUrl]); //TODO: these variables should be get from api or sdk const validateFail = useRef(false), isFormFinalized = useRef(false), isProgressiveSubmit = useRef(false), isSuccess = useRef(false), - submittable = true, submissionWarning = useRef(false), message = useRef(""), isReadOnlyMode = false, readOnlyModeMessage = "", - currentStepIndex = formContext?.currentStepIndex ?? 0, submissionStorageKey = FormConstants.FormSubmissionId + form.key, - isStepValidToDisplay = true; - + isStepValidToDisplay = stepDependCondition.isStepValidToDisplay(currentStepIndex, currentPageUrl), + isMalFormSteps = stepHelper.isMalFormSteps(); + if((isFormFinalized.current || isProgressiveSubmit.current) && isSuccess.current) { statusDisplay.current = "Form__Success__Message"; statusMessage.current = form.properties.submitSuccessMessage ?? message.current; } - else if ((submissionWarning.current || (!submittable && !isSuccess.current)) + else if ((submissionWarning.current || !isSuccess.current) && !isNullOrEmpty(message.current)) { statusDisplay.current = "Form__Warning__Message"; statusMessage.current = message.current; @@ -55,21 +63,6 @@ export const FormBody = (props: FormBodyProps) => { const validationCssClass = validateFail.current ? "ValidationFail" : "ValidationSuccess"; - const isInCurrentStep = (elementKey: string): boolean => { - let currentStep = form.steps[currentStepIndex]; - if(currentStep){ - return currentStep.elements.some(e => equals(e.key, elementKey)); - } - return true; - } - - const getFirstInvalidElement = (formValidationResults: FormValidationResult[]): string => { - return formValidationResults.filter(fv => - fv.results.some(r => !r.valid) && - form.steps[currentStepIndex]?.elements?.some(e => equals(e.key, fv.elementKey)) - )[0]?.elementKey; - } - const showError = (error: string) => { submissionWarning.current = !isNullOrEmpty(error); message.current = error; @@ -91,26 +84,26 @@ export const FormBody = (props: FormBodyProps) => { } //filter submissions by active elements and current step let formSubmissions = (formContext?.formSubmissions ?? []) - .filter(fs => !isInArray(fs.elementKey, formContext?.dependencyInactiveElements ?? []) && isInCurrentStep(fs.elementKey)); + .filter(fs => !isInArray(fs.elementKey, formContext?.dependencyInactiveElements ?? []) && stepHelper.isInCurrentStep(fs.elementKey, currentStepIndex)); //validate all submission data before submit let formValidationResults = formSubmitter.doValidate(formSubmissions); dispatchFunctions.updateAllValidation(formValidationResults); //set focus on the 1st invalid element of current step - let invalid = getFirstInvalidElement(formValidationResults); + let invalid = stepHelper.getFirstInvalidElement(formValidationResults, currentStepIndex); if(!isNullOrEmpty(invalid)){ dispatchFunctions.updateFocusOn(invalid); return; } - let isLastStep = formContext?.currentStepIndex === form.steps.length - 1; + let isLastStep = currentStepIndex === form.steps.length - 1; let model: FormSubmitModel = { formKey: form.key, locale: form.locale, isFinalized: submitButton?.properties?.finalizeForm || isLastStep, partialSubmissionKey: localFormCache.get(submissionStorageKey) ?? formContext?.submissionKey ?? "", - hostedPageUrl: window.location.pathname, + hostedPageUrl: currentPageUrl, submissionData: formSubmissions, accessToken: formContext?.identityInfo?.accessToken, currentStepIndex: currentStepIndex @@ -142,18 +135,17 @@ export const FormBody = (props: FormBodyProps) => { dispatchFunctions.updateAllValidation(formValidationResults); //set focus on the 1st invalid element of current step - dispatchFunctions.updateFocusOn(getFirstInvalidElement(formValidationResults)); + dispatchFunctions.updateFocusOn(stepHelper.getFirstInvalidElement(formValidationResults, currentStepIndex)); } validateFail.current = response.validationFail; isSuccess.current = response.success; isFormFinalized.current = isLastStep && response.success; dispatchFunctions.updateSubmissionKey(response.submissionKey); - localFormCache.set(submissionStorageKey, response.submissionKey) + localFormCache.set(submissionStorageKey, response.submissionKey); if (isFormFinalized.current) { - formCache.remove(submissionStorageKey) - localFormCache.remove(submissionStorageKey) + localFormCache.remove(submissionStorageKey); } }).catch((e: ProblemDetail) => { if(e.status === 401) { @@ -177,6 +169,8 @@ export const FormBody = (props: FormBodyProps) => { } }, [props.identityInfo?.accessToken]); + isMalFormSteps && showError("Improperly formed FormStep configuration. Some steps are attached to pages, while some steps are not attached, or attached to content with no public URL."); + return (
{
{/* render element */} {form.steps.map((e, i) => { - let stepDisplaying = (currentStepIndex === i && !isFormFinalized.current && isStepValidToDisplay) ? "" : "hide"; + let stepDisplaying = (currentStepIndex === i && !isFormFinalized.current && isStepValidToDisplay && !isMalFormSteps) ? "" : "hide"; return (
@@ -229,6 +223,9 @@ export const FormBody = (props: FormBodyProps) => { isFormFinalized={isFormFinalized.current} history = {props.history} handleSubmit = {handleSubmit} + isMalFormSteps = {isMalFormSteps} + isStepValidToDisplay = {isStepValidToDisplay} + currentStepIndex={currentStepIndex} />
diff --git a/src/@episerver/forms-react/src/components/FormContainerBlock.tsx b/src/@episerver/forms-react/src/components/FormContainerBlock.tsx index 7fc201d..78b1de0 100644 --- a/src/@episerver/forms-react/src/components/FormContainerBlock.tsx +++ b/src/@episerver/forms-react/src/components/FormContainerBlock.tsx @@ -8,6 +8,7 @@ export interface FormContainerProps { identityInfo?: IdentityInfo; baseUrl: string; history?: any; + currentPageUrl?: string; } export function FormContainerBlock(props: FormContainerProps){ @@ -18,7 +19,7 @@ export function FormContainerBlock(props: FormContainerProps){ {/* finally return the form */} return ( - + ) } \ No newline at end of file diff --git a/src/@episerver/forms-react/src/components/FormStepNavigation.tsx b/src/@episerver/forms-react/src/components/FormStepNavigation.tsx index 836b73a..4a4599e 100644 --- a/src/@episerver/forms-react/src/components/FormStepNavigation.tsx +++ b/src/@episerver/forms-react/src/components/FormStepNavigation.tsx @@ -1,12 +1,15 @@ import React, { useRef } from "react"; import { useForms } from "../context/store"; -import { FormCache, FormConstants, FormContainer, FormStep, StepDependCondition, SubmitButtonType, isNull } from "@episerver/forms-sdk"; +import { FormCache, FormContainer, FormStep, StepDependCondition, SubmitButtonType, isNull } from "@episerver/forms-sdk"; import { DispatchFunctions } from "../context/dispatchFunctions"; interface FormStepNavigationProps { - isFormFinalized: boolean - history?: any - handleSubmit: (e: any) => void + isFormFinalized: boolean; + history?: any; + handleSubmit: (e: any) => void; + isMalFormSteps: boolean; + isStepValidToDisplay: boolean; + currentStepIndex: number; } export const FormStepNavigation = (props: FormStepNavigationProps) => { @@ -14,20 +17,19 @@ export const FormStepNavigation = (props: FormStepNavigationProps) => { const formCache = new FormCache(); const form = formContext?.formContainer ?? {} as FormContainer; const depend = new StepDependCondition(form, formContext?.dependencyInactiveElements ?? []); - const { isFormFinalized, history, handleSubmit } = props; + const { isFormFinalized, history, handleSubmit, isMalFormSteps, isStepValidToDisplay, currentStepIndex } = props; const dispatchFuncs = new DispatchFunctions(); const stepLocalizations = useRef>(form.steps?.filter(s => !isNull(s.formStep.localizations))[0]?.formStep.localizations).current; const submittable = true const stepCount = form.steps.length; - const currentStepIndex = formContext?.currentStepIndex ?? 0 const currentDisplayStepIndex = currentStepIndex + 1; const prevButtonDisableState = (currentStepIndex == 0) || !submittable; const nextButtonDisableState = (currentStepIndex == stepCount - 1) || !submittable; const progressWidth = (100 * currentDisplayStepIndex / stepCount) + "%"; - const isShowStepNavigation = stepCount > 1 && currentStepIndex > -1 && currentStepIndex < stepCount && !isFormFinalized; + const isShowStepNavigation = stepCount > 1 && currentStepIndex > -1 && currentStepIndex < stepCount && !isFormFinalized && !isMalFormSteps && isStepValidToDisplay; const handlePrevStep = (event: React.MouseEvent) => { event.preventDefault() @@ -43,9 +45,6 @@ export const FormStepNavigation = (props: FormStepNavigationProps) => { const goToStep = (stepIndex: number) => { var step = form.steps[stepIndex].formStep as FormStep - formCache.set(FormConstants.FormCurrentStep + form.key, stepIndex) - dispatchFuncs.updateCurrentStepIndex(stepIndex) - if (!isNull(step) && !isNull(step.properties.attachedContentLink)) { let url = new URL(step.properties.attachedContentLink) history && history.push(url.pathname); diff --git a/src/@episerver/forms-react/src/context/dispatchFunctions.ts b/src/@episerver/forms-react/src/context/dispatchFunctions.ts index a778193..2f2d7f5 100644 --- a/src/@episerver/forms-react/src/context/dispatchFunctions.ts +++ b/src/@episerver/forms-react/src/context/dispatchFunctions.ts @@ -75,13 +75,6 @@ export class DispatchFunctions { }); } - updateCurrentStepIndex = (currentStepIndex?: number) => { - this._dispatch({ - type: ActionType.UpdateCurrentStepIndex, - currentStepIndex - }); - } - updateIsSubmitting = (isSubmitting?: boolean) => { this._dispatch({ type: ActionType.UpdateIsSubmitting, diff --git a/src/@episerver/forms-react/src/context/reducer.ts b/src/@episerver/forms-react/src/context/reducer.ts index e192fc6..b7cee73 100644 --- a/src/@episerver/forms-react/src/context/reducer.ts +++ b/src/@episerver/forms-react/src/context/reducer.ts @@ -13,7 +13,6 @@ export enum ActionType { UpdateFocusOn = "UpdateFocusOn", UpdateIdentityInfo = "UpdateIdentityInfo", UpdateSubmissionKey = "UpdateSubmissionKey", - UpdateCurrentStepIndex = "UpdateCurrentStepIndex", UpdateIsSubmitting = "UpdateIsSubmitting" } @@ -79,12 +78,6 @@ export function formReducer(formState: FormState, action: any) { submissionKey: action.submissionKey } as FormState } - case ActionType.UpdateCurrentStepIndex: { - return { - ...formState, - currentStepIndex: action.currentStepIndex - } as FormState - } case ActionType.UpdateIsSubmitting: { return { ...formState, diff --git a/src/@episerver/forms-sdk/src/form-step/index.ts b/src/@episerver/forms-sdk/src/form-step/index.ts index 2b66595..e3a16e7 100644 --- a/src/@episerver/forms-sdk/src/form-step/index.ts +++ b/src/@episerver/forms-sdk/src/form-step/index.ts @@ -1,2 +1,3 @@ export * from "./stepBuilder"; -export * from "./stepDependCondition"; \ No newline at end of file +export * from "./stepDependCondition"; +export * from "./stepHelper"; \ No newline at end of file diff --git a/src/@episerver/forms-sdk/src/form-step/stepDependCondition.ts b/src/@episerver/forms-sdk/src/form-step/stepDependCondition.ts index f60a116..b456293 100644 --- a/src/@episerver/forms-sdk/src/form-step/stepDependCondition.ts +++ b/src/@episerver/forms-sdk/src/form-step/stepDependCondition.ts @@ -1,15 +1,18 @@ import { ConditionFunctions } from "../form-depend-conditions/ConditionFunctions"; import { FormStorage } from "../form-storage"; -import { isInArray } from "../helpers"; +import { equals, isInArray, isNullOrEmpty } from "../helpers"; import { FormContainer, FormStep } from "../models"; +import { StepHelper } from "./stepHelper"; /** * Class to help check step is satisfy depend condition */ export class StepDependCondition { - readonly _form: FormContainer - readonly _formStorage: FormStorage - readonly _inactiveElements: string[] + readonly _form: FormContainer; + readonly _formStorage: FormStorage; + readonly _inactiveElements: string[]; + readonly _tempBaseUrl = "http://temp"; + readonly _stepHelper: StepHelper; /** * The constructor of class StepDependCondition * @param form Current form container @@ -19,6 +22,7 @@ export class StepDependCondition { this._form = form; this._formStorage = new FormStorage(form); this._inactiveElements = inactiveElements; + this._stepHelper = new StepHelper(form); } /** @@ -33,7 +37,7 @@ export class StepDependCondition { return false; } - let dependField = step.properties.dependField, + let dependField = step.properties?.dependField, storedData = this._formStorage.loadFormDataFromStorage().filter(fs => fs.elementKey === dependField?.key)[0], funcOfDependCondition = ConditionFunctions[step.properties.dependCondition]; @@ -81,4 +85,65 @@ export class StepDependCondition { } return undefined; } + + + + /** + * Whether step index is valid to display + * @param stepIndex + * @param currentPageUrl + * @returns + */ + isStepValidToDisplay (stepIndex: number, currentPageUrl: string): boolean { + let totalStep = this._form.steps.length; + if(stepIndex < 0 || stepIndex >= totalStep){ + return false; + } + let step = this._form.steps[stepIndex].formStep; + let attachedContent = step.properties?.attachedContentLink; + let attachedContentUrl = new URL(attachedContent, this._tempBaseUrl); + let pageUrl = new URL(currentPageUrl, this._tempBaseUrl) + // if the step is not configured for display in current page, return false + if(!isNullOrEmpty(attachedContent) && !equals(attachedContentUrl.pathname, pageUrl.pathname)){ + return false; + } + // always display the last step + if (stepIndex == totalStep - 1) + { + return true; + } + if(!this._stepHelper.isNeedCheckDependCondition(stepIndex)){ + // the step has no depend condition always display + return true; + } + //the step has depend condition + let submissionData = this._formStorage.loadFormDataFromStorage(); + if(submissionData.length === 0){ + return false + } + let inactiveStepsIndex = this.getInactiveStepsIndex(); + return !inactiveStepsIndex.some(i => i === stepIndex); + } + + /** + * Get an array of step index that are inactive by depend conditions + * @returns + */ + getInactiveStepsIndex(): number[] { + let totalStep = this._form.steps.length; + if(totalStep === 1){ + return []; + } + let inactiveSteps: number[] = []; + + this._form.steps.forEach((s, i) => { + if(this._stepHelper.isNeedCheckDependCondition(i) && !this.isSatisfied(i)){ + inactiveSteps = inactiveSteps.concat(i); + } + }); + + return inactiveSteps; + } + + } \ No newline at end of file diff --git a/src/@episerver/forms-sdk/src/form-step/stepHelper.ts b/src/@episerver/forms-sdk/src/form-step/stepHelper.ts new file mode 100644 index 0000000..f9d079e --- /dev/null +++ b/src/@episerver/forms-sdk/src/form-step/stepHelper.ts @@ -0,0 +1,101 @@ +import { equals, isNull, isNullOrEmpty } from "../helpers"; +import { FormContainer, FormValidationResult } from "../models"; + +/** + * Class for step function helpers + */ +export class StepHelper { + readonly _form: FormContainer; + readonly _tempBaseUrl = "http://temp"; + + constructor(form: FormContainer){ + this._form = form; + } + + /** + * Verify this Form has all steps not attached to any page. + * @returns true if no steps attached to any page. + */ + isAllStepsAreNotLinked(): boolean { + return !this._form.steps.some(s => !isNullOrEmpty(s.formStep.properties?.attachedContentLink)); + } + + /** + * Check whether a Form has steps each attached to a page. + * @returns true if there is a step does not attach to any page but others do. + */ + isMalFormSteps(): boolean { + let isMalform = false; + let totalStep = this._form.steps.length; + + if(totalStep >= 2 && !this.isAllStepsAreNotLinked()){ + isMalform = this._form.steps.some(s => isNullOrEmpty(s.formStep.properties?.attachedContentLink)) + } + return isMalform; + } + + /** + * Get current step index depend on current page url + * @param currentPageUrl + * @returns + */ + getCurrentStepIndex (currentPageUrl: string): number { + let currentStepIndex = 0; + + if(this.isAllStepsAreNotLinked()){ + currentStepIndex = 0; + } + else { + this._form.steps.every((s, i)=>{ + let url = new URL(s.formStep.properties?.attachedContentLink, this._tempBaseUrl); + let pageUrl = new URL(currentPageUrl, this._tempBaseUrl) + if(equals(pageUrl.pathname, url.pathname)){ + currentStepIndex = i; + return false; + } + return true; + }); + } + return currentStepIndex; + } + + /** + * Check whether element is in step + * @param elementKey + * @param stepIndex + * @returns true if element is in step, otherwise false + */ + isInCurrentStep (elementKey: string, stepIndex: number): boolean { + let currentStep = this._form.steps[stepIndex]; + if(currentStep){ + return currentStep.elements.some(e => equals(e.key, elementKey)); + } + return true; + } + + /** + * Get the first elementKey in the list element that are invalid value + * @param formValidationResults + * @param stepIndex + * @returns + */ + getFirstInvalidElement (formValidationResults: FormValidationResult[], stepIndex: number): string { + return formValidationResults.filter(fv => + fv.results.some(r => !r.valid) && + this._form.steps[stepIndex]?.elements?.some(e => equals(e.key, fv.elementKey)) + )[0]?.elementKey; + } + + /** + * Check whether a step is needed to check depend condition + * @param stepIndex + * @returns true if dependField property not null + */ + isNeedCheckDependCondition(stepIndex: number): boolean { + let step = this._form.steps[stepIndex]?.formStep; + if(isNull(step)) { + return false; + } + return !isNullOrEmpty(step.properties?.dependField?.key) + } +} \ No newline at end of file diff --git a/src/@episerver/forms-sdk/src/helpers/initFormState.ts b/src/@episerver/forms-sdk/src/helpers/initFormState.ts index 538d82a..f54ee04 100644 --- a/src/@episerver/forms-sdk/src/helpers/initFormState.ts +++ b/src/@episerver/forms-sdk/src/helpers/initFormState.ts @@ -1,4 +1,3 @@ -import { FormCache } from "../form-cache"; import { FormStorage } from "../form-storage"; import { ElementValidationResult, FormConstants, FormContainer, FormState, FormSubmission, FormValidationResult, StepDependencies, ValidatableElementBaseProperties } from "../models"; import { getDefaultValue } from "./elementHelper"; @@ -12,7 +11,6 @@ import { equals, isNull } from "./utils"; export function initFormState(formContainer: FormContainer): FormState { const formStorage = new FormStorage(formContainer); const formData = formStorage.loadFormDataFromStorage(); - const formCache = new FormCache() let formSubmissions = [] as FormSubmission[]; let formValidationResults = [] as FormValidationResult[]; @@ -51,7 +49,6 @@ export function initFormState(formContainer: FormContainer): FormState { isReset: false, focusOn: "", dependencyInactiveElements: [], - currentStepIndex: parseInt(formCache.get(FormConstants.FormCurrentStep + formContainer.key) ?? "0"), formSubmissions, formValidationResults, stepDependencies, diff --git a/src/@episerver/forms-sdk/src/models/enums/FormConstants.ts b/src/@episerver/forms-sdk/src/models/enums/FormConstants.ts index 45ef87e..3fce29e 100644 --- a/src/@episerver/forms-sdk/src/models/enums/FormConstants.ts +++ b/src/@episerver/forms-sdk/src/models/enums/FormConstants.ts @@ -4,6 +4,5 @@ export enum FormConstants { FormAccessToken = "form_access_token", FormFieldPrefix = "__field_", - FormCurrentStep = "form_current_step_", FormSubmissionId = "form_submission_id_" } \ No newline at end of file diff --git a/src/@episerver/forms-sdk/src/models/states/FormState.ts b/src/@episerver/forms-sdk/src/models/states/FormState.ts index 1b5ede9..0c41ccb 100644 --- a/src/@episerver/forms-sdk/src/models/states/FormState.ts +++ b/src/@episerver/forms-sdk/src/models/states/FormState.ts @@ -17,6 +17,5 @@ export interface FormState { focusOn: string, identityInfo?: IdentityInfo submissionKey?: string - currentStepIndex: number isSubmitting?: boolean } \ No newline at end of file