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) <noreply@anthropic.com>
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user