Enhance ticket management with dashboard actions and priority settings

- Introduced a new `runTicketDashboardActionJob` to handle ticket actions (close, claim, set priority) with Discord side effects.
- Added a priority dropdown in the ticket control panel, allowing users to set ticket urgency levels.
- Updated WebUI to display open tickets with options to claim, close, or adjust priority, enhancing user interaction.
- Improved localization for new ticket management features in both English and German.
- Documented changes in phase tracking to reflect the new ticket dashboard functionalities.
This commit is contained in:
TheOnlyMace
2026-07-25 16:21:51 +02:00
parent ac5ecc9a1c
commit 5c11b68fc0
15 changed files with 710 additions and 14 deletions

View File

@@ -19,7 +19,9 @@ import {
SelfRoleModeSchema,
SuggestionStatusSchema,
TagResponseTypeSchema,
TicketModeSchema
TicketModeSchema,
TicketPrioritySchema,
TicketStatusSchema
} from './phase4.js';
import { SocialFeedTypeSchema } from './phase5.js';
@@ -411,6 +413,37 @@ export type TicketCategoryDashboardCreate = z.infer<typeof TicketCategoryDashboa
export const TicketCategoryDashboardUpdateSchema = nonEmptyPatch(TicketCategoryDashboardCreateSchema);
export type TicketCategoryDashboardUpdate = z.infer<typeof TicketCategoryDashboardUpdateSchema>;
export const TicketDashboardSchema = z.object({
id: z.string(),
openerId: z.string(),
claimedById: z.string().nullable(),
channelId: z.string().nullable(),
threadId: z.string().nullable(),
status: TicketStatusSchema,
priority: TicketPrioritySchema,
subject: z.string().nullable(),
categoryId: z.string().nullable(),
categoryName: z.string().nullable(),
lastActivityAt: z.string(),
createdAt: z.string()
});
export type TicketDashboard = z.infer<typeof TicketDashboardSchema>;
export const TicketDashboardActionSchema = z.discriminatedUnion('action', [
z.object({
action: z.literal('close'),
reason: z.string().max(500).optional()
}),
z.object({
action: z.literal('claim')
}),
z.object({
action: z.literal('priority'),
priority: TicketPrioritySchema
})
]);
export type TicketDashboardAction = z.infer<typeof TicketDashboardActionSchema>;
// ---------------------------------------------------------------------------
// Giveaways
// ---------------------------------------------------------------------------

View File

@@ -427,11 +427,16 @@ const de: Dictionary = {
'ticket.claimed': '{user} hat dieses Ticket übernommen.',
'ticket.control.title': 'Ticket-Steuerung',
'ticket.control.description':
'Übernehmen oder schließen, bzw. weitere Nutzer über die Auswahlmenüs hinzufügen oder entfernen. Slash-Commands: `/ticket rename`, `/ticket priority`.',
'Übernehmen, schließen, Priorität setzen oder Nutzer über die Menüs hinzufügen/entfernen. Zusätzlich: `/ticket rename`.',
'ticket.control.claim': 'Übernehmen',
'ticket.control.close': 'Schließen',
'ticket.control.addPlaceholder': 'Nutzer zum Ticket hinzufügen…',
'ticket.control.removePlaceholder': 'Nutzer aus dem Ticket entfernen…',
'ticket.control.priorityPlaceholder': 'Priorität wählen…',
'ticket.control.priorityLowHint': 'Geringe Dringlichkeit',
'ticket.control.priorityNormalHint': 'Standard-Priorität',
'ticket.control.priorityHighHint': 'Erhöhte Dringlichkeit',
'ticket.control.priorityUrgentHint': 'Sofortige Bearbeitung',
'ticket.userAdded': '{user} wurde zum Ticket hinzugefügt.',
'ticket.userRemoved': '{user} wurde aus dem Ticket entfernt.',
'ticket.renamed': 'Ticket umbenannt in **{name}**.',
@@ -1034,11 +1039,16 @@ const en: Dictionary = {
'ticket.claimed': '{user} claimed this ticket.',
'ticket.control.title': 'Ticket controls',
'ticket.control.description':
'Claim or close this ticket, or add/remove users with the menus below. Slash commands: `/ticket rename`, `/ticket priority`.',
'Claim, close, set priority, or add/remove users with the menus below. Also: `/ticket rename`.',
'ticket.control.claim': 'Claim',
'ticket.control.close': 'Close',
'ticket.control.addPlaceholder': 'Add a user to this ticket…',
'ticket.control.removePlaceholder': 'Remove a user from this ticket…',
'ticket.control.priorityPlaceholder': 'Choose priority…',
'ticket.control.priorityLowHint': 'Low urgency',
'ticket.control.priorityNormalHint': 'Default priority',
'ticket.control.priorityHighHint': 'Elevated urgency',
'ticket.control.priorityUrgentHint': 'Needs immediate attention',
'ticket.userAdded': '{user} was added to the ticket.',
'ticket.userRemoved': '{user} was removed from the ticket.',
'ticket.renamed': 'Ticket renamed to **{name}**.',