From 13c7a49caef483e09100c40f67eba68a089ad81c Mon Sep 17 00:00:00 2001 From: shuhaib-aot Date: Mon, 4 Nov 2024 14:18:01 +0530 Subject: [PATCH] FWF-3864 [bugfix] fixed status not retaining of published forms --- forms-flow-web/src/components/Form/EditForm/index.js | 8 +++++--- forms-flow-web/src/components/Form/List.js | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/forms-flow-web/src/components/Form/EditForm/index.js b/forms-flow-web/src/components/Form/EditForm/index.js index 1f4911101..624aed5ca 100644 --- a/forms-flow-web/src/components/Form/EditForm/index.js +++ b/forms-flow-web/src/components/Form/EditForm/index.js @@ -1,4 +1,4 @@ -import React, { useEffect } from "react"; +import React, { useEffect,useState } from "react"; import { useParams } from "react-router-dom"; import { useDispatch, useSelector } from "react-redux"; import { Edit as FormEdit } from './FormEdit.js'; @@ -22,7 +22,7 @@ const Index = () => { (state) => state.process?.formAuthVerifyLoading ); const apiCallError = useSelector((state) => state.errors?.apiCallError); - + const [mapperDataLoading, setMapperDataLoading] = useState(false); // fetch form and mapper data along with authorization data const errorHandling = (err) => { @@ -52,8 +52,10 @@ const Index = () => { } else { try { //TBD: need to combine these two calls + setMapperDataLoading(true); dispatch(getFormProcesses(res._id,(err, res)=>{ dispatch(getApplicationCount(res.id)); + setMapperDataLoading(false); })); const authResponse = await fetchFormAuthorizationDetials( res?.parentFormId || res._id @@ -68,7 +70,7 @@ const Index = () => { ); }, [formId]); - if (formAuthVerifyLoading) { + if (formAuthVerifyLoading || mapperDataLoading) { return ; } if (apiCallError) { diff --git a/forms-flow-web/src/components/Form/List.js b/forms-flow-web/src/components/Form/List.js index d7b8b71f1..bccb77354 100644 --- a/forms-flow-web/src/components/Form/List.js +++ b/forms-flow-web/src/components/Form/List.js @@ -293,7 +293,6 @@ const List = React.memo((props) => { setFormSubmitted(false); }); }; - console.log(form,"form"); const onChangeCheckBox = () => { const newWizardChecked = !wizardChecked;