From cbe44c97f6ad844cf0a9d43e78f294cbd0311499 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Tue, 14 May 2024 12:03:43 -0300 Subject: [PATCH] Upcoming deliveries --- src/components/ui/VnSearchbar.vue | 13 ++-- src/pages/Zone/Card/ZoneCard.vue | 2 +- src/pages/Zone/Card/ZoneDescriptor.vue | 1 - src/pages/Zone/ZoneList.vue | 54 +--------------- src/pages/Zone/ZoneMain.vue | 61 ++++++++++++++++++ src/pages/Zone/ZoneUpcoming.vue | 87 +++++++++++++++++--------- src/pages/Zone/locale/en.yml | 14 +++-- src/pages/Zone/locale/es.yml | 16 ++--- src/router/modules/zone.js | 87 +++----------------------- 9 files changed, 155 insertions(+), 180 deletions(-) diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index aaf197d74..568a35c61 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -91,12 +91,6 @@ async function search() { if (!props.redirect) return; - if (props.customRouteRedirectName) - return router.push({ - name: props.customRouteRedirectName, - params: { id: searchText.value }, - }); - const { matched: matches } = router.currentRoute.value; const { path } = matches.at(-1); const [, moduleName] = path.split('/'); @@ -105,6 +99,13 @@ async function search() { return router.push({ path: `/${moduleName}/list` }); const targetId = store.data[0].id; + + if (props.customRouteRedirectName && targetId) + return router.push({ + name: props.customRouteRedirectName, + params: { id: targetId }, + }); + let targetUrl; if (path.endsWith('/list')) targetUrl = path.replace('/list', `/${targetId}/summary`); diff --git a/src/pages/Zone/Card/ZoneCard.vue b/src/pages/Zone/Card/ZoneCard.vue index 9d6895f36..d8c51afe7 100644 --- a/src/pages/Zone/Card/ZoneCard.vue +++ b/src/pages/Zone/Card/ZoneCard.vue @@ -8,7 +8,7 @@ import ZoneDescriptor from './ZoneDescriptor.vue'; base-url="Zones" :descriptor="ZoneDescriptor" searchbar-data-key="ZoneList" - searchbar-url="Zones/filter" + searchbar-url="Zones" searchbar-label="Search zones" searchbar-info="You can search by zone reference" /> diff --git a/src/pages/Zone/Card/ZoneDescriptor.vue b/src/pages/Zone/Card/ZoneDescriptor.vue index 8f0aa9e07..aee6174a3 100644 --- a/src/pages/Zone/Card/ZoneDescriptor.vue +++ b/src/pages/Zone/Card/ZoneDescriptor.vue @@ -73,7 +73,6 @@ const setData = (entity) => { -->