From 3ae523ef040f9113aaae0971771cd4e693202abe Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 27 May 2024 16:52:53 +0200 Subject: [PATCH] test(WorkerList): refs #7589 fix e2e --- src/components/ui/CardSummary.vue | 17 +++++++++++++---- .../integration/worker/workerList.spec.js | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/components/ui/CardSummary.vue b/src/components/ui/CardSummary.vue index 57d1cb19a..ae9a43578 100644 --- a/src/components/ui/CardSummary.vue +++ b/src/components/ui/CardSummary.vue @@ -56,11 +56,20 @@ async function fetch() { } const showRedirectToSummaryIcon = computed(() => { - const routeExists = route.matched.some( - (route) => route.name === `${route.meta.moduleName}Summary` - ); - return !isSummary.value && route.meta.moduleName && routeExists; + const exist = existSummary(route.matched); + return !isSummary.value && route.meta.moduleName && exist; }); + +function existSummary(routes) { + const hasSummary = routes.some((r) => r.name === `${route.meta.moduleName}Summary`); + if (hasSummary) return hasSummary; + for (const current of routes) { + if (current.path != '/' && current.children) { + const exist = existSummary(current.children); + if (exist) return exist; + } + } +}