- fixed JS error related to non existent ndg prop;

This commit is contained in:
Vitalii Kiiko
2026-02-16 15:50:07 +01:00
parent a29f88d252
commit abfcb1168e
3 changed files with 22 additions and 22 deletions

View File

@@ -790,10 +790,10 @@ const DomandaEditInstructorManager = () => {
detail: data.message
});
}
if (data.data.ndg) {
if (data.data?.ndg) {
setData((data) => ({
...data,
ndg: data.data.ndg
ndg: data.data?.ndg
}));
}
}
@@ -1002,7 +1002,7 @@ const DomandaEditInstructorManager = () => {
const shouldDisableNewSoccorso = () => {
if (APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE') {
//return !data.ndg || !data.appointmentId || !allFilesRated || !atLeastOneChecked;
return !data.ndg || !allFilesRated || !atLeastOneChecked;
return !data?.ndg || !allFilesRated || !atLeastOneChecked;
} else if (APP_HUB_ID === 't7jh5wfg9QXylNaTZkPoE') {
return !allFilesRated || !atLeastOneChecked;
} else {
@@ -1463,7 +1463,7 @@ const DomandaEditInstructorManager = () => {
outlined severity="info"
aria-label={__('Mostra', 'gepafin')}/>
<ArchiveDocument
ndg={data.ndg}
ndg={data?.ndg}
applicationId={id}
fileDescr={renderHtmlContent(o.name)}
fileId={o.id}
@@ -1503,7 +1503,7 @@ const DomandaEditInstructorManager = () => {
<div>{renderHtmlContent(data.signedDocument.fileName)}</div>
<div className="appPageSection__iconActions">
<ArchiveDocument
ndg={data.ndg}
ndg={data?.ndg}
applicationId={id}
fileDescr={renderHtmlContent(data.signedDocument.fileName)}
fileId={data.signedDocument.id}
@@ -1530,7 +1530,7 @@ const DomandaEditInstructorManager = () => {
updateFn={updateEvaluationValue}
shouldDisableFieldFn={(name) => shouldDisableField(name) || evaluationBlockedForUser(data)}
name="files"
ndg={data.ndg}
ndg={data?.ndg}
applicationId={id}/>
: <p>{__('Nessun documento allegato', 'gepafin')}</p>}
</div>
@@ -1652,7 +1652,7 @@ const DomandaEditInstructorManager = () => {
outlined severity="info"
aria-label={__('Mostra', 'gepafin')}/>
<ArchiveDocument
ndg={data.ndg}
ndg={data?.ndg}
applicationId={id}
fileDescr={renderHtmlContent(o.name)}
fileId={o.id}
@@ -1698,7 +1698,7 @@ const DomandaEditInstructorManager = () => {
outlined severity="info"
aria-label={__('Mostra', 'gepafin')}/>
<ArchiveDocument
ndg={data.ndg}
ndg={data?.ndg}
applicationId={id}
fileDescr={renderHtmlContent(data.signedDocument.fileName)}
fileId={data.signedDocument.id}
@@ -1725,7 +1725,7 @@ const DomandaEditInstructorManager = () => {
updateFn={updateEvaluationValue}
shouldDisableFieldFn={(name) => shouldDisableField(name) || evaluationBlockedForUser(data)}
name="files"
ndg={data.ndg}
ndg={data?.ndg}
applicationId={id}/>
: <p>{__('Nessun documento allegato', 'gepafin')}</p>}
</div>
@@ -1741,7 +1741,7 @@ const DomandaEditInstructorManager = () => {
updateFn={updateEvaluationValue}
shouldDisableFieldFn={(name) => shouldDisableField(name) || evaluationBlockedForUser(data)}
name="amendmentDetails"
ndg={data.ndg}
ndg={data?.ndg}
applicationId={id}/>
</div> : null}

View File

@@ -790,10 +790,10 @@ const DomandaEditPreInstructor = () => {
detail: data.message
});
}
if (data.data.ndg) {
if (data.data?.ndg) {
setData((data) => ({
...data,
ndg: data.data.ndg
ndg: data.data?.ndg
}));
}
}
@@ -1002,7 +1002,7 @@ const DomandaEditPreInstructor = () => {
const shouldDisableNewSoccorso = () => {
if (APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE') {
//return !data.ndg || !data.appointmentId || !allFilesRated || !atLeastOneChecked;
return !data.ndg || !allFilesRated || !atLeastOneChecked;
return !data?.ndg || !allFilesRated || !atLeastOneChecked;
} else if (APP_HUB_ID === 't7jh5wfg9QXylNaTZkPoE') {
return !allFilesRated || !atLeastOneChecked;
} else {
@@ -1463,7 +1463,7 @@ const DomandaEditPreInstructor = () => {
outlined severity="info"
aria-label={__('Mostra', 'gepafin')}/>
<ArchiveDocument
ndg={data.ndg}
ndg={data?.ndg}
applicationId={id}
fileDescr={renderHtmlContent(o.name)}
fileId={o.id}
@@ -1503,7 +1503,7 @@ const DomandaEditPreInstructor = () => {
<div>{renderHtmlContent(data.signedDocument.fileName)}</div>
<div className="appPageSection__iconActions">
<ArchiveDocument
ndg={data.ndg}
ndg={data?.ndg}
applicationId={id}
fileDescr={renderHtmlContent(data.signedDocument.fileName)}
fileId={data.signedDocument.id}
@@ -1530,7 +1530,7 @@ const DomandaEditPreInstructor = () => {
updateFn={updateEvaluationValue}
shouldDisableFieldFn={(name) => shouldDisableField(name) || evaluationBlockedForUser(data)}
name="files"
ndg={data.ndg}
ndg={data?.ndg}
applicationId={id}/>
: <p>{__('Nessun documento allegato', 'gepafin')}</p>}
</div>
@@ -1652,7 +1652,7 @@ const DomandaEditPreInstructor = () => {
outlined severity="info"
aria-label={__('Mostra', 'gepafin')}/>
<ArchiveDocument
ndg={data.ndg}
ndg={data?.ndg}
applicationId={id}
fileDescr={renderHtmlContent(o.name)}
fileId={o.id}
@@ -1698,7 +1698,7 @@ const DomandaEditPreInstructor = () => {
outlined severity="info"
aria-label={__('Mostra', 'gepafin')}/>
<ArchiveDocument
ndg={data.ndg}
ndg={data?.ndg}
applicationId={id}
fileDescr={renderHtmlContent(data.signedDocument.fileName)}
fileId={data.signedDocument.id}
@@ -1725,7 +1725,7 @@ const DomandaEditPreInstructor = () => {
updateFn={updateEvaluationValue}
shouldDisableFieldFn={(name) => shouldDisableField(name) || evaluationBlockedForUser(data)}
name="files"
ndg={data.ndg}
ndg={data?.ndg}
applicationId={id}/>
: <p>{__('Nessun documento allegato', 'gepafin')}</p>}
</div>
@@ -1741,7 +1741,7 @@ const DomandaEditPreInstructor = () => {
updateFn={updateEvaluationValue}
shouldDisableFieldFn={(name) => shouldDisableField(name) || evaluationBlockedForUser(data)}
name="amendmentDetails"
ndg={data.ndg}
ndg={data?.ndg}
applicationId={id}/>
</div> : null}