diff --git a/modules/helpdesk/web/js/helpdesk-risk-radar.js b/modules/helpdesk/web/js/helpdesk-risk-radar.js index dbba3d7..3b415eb 100644 --- a/modules/helpdesk/web/js/helpdesk-risk-radar.js +++ b/modules/helpdesk/web/js/helpdesk-risk-radar.js @@ -131,7 +131,7 @@ if (container) { if (reasons.length > 0) { const reasonList = h('ul', 'helpdesk-risk-card-reasons'); for (const r of reasons) { - reasonList.appendChild(h('li', '', '• ' + r)); + reasonList.appendChild(h('li', '', r)); } card.appendChild(reasonList); } @@ -153,23 +153,35 @@ if (container) { dialogTitle.textContent = (customer.customer_name || customer.customer_no) + ' — ' + customer.risk_score + '/100'; dialogBody.replaceChildren(); - // All 5 dimensions + // All 5 dimensions as table with raw value, score, weight const dims = customer.dimensions || []; - const dimSection = h('div', 'helpdesk-risk-detail-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', '', d('labelScore', 'Score'))); + dimHeadRow.appendChild(h('th', '', '%')); + dimHead.appendChild(dimHeadRow); + dimTable.appendChild(dimHead); + const dimBody = h('tbody'); for (const dim of dims) { - const row = h('div', 'helpdesk-risk-detail-dim'); - row.appendChild(h('span', 'helpdesk-risk-detail-dim-label', dimLabel(dim.id))); - const bar = h('div', 'helpdesk-risk-card-driver-bar'); - const fill = h('div', 'helpdesk-risk-card-driver-fill'); - fill.style.width = (dim.dimension_score !== null ? Math.min(100, dim.dimension_score) : 0) + '%'; - bar.appendChild(fill); - row.appendChild(bar); - const val = h('span', 'helpdesk-risk-detail-dim-value'); - val.textContent = dim.dimension_score !== null ? dim.dimension_score + '/100' : '—'; - row.appendChild(val); - dimSection.appendChild(row); + 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) : '—')); + dimBody.appendChild(tr); } - dialogBody.appendChild(dimSection); + // 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', '', '')); + dimBody.appendChild(totalTr); + dimTable.appendChild(dimBody); + dialogBody.appendChild(dimTable); // Open tickets list const tickets = customer.open_tickets || [];