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