From 33c11aec15f7a7efc4bfddb910c5285b08db4551 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Fri, 21 Mar 2025 10:43:42 +0100 Subject: [PATCH] - fixed JS error on evaluation page; - fixed disabling rating for additional files after first amendment was created and closed; --- src/pages/DomandaEditInstructorManager/index.js | 3 ++- src/pages/DomandaEditPreInstructor/index.js | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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]);