diff --git a/modules/helpdesk/web/js/helpdesk-risk-radar.js b/modules/helpdesk/web/js/helpdesk-risk-radar.js index 139f648..92c7b44 100644 --- a/modules/helpdesk/web/js/helpdesk-risk-radar.js +++ b/modules/helpdesk/web/js/helpdesk-risk-radar.js @@ -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);