Render map points by entity type
Some checks failed
Build Docker Image / build (push) Has been cancelled
Some checks failed
Build Docker Image / build (push) Has been cancelled
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
ref="catalogPageRef"
|
||||
:loading="isLoading"
|
||||
:use-server-clustering="true"
|
||||
:use-typed-clusters="true"
|
||||
:cluster-node-type="clusterNodeType"
|
||||
map-id="unified-catalog-map"
|
||||
:point-color="mapPointColor"
|
||||
@@ -410,10 +411,12 @@ const onMapSelect = async (item: MapSelectItem) => {
|
||||
|
||||
const itemName = item.name || itemId.slice(0, 8) + '...'
|
||||
|
||||
const itemType = (item as MapSelectItem & { type?: 'hub' | 'supplier' | 'offer' }).type
|
||||
|
||||
// If in selection mode, use map click to fill the selector
|
||||
if (selectMode.value) {
|
||||
// For hubs selection - click on hub fills hub selector
|
||||
if (selectMode.value === 'hub' && mapViewMode.value === 'hubs') {
|
||||
if (selectMode.value === 'hub' && (itemType === 'hub' || mapViewMode.value === 'hubs')) {
|
||||
selectItem('hub', itemId, itemName)
|
||||
showQuoteResults.value = false
|
||||
offers.value = []
|
||||
@@ -421,7 +424,7 @@ const onMapSelect = async (item: MapSelectItem) => {
|
||||
}
|
||||
|
||||
// For supplier selection - click on supplier fills supplier selector
|
||||
if (selectMode.value === 'supplier' && mapViewMode.value === 'suppliers') {
|
||||
if (selectMode.value === 'supplier' && (itemType === 'supplier' || mapViewMode.value === 'suppliers')) {
|
||||
selectItem('supplier', itemId, itemName)
|
||||
showQuoteResults.value = false
|
||||
offers.value = []
|
||||
@@ -429,7 +432,7 @@ const onMapSelect = async (item: MapSelectItem) => {
|
||||
}
|
||||
|
||||
// For product selection viewing offers - fetch offer to get productUuid
|
||||
if (selectMode.value === 'product' && mapViewMode.value === 'offers') {
|
||||
if (selectMode.value === 'product' && (itemType === 'offer' || mapViewMode.value === 'offers')) {
|
||||
// Fetch offer details to get productUuid (not available in cluster data)
|
||||
const data = await execute(GetOfferDocument, { uuid: itemId }, 'public', 'exchange')
|
||||
const offer = data?.getOffer
|
||||
@@ -444,8 +447,8 @@ const onMapSelect = async (item: MapSelectItem) => {
|
||||
|
||||
// NEW: Default behavior - open Info directly
|
||||
let infoType: 'hub' | 'supplier' | 'offer'
|
||||
if (mapViewMode.value === 'hubs') infoType = 'hub'
|
||||
else if (mapViewMode.value === 'suppliers') infoType = 'supplier'
|
||||
if (itemType === 'hub' || mapViewMode.value === 'hubs') infoType = 'hub'
|
||||
else if (itemType === 'supplier' || mapViewMode.value === 'suppliers') infoType = 'supplier'
|
||||
else infoType = 'offer'
|
||||
|
||||
openInfo(infoType, itemId)
|
||||
|
||||
Reference in New Issue
Block a user