- fixed JS error on evaluation page;

- fixed disabling rating for additional files after first amendment was created and closed;
This commit is contained in:
Vitalii Kiiko
2025-03-21 10:43:42 +01:00
parent b3a3879bac
commit 33c11aec15
2 changed files with 5 additions and 3 deletions

View File

@@ -319,7 +319,7 @@ const DomandaEditInstructorManager = () => {
files: klona(data.files), files: klona(data.files),
evaluationDocument: klona(data.evaluationDocument.map(o => ({ evaluationDocument: klona(data.evaluationDocument.map(o => ({
...o, ...o,
fileValue: o.fileValue[0] ? o.fileValue[0].id : '' fileValue: o.fileValue && o.fileValue[0] ? o.fileValue[0].id : ''
}) })
)), )),
amendmentDetails: klona(data.amendmentDetails), amendmentDetails: klona(data.amendmentDetails),
@@ -592,6 +592,7 @@ const DomandaEditInstructorManager = () => {
const shouldDisableField = useCallback((fieldName) => { const shouldDisableField = useCallback((fieldName) => {
return !['EVALUATION', 'ADMISSIBLE'].includes(data.applicationStatus) return !['EVALUATION', 'ADMISSIBLE'].includes(data.applicationStatus)
|| (['ADMISSIBLE'].includes(data.applicationStatus) && fieldName !== 'criteria') || (['ADMISSIBLE'].includes(data.applicationStatus) && fieldName !== 'criteria')
|| (fieldName === 'files' && !isEmpty(data.amendmentDetails))
}, [data.applicationStatus]); }, [data.applicationStatus]);
const headerCompleteDialog = () => { const headerCompleteDialog = () => {

View File

@@ -319,7 +319,7 @@ const DomandaEditPreInstructor = () => {
files: klona(data.files), files: klona(data.files),
evaluationDocument: klona(data.evaluationDocument.map(o => ({ evaluationDocument: klona(data.evaluationDocument.map(o => ({
...o, ...o,
fileValue: o.fileValue[0] ? o.fileValue[0].id : '' fileValue: o.fileValue && o.fileValue[0] ? o.fileValue[0].id : ''
}) })
)), )),
amendmentDetails: klona(data.amendmentDetails), amendmentDetails: klona(data.amendmentDetails),
@@ -592,6 +592,7 @@ const DomandaEditPreInstructor = () => {
const shouldDisableField = useCallback((fieldName) => { const shouldDisableField = useCallback((fieldName) => {
return !['EVALUATION', 'ADMISSIBLE'].includes(data.applicationStatus) return !['EVALUATION', 'ADMISSIBLE'].includes(data.applicationStatus)
|| (['ADMISSIBLE'].includes(data.applicationStatus) && fieldName !== 'criteria') || (['ADMISSIBLE'].includes(data.applicationStatus) && fieldName !== 'criteria')
|| (fieldName === 'files' && !isEmpty(data.amendmentDetails))
}, [data.applicationStatus]); }, [data.applicationStatus]);
const headerCompleteDialog = () => { const headerCompleteDialog = () => {
@@ -929,7 +930,7 @@ const DomandaEditPreInstructor = () => {
storeSet.main.setAsyncRequest(); storeSet.main.setAsyncRequest();
ApplicationEvaluationService.getEvaluationVersionByApplId(entityId, getVersion, errGetVersion); ApplicationEvaluationService.getEvaluationVersionByApplId(entityId, getVersion, errGetVersion);
AmendmentsService.getSoccorsoByApplId(entityId, getAmendmentsCallback, errGetAmendmentsCallback, [ AmendmentsService.getSoccorsoByApplId(entityId, getAmendmentsCallback, errGetAmendmentsCallback, [
['statuses', ['AWAITING', 'RESPONSE_RECEIVED']] ['statuses', ['AWAITING', 'RESPONSE_RECEIVED', 'CLOSE']]
]); ]);
}, [id]); }, [id]);