diff --git a/modules/helpdesk/i18n/default_de.json b/modules/helpdesk/i18n/default_de.json index 3785570..bd13d1f 100644 --- a/modules/helpdesk/i18n/default_de.json +++ b/modules/helpdesk/i18n/default_de.json @@ -323,5 +323,8 @@ "open": "offen", "overdue": "überfällig", "net": "netto", - "Search customers...": "Kunden suchen..." + "Search customers...": "Kunden suchen...", + "more than resolved": "mehr als gelöst", + "SLA breaches": "SLA-Verletzungen", + "Oldest ticket": "Ältestes Ticket" } diff --git a/modules/helpdesk/i18n/default_en.json b/modules/helpdesk/i18n/default_en.json index d4ebabe..ecc2b36 100644 --- a/modules/helpdesk/i18n/default_en.json +++ b/modules/helpdesk/i18n/default_en.json @@ -323,5 +323,8 @@ "open": "open", "overdue": "overdue", "net": "net", - "Search customers...": "Search customers..." + "Search customers...": "Search customers...", + "more than resolved": "more than resolved", + "SLA breaches": "SLA breaches", + "Oldest ticket": "Oldest ticket" } diff --git a/modules/helpdesk/pages/helpdesk/risk-radar/index(default).phtml b/modules/helpdesk/pages/helpdesk/risk-radar/index(default).phtml index 285d9e6..49fc9f1 100644 --- a/modules/helpdesk/pages/helpdesk/risk-radar/index(default).phtml +++ b/modules/helpdesk/pages/helpdesk/risk-radar/index(default).phtml @@ -36,6 +36,9 @@ $periodLabels = [ data-label-ticket="" data-label-status="" data-label-age="" + data-label-more-than-resolved="" + data-label-sla-breaches="" + data-label-oldest-ticket="" data-label-tickets="" data-label-score="" > diff --git a/modules/helpdesk/web/css/helpdesk.css b/modules/helpdesk/web/css/helpdesk.css index 482fe42..89f0aeb 100644 --- a/modules/helpdesk/web/css/helpdesk.css +++ b/modules/helpdesk/web/css/helpdesk.css @@ -630,22 +630,15 @@ font-weight: 600; } - .helpdesk-risk-card-drivers { - display: grid; - gap: calc(var(--app-spacing) * 0.2); - } - - .helpdesk-risk-card-driver { - display: flex; - align-items: center; - gap: calc(var(--app-spacing) * 0.35); + .helpdesk-risk-card-reasons { + list-style: none; + margin: 0; + padding: 0; font-size: var(--text-xs, 0.75rem); - } - - .helpdesk-risk-card-driver-label { - min-width: 7ch; color: var(--app-muted-color); - flex-shrink: 0; + display: flex; + flex-direction: column; + gap: 0.15em; } .helpdesk-risk-card-driver-bar { diff --git a/modules/helpdesk/web/js/helpdesk-risk-radar.js b/modules/helpdesk/web/js/helpdesk-risk-radar.js index 65c0279..dbba3d7 100644 --- a/modules/helpdesk/web/js/helpdesk-risk-radar.js +++ b/modules/helpdesk/web/js/helpdesk-risk-radar.js @@ -111,22 +111,29 @@ if (container) { card.appendChild(metrics); - // Top drivers - const drivers = customer.drivers || []; - if (drivers.length > 0) { - const driverSection = h('div', 'helpdesk-risk-card-drivers'); - for (const dr of drivers) { - if (dr.dimension_score === null || dr.weighted_points <= 0) continue; - const row = h('div', 'helpdesk-risk-card-driver'); - row.appendChild(h('span', 'helpdesk-risk-card-driver-label', dimLabel(dr.id))); - const bar = h('div', 'helpdesk-risk-card-driver-bar'); - const fill = h('div', 'helpdesk-risk-card-driver-fill'); - fill.style.width = Math.min(100, dr.dimension_score) + '%'; - bar.appendChild(fill); - row.appendChild(bar); - driverSection.appendChild(row); + // Why at risk — concrete facts + const kpiOpen = kpis.open || 0; + const kpiCritical = kpis.critical || 0; + const kpiSla = kpis.sla_overdue || 0; + const kpiNet = kpis.net_flow || 0; + const kpiOldest = kpis.oldest_open_hours || 0; + + const reasons = []; + if (kpiOpen > 0) { + let text = kpiOpen + ' ' + d('labelOpen', 'open'); + if (kpiCritical > 0) text += ', ' + kpiCritical + ' ' + d('labelCritical', 'critical'); + reasons.push(text); + } + if (kpiNet > 0) reasons.push('↑' + kpiNet + ' ' + d('labelMoreThanResolved', 'more than resolved')); + if (kpiSla > 0) reasons.push(kpiSla + ' ' + d('labelSlaBreaches', 'SLA breaches')); + if (kpiOldest > 168) reasons.push(d('labelOldestTicket', 'Oldest ticket') + ' ' + formatAge(kpiOldest)); + + if (reasons.length > 0) { + const reasonList = h('ul', 'helpdesk-risk-card-reasons'); + for (const r of reasons) { + reasonList.appendChild(h('li', '', '• ' + r)); } - card.appendChild(driverSection); + card.appendChild(reasonList); } // Click/keyboard to open detail