- added auto saving on validation application request;
This commit is contained in:
@@ -100,11 +100,7 @@ const BandoApplication = () => {
|
|||||||
const formValues = watch();
|
const formValues = watch();
|
||||||
|
|
||||||
const onValidate = () => {
|
const onValidate = () => {
|
||||||
const applId = getApplicationId();
|
saveDraft('VALIDATE');
|
||||||
storeSet.main.setAsyncRequest();
|
|
||||||
formMsgs.current.clear();
|
|
||||||
|
|
||||||
ApplicationService.validateApplication(applId, {}, validateApplicationCallback, errValidateApplicationCallback);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
@@ -263,11 +259,19 @@ const BandoApplication = () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!isEmpty(saveAndMove) && is(String, saveAndMove)) {
|
if (!isEmpty(saveAndMove) && is(String, saveAndMove)) {
|
||||||
storeSet.main.setAsyncRequest();
|
if (['NEXT','PREVIOUS'].includes(saveAndMove)) {
|
||||||
ApplicationService.getApplicationForm(data.data.id, getApplFormCallback, errGetApplFormCallbacks, [
|
storeSet.main.setAsyncRequest();
|
||||||
['formId', formId],
|
ApplicationService.getApplicationForm(data.data.id, getApplFormCallback, errGetApplFormCallbacks, [
|
||||||
['action', saveAndMove]
|
['formId', formId],
|
||||||
]);
|
['action', saveAndMove]
|
||||||
|
]);
|
||||||
|
} else if (['VALIDATE'].includes(saveAndMove)) {
|
||||||
|
const applId = getApplicationId();
|
||||||
|
storeSet.main.setAsyncRequest();
|
||||||
|
formMsgs.current.clear();
|
||||||
|
|
||||||
|
ApplicationService.validateApplication(applId, {}, validateApplicationCallback, errValidateApplicationCallback);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ApplicationService.getApplicationForm(data.data.id, getStatusCheckCallback, errGetStatusCheckCallbacks);
|
ApplicationService.getApplicationForm(data.data.id, getStatusCheckCallback, errGetStatusCheckCallbacks);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ const BuilderElementProperLabel = ({ id, defaultLabel }) => {
|
|||||||
const elements = useStore().main.formElements();
|
const elements = useStore().main.formElements();
|
||||||
const element = head(elements.filter(o => o.id === id));
|
const element = head(elements.filter(o => o.id === id));
|
||||||
const [label, setLabel] = useState('');
|
const [label, setLabel] = useState('');
|
||||||
const isRequired = pathOr(false, ['validators', 'isRequired'], element)
|
const isRequired = pathOr(false, ['validators', 'isRequired'], element);
|
||||||
|
const customValidation = pathOr(false, ['validators', 'custom'], element);
|
||||||
|
let maybeNonEmptyTables = customValidation === 'nonEmptyTables';
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const label = head(element.settings.filter(o => o.name === 'label'));
|
const label = head(element.settings.filter(o => o.name === 'label'));
|
||||||
@@ -26,7 +28,7 @@ const BuilderElementProperLabel = ({ id, defaultLabel }) => {
|
|||||||
|
|
||||||
return <div className="label">
|
return <div className="label">
|
||||||
{renderHtmlContent(label)}
|
{renderHtmlContent(label)}
|
||||||
{isRequired ? <span className="appForm__field--required">*</span> : null}
|
{isRequired || maybeNonEmptyTables ? <span className="appForm__field--required">*</span> : null}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user