From e45e7c519bd213d8356c00f7d3e61c7670c802ee Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 23 Oct 2024 13:03:12 +0200 Subject: [PATCH] fix: summary --- src/components/ui/CardDescriptor.vue | 2 +- src/components/ui/CardSummary.vue | 17 +++++++++++++++-- src/pages/Customer/Card/CustomerSummary.vue | 1 + .../components/CustomerSummaryTable.vue | 4 ++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index 90ac856e5..b4bd40bfe 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -135,7 +135,7 @@ const toModule = computed(() => dense size="md" icon="preview" - color="white" + color="primary" class="link" v-if="summary" > diff --git a/src/components/ui/CardSummary.vue b/src/components/ui/CardSummary.vue index f27740f18..888bdfe68 100644 --- a/src/components/ui/CardSummary.vue +++ b/src/components/ui/CardSummary.vue @@ -61,7 +61,21 @@ async function fetch() { const showRedirectToSummaryIcon = computed(() => { const exist = existSummary(route.matched); - return !isSummary.value && route.meta.moduleName && exist; + const isDialog = document.querySelectorAll('[role="dialog"]').length > 0; + + // const isSameModule = `${route.meta.moduleName}Summary` === props.dataKey; + // if (!isSameModule) return true; + + console.error( + isDialog, + 'exist', + isSummary.value, + route.matched, + !isSummary.value, + route.meta.moduleName, + exist + ); + return isDialog; }); function existSummary(routes) { @@ -91,7 +105,6 @@ function existSummary(routes) { params: { id: entityId || entity.id }, }" > - diff --git a/src/pages/Customer/Card/CustomerSummary.vue b/src/pages/Customer/Card/CustomerSummary.vue index 852ace26b..f28b23657 100644 --- a/src/pages/Customer/Card/CustomerSummary.vue +++ b/src/pages/Customer/Card/CustomerSummary.vue @@ -67,6 +67,7 @@ const creditWarning = computed(() => { ref="summary" :url="`Clients/${entityId}/summary`" data-key="CustomerSummary" + module-name="Customer" >