- updated;
This commit is contained in:
@@ -31,7 +31,9 @@ import SoccorsoResendEmails from '../../../SoccorsoEditPreInstructor/components/
|
||||
|
||||
const APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||
|
||||
const DomandeTablePreInstructorAsync = ({ userId = null, statuses = [] }) => {
|
||||
const DomandeTablePreInstructorAsync = ({ userId = null, statuses = [],
|
||||
applicationStatuses = ['EVALUATION', 'SOCCORSO', 'NDG', 'APPOINTMENT', 'ADMISSIBLE',
|
||||
'AWAITING_TECHNICAL_EVALUATION', 'TECHNICAL_EVALUATION']}) => {
|
||||
const navigate = useNavigate();
|
||||
const userData = useStoreValue('userData');
|
||||
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
||||
@@ -54,8 +56,6 @@ const DomandeTablePreInstructorAsync = ({ userId = null, statuses = [] }) => {
|
||||
assignedUserName: { value: null, matchMode: 'equals' }
|
||||
}
|
||||
});
|
||||
const applicationStatuses = ['EVALUATION', 'SOCCORSO', 'NDG', 'APPOINTMENT', 'ADMISSIBLE',
|
||||
'AWAITING_TECHNICAL_EVALUATION', 'TECHNICAL_EVALUATION'];
|
||||
|
||||
const getPaginationQuery = useCallback(() => getQueryParamsForPaginatedEndpoint(lazyState, statuses, 'applicationId'), [lazyState]);
|
||||
|
||||
|
||||
@@ -525,7 +525,8 @@ const DomandaEditInstructorManager = () => {
|
||||
files: klona(data.files),
|
||||
note: data.note,
|
||||
motivation: finalDialogData.motivation,
|
||||
rejectedReason: finalDialogData.subject
|
||||
rejectedReason: finalDialogData.reason,
|
||||
rejectedReasonSubject: finalDialogData.subject
|
||||
}
|
||||
|
||||
const formDataToSend = new FormData();
|
||||
@@ -562,7 +563,8 @@ const DomandaEditInstructorManager = () => {
|
||||
amendmentDetails: klona(data.amendmentDetails),
|
||||
note: data.note,
|
||||
motivation: finalDialogData.motivation,
|
||||
rejectedReason: finalDialogData.subject
|
||||
rejectedReason: finalDialogData.reason,
|
||||
rejectedReasonSubject: finalDialogData.subject
|
||||
}
|
||||
|
||||
const formDataToSend = new FormData();
|
||||
@@ -723,7 +725,7 @@ const DomandaEditInstructorManager = () => {
|
||||
onSubmitAction = () => doReject('TECHNICAL_EVALUATION_REJECTED');
|
||||
} else {
|
||||
onSubmitAction = () => doReject('REJECTED');
|
||||
isDisabled = isDisabled || !finalDialogData.subject || isEmpty(finalDialogData.subject) || !finalDialogData.motivation || isEmpty(finalDialogData.motivation)
|
||||
isDisabled = isDisabled || !finalDialogData.reason || isEmpty(finalDialogData.reason) || !finalDialogData.motivation || isEmpty(finalDialogData.motivation)
|
||||
}
|
||||
|
||||
return <div>
|
||||
@@ -1590,22 +1592,31 @@ const DomandaEditInstructorManager = () => {
|
||||
</div> : null}
|
||||
{operationType === 'reject' && APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE'
|
||||
? <div className="appForm__field">
|
||||
<label className={classNames({ 'p-error': !finalDialogData.subject || isEmpty(finalDialogData.subject) })}>
|
||||
<label className={classNames({ 'p-error': !finalDialogData.reason || isEmpty(finalDialogData.reason) })}>
|
||||
{__('Oggetto', 'gepafin')}
|
||||
</label>
|
||||
<Dropdown
|
||||
value={null}
|
||||
value={rejectionReasons.find(reason => reason.id === finalDialogData.reasonId) || null}
|
||||
options={rejectionReasons}
|
||||
optionLabel="label"
|
||||
placeholder={__('Seleziona motivo', 'gepafin')}
|
||||
onChange={(e) => updateFinalDialogData(e.value.text, 'subject')}
|
||||
onChange={(e) => {
|
||||
setFinalDialogData(prev => ({
|
||||
...prev,
|
||||
reasonId: e.value.id,
|
||||
reason: e.value.text,
|
||||
subject: e.value.subject
|
||||
}))
|
||||
}}
|
||||
style={{ marginBottom: '10px' }}
|
||||
/>
|
||||
<InputText
|
||||
name="subject"
|
||||
value={finalDialogData.subject}
|
||||
invalid={!finalDialogData.subject || isEmpty(finalDialogData.subject)}
|
||||
onChange={(e) => updateFinalDialogData(e.target.value, 'subject')}/>
|
||||
<InputTextarea
|
||||
name="reason"
|
||||
value={finalDialogData.reason}
|
||||
invalid={!finalDialogData.reason || isEmpty(finalDialogData.reason)}
|
||||
onChange={(e) => updateFinalDialogData(e.target.value, 'reason')}
|
||||
rows={3}
|
||||
style={{ width: '100%' }}/>
|
||||
</div> : null}
|
||||
<div className="appForm__field">
|
||||
<label className={classNames({ 'p-error': !finalDialogData.motivation || isEmpty(finalDialogData.motivation) })}>
|
||||
|
||||
@@ -525,7 +525,8 @@ const DomandaEditPreInstructor = () => {
|
||||
files: klona(data.files),
|
||||
note: data.note,
|
||||
motivation: finalDialogData.motivation,
|
||||
rejectedReason: finalDialogData.subject
|
||||
rejectedReason: finalDialogData.reason,
|
||||
rejectedReasonSubject: finalDialogData.subject
|
||||
}
|
||||
|
||||
const formDataToSend = new FormData();
|
||||
@@ -562,7 +563,8 @@ const DomandaEditPreInstructor = () => {
|
||||
amendmentDetails: klona(data.amendmentDetails),
|
||||
note: data.note,
|
||||
motivation: finalDialogData.motivation,
|
||||
rejectedReason: finalDialogData.subject
|
||||
rejectedReason: finalDialogData.reason,
|
||||
rejectedReasonSubject: finalDialogData.subject
|
||||
}
|
||||
|
||||
const formDataToSend = new FormData();
|
||||
@@ -723,7 +725,7 @@ const DomandaEditPreInstructor = () => {
|
||||
onSubmitAction = () => doReject('TECHNICAL_EVALUATION_REJECTED');
|
||||
} else {
|
||||
onSubmitAction = () => doReject('REJECTED');
|
||||
isDisabled = isDisabled || !finalDialogData.subject || isEmpty(finalDialogData.subject) || !finalDialogData.motivation || isEmpty(finalDialogData.motivation)
|
||||
isDisabled = isDisabled || !finalDialogData.reason || isEmpty(finalDialogData.reason) || !finalDialogData.motivation || isEmpty(finalDialogData.motivation)
|
||||
}
|
||||
|
||||
return <div>
|
||||
@@ -1590,22 +1592,31 @@ const DomandaEditPreInstructor = () => {
|
||||
</div> : null}
|
||||
{operationType === 'reject' && APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE'
|
||||
? <div className="appForm__field">
|
||||
<label className={classNames({ 'p-error': !finalDialogData.subject || isEmpty(finalDialogData.subject) })}>
|
||||
<label className={classNames({ 'p-error': !finalDialogData.reason || isEmpty(finalDialogData.reason) })}>
|
||||
{__('Oggetto', 'gepafin')}
|
||||
</label>
|
||||
<Dropdown
|
||||
value={null}
|
||||
value={rejectionReasons.find(reason => reason.id === finalDialogData.reasonId) || null}
|
||||
options={rejectionReasons}
|
||||
optionLabel="label"
|
||||
placeholder={__('Seleziona motivo', 'gepafin')}
|
||||
onChange={(e) => updateFinalDialogData(e.value.text, 'subject')}
|
||||
onChange={(e) => {
|
||||
setFinalDialogData(prev => ({
|
||||
...prev,
|
||||
reasonId: e.value.id,
|
||||
reason: e.value.text,
|
||||
subject: e.value.subject
|
||||
}))
|
||||
}}
|
||||
style={{ marginBottom: '10px' }}
|
||||
/>
|
||||
<InputText
|
||||
name="subject"
|
||||
value={finalDialogData.subject}
|
||||
invalid={!finalDialogData.subject || isEmpty(finalDialogData.subject)}
|
||||
onChange={(e) => updateFinalDialogData(e.target.value, 'subject')}/>
|
||||
<InputTextarea
|
||||
name="reason"
|
||||
value={finalDialogData.reason}
|
||||
invalid={!finalDialogData.reason || isEmpty(finalDialogData.reason)}
|
||||
onChange={(e) => updateFinalDialogData(e.target.value, 'reason')}
|
||||
rows={3}
|
||||
style={{ width: '100%' }}/>
|
||||
</div> : null}
|
||||
<div className="appForm__field">
|
||||
<label className={classNames({ 'p-error': !finalDialogData.motivation || isEmpty(finalDialogData.motivation) })}>
|
||||
|
||||
@@ -15,7 +15,7 @@ const DomandeArchive = () => {
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Domande completate', 'gepafin')}</h2>
|
||||
<DomandeTablePreInstructorAsync statuses={['CLOSE']} userId={0}/>
|
||||
<DomandeTablePreInstructorAsync statuses={['CLOSE']} applicationStatuses={['APPROVED', 'REJECTED', 'TECHNICAL_EVALUATION_REJECTED']} userId={0}/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -20,7 +20,7 @@ const DomandeArchivePreInstructor = () => {
|
||||
|
||||
<div className="appPageSection">
|
||||
<h2>{__('Domande completate', 'gepafin')}</h2>
|
||||
<DomandeTablePreInstructorAsync statuses={['CLOSE']} userId={userData.id}/>
|
||||
<DomandeTablePreInstructorAsync statuses={['CLOSE']} applicationStatuses={['APPROVED', 'REJECTED', 'TECHNICAL_EVALUATION_REJECTED']} userId={userData.id}/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user