Implement message preview feature for support tickets
CI / Backend (build + test) (push) Successful in 1m15s
CI / Frontend (lint + typecheck + build) (push) Successful in 30s

- Added a new property `MessagePreview` to the `TicketSummaryDto` to display the truncated first message of a ticket.
- Updated the `TicketMapping` class to retrieve the first message for each ticket and truncate it for preview purposes.
- Modified the `SupportTicketList` and `AdminSupportPage` components to conditionally render the message preview in the ticket list, enhancing user experience by providing context at a glance.
This commit is contained in:
Leonid Pershin
2026-07-14 07:47:57 +03:00
parent d26723dce0
commit 9a6540a266
6 changed files with 115 additions and 5 deletions
@@ -52,7 +52,8 @@ export function SupportTicketList() {
<CardTitle className="text-base">{t(`support.type.${ticket.type}`)}</CardTitle>
<TicketStatusBadge status={ticket.status} />
</CardHeader>
<CardContent>
<CardContent className="flex flex-col gap-1">
{ticket.messagePreview && <p className="truncate text-xs text-muted-foreground">{ticket.messagePreview}</p>}
<p className="text-xs text-muted-foreground">
{t('support.lastActivity', { date: new Date(ticket.lastActivityAt).toLocaleString() })}
</p>
+2 -1
View File
@@ -55,7 +55,8 @@ function AdminSupportPage() {
</CardTitle>
<TicketStatusBadge status={ticket.status} />
</CardHeader>
<CardContent>
<CardContent className="flex flex-col gap-1">
{ticket.messagePreview && <p className="truncate text-xs text-muted-foreground">{ticket.messagePreview}</p>}
<p className="text-xs text-muted-foreground">
{t('support.lastActivity', { date: new Date(ticket.lastActivityAt).toLocaleString() })}
</p>
+1
View File
@@ -267,6 +267,7 @@ export type TicketSummaryDto = {
status: TicketStatus
createdAt: string
lastActivityAt: string
messagePreview: string | null
}
export type TicketDetailDto = {