feat(helpdesk): promote ticket description to its own column in updates list

The ticket description was only visible as a tooltip on the ticket number
link — easy to miss and not searchable by eye when scanning the list.
Move it to a dedicated "Description" column right after "Ticket".

- helpdesk-updates-index.js: new column between Ticket and Ticket status,
  using the shared `.app-cell-note` class for ellipsis + title fallback
  on long descriptions. Drop the now-redundant data-tooltip on the
  ticket link. mapData gets one extra positional entry.
- updates/index(default).phtml: add ticketDescription label to
  pageConfig. i18n key "Description" already exists in both core and
  helpdesk dictionaries, no new strings required.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-22 10:24:29 +02:00
parent 53ccd212d5
commit c14ff27c37
2 changed files with 17 additions and 5 deletions

View File

@@ -83,6 +83,7 @@ require templatePath('partials/app-list-filters.phtml');
'csrfToken' => $csrfToken ?? '', 'csrfToken' => $csrfToken ?? '',
'labels' => [ 'labels' => [
'ticketNo' => t('Ticket'), 'ticketNo' => t('Ticket'),
'ticketDescription' => t('Description'),
'category' => t('Type'), 'category' => t('Type'),
'debitor' => t('Customer'), 'debitor' => t('Customer'),
'domain' => t('Domain'), 'domain' => t('Domain'),

View File

@@ -25,11 +25,21 @@ createListPageModule({
formatter: (cell) => { formatter: (cell) => {
const no = escapeHtml(String(cell?.no || '')); const no = escapeHtml(String(cell?.no || ''));
const url = String(cell?.url || '').trim(); const url = String(cell?.url || '').trim();
const desc = escapeHtml(String(cell?.description || ''));
const tip = desc ? ` data-tooltip="${desc}" data-tooltip-pos="top"` : '';
if (no === '') return gridjs.html('<span class="text-muted">—</span>'); if (no === '') return gridjs.html('<span class="text-muted">—</span>');
if (url === '') return gridjs.html(`<span${tip}>${no}</span>`); if (url === '') return gridjs.html(`<span>${no}</span>`);
return gridjs.html(`<a href="${escapeHtml(url)}"${tip}>${no}</a>`); return gridjs.html(`<a href="${escapeHtml(url)}">${no}</a>`);
},
},
{
name: labels.ticketDescription || 'Description',
sort: false,
formatter: (cell) => {
const text = String(cell || '').trim();
if (text === '') {
return gridjs.html('<span class="text-muted">—</span>');
}
const escaped = escapeHtml(text);
return gridjs.html(`<span class="app-cell-note" title="${escaped}">${escaped}</span>`);
}, },
}, },
{ {
@@ -103,7 +113,8 @@ createListPageModule({
mapData: (data) => { mapData: (data) => {
const rows = data.rows || data.data || []; const rows = data.rows || data.data || [];
return rows.map((row) => [ return rows.map((row) => [
{ no: row.ticket_no || '', url: row.ticket_url || '', description: row.ticket_description || '' }, { no: row.ticket_no || '', url: row.ticket_url || '' },
row.ticket_description || '',
{ label: row.ticket_state_label || '', variant: row.ticket_state_variant || 'neutral' }, { label: row.ticket_state_label || '', variant: row.ticket_state_variant || 'neutral' },
{ label: row.status_label || '', variant: row.status_variant || 'neutral' }, { label: row.status_label || '', variant: row.status_variant || 'neutral' },
{ {