Fix InfoPanel for offers - supplier name and map point
Some checks failed
Build Docker Image / build (push) Has been cancelled

- Show supplier name with loading state instead of "View Supplier" link
- Fix offer coordinates on map (use locationLatitude/locationLongitude)
This commit is contained in:
Ruslan Bakiev
2026-01-27 12:12:05 +07:00
parent c152a5b14c
commit c39bc55ebc
2 changed files with 31 additions and 12 deletions

View File

@@ -41,15 +41,21 @@
{{ formatPrice(entity.pricePerUnit) }} {{ entity.currency || 'RUB' }}/{{ entity.unit || 't' }}
</p>
<!-- Supplier link for offer -->
<button
v-if="entityType === 'offer' && entity?.teamUuid"
class="text-sm text-primary hover:underline flex items-center gap-1 mt-1"
@click="emit('open-info', 'supplier', entity.teamUuid)"
>
<!-- Supplier for offer -->
<div v-if="entityType === 'offer'" class="text-sm text-white/70 flex items-center gap-1 mt-1">
<Icon name="lucide:factory" size="14" />
{{ entity.supplierName || entity.teamName || $t('catalog.info.viewSupplier') }}
</button>
<span v-if="loadingSuppliers" class="loading loading-spinner loading-xs" />
<span v-else-if="supplierDisplayName">
{{ supplierDisplayName }}
</span>
<button
v-else-if="entity?.teamUuid"
class="text-primary hover:underline"
@click="emit('open-info', 'supplier', entity.teamUuid)"
>
{{ $t('catalog.info.viewSupplier') }}
</button>
</div>
</div>
<!-- Products Section (for hub/supplier) -->
@@ -209,6 +215,16 @@ const entityIcon = computed(() => {
return 'lucide:info'
})
// Supplier name for offer (from entity or relatedSuppliers)
const supplierDisplayName = computed(() => {
if (props.entity?.supplierName) return props.entity.supplierName
if (props.entity?.teamName) return props.entity.teamName
if (relatedSuppliers.value.length > 0 && relatedSuppliers.value[0]?.name) {
return relatedSuppliers.value[0].name
}
return null
})
// Format price
const formatPrice = (price: number | string) => {
const num = typeof price === 'string' ? parseFloat(price) : price

View File

@@ -298,12 +298,15 @@ const relatedPoints = computed(() => {
}> = []
// Add current entity first (the one we're viewing in InfoPanel)
if (entity.value?.latitude && entity.value?.longitude) {
// For offers, coordinates are in locationLatitude/locationLongitude
const lat = entity.value?.latitude ?? entity.value?.locationLatitude
const lon = entity.value?.longitude ?? entity.value?.locationLongitude
if (lat && lon) {
points.push({
uuid: infoId.value.uuid,
name: entity.value.name || '',
latitude: Number(entity.value.latitude),
longitude: Number(entity.value.longitude),
name: entity.value.name || entity.value.productName || '',
latitude: Number(lat),
longitude: Number(lon),
type: infoId.value.type
})
}