From 53f3908dc36878cc3eb87a170c58ddddf581941f Mon Sep 17 00:00:00 2001 From: Bogdan Kostov Date: Tue, 2 Jan 2024 17:10:03 +0100 Subject: [PATCH] [#125] Fix error in dashboard when dashboard artifact lists are empty. --- .../dashboard/content/list/DashboardFailureModesTableList.tsx | 2 +- .../dashboard/content/list/DashboardFaultTreeList.tsx | 2 +- src/components/dashboard/content/list/DashboardSystemList.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/dashboard/content/list/DashboardFailureModesTableList.tsx b/src/components/dashboard/content/list/DashboardFailureModesTableList.tsx index cc496d15..f8b4b71a 100644 --- a/src/components/dashboard/content/list/DashboardFailureModesTableList.tsx +++ b/src/components/dashboard/content/list/DashboardFailureModesTableList.tsx @@ -56,7 +56,7 @@ const DashboardFailureModesTableList = () => { return ( - {tables.map((mode) => { + {tables.filter(m => !!m && !!m.iri).map((mode) => { const routePath = ROUTES.FMEA + extractFragment(mode.iri); return ( diff --git a/src/components/dashboard/content/list/DashboardFaultTreeList.tsx b/src/components/dashboard/content/list/DashboardFaultTreeList.tsx index 536e4744..840d1a23 100644 --- a/src/components/dashboard/content/list/DashboardFaultTreeList.tsx +++ b/src/components/dashboard/content/list/DashboardFaultTreeList.tsx @@ -52,7 +52,7 @@ const DashboardFaultTreeList = () => { return ( - {faultTrees.map((tree) => { + {faultTrees.filter(f => !!f && !!f.iri).map((tree) => { const routePath = ROUTES.FTA + extractFragment(tree.iri); return ( diff --git a/src/components/dashboard/content/list/DashboardSystemList.tsx b/src/components/dashboard/content/list/DashboardSystemList.tsx index 05d86d39..caac6f29 100644 --- a/src/components/dashboard/content/list/DashboardSystemList.tsx +++ b/src/components/dashboard/content/list/DashboardSystemList.tsx @@ -52,7 +52,7 @@ const DashboardSystemList = () => { return ( - {systems.map((system) => { + {systems.filter(s => !!s && !!s.iri).map((system) => { const routePath = ROUTES.SYSTEM + extractFragment(system.iri); return (