Unverified Commit 3d0fbeff authored by Zhou (Link)  Fang's avatar Zhou (Link) Fang Committed by GitHub
Browse files

fixed backup issue in a specific task flow (#317)

parent 41c1f9f4
...@@ -299,6 +299,7 @@ export default function Application() { ...@@ -299,6 +299,7 @@ export default function Application() {
resetMembershipLevelForm={formikMembershipLevel.resetForm} resetMembershipLevelForm={formikMembershipLevel.resetForm}
resetWorkingGroupForm={formikWorkingGroups.resetForm} resetWorkingGroupForm={formikWorkingGroups.resetForm}
resetSigningAuthorityForm={formikSigningAuthority.resetForm} resetSigningAuthorityForm={formikSigningAuthority.resetForm}
setUpdatedFormValues={setUpdatedFormValues}
/> />
</Route> </Route>
......
...@@ -132,6 +132,7 @@ class SignIn extends React.Component { ...@@ -132,6 +132,7 @@ class SignIn extends React.Component {
resetMembershipLevelForm={this.props.resetMembershipLevelForm} resetMembershipLevelForm={this.props.resetMembershipLevelForm}
resetWorkingGroupForm={this.props.resetWorkingGroupForm} resetWorkingGroupForm={this.props.resetWorkingGroupForm}
resetSigningAuthorityForm={this.props.resetSigningAuthorityForm} resetSigningAuthorityForm={this.props.resetSigningAuthorityForm}
setUpdatedFormValues={this.props.setUpdatedFormValues}
/> />
) : ( ) : (
this.renderButtons(this.props.setFurthestPage) this.renderButtons(this.props.setFurthestPage)
......
...@@ -13,6 +13,7 @@ import { ...@@ -13,6 +13,7 @@ import {
} from '../../../Utils/formFunctionHelpers'; } from '../../../Utils/formFunctionHelpers';
import { useCallback, useContext, useEffect, useState } from 'react'; import { useCallback, useContext, useEffect, useState } from 'react';
import Loading from '../Loading/Loading'; import Loading from '../Loading/Loading';
import { initialValues } from '../FormComponents/formFieldModel';
const styles = { const styles = {
marginBottom: '30px', marginBottom: '30px',
textAlign: 'center', textAlign: 'center',
...@@ -26,6 +27,7 @@ const FormChooser = ({ ...@@ -26,6 +27,7 @@ const FormChooser = ({
resetWorkingGroupForm, resetWorkingGroupForm,
resetMembershipLevelForm, resetMembershipLevelForm,
resetCompanyInfoForm, resetCompanyInfoForm,
setUpdatedFormValues
}) => { }) => {
const { setCurrentFormId, furthestPage } = useContext(MembershipContext); const { setCurrentFormId, furthestPage } = useContext(MembershipContext);
const [hasExistingForm, setHasExistingForm] = useState(''); const [hasExistingForm, setHasExistingForm] = useState('');
...@@ -42,7 +44,10 @@ const FormChooser = ({ ...@@ -42,7 +44,10 @@ const FormChooser = ({
const handleStartNewForm = () => { const handleStartNewForm = () => {
setIsStartNewForm(true); setIsStartNewForm(true);
if (getCurrentMode() === MODE_REACT_API) setCurrentFormId(''); setUpdatedFormValues(initialValues); // reset backup values
if (getCurrentMode() === MODE_REACT_API) {
setCurrentFormId('');
}
// reset the form if user has gone to a further page/step // reset the form if user has gone to a further page/step
if (furthestPage.index > 0) { if (furthestPage.index > 0) {
resetCompanyInfoForm(); resetCompanyInfoForm();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment