From ead1697ff0bcfbefed3b09ab5e93f724e34f4778 Mon Sep 17 00:00:00 2001 From: Kjell Tore Guttormsen Date: Mon, 4 May 2026 06:06:28 +0200 Subject: [PATCH] feat(ms-ai-architect): renderer A.4 frimpact adopt page-header + critique-cards - renderFria wrapped med renderPageShell (eyebrow FRIA, lede ref AI Act Art. 27) - Erstatter rights-matrix med D4 critique-cards per rettighet (severity fra impact-score) - Ny fria-case i inferVerdict: max impact >=4 block, >=3 warning, ellers go-with-conditions - DS_CLASSES test oppdatert: rights-matrix -> critique-card (Step 10 endrer body for FRIA) --- .../ms-ai-architect-playground.html | 48 ++++++++++++++----- .../tests/test-playground-v3.sh | 2 +- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/plugins/ms-ai-architect/playground/ms-ai-architect-playground.html b/plugins/ms-ai-architect/playground/ms-ai-architect-playground.html index fd4ef2f..3777921 100644 --- a/plugins/ms-ai-architect/playground/ms-ai-architect-playground.html +++ b/plugins/ms-ai-architect/playground/ms-ai-architect-playground.html @@ -3130,20 +3130,35 @@ } function renderFria(data, slot) { - const headerHtml = - '
' + - '
Rettighet
' + - '
Impact (0-5)
' + - '
Tiltak
' + - '
'; - const rowsHtml = (data.rights || []).map(function (r) { - return '
' + - '
' + escapeHtml(r.name) + '
' + - '
' + r.impact + '
' + - '
' + escapeHtml(r.mitigation) + '
' + + const sevForImpact = function (n) { + const v = Number(n) || 0; + if (v >= 4) return 'critical'; + if (v >= 3) return 'high'; + if (v >= 2) return 'medium'; + if (v >= 1) return 'low'; + return 'info'; + }; + const cardsHtml = (data.rights || []).map(function (r, idx) { + const sev = sevForImpact(r.impact); + return '
' + + '
' + + '
' + escapeHtml(r.name) + '
' + + '
' + + 'FRIA-' + String(idx + 1).padStart(2, '0') + '' + + 'Impact ' + escapeHtml(String(r.impact || 0)) + '/5' + + '
' + + '
' + + (r.mitigation ? '
' + escapeHtml(r.mitigation) + '
' : '') + '
'; }).join(''); - slot.innerHTML = '
' + headerHtml + rowsHtml + '
'; + const body = '
' + (cardsHtml || '

Ingen rettigheter registrert.

') + '
'; + slot.innerHTML = renderPageShell({ + eyebrow: 'FRIA', + title: data.title || 'Fundamental Rights Impact Assessment', + lede: data.lede || 'EU AI Act Art. 27 — obligatorisk for offentlig sektor som deployer.', + verdict: data.verdict || inferVerdict(data, 'fria'), + keyStats: data.keyStats || inferKeyStats(data, 'fria') + }, body); } function renderConformity(data, slot) { @@ -3674,6 +3689,15 @@ if (threats.length) return 'warning'; return 'n-a'; } + case 'fria': { + const rights = data.rights || []; + if (!rights.length) return 'n-a'; + const max = rights.reduce(function (a, r) { const v = Number(r.impact) || 0; return v > a ? v : a; }, 0); + if (max >= 4) return 'block'; + if (max >= 3) return 'warning'; + if (max >= 1) return 'go-with-conditions'; + return 'go'; + } case 'conformity-checklist': { const cl = data.checklist || []; if (!cl.length) return 'n-a'; diff --git a/plugins/ms-ai-architect/tests/test-playground-v3.sh b/plugins/ms-ai-architect/tests/test-playground-v3.sh index c32d26b..0ab9ebe 100755 --- a/plugins/ms-ai-architect/tests/test-playground-v3.sh +++ b/plugins/ms-ai-architect/tests/test-playground-v3.sh @@ -198,7 +198,7 @@ fi # ------------------------------------------------------- # 12. Design-system CSS-klasse-bruk (Tier 1+2+3) # ------------------------------------------------------- -DS_CLASSES=".pyramide .matrix .radar .findings .distribution .rights-matrix .capability-matrix .aiact-timeline .tracks .error-summary .guide-panel .expansion .form-progress" +DS_CLASSES=".pyramide .matrix .radar .findings .distribution .critique-card .capability-matrix .aiact-timeline .tracks .error-summary .guide-panel .expansion .form-progress" for cls in $DS_CLASSES; do # Match som klassen i class="..." eller selektor — søk på klassenavnet uten leading dot bare="${cls#.}"