From 08d7e0ade99e40ef62633972d1db3e4483fe1875 Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev <572431+veikab@users.noreply.github.com> Date: Thu, 22 Jan 2026 10:57:30 +0700 Subject: [PATCH] Implement unified catalog search with token-based filtering - Add useCatalogSearch composable for managing unified search state - Add UnifiedSearchBar component with token chips for filters - Add CatalogHero component for empty/landing state - Create grid components for each display mode: - CatalogGridProducts, CatalogGridSuppliers, CatalogGridHubs - CatalogGridHubsForProduct, CatalogGridProductsFromSupplier - CatalogGridProductsInHub, CatalogGridOffers - Add unified catalog page at /catalog with query params - Remove SubNavigation from catalog section (kept for other sections) - Update all links to use new unified catalog paths - Delete old nested catalog pages (offers/suppliers/hubs flows) - Add i18n translations for catalog section --- app/components/GoodsContent.vue | 4 +- app/components/Sidebar.vue | 36 +- app/components/catalog/CatalogBreadcrumbs.vue | 2 +- app/components/catalog/CatalogGridHubs.vue | 58 +++ .../catalog/CatalogGridHubsForProduct.vue | 99 ++++ app/components/catalog/CatalogGridOffers.vue | 124 +++++ .../catalog/CatalogGridProducts.vue | 46 ++ .../CatalogGridProductsFromSupplier.vue | 95 ++++ .../catalog/CatalogGridProductsInHub.vue | 93 ++++ .../catalog/CatalogGridSuppliers.vue | 57 +++ app/components/catalog/CatalogHero.vue | 42 ++ app/components/catalog/CatalogHubsSection.vue | 2 +- .../catalog/CatalogOffersSection.vue | 2 +- .../catalog/CatalogSuppliersSection.vue | 2 +- app/components/catalog/OffersBreadcrumbs.vue | 6 +- app/components/catalog/SupplierCard.vue | 2 +- .../catalog/SuppliersBreadcrumbs.vue | 6 +- app/components/navigation/MainNavigation.vue | 2 +- app/components/navigation/SubNavigation.vue | 6 +- app/components/search/GlobalSearchBar.vue | 12 +- app/components/search/UnifiedSearchBar.vue | 133 ++++++ app/composables/useCatalogSearch.ts | 233 +++++++++ app/layouts/topnav.vue | 24 +- app/pages/catalog/hubs/[id]/[productId].vue | 309 ------------ app/pages/catalog/hubs/[id]/index.vue | 6 +- app/pages/catalog/hubs/index.vue | 184 ------- app/pages/catalog/index.vue | 145 ++++++ .../catalog/offers/[productId]/[hubId].vue | 356 -------------- .../catalog/offers/[productId]/index.vue | 158 ------ app/pages/catalog/offers/index.vue | 85 ---- app/pages/catalog/products/[id].vue | 2 +- .../[supplierId]/[productId]/[hubId].vue | 450 ------------------ .../[supplierId]/[productId]/index.vue | 257 ---------- .../catalog/suppliers/[supplierId]/index.vue | 215 --------- app/pages/catalog/suppliers/index.vue | 124 ----- app/pages/select-location/index.vue | 7 +- app/pages/select-location/map.vue | 7 +- i18n/locales/en/catalog.json | 36 ++ i18n/locales/ru/catalog.json | 36 ++ 39 files changed, 1278 insertions(+), 2185 deletions(-) create mode 100644 app/components/catalog/CatalogGridHubs.vue create mode 100644 app/components/catalog/CatalogGridHubsForProduct.vue create mode 100644 app/components/catalog/CatalogGridOffers.vue create mode 100644 app/components/catalog/CatalogGridProducts.vue create mode 100644 app/components/catalog/CatalogGridProductsFromSupplier.vue create mode 100644 app/components/catalog/CatalogGridProductsInHub.vue create mode 100644 app/components/catalog/CatalogGridSuppliers.vue create mode 100644 app/components/catalog/CatalogHero.vue create mode 100644 app/components/search/UnifiedSearchBar.vue create mode 100644 app/composables/useCatalogSearch.ts delete mode 100644 app/pages/catalog/hubs/[id]/[productId].vue delete mode 100644 app/pages/catalog/hubs/index.vue create mode 100644 app/pages/catalog/index.vue delete mode 100644 app/pages/catalog/offers/[productId]/[hubId].vue delete mode 100644 app/pages/catalog/offers/[productId]/index.vue delete mode 100644 app/pages/catalog/offers/index.vue delete mode 100644 app/pages/catalog/suppliers/[supplierId]/[productId]/[hubId].vue delete mode 100644 app/pages/catalog/suppliers/[supplierId]/[productId]/index.vue delete mode 100644 app/pages/catalog/suppliers/[supplierId]/index.vue delete mode 100644 app/pages/catalog/suppliers/index.vue create mode 100644 i18n/locales/en/catalog.json create mode 100644 i18n/locales/ru/catalog.json diff --git a/app/components/GoodsContent.vue b/app/components/GoodsContent.vue index 7abeeba..a770e05 100644 --- a/app/components/GoodsContent.vue +++ b/app/components/GoodsContent.vue @@ -54,8 +54,8 @@ const selectProduct = (product: any) => { if (locationUuid) { // Both product and hub selected -> show offers navigateTo({ - path: `/catalog/offers/${product.uuid}/${locationUuid}`, - query + path: `/catalog`, + query: { product: product.uuid, hub: locationUuid, ...query } }) return } diff --git a/app/components/Sidebar.vue b/app/components/Sidebar.vue index 5990a07..0506e62 100644 --- a/app/components/Sidebar.vue +++ b/app/components/Sidebar.vue @@ -38,8 +38,8 @@
+ {{ t('catalog.hero.subtitle') }} +
+ +