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