fix(helpdesk): show risk score as points/budget per dimension in dialog

Each dimension shows 'points / max' (e.g. '18 / 35') making the
score composition immediately understandable. Total row sums to
the final 'score / 100'. Replaces abstract percentage column.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 00:49:34 +02:00
parent 28cb60efb3
commit 1128197022

View File

@@ -125,32 +125,32 @@ if (container) {
dialogTitle.textContent = (customer.customer_name || customer.customer_no) + ' — ' + customer.risk_score + '/100';
dialogBody.replaceChildren();
// All 5 dimensions as table with raw value, score, weight
// Dimensions as points breakdown: "18 / 35"
const dims = customer.dimensions || [];
const dimTable = h('table', 'helpdesk-risk-detail-tickets');
const dimHead = h('thead');
const dimHeadRow = h('tr');
dimHeadRow.appendChild(h('th', '', d('labelScore', 'Dimension')));
dimHeadRow.appendChild(h('th', '', 'Dimension'));
dimHeadRow.appendChild(h('th', '', d('labelScore', 'Score')));
dimHeadRow.appendChild(h('th', '', '%'));
dimHead.appendChild(dimHeadRow);
dimTable.appendChild(dimHead);
const dimBody = h('tbody');
for (const dim of dims) {
const tr = h('tr');
tr.appendChild(h('td', '', dimLabel(dim.id)));
tr.appendChild(h('td', '', dim.dimension_score !== null ? String(dim.dimension_score) : '—'));
tr.appendChild(h('td', '', dim.weighted_points > 0 ? dim.weighted_points.toFixed(1) : '—'));
const points = Math.round(dim.weighted_points || 0);
tr.appendChild(h('td', '', points + ' / ' + dim.weight));
dimBody.appendChild(tr);
}
// Total row
const totalTr = h('tr');
totalTr.appendChild(h('td', '', 'Total'));
const totalTd = h('td', '');
totalTd.style.fontWeight = '700';
totalTd.textContent = String(customer.risk_score);
totalTr.appendChild(totalTd);
totalTr.appendChild(h('td', '', ''));
const totalLabel = h('td', '');
totalLabel.style.fontWeight = '700';
totalLabel.textContent = 'Total';
totalTr.appendChild(totalLabel);
const totalVal = h('td', '');
totalVal.style.fontWeight = '700';
totalVal.textContent = customer.risk_score + ' / 100';
totalTr.appendChild(totalVal);
dimBody.appendChild(totalTr);
dimTable.appendChild(dimBody);
dialogBody.appendChild(dimTable);