Implement warning system enhancements with unique identifiers
- Added a `warningNumber` field to the `Warning` model for sequential identification of warnings. - Updated the `createWarning` function to handle the new `warningNumber` logic and notify users via DM upon receiving a warning. - Refactored moderation commands to utilize the new warning system, including changes to the warning creation and removal processes. - Enhanced the WebUI to display warning numbers in the warnings table and updated localization for related messages. - Documented changes in phase tracking to reflect the new warning system features.
This commit is contained in:
@@ -105,6 +105,7 @@ export function WarningsTable({ guildId, initialWarnings }: WarningsTableProps)
|
||||
<table className="w-full text-sm">
|
||||
<thead>
|
||||
<tr className="border-b border-border text-left text-xs uppercase text-muted-foreground">
|
||||
<th className="py-2 pr-4">#</th>
|
||||
<th className="py-2 pr-4">{t('modulePages.moderation.target')}</th>
|
||||
<th className="py-2 pr-4">{t('modulePages.moderation.moderator')}</th>
|
||||
<th className="py-2 pr-4">{t('modulePages.moderation.reason')}</th>
|
||||
@@ -115,6 +116,7 @@ export function WarningsTable({ guildId, initialWarnings }: WarningsTableProps)
|
||||
<tbody className="divide-y divide-border">
|
||||
{warnings.map((entry) => (
|
||||
<tr key={entry.id}>
|
||||
<td className="py-2 pr-4 font-mono text-xs">#{entry.warningNumber}</td>
|
||||
<td className="py-2 pr-4 font-mono text-xs">{entry.userId}</td>
|
||||
<td className="py-2 pr-4 font-mono text-xs">{entry.moderatorId}</td>
|
||||
<td className="max-w-64 truncate py-2 pr-4">
|
||||
|
||||
@@ -13,6 +13,7 @@ export async function listWarnings(guildId: string, query: WarningListQuery): Pr
|
||||
|
||||
return warnings.map((warning) => ({
|
||||
id: warning.id,
|
||||
warningNumber: warning.warningNumber,
|
||||
userId: warning.userId,
|
||||
moderatorId: warning.moderatorId,
|
||||
reason: warning.reason,
|
||||
|
||||
@@ -366,7 +366,7 @@
|
||||
"deleteCase": "Fall löschen",
|
||||
"confirmDeleteCase": "Diesen Fall wirklich löschen?",
|
||||
"warningsTitle": "Verwarnungen",
|
||||
"warningsDescription": "Letzte Verwarnungen. Entfernen löscht den Warn-Eintrag.",
|
||||
"warningsDescription": "Letzte Verwarnungen mit kurzer Nummer (#). Entfernen löscht den Warn-Eintrag.",
|
||||
"warningsEmpty": "Keine Verwarnungen gefunden.",
|
||||
"warningsSearchUser": "User-ID filtern",
|
||||
"removeWarning": "Verwarnung entfernen",
|
||||
|
||||
@@ -366,7 +366,7 @@
|
||||
"deleteCase": "Delete case",
|
||||
"confirmDeleteCase": "Really delete this case?",
|
||||
"warningsTitle": "Warnings",
|
||||
"warningsDescription": "Recent warnings. Remove deletes the warning entry.",
|
||||
"warningsDescription": "Recent warnings with short numbers (#). Remove deletes the warning entry.",
|
||||
"warningsEmpty": "No warnings found.",
|
||||
"warningsSearchUser": "Filter by user ID",
|
||||
"removeWarning": "Remove warning",
|
||||
|
||||
Reference in New Issue
Block a user