diff --git a/src/components/manage/Blocks/DefaultView.jsx b/src/components/manage/Blocks/DefaultView.jsx index 1052a2d2..bd98f4de 100644 --- a/src/components/manage/Blocks/DefaultView.jsx +++ b/src/components/manage/Blocks/DefaultView.jsx @@ -20,9 +20,9 @@ const DefaultView = props => { const providerUrl = data?.providerUrl || settings.providerUrl || null; useEffect(() => { if ( - selectQuery.table && - selectQuery.columnKey && - selectQuery.columnValue && + selectQuery?.table && + selectQuery?.columnKey && + selectQuery?.columnValue && providerUrl && !state.loading ) { diff --git a/src/components/manage/Blocks/FacilityBlock/View.jsx b/src/components/manage/Blocks/FacilityBlock/View.jsx index dd4f6cd4..8f78ec11 100644 --- a/src/components/manage/Blocks/FacilityBlock/View.jsx +++ b/src/components/manage/Blocks/FacilityBlock/View.jsx @@ -28,23 +28,27 @@ const View = props => {

[facilityName1]

Industrial activity

-

{state.items[0]?.mainActivity}

+

{state.items?.[0]?.mainActivity}

Last report was submitted on:

- {moment(state.items[0]?.eprtrReportingDate).format('DD MMM YYYY')} + {moment(state.items?.[0]?.eprtrReportingDate).format( + 'DD MMM YYYY', + )}

Reporting year

-

{state.items[0]?.eprtrReportingYear}

+

{state.items?.[0]?.eprtrReportingYear}

Publish date

- {moment(state.items[0]?.eprtrReportingDate).format('DD MMM YYYY')} + {moment(state.items?.[0]?.eprtrReportingDate).format( + 'DD MMM YYYY', + )}

@@ -53,15 +57,15 @@ const View = props => {

Competent Authority

Last updated:{' '} - {moment(state.items[0]?.authLastUpdated).format('DD MMM YYYY')} + {moment(state.items?.[0]?.authLastUpdated).format('DD MMM YYYY')}

{metadata.map(meta => - state.items[0]?.[meta.id] ? ( + state.items?.[0]?.[meta.id] ? (

{meta.label}

-

{state.items[0]?.[meta.id]}

+

{state.items?.[0]?.[meta.id]}

) : meta.default ? (
diff --git a/src/components/manage/Blocks/RegulatoryInformationBlock/View.jsx b/src/components/manage/Blocks/RegulatoryInformationBlock/View.jsx index d055bf56..03ad43bc 100644 --- a/src/components/manage/Blocks/RegulatoryInformationBlock/View.jsx +++ b/src/components/manage/Blocks/RegulatoryInformationBlock/View.jsx @@ -57,15 +57,15 @@ const View = props => {

About the entity

BAT Conlcussions

- - {state.items[0]?.batFileName} + + {state.items?.[0]?.batFileName} { />
@@ -82,7 +82,7 @@ const View = props => {

Operating permit