Skip to content

Commit

Permalink
upd: remove approvals from admin-users
Browse files Browse the repository at this point in the history
Removes approvals tab in favor of the new approvals page
  • Loading branch information
Mar0xy authored and kakkokari-gtyih committed Dec 29, 2023
1 parent 37a1418 commit 38616fe
Showing 1 changed file with 1 addition and 31 deletions.
32 changes: 1 addition & 31 deletions packages/frontend/src/pages/admin-user.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,20 +199,6 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkObjectView tall :value="user">
</MkObjectView>
</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>
</MkSpacer>
</MkStickyContainer>
Expand Down Expand Up @@ -262,7 +248,6 @@ const silenced = ref(false);
const approved = ref(false);
const suspended = ref(false);
const moderationNote = ref('');
const signupReason = ref('');
const filesPagination = {
endpoint: 'admin/drive/files' as const,
limit: 10,
Expand Down Expand Up @@ -295,7 +280,6 @@ function createFetcher() {
approved.value = info.value.approved;
suspended.value = info.value.isSuspended;
moderationNote.value = info.value.moderationNote;
signupReason.value = info.value.signupReason;

watch(moderationNote, async () => {
await os.api('admin/update-user-note', { userId: user.value.id, text: moderationNote.value });
Expand Down Expand Up @@ -425,16 +409,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() {
const roles = await os.api('admin/roles/list');

Expand Down Expand Up @@ -545,11 +519,7 @@ const headerTabs = computed(() => [{
key: 'raw',
title: 'Raw',
icon: 'ti ti-code',
}, (iAmAdmin && !approved) ? {
key: 'approval',
title: 'Approval',
icon: 'ti ti-eye',
} : undefined]);
});

definePageMetadata(computed(() => ({
title: user.value ? acct(user.value) : i18n.ts.userInfo,
Expand Down

0 comments on commit 38616fe

Please sign in to comment.