- fixed JS error related to non existent ndg prop;
This commit is contained in:
@@ -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}
|
||||
|
||||
|
||||
@@ -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}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user