- updated version;
This commit is contained in:
@@ -13,6 +13,7 @@ import BandoEditFormActions from '../BandoEditFormActions';
|
||||
import UnsavedChangesDetector from '../../../../components/UnsavedChangesDetector';
|
||||
import BandoService from '../../../../service/bando-service';
|
||||
import LookupdataService from '../../../../service/lookupdata-service';
|
||||
import { storeSet } from '../../../../store';
|
||||
|
||||
const BandoEditFormStep2 = forwardRef(function ({ initialData, getFormErrors }, ref) {
|
||||
const navigate = useNavigate();
|
||||
@@ -94,11 +95,11 @@ const BandoEditFormStep2 = forwardRef(function ({ initialData, getFormErrors },
|
||||
}
|
||||
|
||||
const openPreview = () => {
|
||||
navigate('/bandi/preview/11');
|
||||
navigate('/tenders/preview/11');
|
||||
}
|
||||
|
||||
const openPreviewEvaluation = () => {
|
||||
navigate('/bandi/preview-evaluation/11');
|
||||
navigate('/tenders/preview-evaluation/11');
|
||||
}
|
||||
|
||||
useImperativeHandle(
|
||||
@@ -118,6 +119,7 @@ const BandoEditFormStep2 = forwardRef(function ({ initialData, getFormErrors },
|
||||
}, [errors, isValid]);
|
||||
|
||||
useEffect(() => {
|
||||
storeSet.main.formInitialData(initialData);
|
||||
setFormInitialData(initialData);
|
||||
}, [initialData]);
|
||||
|
||||
@@ -131,12 +133,16 @@ const BandoEditFormStep2 = forwardRef(function ({ initialData, getFormErrors },
|
||||
|
||||
useEffect(() => {
|
||||
trigger().then(() => clearErrors());
|
||||
LookupdataService.getItems(lookupdataCallback, errLookupdataCallback, [['type', ['CHECKLIST', 'EVALUATION_CRITERIA']]])
|
||||
LookupdataService.getItems(lookupdataCallback, errLookupdataCallback, [['type', ['CHECKLIST', 'EVALUATION_CRITERIA']]]);
|
||||
|
||||
return () => {
|
||||
storeSet.main.formInitialData({});
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<form className="appForm" onSubmit={handleSubmit(onSubmit)}>
|
||||
<UnsavedChangesDetector initialData={initialData} getValuesFn={getValues}/>
|
||||
<UnsavedChangesDetector getValuesFn={getValues}/>
|
||||
<FormFieldRepeaterCriteria
|
||||
data={values}
|
||||
setDataFn={setValue}
|
||||
|
||||
Reference in New Issue
Block a user