[FEAT] #384 p.2.1 — ricodifica display Proc.->Policy in Misure e Requisiti
I codici delle policy/procedure di default si presentano con prefisso "Policy." (es. Proc.01 -> Policy.01) tramite helper policyCode(). Solo etichetta UI: proc_code canonico invariato come chiave di join requisito<->policy (non rompe il futuro link bidirezionale, punto 3). v1.23.4. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
6496c9655d
commit
6f3ca4b4bd
@@ -179,6 +179,9 @@
|
||||
|
||||
function el(id) { return document.getElementById(id); }
|
||||
function esc(s) { const d = document.createElement('div'); d.textContent = (s == null ? '' : String(s)); return d.innerHTML; }
|
||||
// Ticket #384 p.2.1 — i codici procedura/policy si presentano con prefisso "Policy." (Proc.NN -> Policy.NN).
|
||||
// Il codice canonico nel catalogo resta proc_code (chiave di join requisiti<->procedure): qui si rietichetta solo per la UI.
|
||||
function policyCode(code) { return code ? String(code).replace(/^Proc\./i, 'Policy.') : code; }
|
||||
|
||||
const STATO_META = {
|
||||
da_valutare: { label: 'Da valutare', cls: 'sv-todo' },
|
||||
@@ -295,7 +298,7 @@
|
||||
html += '<td class="mr-req-code">' + esc(req.requisito_code) + '</td>';
|
||||
}
|
||||
html += '<td>' + esc(req.requisito_descr) + '</td>';
|
||||
html += '<td>' + (req.proc_code ? '<span class="mr-code-pill">' + esc(req.proc_code) + '</span> ' + esc(req.proc_descr || '') : '—') + '</td>';
|
||||
html += '<td>' + (req.proc_code ? '<span class="mr-code-pill">' + esc(policyCode(req.proc_code)) + '</span> ' + esc(req.proc_descr || '') : '—') + '</td>';
|
||||
html += '<td>' + (req.risk_code ? '<span class="mr-code-pill">' + esc(req.risk_code) + '</span> ' + esc(req.risk_descr || '') : '—') + '</td>';
|
||||
html += '<td class="mr-yn ' + (req.applies_important ? 'y' : 'n') + '">' + (req.applies_important ? '✓' : '—') + '</td>';
|
||||
html += '<td class="mr-yn ' + (req.applies_essential ? 'y' : 'n') + '">' + (req.applies_essential ? '✓' : '—') + '</td>';
|
||||
@@ -318,7 +321,7 @@
|
||||
const q = MR.byId[reqId];
|
||||
if (!q) return;
|
||||
el('mr-eval-id').value = reqId;
|
||||
el('mr-modal-sub').textContent = (q.requisito_code || '') + ' · ' + (q.proc_code || '') + ' / ' + (q.risk_code || '');
|
||||
el('mr-modal-sub').textContent = (q.requisito_code || '') + ' · ' + (policyCode(q.proc_code) || '') + ' / ' + (q.risk_code || '');
|
||||
let ctx = '<div>' + esc(q.requisito_descr || '') + '</div>';
|
||||
if (q.risk_code) ctx += '<div style="margin-top:6px"><span class="pill">' + esc(q.risk_code) + '</span> ' + esc(q.risk_descr || '') + '</div>';
|
||||
el('mr-eval-ctx').innerHTML = ctx;
|
||||
|
||||
Reference in New Issue
Block a user