Fix SelectionPanel styling + add product filtering by supplier/hub
All checks were successful
Build Docker Image / build (push) Successful in 4m3s
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user