Add entity color scheme and improve map hover effect
All checks were successful
Build Docker Image / build (push) Successful in 3m6s
All checks were successful
Build Docker Image / build (push) Successful in 3m6s
- Add color scheme: product/offer=orange, supplier=blue, hub=green - Remove 'location' filter (same as hub) - Quantity filter appears only after product is selected - Map hover shows 'target' ring effect (outer white ring) - Tokens in header use entity-specific colors
This commit is contained in:
@@ -12,7 +12,7 @@ export type DisplayMode =
|
||||
| 'grid-offers'
|
||||
|
||||
export interface SearchFilter {
|
||||
type: 'product' | 'supplier' | 'hub' | 'location' | 'quantity'
|
||||
type: 'product' | 'supplier' | 'hub' | 'quantity'
|
||||
id: string
|
||||
label: string
|
||||
}
|
||||
@@ -22,16 +22,22 @@ export interface SearchState {
|
||||
product: { id: string; name: string } | null
|
||||
supplier: { id: string; name: string } | null
|
||||
hub: { id: string; name: string } | null
|
||||
location: { id: string; name: string } | null
|
||||
quantity: string | null
|
||||
}
|
||||
|
||||
// Color scheme for entity types
|
||||
export const entityColors = {
|
||||
product: '#f97316', // orange
|
||||
supplier: '#3b82f6', // blue
|
||||
hub: '#22c55e', // green
|
||||
offer: '#f97316' // orange (same as product context)
|
||||
} as const
|
||||
|
||||
// Filter labels cache (to show names instead of UUIDs)
|
||||
const filterLabels = ref<Record<string, Record<string, string>>>({
|
||||
product: {},
|
||||
supplier: {},
|
||||
hub: {},
|
||||
location: {}
|
||||
hub: {}
|
||||
})
|
||||
|
||||
export function useCatalogSearch() {
|
||||
@@ -51,7 +57,6 @@ export function useCatalogSearch() {
|
||||
const productId = computed(() => route.query.product as string | undefined)
|
||||
const supplierId = computed(() => route.query.supplier as string | undefined)
|
||||
const hubId = computed(() => route.query.hub as string | undefined)
|
||||
const locationId = computed(() => route.query.location as string | undefined)
|
||||
const quantity = computed(() => route.query.qty as string | undefined)
|
||||
|
||||
// Get label for a filter (from cache or fallback to ID)
|
||||
@@ -96,14 +101,6 @@ export function useCatalogSearch() {
|
||||
icon: 'lucide:map-pin'
|
||||
})
|
||||
}
|
||||
if (locationId.value) {
|
||||
tokens.push({
|
||||
type: 'location',
|
||||
id: locationId.value,
|
||||
label: getLabel('location', locationId.value) || t('catalog.filters.location'),
|
||||
icon: 'lucide:navigation'
|
||||
})
|
||||
}
|
||||
if (quantity.value) {
|
||||
tokens.push({
|
||||
type: 'quantity',
|
||||
@@ -129,10 +126,8 @@ export function useCatalogSearch() {
|
||||
if (!hubId.value && selectMode.value !== 'hub') {
|
||||
chips.push({ type: 'hub', label: t('catalog.filters.hub') })
|
||||
}
|
||||
if (!locationId.value) {
|
||||
chips.push({ type: 'location', label: t('catalog.filters.location') })
|
||||
}
|
||||
if (!quantity.value) {
|
||||
// Quantity only available after product is selected
|
||||
if (productId.value && !quantity.value) {
|
||||
chips.push({ type: 'quantity', label: t('catalog.filters.quantity') })
|
||||
}
|
||||
|
||||
@@ -226,10 +221,12 @@ export function useCatalogSearch() {
|
||||
productId,
|
||||
supplierId,
|
||||
hubId,
|
||||
locationId,
|
||||
quantity,
|
||||
searchQuery,
|
||||
|
||||
// Colors
|
||||
entityColors,
|
||||
|
||||
// Computed
|
||||
activeTokens,
|
||||
availableChips,
|
||||
|
||||
Reference in New Issue
Block a user