feat: show all Letzshop products in Products tab without vendor filter

- Update loadProducts() to show all Letzshop marketplace products when
  no vendor is selected, filtered by vendor when one is selected
- Add vendor column to products table (shown when no vendor filter)
- Update header to show context-aware subtitle
- Hide Import/Export buttons when no vendor selected
- Remove "Marketplace Products" from sidebar menu (accessible via
  Marketplace > Letzshop > Products tab)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-25 00:07:27 +01:00
parent 508e121a0e
commit 1a962dc6d1
3 changed files with 33 additions and 22 deletions

View File

@@ -218,7 +218,7 @@ function adminMarketplaceLetzshop() {
},
/**
* Load cross-vendor aggregate data
* Load cross-vendor aggregate data (when no vendor is selected)
*/
async loadCrossVendorData() {
marketplaceLetzshopLog.info('Loading cross-vendor data');
@@ -226,6 +226,7 @@ function adminMarketplaceLetzshop() {
try {
await Promise.all([
this.loadProducts(),
this.loadOrders(),
this.loadExceptions(),
this.loadExceptionStats(),
@@ -428,27 +429,25 @@ function adminMarketplaceLetzshop() {
// ═══════════════════════════════════════════════════════════════
/**
* Load Letzshop products for selected vendor
* Uses /admin/products endpoint with marketplace=Letzshop filter
* Load Letzshop products
* When vendor is selected: shows products for that vendor
* When no vendor selected: shows ALL Letzshop marketplace products
*/
async loadProducts() {
if (!this.selectedVendor) {
this.products = [];
this.totalProducts = 0;
this.productStats = { total: 0, active: 0, inactive: 0, last_sync: null };
return;
}
this.loadingProducts = true;
try {
const params = new URLSearchParams({
marketplace: 'Letzshop',
vendor_name: this.selectedVendor.name,
skip: ((this.productsPage - 1) * this.productsLimit).toString(),
limit: this.productsLimit.toString()
});
// Filter by vendor if one is selected
if (this.selectedVendor) {
params.append('vendor_name', this.selectedVendor.name);
}
if (this.productFilters.search) {
params.append('search', this.productFilters.search);
}
@@ -474,15 +473,19 @@ function adminMarketplaceLetzshop() {
/**
* Load product statistics for Letzshop products
* Shows stats for selected vendor or all Letzshop products
*/
async loadProductStats() {
if (!this.selectedVendor) return;
try {
const params = new URLSearchParams({
marketplace: 'Letzshop',
vendor_name: this.selectedVendor.name
marketplace: 'Letzshop'
});
// Filter by vendor if one is selected
if (this.selectedVendor) {
params.append('vendor_name', this.selectedVendor.name);
}
const response = await apiClient.get(`/admin/products/stats?${params}`);
this.productStats = {
total: response.total || 0,