Added Validations for better error tracking

Signed-off-by: mufaddal motiwala <mufaddalmm.52@gmail.com>
This commit is contained in:
mufaddal motiwala
2021-11-24 06:44:00 +05:30
parent f5fe59f964
commit eff6ff71ee
2 changed files with 9 additions and 3 deletions
@@ -55,7 +55,13 @@ export const DashboardEntityList = () => {
<Grid container spacing={3} direction="column">
<Grid item xs={12}>
<InfoCard title="New Relic Dashboard Pages" variant="gridItem">
{value.getDashboardEntity.data.actor.entitySearch.results.entities.map(
{value?.getDashboardEntity === undefined &&
'Unauthorized Request , please check API Key'}
{value?.getDashboardEntity?.data.actor.entitySearch.results.entities
.length <= 0 && (
<>No Dashboard Pages found with the specified Dashboard GUID</>
)}
{value?.getDashboardEntity?.data.actor.entitySearch.results.entities?.map(
(entity: any) => {
return (
<Box style={{ margin: '10px' }} display="flex">
@@ -109,7 +109,7 @@ export const DashboardSnapshotList = ({ guid }: Props) => {
value={value1}
style={{ width: '100%' }}
>
{value.getDashboardEntity.data.actor.entitySearch.results.entities?.map(
{value?.getDashboardEntity?.data?.actor.entitySearch.results.entities?.map(
(Entity: any, index: any) => {
return (
<Tab
@@ -125,7 +125,7 @@ export const DashboardSnapshotList = ({ guid }: Props) => {
},
)}
</Tabs>
{value.getDashboardEntity.data.actor.entitySearch.results.entities?.map(
{value?.getDashboardEntity?.data?.actor.entitySearch.results.entities?.map(
(Entity: any, index: any) => {
return (
<TabPanel value1={value1} index={index}>