From 62e6bfe4143df012eb09e7103e4155b191367b98 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Fri, 19 Dec 2025 09:30:33 +0100 Subject: [PATCH] remove who/moderator column, add comment if contribution was created by moderator --- .../components/Tables/OpenCreationsTable.vue | 17 +++++++++++++++-- admin/src/locales/de.json | 4 ++-- admin/src/locales/en.json | 6 +++--- admin/src/pages/CreationConfirm.vue | 5 ----- database/src/queries/user.ts | 6 +----- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/admin/src/components/Tables/OpenCreationsTable.vue b/admin/src/components/Tables/OpenCreationsTable.vue index ae69470e4..9d1b43db9 100644 --- a/admin/src/components/Tables/OpenCreationsTable.vue +++ b/admin/src/components/Tables/OpenCreationsTable.vue @@ -236,7 +236,13 @@ export default { } }, isAddCommentToMemo(item) { - return item.updatedBy > 0 || item.confirmedBy > 0 || item.deletedBy > 0 || item.deniedBy > 0 + return ( + item.updatedBy > 0 || + item.confirmedBy > 0 || + item.deletedBy > 0 || + item.deniedBy > 0 || + item.moderatorId > 0 + ) }, getMemoComment(item) { let comment = '' @@ -250,10 +256,17 @@ export default { if (item.updatedBy > 0) { if (comment.length) { - comment += ' ' + comment += ' | ' } comment += this.$t('moderator.memo-modified', { name: item.updatedByUserName }) } + + if (item.moderatorId > 0) { + if (comment.length) { + comment += ' | ' + } + comment += this.$t('contribution.createdBy', { name: item.moderatorUserName }) + } return comment }, addClipboardListener() { diff --git a/admin/src/locales/de.json b/admin/src/locales/de.json index 8e098b2ab..2443e3e3d 100644 --- a/admin/src/locales/de.json +++ b/admin/src/locales/de.json @@ -18,6 +18,7 @@ "close": "Schließen", "contribution": { "confirmedBy": "Bestätigt von {name}.", + "createdBy": "Erstellt von {name}.", "deletedBy": "Gelöscht von {name}.", "deniedBy": "Abgelehnt von {name}." }, @@ -179,8 +180,7 @@ "notice": "Notiz", "notice-tooltip": "Die Notiz ist nur für Moderatoren sichtbar", "request": "Diese Nachricht ist nur für die Moderatoren sichtbar!", - "show-submission-form": "warten auf Erinnerung?", - "who": "Wer?" + "show-submission-form": "warten auf Erinnerung?" }, "name": "Name", "navbar": { diff --git a/admin/src/locales/en.json b/admin/src/locales/en.json index e3f5b03f0..45b0f2a80 100644 --- a/admin/src/locales/en.json +++ b/admin/src/locales/en.json @@ -18,8 +18,9 @@ "close": "Close", "contribution": { "confirmedBy": "Confirmed by {name}.", + "createdBy": "Created by {name}.", "deletedBy": "Deleted by {name}.", - "deniedBy": "Denied by {name}." + "deniedBy": "Rejected by {name}." }, "contributionLink": { "amount": "Amount", @@ -179,8 +180,7 @@ "notice": "Note", "notice-tooltip": "The note is only visible to moderators", "request": "This message is only visible to the moderators!", - "show-submission-form": "wait for reminder?", - "who": "Who?" + "show-submission-form": "wait for reminder?" }, "name": "Name", "navbar": { diff --git a/admin/src/pages/CreationConfirm.vue b/admin/src/pages/CreationConfirm.vue index 01f38a7c6..af002bac8 100644 --- a/admin/src/pages/CreationConfirm.vue +++ b/admin/src/pages/CreationConfirm.vue @@ -178,7 +178,6 @@ const fields = computed( baseFields.amount, baseFields.memo, baseFields.contributionDate, - { key: 'moderatorUserName', label: t('moderator.who'), class: 'no-select' }, { key: 'editCreation', label: t('details') }, { key: 'confirm', label: t('save') }, ], @@ -191,7 +190,6 @@ const fields = computed( baseFields.contributionDate, baseFields.createdAt, baseFields.confirmedAt, - baseFields.confirmedByUserName, { key: 'chatCreation', label: t('details') }, ], // denied contributions @@ -207,7 +205,6 @@ const fields = computed( label: t('contributions.denied'), formatter: formatDateOrDash, }, - { key: 'deniedByUserName', label: t('moderator.who') }, { key: 'chatCreation', label: t('details') }, ], // deleted contributions @@ -223,7 +220,6 @@ const fields = computed( label: t('contributions.deleted'), formatter: formatDateOrDash, }, - { key: 'deletedByUserName', label: t('moderator.who') }, { key: 'chatCreation', label: t('details') }, ], // all contributions @@ -236,7 +232,6 @@ const fields = computed( baseFields.contributionDate, baseFields.createdAt, baseFields.confirmedAt, - baseFields.confirmedByUserName, { key: 'chatCreation', label: t('details') }, ], ][tabIndex.value], diff --git a/database/src/queries/user.ts b/database/src/queries/user.ts index 5aa46a07b..2a1c474d7 100644 --- a/database/src/queries/user.ts +++ b/database/src/queries/user.ts @@ -89,11 +89,7 @@ export async function findUserNamesByIds(userIds: number[]): Promise { - let name = `${user.firstName} ${user.lastName}` - if (user.alias && user.alias.length > 2) { - name = user.alias - } - return [user.id, name] + return [user.id, `${user.firstName} ${user.lastName}`] }), ) }