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:
@@ -468,32 +468,36 @@ function adminComponents() {
|
||||
|
||||
// ✅ CRITICAL: Proper initialization with guard
|
||||
async init() {
|
||||
// Load i18n translations
|
||||
await I18n.loadModule('dev_tools');
|
||||
try {
|
||||
// Load i18n translations
|
||||
await I18n.loadModule('dev_tools');
|
||||
|
||||
componentsLog.info('=== COMPONENTS PAGE INITIALIZING ===');
|
||||
componentsLog.info('=== COMPONENTS PAGE INITIALIZING ===');
|
||||
|
||||
// Prevent multiple initializations
|
||||
if (window._componentsInitialized) {
|
||||
componentsLog.warn('Components page already initialized, skipping...');
|
||||
return;
|
||||
}
|
||||
window._componentsInitialized = true;
|
||||
// Prevent multiple initializations
|
||||
if (window._componentsInitialized) {
|
||||
componentsLog.warn('Components page already initialized, skipping...');
|
||||
return;
|
||||
}
|
||||
window._componentsInitialized = true;
|
||||
|
||||
// Set active section from URL hash if present
|
||||
this.setActiveSectionFromHash();
|
||||
|
||||
// Listen for hash changes
|
||||
window.addEventListener('hashchange', () => {
|
||||
// Set active section from URL hash if present
|
||||
this.setActiveSectionFromHash();
|
||||
});
|
||||
|
||||
// Initialize charts after DOM is ready
|
||||
this.$nextTick(() => {
|
||||
this.initializeCharts();
|
||||
});
|
||||
// Listen for hash changes
|
||||
window.addEventListener('hashchange', () => {
|
||||
this.setActiveSectionFromHash();
|
||||
});
|
||||
|
||||
componentsLog.info('=== COMPONENTS PAGE INITIALIZATION COMPLETE ===');
|
||||
// Initialize charts after DOM is ready
|
||||
this.$nextTick(() => {
|
||||
this.initializeCharts();
|
||||
});
|
||||
|
||||
componentsLog.info('=== COMPONENTS PAGE INITIALIZATION COMPLETE ===');
|
||||
} catch (error) {
|
||||
componentsLog.error('Init failed:', error);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user