Make pins explicit and selection open info
All checks were successful
Build Docker Image / build (push) Successful in 5m24s
All checks were successful
Build Docker Image / build (push) Successful in 5m24s
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
:cluster-supplier-uuid="clusterSupplierUuid"
|
||||
@select="onMapSelect"
|
||||
@bounds-change="onBoundsChange"
|
||||
@update:filter-by-bounds="$event ? setBoundsInUrl(currentMapBounds) : clearBoundsFromUrl()"
|
||||
@update:filter-by-bounds="onToggleBoundsFilter"
|
||||
>
|
||||
<!-- Panel slot - shows selection list OR info OR quote results -->
|
||||
<template #panel>
|
||||
@@ -175,7 +175,8 @@ const {
|
||||
urlBounds,
|
||||
filterByBounds,
|
||||
setBoundsInUrl,
|
||||
clearBoundsFromUrl
|
||||
clearBoundsFromUrl,
|
||||
setBoundsFilterEnabled
|
||||
} = useCatalogSearch()
|
||||
|
||||
// Info panel composable
|
||||
@@ -255,7 +256,20 @@ const getSelectionBounds = () => {
|
||||
return { west: bounds.west, south: bounds.south, east: bounds.east, north: bounds.north }
|
||||
}
|
||||
|
||||
const onToggleBoundsFilter = (enabled: boolean) => {
|
||||
if (enabled) {
|
||||
setBoundsFilterEnabled(true)
|
||||
const bounds = getSelectionBounds()
|
||||
if (bounds) {
|
||||
setBoundsInUrl(bounds)
|
||||
}
|
||||
} else {
|
||||
clearBoundsFromUrl()
|
||||
}
|
||||
}
|
||||
|
||||
const applySelectionBounds = () => {
|
||||
if (!filterByBounds.value) return
|
||||
if (!selectionBoundsBackup.value) {
|
||||
selectionBoundsBackup.value = {
|
||||
hadBounds: !!urlBounds.value,
|
||||
@@ -651,10 +665,18 @@ const onMapSelect = async (item: MapSelectItem) => {
|
||||
setLabel(infoType, itemId, itemName)
|
||||
}
|
||||
|
||||
// Handle selection from SelectionPanel - add to filter (show badge in search)
|
||||
// Handle selection from SelectionPanel - open info card (pin only via pin button)
|
||||
const onSelectItem = (type: string, item: { uuid?: string | null; name?: string | null }) => {
|
||||
if (item.uuid && item.name) {
|
||||
selectItem(type, item.uuid, item.name)
|
||||
if (!item.uuid) return
|
||||
if (type === 'hub' || type === 'supplier') {
|
||||
if (item.name) {
|
||||
setLabel(type, item.uuid, item.name)
|
||||
}
|
||||
openInfo(type, item.uuid)
|
||||
return
|
||||
}
|
||||
if (type === 'product') {
|
||||
router.push(localePath(`/catalog/products/${item.uuid}`))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user