Replace breadcrumbs with key-value badges in search bar
All checks were successful
Build Docker Image / build (push) Successful in 4m0s
All checks were successful
Build Docker Image / build (push) Successful in 4m0s
- Add key property to FilterOption interface in CatalogSearchBar - Display badges in "Key: Value" format (e.g., "Поставщик: Name") - Remove SuppliersBreadcrumbs from supplier catalog pages - Add navigationFilters computed with supplier/product/hub badges - Add handleRemoveFilter to navigate back when badge is clicked
This commit is contained in:
@@ -11,8 +11,10 @@
|
||||
<template #searchBar="{ displayedCount, totalCount }">
|
||||
<CatalogSearchBar
|
||||
v-model:search-query="searchQuery"
|
||||
:active-filters="navigationFilters"
|
||||
:displayed-count="displayedCount"
|
||||
:total-count="totalCount"
|
||||
@remove-filter="handleRemoveFilter"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@@ -33,9 +35,6 @@
|
||||
|
||||
<!-- Content Header -->
|
||||
<Stack v-else gap="4">
|
||||
<!-- Breadcrumbs -->
|
||||
<SuppliersBreadcrumbs :supplier-id="supplierId" :supplier-name="supplier?.name" />
|
||||
|
||||
<!-- Header with supplier info -->
|
||||
<div class="flex items-start gap-4">
|
||||
<!-- Logo -->
|
||||
@@ -100,6 +99,28 @@ const offers = ref<any[]>([])
|
||||
|
||||
const supplierId = computed(() => route.params.supplierId as string)
|
||||
|
||||
// Navigation filters for search bar badges
|
||||
const navigationFilters = computed(() => {
|
||||
const filters: Array<{ id: string; label: string; key: string }> = []
|
||||
|
||||
if (supplier.value?.name) {
|
||||
filters.push({
|
||||
id: 'supplier',
|
||||
key: 'Поставщик',
|
||||
label: supplier.value.name
|
||||
})
|
||||
}
|
||||
|
||||
return filters
|
||||
})
|
||||
|
||||
// Handle removing navigation filter (navigate back)
|
||||
const handleRemoveFilter = (filterId: string) => {
|
||||
if (filterId === 'supplier') {
|
||||
navigateTo(localePath('/catalog/suppliers'))
|
||||
}
|
||||
}
|
||||
|
||||
// Search
|
||||
const searchQuery = ref('')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user