Fix SelectionPanel styling + add product filtering by supplier/hub
All checks were successful
Build Docker Image / build (push) Successful in 4m3s

- SelectionPanel header: dark glass style instead of white
- useCatalogProducts: filter by supplierId or hubId using dedicated queries
- catalog/index: connect filters from query params to composable
This commit is contained in:
Ruslan Bakiev
2026-01-24 11:13:22 +07:00
parent 2fc4dfb834
commit 7c566aeafc
3 changed files with 101 additions and 17 deletions

View File

@@ -108,7 +108,17 @@ const {
} = useCatalogSearch()
// Composables for data (initialize immediately when selectMode changes)
const { items: products, isLoading: productsLoading, isLoadingMore: productsLoadingMore, canLoadMore: productsCanLoadMore, loadMore: loadMoreProducts, init: initProducts } = useCatalogProducts()
const {
items: products,
isLoading: productsLoading,
isLoadingMore: productsLoadingMore,
canLoadMore: productsCanLoadMore,
loadMore: loadMoreProducts,
init: initProducts,
setSupplierFilter,
setHubFilter,
clearFilters: clearProductFilters
} = useCatalogProducts()
const { items: hubs, isLoading: hubsLoading, isLoadingMore: hubsLoadingMore, canLoadMore: hubsCanLoadMore, loadMore: loadMoreHubs, init: initHubs } = useCatalogHubs()
const { items: suppliers, isLoading: suppliersLoading, isLoadingMore: suppliersLoadingMore, canLoadMore: suppliersCanLoadMore, loadMore: loadMoreSuppliers, init: initSuppliers } = useCatalogSuppliers()
@@ -175,6 +185,17 @@ watch(selectMode, async (mode) => {
}
}, { immediate: true })
// Apply filters to products based on selected supplier/hub
watch([supplierId, hubId], ([newSupplierId, newHubId]) => {
if (newSupplierId) {
setSupplierFilter(newSupplierId)
} else if (newHubId) {
setHubFilter(newHubId)
} else {
clearProductFilters()
}
}, { immediate: true })
// Offers data for quote results
const offers = ref<any[]>([])
const offersLoading = ref(false)