[FIX] FAB segnalazione/ARIA: icone FontAwesome -> SVG inline (regressione swap BI) + slot data-api-key

Icone: bug-reporter.js (nx-bell fa-bell, nx-bug fa-life-ring) + common.js ai-chat-fab/header/send
(fa-wand-magic-sparkles, fa-paper-plane) erano FA, rimosso dallo swap BI -> cerchi vuoti. Sostituite con
SVG inline (currentColor, self-contained). Verificato headless: 3 FAB renderizzano svg.
Auth widget: cablato s.dataset.apiKey <- window.NEXUS_WIDGET_API_KEY (X-API-Key gateway AgileHub, era
assente -> 401). _detectUser ora legge anche nis2_access_token. SERVE la chiave X-API-Key da AgileHub.
This commit is contained in:
DevEnv nis2-agile
2026-06-13 18:49:49 +02:00
parent 703831c556
commit b49044c57f
2 changed files with 11 additions and 6 deletions
+3 -3
View File
@@ -64,7 +64,7 @@
if (u.email) { CFG.userEmail = u.email; CFG.userName = u.name || u.full_name || CFG.userName; CFG.userRole = u.role || CFG.userRole; return; }
}
// 3. JWT decode da access_token / nexus_token
const token = sessionStorage.getItem('access_token') || sessionStorage.getItem('nexus_token') || localStorage.getItem('nexus_token');
const token = sessionStorage.getItem('access_token') || sessionStorage.getItem('nexus_token') || localStorage.getItem('nexus_token') || localStorage.getItem('nis2_access_token');
if (token && token.includes('.')) {
const payload = JSON.parse(atob(token.split('.')[1].replace(/-/g,'+').replace(/_/g,'/')));
if (payload.email) { CFG.userEmail = payload.email; CFG.userName = payload.name || payload.full_name || CFG.userName; CFG.userRole = payload.role || CFG.userRole; }
@@ -179,8 +179,8 @@
const bar = document.createElement('div');
bar.id = 'nx-bar';
bar.innerHTML = `
<button id="nx-bell-btn" title="Notifiche"><i class="fas fa-bell"></i><span id="nx-bell-badge" style="display:none">0</span></button>
<button id="nx-bug-btn" title="Chiedi supporto"><i class="fas fa-life-ring"></i></button>
<button id="nx-bell-btn" title="Notifiche"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 8a6 6 0 0 0-12 0c0 7-3 9-3 9h18s-3-2-3-9"/><path d="M13.73 21a2 2 0 0 1-3.46 0"/></svg><span id="nx-bell-badge" style="display:none">0</span></button>
<button id="nx-bug-btn" title="Chiedi supporto"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><circle cx="12" cy="12" r="4"/><line x1="4.93" y1="4.93" x2="9.17" y2="9.17"/><line x1="14.83" y1="14.83" x2="19.07" y2="19.07"/><line x1="14.83" y1="9.17" x2="19.07" y2="4.93"/><line x1="9.17" y1="14.83" x2="4.93" y2="19.07"/></svg></button>
`;
document.body.appendChild(bar);