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:
2026-02-01 21:21:03 +01:00
parent d7a0ff8818
commit c13eb8d8c2
17 changed files with 304 additions and 212 deletions

View File

@@ -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);
}
},
/**

View File

@@ -16,6 +16,9 @@ function adminIcons() {
// ✅ CRITICAL: Set page identifier
currentPage: 'icons',
// Loading state
loading: false,
// Search and filter
searchQuery: '',
activeCategory: 'all',
@@ -45,11 +48,6 @@ function adminIcons() {
// ✅ CRITICAL: Proper initialization with guard
async init() {
// Load i18n translations
await I18n.loadModule('dev_tools');
iconsLog.info('=== ICONS PAGE INITIALIZING ===');
// Prevent multiple initializations
if (window._iconsPageInitialized) {
iconsLog.warn('Icons page already initialized, skipping...');
@@ -57,15 +55,27 @@ function adminIcons() {
}
window._iconsPageInitialized = true;
const startTime = performance.now();
this.loading = true;
try {
// Load i18n translations
await I18n.loadModule('dev_tools');
// Load icons from global Icons object
this.loadIcons();
iconsLog.info('=== ICONS PAGE INITIALIZING ===');
const duration = performance.now() - startTime;
window.LogConfig.logPerformance('Icons Page Init', duration);
const startTime = performance.now();
iconsLog.info('=== ICONS PAGE INITIALIZATION COMPLETE ===');
// Load icons from global Icons object
this.loadIcons();
const duration = performance.now() - startTime;
window.LogConfig.logPerformance('Icons Page Init', duration);
iconsLog.info('=== ICONS PAGE INITIALIZATION COMPLETE ===');
} catch (error) {
iconsLog.error('Init failed:', error);
} finally {
this.loading = false;
}
},
/**