Add registration reasons and approve/reject to pending users
This commit is contained in:
parent
a4173e0900
commit
21c9b06a4e
7 changed files with 62 additions and 4 deletions
|
@ -43,7 +43,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.basic-user-card {
|
.user-information {
|
||||||
width: 0;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding-bottom: 0.6em;
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.basic-user-card {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.registration-reason {
|
||||||
|
padding-left: 5.2em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,7 +165,15 @@
|
||||||
:key="user.id"
|
:key="user.id"
|
||||||
class="user"
|
class="user"
|
||||||
>
|
>
|
||||||
<BasicUserCard :user="user" />
|
<div class="user-information">
|
||||||
|
<BasicUserCard :user="user" />
|
||||||
|
<div
|
||||||
|
v-if="status.need_approval"
|
||||||
|
class="registration-reason"
|
||||||
|
>
|
||||||
|
{{ user.registration_reason }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<ModerationTools
|
<ModerationTools
|
||||||
:user="user"
|
:user="user"
|
||||||
class="user-moderation"
|
class="user-moderation"
|
||||||
|
|
|
@ -104,6 +104,9 @@ const ModerationTools = {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
approveAccount () {
|
||||||
|
this.$store.state.api.backendInteractor.approveAccount({ nickname: this.user.screen_name })
|
||||||
|
},
|
||||||
getPasswordResetToken () {
|
getPasswordResetToken () {
|
||||||
this.$store.state.api.backendInteractor.getPasswordResetToken({ nickname: this.user.screen_name })
|
this.$store.state.api.backendInteractor.getPasswordResetToken({ nickname: this.user.screen_name })
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
|
|
@ -29,6 +29,25 @@
|
||||||
class="dropdown-divider"
|
class="dropdown-divider"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
<span v-if="!user.approved && user.is_local">
|
||||||
|
<button
|
||||||
|
class="button-default dropdown-item"
|
||||||
|
@click="approveAccount()"
|
||||||
|
>
|
||||||
|
{{ $t('user_card.admin_menu.approve_account') }}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="button-default dropdown-item"
|
||||||
|
@click="deleteUserDialog(true)"
|
||||||
|
>
|
||||||
|
{{ $t('user_card.admin_menu.reject_account') }}
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
<div
|
||||||
|
v-if="!user.approved && user.is_local"
|
||||||
|
role="separator"
|
||||||
|
class="dropdown-divider"
|
||||||
|
/>
|
||||||
<button
|
<button
|
||||||
class="button-default dropdown-item"
|
class="button-default dropdown-item"
|
||||||
@click="toggleActivationStatus()"
|
@click="toggleActivationStatus()"
|
||||||
|
@ -172,7 +191,7 @@
|
||||||
<template v-slot:header>
|
<template v-slot:header>
|
||||||
{{ $t('user_card.admin_menu.delete_user') }}
|
{{ $t('user_card.admin_menu.delete_user') }}
|
||||||
</template>
|
</template>
|
||||||
<p>{{ $t('user_card.admin_menu.delete_user_confirmation') }}</p>
|
<p>{{ $t('user_card.admin_menu.delete_user_data_and_deactivate_confirmation') }}</p>
|
||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
<button
|
<button
|
||||||
class="btn button-default"
|
class="btn button-default"
|
||||||
|
|
|
@ -1109,6 +1109,7 @@
|
||||||
"user_card": {
|
"user_card": {
|
||||||
"admin_menu": {
|
"admin_menu": {
|
||||||
"activate_account": "Activate account",
|
"activate_account": "Activate account",
|
||||||
|
"approve_account": "Approve account",
|
||||||
"convert_to": "Convert to { type }",
|
"convert_to": "Convert to { type }",
|
||||||
"deactivate_account": "Deactivate account",
|
"deactivate_account": "Deactivate account",
|
||||||
"delete_account": "Delete account",
|
"delete_account": "Delete account",
|
||||||
|
@ -1127,6 +1128,7 @@
|
||||||
"password_reset_token": "Password reset token",
|
"password_reset_token": "Password reset token",
|
||||||
"password_reset_token_content": "Password reset token has been generated: { token }\nYou can also use this link to reset the password: ",
|
"password_reset_token_content": "Password reset token has been generated: { token }\nYou can also use this link to reset the password: ",
|
||||||
"quarantine": "Disallow user posts from federating",
|
"quarantine": "Disallow user posts from federating",
|
||||||
|
"reject_account": "Reject account",
|
||||||
"revoke_admin": "Revoke Admin",
|
"revoke_admin": "Revoke Admin",
|
||||||
"revoke_moderator": "Revoke Moderator",
|
"revoke_moderator": "Revoke Moderator",
|
||||||
"sandbox": "Force posts to be followers-only",
|
"sandbox": "Force posts to be followers-only",
|
||||||
|
|
|
@ -26,6 +26,7 @@ const ADMIN_REPORT_NOTE_URL = (report, note) => `/api/v1/pleroma/admin/reports/$
|
||||||
const ADMIN_PASSWORD_RESET_TOKEN_URL = nickname => `/api/v1/pleroma/admin/users/${nickname}/password_reset`
|
const ADMIN_PASSWORD_RESET_TOKEN_URL = nickname => `/api/v1/pleroma/admin/users/${nickname}/password_reset`
|
||||||
const ADMIN_FORCE_PASSWORD_RESET_URL = '/api/v1/pleroma/admin/users/force_password_reset'
|
const ADMIN_FORCE_PASSWORD_RESET_URL = '/api/v1/pleroma/admin/users/force_password_reset'
|
||||||
const ADMIN_DISABLE_MFA_URL = '/api/v1/pleroma/admin/users/disable_mfa'
|
const ADMIN_DISABLE_MFA_URL = '/api/v1/pleroma/admin/users/disable_mfa'
|
||||||
|
const ADMIN_APPROVE_ACCOUNT_URL = '/api/v1/pleroma/admin/users/approve'
|
||||||
|
|
||||||
const MFA_SETTINGS_URL = '/api/pleroma/accounts/mfa'
|
const MFA_SETTINGS_URL = '/api/pleroma/accounts/mfa'
|
||||||
const MFA_BACKUP_CODES_URL = '/api/pleroma/accounts/mfa/backup_codes'
|
const MFA_BACKUP_CODES_URL = '/api/pleroma/accounts/mfa/backup_codes'
|
||||||
|
@ -745,6 +746,17 @@ const forceDisableMFA = ({ nickname, credentials }) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const approveAccount = ({ nickname, credentials }) => {
|
||||||
|
return promisedRequest({
|
||||||
|
url: ADMIN_APPROVE_ACCOUNT_URL,
|
||||||
|
method: 'PATCH',
|
||||||
|
payload: {
|
||||||
|
nicknames: [nickname]
|
||||||
|
},
|
||||||
|
credentials
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const fetchTimeline = ({
|
const fetchTimeline = ({
|
||||||
timeline,
|
timeline,
|
||||||
credentials,
|
credentials,
|
||||||
|
@ -1824,6 +1836,7 @@ const apiService = {
|
||||||
getPasswordResetToken,
|
getPasswordResetToken,
|
||||||
forcePasswordReset,
|
forcePasswordReset,
|
||||||
forceDisableMFA,
|
forceDisableMFA,
|
||||||
|
approveAccount,
|
||||||
register,
|
register,
|
||||||
getCaptcha,
|
getCaptcha,
|
||||||
updateProfileImages,
|
updateProfileImages,
|
||||||
|
|
|
@ -149,6 +149,8 @@ export const parseUser = (data) => {
|
||||||
output.profile_image_url = data.avatar
|
output.profile_image_url = data.avatar
|
||||||
output.profile_image_url_original = data.avatar
|
output.profile_image_url_original = data.avatar
|
||||||
output.is_local = data.local
|
output.is_local = data.local
|
||||||
|
output.approved = data.is_approved
|
||||||
|
output.registration_reason = data.registration_reason
|
||||||
output.emoji = []
|
output.emoji = []
|
||||||
} else {
|
} else {
|
||||||
output.screen_name = data.screen_name
|
output.screen_name = data.screen_name
|
||||||
|
|
Loading…
Reference in a new issue