[FEAT] Rischi #501 p3: sezione all-hazard mantenuta ma "Rischi trasversali" comprimibile
Compromesso approvato (Simon/Cristiano) al posto della cancellazione richiesta al punto 3 del #501 — validato nis2-expert (all-hazards = obbligo art.21.2 Direttiva -> art.24 D.Lgs.138/2024; rimuoverla = lacuna di conformità). - risks.html: la sezione diventa un <details> comprimibile. Header sempre visibile con titolo "Rischi trasversali (approccio multirischio / all-hazards) - art. 24 D.Lgs. 138/2024" + contatore. Apri-se-vuota (updateAllhazardHeader): vuota -> aperta (presidiata in audit), con voci -> chiusa (meno ingombro). Nota riformulata che la distingue dai "rischi di non conformità". - i18n.js custom_heading/custom_help (IT+EN) + help.js allineati. - Manuale + KB RISCHI_MODELLO.md aggiornati. Cache-buster help/i18n 20260731. - Solo frontend/statico. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
8736d6bb4f
commit
ed0b16eee2
+50
-6
@@ -344,6 +344,24 @@
|
||||
.act-row .act-when { font-size:0.72rem; color:var(--gray-500); white-space:nowrap; min-width:74px; }
|
||||
.act-row .act-desc { flex:1; font-size:0.82rem; color:var(--gray-800); }
|
||||
.act-row .act-st { font-size:0.68rem; font-weight:700; text-transform:uppercase; color:var(--gray-500); }
|
||||
/* ── Sezione "Rischi trasversali (all-hazards)" comprimibile (#501 p3) ── */
|
||||
details.allhazard { margin: 4px 0 8px; }
|
||||
details.allhazard > summary {
|
||||
list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
|
||||
padding: 12px 14px; border: 1px solid var(--gray-200, #e4e9f1); border-radius: 10px;
|
||||
background: var(--gray-50, #f7f9fc); font-weight: 700; color: var(--gray-800, #1e2e46);
|
||||
font-size: 1.02rem;
|
||||
}
|
||||
details.allhazard > summary::-webkit-details-marker { display: none; }
|
||||
details.allhazard > summary:hover { background: #eef2f8; }
|
||||
details.allhazard .ah-caret { display: inline-flex; color: var(--gray-500, #7382a0); transition: transform .15s; }
|
||||
details.allhazard[open] > summary .ah-caret { transform: rotate(90deg); }
|
||||
details.allhazard .ah-title { flex: 1; min-width: 0; }
|
||||
details.allhazard .ah-count {
|
||||
display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px;
|
||||
padding: 0 8px; border-radius: 20px; background: #e5edfb; color: #1f529e; font-size: 0.8rem; font-weight: 800;
|
||||
}
|
||||
details.allhazard .ah-count.empty { background: #fdeaea; color: #c0392b; }
|
||||
</style>
|
||||
<!-- PWA:start -->
|
||||
<link rel="manifest" href="/manifest.webmanifest">
|
||||
@@ -434,11 +452,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ── SEZIONE 2: Rischi aggiuntivi (multirischio / all-hazard) ── -->
|
||||
<h2 style="font-size:1.05rem;margin:0 0 6px;" data-i18n="risks.custom_heading">Rischi aggiuntivi (approccio multirischio / all-hazard)</h2>
|
||||
<p class="text-muted" style="font-size:0.82rem;margin:0 0 16px;line-height:1.5;" data-i18n="risks.custom_help">Oltre ai rischi derivati dai requisiti, i profili amministrativi possono aggiungere rischi non coperti da un singolo requisito (es. minacce fisiche, catena di fornitura, eventi naturali): copre l'approccio multirischio/all-hazard (art. 24 D.Lgs. 138/2024).</p>
|
||||
<!-- ── SEZIONE 2: Rischi trasversali (multirischio / all-hazards) — accordion (#501 p3) ── -->
|
||||
<details id="allhazard-section" class="allhazard" open>
|
||||
<summary class="allhazard-summary">
|
||||
<span class="ah-caret" aria-hidden="true">
|
||||
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2"><path d="m9 18 6-6-6-6"/></svg>
|
||||
</span>
|
||||
<span class="ah-title" data-i18n="risks.custom_heading">Rischi trasversali (approccio multirischio / all-hazards) — art. 24 D.Lgs. 138/2024</span>
|
||||
<span class="ah-count" id="allhazard-count" aria-hidden="true"></span>
|
||||
</summary>
|
||||
<p class="text-muted" style="font-size:0.82rem;margin:10px 0 16px;line-height:1.5;" data-i18n="risks.custom_help">Qui si registrano le minacce non riconducibili a un singolo requisito (ambiente fisico, catena di fornitura, eventi naturali, errore umano), come richiesto dall'approccio multirischio/all-hazards (art. 24 D.Lgs. 138/2024, che recepisce l'art. 21 §2 della Direttiva (UE) 2022/2555). Si distinguono dai «rischi di non conformità» della tabella qui sopra, che misurano il mancato o parziale soddisfacimento dei singoli requisiti.</p>
|
||||
|
||||
<!-- Table View (rischi custom) -->
|
||||
<!-- Table View (rischi trasversali) -->
|
||||
<div id="view-table">
|
||||
<div class="filters-bar">
|
||||
<select class="form-select" id="filter-category" onchange="loadRisks()" aria-label="Filtra per categoria">
|
||||
@@ -486,6 +511,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<!-- Matrix View (sempre visibile) -->
|
||||
<div id="view-matrix" style="margin-top:16px;">
|
||||
@@ -544,8 +570,8 @@
|
||||
<script src="/js/common.js?v=20260729b"></script>
|
||||
<script src="/vendor/lucide/lucide.min.js"></script>
|
||||
<script src="/js/topnav-v3.js?v=20260729"></script>
|
||||
<script src="/js/i18n.js?v=20260730b"></script>
|
||||
<script src="/js/help.js?v=20260730b"></script>
|
||||
<script src="/js/i18n.js?v=20260731"></script>
|
||||
<script src="/js/help.js?v=20260731"></script>
|
||||
<script>
|
||||
// ── Auth & Init ──────────────────────────────────────────────
|
||||
if (!checkAuth()) throw new Error('Not authenticated');
|
||||
@@ -1018,6 +1044,7 @@
|
||||
if (result.success) {
|
||||
risksData = (result.data && result.data.items) || [];
|
||||
renderRisksTable(risksData);
|
||||
updateAllhazardHeader(risksData.length);
|
||||
} else {
|
||||
showNotification(result.message || 'Errore nel caricamento rischi', 'error');
|
||||
}
|
||||
@@ -1026,6 +1053,23 @@
|
||||
}
|
||||
}
|
||||
|
||||
// ── Header sezione "Rischi trasversali": contatore + apri-se-vuota (una volta).
|
||||
// Normativo: la sezione resta sempre presente; se è VUOTA si apre da sola così
|
||||
// in audit risulta presidiata, non nascosta (parere nis2-expert, #501 p3). ──
|
||||
let _allhazardInit = false;
|
||||
function updateAllhazardHeader(count) {
|
||||
const badge = document.getElementById('allhazard-count');
|
||||
const sec = document.getElementById('allhazard-section');
|
||||
if (badge) {
|
||||
badge.textContent = count;
|
||||
badge.classList.toggle('empty', count === 0);
|
||||
}
|
||||
if (sec && !_allhazardInit) {
|
||||
_allhazardInit = true;
|
||||
sec.open = (count === 0); // vuota → aperta; con voci → chiusa (meno ingombro)
|
||||
}
|
||||
}
|
||||
|
||||
// ── Table Render ─────────────────────────────────────────────
|
||||
function renderRisksTable(risks) {
|
||||
const tbody = document.getElementById('risks-table-body');
|
||||
|
||||
Reference in New Issue
Block a user