From ba356d2d6121b888a67ed86a46f45622dae8cf49 Mon Sep 17 00:00:00 2001 From: fs Date: Mon, 6 Apr 2026 00:28:09 +0200 Subject: [PATCH] fix(helpdesk): address code review findings for Risk Radar - CR-001/002: Replace hardcoded 'critical', 'Ticket', 'Status' with i18n data-label attributes - CR-004: Add tabindex, role=button, keydown handler to risk cards for keyboard accessibility - CR-005: Add aria-labelledby on detail dialog Co-Authored-By: Claude Opus 4.6 (1M context) --- .../pages/helpdesk/risk-radar/index(default).phtml | 6 +++++- modules/helpdesk/web/js/helpdesk-risk-radar.js | 14 ++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/modules/helpdesk/pages/helpdesk/risk-radar/index(default).phtml b/modules/helpdesk/pages/helpdesk/risk-radar/index(default).phtml index cb79081..e60b065 100644 --- a/modules/helpdesk/pages/helpdesk/risk-radar/index(default).phtml +++ b/modules/helpdesk/pages/helpdesk/risk-radar/index(default).phtml @@ -32,6 +32,10 @@ $periodLabels = [ data-label-overdue="" data-label-net="" data-label-search="" + data-label-critical="" + data-label-ticket="" + data-label-status="" + data-label-age="" data-label-tickets="" data-label-score="" > @@ -114,7 +118,7 @@ $periodLabels = [
- +

diff --git a/modules/helpdesk/web/js/helpdesk-risk-radar.js b/modules/helpdesk/web/js/helpdesk-risk-radar.js index 56734ff..59112b0 100644 --- a/modules/helpdesk/web/js/helpdesk-risk-radar.js +++ b/modules/helpdesk/web/js/helpdesk-risk-radar.js @@ -94,7 +94,7 @@ if (container) { } if (kpis.critical > 0) { const m = h('span', 'helpdesk-risk-card-metric helpdesk-risk-card-metric-warn'); - m.textContent = kpis.critical + ' critical'; + m.textContent = kpis.critical + ' ' + d('labelCritical', 'critical'); metrics.appendChild(m); } const openM = h('span', 'helpdesk-risk-card-metric'); @@ -128,9 +128,11 @@ if (container) { card.appendChild(driverSection); } - // Click to open detail - card.style.cursor = 'pointer'; + // Click/keyboard to open detail + card.tabIndex = 0; + card.setAttribute('role', 'button'); card.addEventListener('click', () => openDetail(customer)); + card.addEventListener('keydown', (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); openDetail(customer); } }); return card; } @@ -169,10 +171,10 @@ if (container) { const table = h('table', 'helpdesk-risk-detail-tickets'); const thead = h('thead'); const headRow = h('tr'); - headRow.appendChild(h('th', '', 'Ticket')); + headRow.appendChild(h('th', '', d('labelTicket', 'Ticket'))); headRow.appendChild(h('th', '', d('labelSla', 'SLA'))); - headRow.appendChild(h('th', '', 'Status')); - headRow.appendChild(h('th', '', d('labelInactivity', 'Age'))); + headRow.appendChild(h('th', '', d('labelStatus', 'Status'))); + headRow.appendChild(h('th', '', d('labelAge', 'Age'))); thead.appendChild(headRow); table.appendChild(thead); const tbody = h('tbody');