fix: resolve architecture validation errors and warnings

- Fix JS-008: Replace raw fetch() with apiClient in letzshop-vendor-directory.js
- Fix JS-005: Add init guard to letzshop-vendor-directory.js
- Fix JS-004: Increase search region in validator (800→2000 chars) to detect
  currentPage in files with setup code before return statement
- Fix JS-001: Use centralized logger in media-picker.js
- Fix API-002: Move database query from onboarding.py to order_service.py
- Fix FE-001: Add noqa comment to search.html (shop uses custom themed pagination)
- Add audit validator to validate_all.py script
- Update frontend.yaml with vendor exclusion pattern

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-13 20:36:01 +01:00
parent ccfbbcb804
commit 65e5c55266
7 changed files with 84 additions and 23 deletions

View File

@@ -13,6 +13,10 @@
* }
*/
// Use centralized logger
const mediaPickerLog = window.LogConfig.loggers.mediaPicker ||
window.LogConfig.createLogger('mediaPicker', false);
/**
* Create media picker mixin for Alpine.js components
*
@@ -66,7 +70,7 @@ function mediaPickerMixin(vendorIdGetter, multiSelect = false) {
const vendorId = typeof vendorIdGetter === 'function' ? vendorIdGetter() : vendorIdGetter;
if (!vendorId) {
console.warn('Media picker: No vendor ID available');
mediaPickerLog.warn('No vendor ID available');
return;
}
@@ -91,7 +95,7 @@ function mediaPickerMixin(vendorIdGetter, multiSelect = false) {
this.mediaPickerState.media = response.media || [];
this.mediaPickerState.total = response.total || 0;
} catch (error) {
console.error('Failed to load media library:', error);
mediaPickerLog.error('Failed to load media library:', error);
window.dispatchEvent(new CustomEvent('toast', {
detail: { message: 'Failed to load media library', type: 'error' }
}));
@@ -131,7 +135,7 @@ function mediaPickerMixin(vendorIdGetter, multiSelect = false) {
...(response.media || [])
];
} catch (error) {
console.error('Failed to load more media:', error);
mediaPickerLog.error('Failed to load more media:', error);
} finally {
this.mediaPickerState.loading = false;
}
@@ -193,7 +197,7 @@ function mediaPickerMixin(vendorIdGetter, multiSelect = false) {
}));
}
} catch (error) {
console.error('Failed to upload image:', error);
mediaPickerLog.error('Failed to upload image:', error);
window.dispatchEvent(new CustomEvent('toast', {
detail: { message: error.message || 'Failed to upload image', type: 'error' }
}));
@@ -260,7 +264,7 @@ function mediaPickerMixin(vendorIdGetter, multiSelect = false) {
if (this.form) {
this.form.primary_image_url = media.url;
}
console.log('Main image set:', media.url);
mediaPickerLog.info('Main image set:', media.url);
},
/**
@@ -274,7 +278,7 @@ function mediaPickerMixin(vendorIdGetter, multiSelect = false) {
...newUrls
];
}
console.log('Additional images added:', mediaList.map(m => m.url));
mediaPickerLog.info('Additional images added:', mediaList.map(m => m.url));
},
/**