add dialog
This commit is contained in:
@@ -612,12 +612,26 @@ const DomandaEditPreInstructor = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const footerCompleteDialog = useCallback(() => {
|
const footerCompleteDialog = useCallback(() => {
|
||||||
|
let onSubmitAction;
|
||||||
|
let isDisabled = loading;
|
||||||
|
|
||||||
|
if (operationType === 'approve') {
|
||||||
|
onSubmitAction = doApprove;
|
||||||
|
isDisabled = isDisabled || !amountAccepted || isEmpty(amountAccepted) || amountAccepted === 0;
|
||||||
|
} else if (operationType === 'tf_reject') {
|
||||||
|
onSubmitAction = doRejectingStatus;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
onSubmitAction = doReject;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return <div>
|
return <div>
|
||||||
<Button type="button" label={__('Annulla', 'gepafin')} onClick={hideCompleteDialog} outlined/>
|
<Button type="button" label={__('Annulla', 'gepafin')} onClick={hideCompleteDialog} outlined/>
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={loading || ('approve' === operationType && (!amountAccepted || isEmpty(amountAccepted) || amountAccepted === 0))}
|
disabled={isDisabled}
|
||||||
label={__('Invia', 'gepafin')} onClick={'approve' === operationType ? doApprove : doReject}/>
|
label={__('Invia', 'gepafin')} onClick={onSubmitAction}/>
|
||||||
</div>
|
</div>
|
||||||
}, [amountAccepted, data, motivation]);
|
}, [amountAccepted, data, motivation]);
|
||||||
|
|
||||||
@@ -823,7 +837,8 @@ const DomandaEditPreInstructor = () => {
|
|||||||
applicationStatus: 'TECHNICAL_EVALUATION_REJECTED'
|
applicationStatus: 'TECHNICAL_EVALUATION_REJECTED'
|
||||||
};
|
};
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
setIsVisibleCompleteDialog(false);
|
setOperationType('tf_reject');
|
||||||
|
setIsVisibleCompleteDialog(true);
|
||||||
ApplicationEvaluationService.updateStatus(assignedApplicationId, body, handleRejectingSuccess, handleRejectingError);
|
ApplicationEvaluationService.updateStatus(assignedApplicationId, body, handleRejectingSuccess, handleRejectingError);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user