Show map by default on /catalog, add offersCount to products
All checks were successful
Build Docker Image / build (push) Successful in 3m27s
All checks were successful
Build Docker Image / build (push) Successful in 3m27s
- Change displayMode from 'hero' to 'map-default' for /catalog - Always show map on catalog page (fullWidthMap when no selectMode) - Add offersCount to GetProducts, GetProductsBySupplier, GetProductsNearHub - Remove CatalogHero from catalog page (hero content stays on /)
This commit is contained in:
@@ -2,7 +2,7 @@ import type { LocationQuery } from 'vue-router'
|
||||
|
||||
export type SelectMode = 'product' | 'supplier' | 'hub' | null
|
||||
export type DisplayMode =
|
||||
| 'hero'
|
||||
| 'map-default'
|
||||
| 'grid-products'
|
||||
| 'grid-suppliers'
|
||||
| 'grid-hubs'
|
||||
@@ -148,8 +148,8 @@ export function useCatalogSearch() {
|
||||
if (supplierId.value) return 'grid-products-from-supplier'
|
||||
if (hubId.value) return 'grid-products-in-hub'
|
||||
|
||||
// Empty state
|
||||
return 'hero'
|
||||
// Default: show map with all offers
|
||||
return 'map-default'
|
||||
})
|
||||
|
||||
// Check if we're on the main page (not /catalog)
|
||||
|
||||
@@ -57,9 +57,7 @@
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
<!-- Hero for empty state -->
|
||||
<CatalogHero v-if="displayMode === 'hero'" @start-select="startSelect" />
|
||||
<Text v-else tone="muted">{{ t('catalog.empty.noResults') }}</Text>
|
||||
<Text v-if="displayMode !== 'map-default'" tone="muted">{{ t('catalog.empty.noResults') }}</Text>
|
||||
</template>
|
||||
</CatalogPage>
|
||||
</template>
|
||||
@@ -125,23 +123,25 @@ const cardType = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
const showMap = computed(() => displayMode.value !== 'hero')
|
||||
// Always show map on /catalog
|
||||
const showMap = computed(() => true)
|
||||
|
||||
// Full width map when not in select mode (after filter is selected)
|
||||
// selectMode is active = grid + map, after selection = only map
|
||||
const fullWidthMap = computed(() => !selectMode.value && displayMode.value !== 'hero')
|
||||
// Full width map when not in select mode (after filter is selected or default map view)
|
||||
// selectMode is active = grid + map, after selection or default = only map
|
||||
const fullWidthMap = computed(() => !selectMode.value)
|
||||
|
||||
// Use server clustering for grids that need it
|
||||
const useServerClustering = computed(() => {
|
||||
// Products grid - show offers clusters
|
||||
// Hubs grid - show hubs clusters
|
||||
// Offers grid - show offer clusters
|
||||
return ['grid-products', 'grid-hubs', 'grid-offers', 'grid-products-from-supplier', 'grid-products-in-hub'].includes(displayMode.value)
|
||||
// Default map - show all offers clusters
|
||||
return ['map-default', 'grid-products', 'grid-hubs', 'grid-offers', 'grid-products-from-supplier', 'grid-products-in-hub'].includes(displayMode.value)
|
||||
})
|
||||
|
||||
const clusterNodeType = computed(() => {
|
||||
// For products/offers show offer locations
|
||||
if (['grid-products', 'grid-offers', 'grid-products-from-supplier', 'grid-products-in-hub'].includes(displayMode.value)) {
|
||||
// For products/offers/default map show offer locations
|
||||
if (['map-default', 'grid-products', 'grid-offers', 'grid-products-from-supplier', 'grid-products-in-hub'].includes(displayMode.value)) {
|
||||
return 'offer'
|
||||
}
|
||||
// For hubs show logistics nodes
|
||||
@@ -219,7 +219,7 @@ const currentItems = computed(() => {
|
||||
case 'grid-offers':
|
||||
items = offers.value
|
||||
break
|
||||
case 'hero':
|
||||
case 'map-default':
|
||||
default:
|
||||
items = []
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user