feat(ModerationReports): enhance moderation reports functionality and UI
All checks were successful
Deploy to production / deploy (push) Successful in 2m3s

- Added topic and forum IDs to moderation report queries for better context.
- Updated admin interface to include links to open reported forum messages.
- Implemented methods to handle opening target messages directly from the moderation reports view.
- Enhanced internationalization support for new UI elements in both German and English.
- Improved scrolling behavior to focus on specific messages when navigating to them.
This commit is contained in:
Torsten Schulz (local)
2026-04-27 14:55:23 +02:00
parent a02fe1f008
commit 90e1c0496a
5 changed files with 39 additions and 3 deletions

View File

@@ -547,7 +547,9 @@
"in_review": "In Prüfung",
"resolved": "Erledigt",
"rejected": "Abgelehnt"
}
},
"openTarget": "Zum Beitrag",
"targetLink": "Link"
}
}
}

View File

@@ -547,7 +547,9 @@
"in_review": "In review",
"resolved": "Resolved",
"rejected": "Rejected"
}
},
"openTarget": "Open post",
"targetLink": "Link"
}
}
}

View File

@@ -26,6 +26,7 @@
<th>{{ $t('admin.moderationReports.reason') }}</th>
<th>{{ $t('admin.moderationReports.reporter') }}</th>
<th>{{ $t('admin.moderationReports.createdAt') }}</th>
<th>{{ $t('admin.moderationReports.targetLink') }}</th>
<th>{{ $t('admin.moderationReports.actions') }}</th>
</tr>
</thead>
@@ -39,6 +40,15 @@
</td>
<td>{{ report.reporterUsername }}</td>
<td>{{ formatDateTimeLong(report.createdAt) }}</td>
<td>
<button
v-if="canOpenTarget(report)"
type="button"
@click="openTarget(report)"
>
{{ $t('admin.moderationReports.openTarget') }}
</button>
</td>
<td class="actions-cell">
<select v-model="draftStatus[report.id]">
<option value="open">{{ $t('admin.moderationReports.status.open') }}</option>
@@ -111,6 +121,13 @@ export default {
showApiError(this, error, this.$t('admin.moderationReports.applyError'));
}
},
canOpenTarget(report) {
return report?.targetType === 'forum_message' && Number(report?.topicId) > 0;
},
openTarget(report) {
if (!this.canOpenTarget(report)) return;
this.$router.push(`/socialnetwork/forumtopic/${report.topicId}#msg-${report.targetId}`);
},
},
};
</script>

View File

@@ -10,7 +10,7 @@
<section class="forum-topic-messages">
<ul class="messages">
<li v-for="message in messages" :key="message.id" class="surface-card">
<li v-for="message in messages" :key="message.id" :id="`msg-${message.id}`" class="surface-card">
<div v-html="sanitizedMessage(message)"></div>
<div class="footer">
<span class="footer-left">
@@ -85,6 +85,7 @@ export default {
this.forumName = data.forum.name;
this.forumId = data.forum.id;
this.messages = data.messages;
this.$nextTick(() => this.scrollToHashIfPresent());
},
async openProfile(id) {
this.$root.$refs.userProfileDialog.userId = id;
@@ -138,6 +139,14 @@ export default {
this.$t('error.title')
);
}
},
scrollToHashIfPresent() {
const hash = this.$route?.hash || '';
if (!hash || hash.length < 2) return;
const el = document.querySelector(hash);
if (el && typeof el.scrollIntoView === 'function') {
el.scrollIntoView({ behavior: 'smooth', block: 'center' });
}
}
}
}