Enhance: アカウント移行機能を使用したユーザーに対してのモデレーションの強化 (#719)

* fix

* fix

* fix

* Feat: アカウント移行機能のモデレーションを行いやすくした

* コミット忘れ

* 文章を組み立てるのやめた

* Fix test

* Fix test

* updateModerationNote から mergeModerationNote に

* updateAccountMoveLogs から insertAccountMoveLog に

---------

Co-authored-by: nenohi <nenohi@nenohi.net>
Co-authored-by: nenohi <kimutipartylove@gmail.com>
This commit is contained in:
まっちゃてぃー。 2024-09-16 22:18:41 +09:00 committed by GitHub
parent 2fe5bb0bb3
commit 6c732d1bfd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 593 additions and 13 deletions

View file

@ -13,6 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div class="profile _gaps">
<MkAccountMoved v-if="user.movedTo" :movedTo="user.movedTo"/>
<MkAccountMoved v-if="movedFromLog" :movedFrom="movedFromLog[0]?.movedFromId"/>
<MkRemoteCaution v-if="user.host != null" :href="user.url ?? user.uri!" class="warn"/>
<div :key="user.id" class="main _panel">
@ -280,6 +281,7 @@ const memoDraft = ref(props.user.memo);
const isEditingMemo = ref(false);
const moderationNote = ref(props.user.moderationNote);
const editModerationNote = ref(false);
const movedFromLog = ref<null | {movedFromId:string;}[]>(null);
watch(moderationNote, async () => {
await misskeyApi('admin/update-user-note', { userId: props.user.id, text: moderationNote.value });
@ -301,6 +303,15 @@ function menu(ev: MouseEvent) {
os.popupMenu(menu, ev.currentTarget ?? ev.target).finally(cleanup);
}
async function fetchMovedFromLog() {
if (!props.user.id) {
movedFromLog.value = null;
return;
}
movedFromLog.value = await misskeyApi('admin/show-user-account-move-logs', { movedToId: props.user.id });
}
function parallaxLoop() {
parallaxAnimationId.value = window.requestAnimationFrame(parallaxLoop);
parallax();
@ -377,6 +388,9 @@ function buildSkebStatus(): string {
watch([props.user], () => {
memoDraft.value = props.user.memo;
fetchSkebStatus();
if ($i?.isModerator) {
fetchMovedFromLog();
}
});
onMounted(() => {
@ -395,6 +409,9 @@ onMounted(() => {
}
}
fetchSkebStatus();
if ($i?.isModerator) {
fetchMovedFromLog();
}
nextTick(() => {
adjustMemoTextarea();
});