upd: remove approvals from admin-users

Removes approvals tab in favor of the new approvals page
This commit is contained in:
Mar0xy 2023-10-20 00:09:38 +02:00
parent 142f500f4b
commit fd8fa9b3de
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
2 changed files with 25 additions and 85 deletions

View file

@ -180,20 +180,6 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkObjectView tall :value="user"> <MkObjectView tall :value="user">
</MkObjectView> </MkObjectView>
</div> </div>
<div v-else-if="tab === 'approval'" class="_gaps_m">
<MkKeyValue oneline>
<template #key>{{ i18n.ts.approvalStatus }}</template>
<template #value><span class="_monospace">{{ approved ? i18n.ts.approved : i18n.ts.notApproved }}</span></template>
</MkKeyValue>
<MkTextarea v-model="signupReason" readonly>
<template #label>Reason</template>
</MkTextarea>
<MkButton v-if="$i.isAdmin" inline success @click="approveAccount">{{ i18n.ts.approveAccount }}</MkButton>
<MkButton v-if="$i.isAdmin" inline danger @click="deleteAccount">{{ i18n.ts.denyAccount }}</MkButton>
</div>
</FormSuspense> </FormSuspense>
</MkSpacer> </MkSpacer>
</MkStickyContainer> </MkStickyContainer>
@ -244,7 +230,6 @@ let approved = $ref(false);
let suspended = $ref(false); let suspended = $ref(false);
let markedAsNSFW = $ref(false); let markedAsNSFW = $ref(false);
let moderationNote = $ref(''); let moderationNote = $ref('');
let signupReason = $ref('');
const filesPagination = { const filesPagination = {
endpoint: 'admin/drive/files' as const, endpoint: 'admin/drive/files' as const,
@ -278,7 +263,6 @@ function createFetcher() {
approved = info.approved; approved = info.approved;
suspended = info.isSuspended; suspended = info.isSuspended;
moderationNote = info.moderationNote; moderationNote = info.moderationNote;
signupReason = info.signupReason;
markedAsNSFW = info.alwaysMarkNsfw; markedAsNSFW = info.alwaysMarkNsfw;
watch($$(moderationNote), async () => { watch($$(moderationNote), async () => {
@ -397,16 +381,6 @@ async function deleteAccount() {
} }
} }
async function approveAccount() {
const confirm = await os.confirm({
type: 'warning',
text: i18n.ts.approveConfirm,
});
if (confirm.canceled) return;
await os.api('admin/approve-user', { userId: user.id });
await refreshUser();
}
async function assignRole() { async function assignRole() {
const roles = await os.api('admin/roles/list'); const roles = await os.api('admin/roles/list');
@ -493,36 +467,7 @@ watch($$(user), () => {
const headerActions = $computed(() => []); const headerActions = $computed(() => []);
const headerTabs = $computed(() => iAmAdmin && !approved ? const headerTabs = $computed(() => [{
[{
key: 'overview',
title: i18n.ts.overview,
icon: 'ph-info ph-bold ph-lg',
}, {
key: 'roles',
title: i18n.ts.roles,
icon: 'ph-seal-check ph-bold pg-lg',
}, {
key: 'announcements',
title: i18n.ts.announcements,
icon: 'ph-megaphone ph-bold ph-lg',
}, {
key: 'drive',
title: i18n.ts.drive,
icon: 'ph-cloud ph-bold ph-lg',
}, {
key: 'chart',
title: i18n.ts.charts,
icon: 'ph-chart-line ph-bold pg-lg',
}, {
key: 'raw',
title: 'Raw',
icon: 'ph-code ph-bold pg-lg',
}, {
key: 'approval',
title: 'Approval',
icon: 'ph-eye ph-bold pg-lg',
}] : [{
key: 'overview', key: 'overview',
title: i18n.ts.overview, title: i18n.ts.overview,
icon: 'ph-info ph-bold ph-lg', icon: 'ph-info ph-bold ph-lg',

View file

@ -1,8 +1,3 @@
<!--
SPDX-FileCopyrightText: syuilo and other misskey contributors
SPDX-License-Identifier: AGPL-3.0-only
-->
<template> <template>
<div> <div>
<MkStickyContainer> <MkStickyContainer>