fix: resolve all architecture validation warnings
JavaScript improvements: - Add try/catch error handling to all async init() functions - Move initialization guards before try/catch blocks (JS-005) - Use centralized logger in i18n.js with silent fallback (JS-001) - Add loading state to icons-page.js (JS-007) Payments module structure: - Add templates/, static/, and locales/ directories (MOD-005) - Add locale files for en, de, fr, lb (MOD-006) Architecture validation now passes with 0 errors, 0 warnings, 0 info. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -97,37 +97,37 @@ function vendorCustomers() {
|
||||
},
|
||||
|
||||
async init() {
|
||||
// Load i18n translations
|
||||
await I18n.loadModule('customers');
|
||||
|
||||
vendorCustomersLog.info('Customers init() called');
|
||||
|
||||
// Guard against multiple initialization
|
||||
if (window._vendorCustomersInitialized) {
|
||||
vendorCustomersLog.warn('Already initialized, skipping');
|
||||
return;
|
||||
}
|
||||
window._vendorCustomersInitialized = true;
|
||||
|
||||
// IMPORTANT: Call parent init first to set vendorCode from URL
|
||||
const parentInit = data().init;
|
||||
if (parentInit) {
|
||||
await parentInit.call(this);
|
||||
}
|
||||
|
||||
// Load platform settings for rows per page
|
||||
if (window.PlatformSettings) {
|
||||
this.pagination.per_page = await window.PlatformSettings.getRowsPerPage();
|
||||
}
|
||||
|
||||
try {
|
||||
// Load i18n translations
|
||||
await I18n.loadModule('customers');
|
||||
|
||||
vendorCustomersLog.info('Customers init() called');
|
||||
|
||||
// Guard against multiple initialization
|
||||
if (window._vendorCustomersInitialized) {
|
||||
vendorCustomersLog.warn('Already initialized, skipping');
|
||||
return;
|
||||
}
|
||||
window._vendorCustomersInitialized = true;
|
||||
|
||||
// IMPORTANT: Call parent init first to set vendorCode from URL
|
||||
const parentInit = data().init;
|
||||
if (parentInit) {
|
||||
await parentInit.call(this);
|
||||
}
|
||||
|
||||
// Load platform settings for rows per page
|
||||
if (window.PlatformSettings) {
|
||||
this.pagination.per_page = await window.PlatformSettings.getRowsPerPage();
|
||||
}
|
||||
|
||||
await this.loadCustomers();
|
||||
|
||||
vendorCustomersLog.info('Customers initialization complete');
|
||||
} catch (error) {
|
||||
vendorCustomersLog.error('Init failed:', error);
|
||||
this.error = 'Failed to initialize customers page';
|
||||
}
|
||||
|
||||
vendorCustomersLog.info('Customers initialization complete');
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user