diff --git a/src/pages/DomandaEditInstructorManager/index.js b/src/pages/DomandaEditInstructorManager/index.js index 1f5f783..5697d1c 100644 --- a/src/pages/DomandaEditInstructorManager/index.js +++ b/src/pages/DomandaEditInstructorManager/index.js @@ -319,7 +319,7 @@ const DomandaEditInstructorManager = () => { files: klona(data.files), evaluationDocument: klona(data.evaluationDocument.map(o => ({ ...o, - fileValue: o.fileValue[0] ? o.fileValue[0].id : '' + fileValue: o.fileValue && o.fileValue[0] ? o.fileValue[0].id : '' }) )), amendmentDetails: klona(data.amendmentDetails), @@ -592,6 +592,7 @@ const DomandaEditInstructorManager = () => { const shouldDisableField = useCallback((fieldName) => { return !['EVALUATION', 'ADMISSIBLE'].includes(data.applicationStatus) || (['ADMISSIBLE'].includes(data.applicationStatus) && fieldName !== 'criteria') + || (fieldName === 'files' && !isEmpty(data.amendmentDetails)) }, [data.applicationStatus]); const headerCompleteDialog = () => { diff --git a/src/pages/DomandaEditPreInstructor/index.js b/src/pages/DomandaEditPreInstructor/index.js index 5ef86f1..5bc09db 100644 --- a/src/pages/DomandaEditPreInstructor/index.js +++ b/src/pages/DomandaEditPreInstructor/index.js @@ -319,7 +319,7 @@ const DomandaEditPreInstructor = () => { files: klona(data.files), evaluationDocument: klona(data.evaluationDocument.map(o => ({ ...o, - fileValue: o.fileValue[0] ? o.fileValue[0].id : '' + fileValue: o.fileValue && o.fileValue[0] ? o.fileValue[0].id : '' }) )), amendmentDetails: klona(data.amendmentDetails), @@ -592,6 +592,7 @@ const DomandaEditPreInstructor = () => { const shouldDisableField = useCallback((fieldName) => { return !['EVALUATION', 'ADMISSIBLE'].includes(data.applicationStatus) || (['ADMISSIBLE'].includes(data.applicationStatus) && fieldName !== 'criteria') + || (fieldName === 'files' && !isEmpty(data.amendmentDetails)) }, [data.applicationStatus]); const headerCompleteDialog = () => { @@ -929,7 +930,7 @@ const DomandaEditPreInstructor = () => { storeSet.main.setAsyncRequest(); ApplicationEvaluationService.getEvaluationVersionByApplId(entityId, getVersion, errGetVersion); AmendmentsService.getSoccorsoByApplId(entityId, getAmendmentsCallback, errGetAmendmentsCallback, [ - ['statuses', ['AWAITING', 'RESPONSE_RECEIVED']] + ['statuses', ['AWAITING', 'RESPONSE_RECEIVED', 'CLOSE']] ]); }, [id]);