Add "deactivated user" card

https://git.pleroma.social/pleroma/pleroma-fe/-/merge_requests/1417
This commit is contained in:
Sam Therapy 2021-12-18 15:02:22 -06:00
parent 86fee257a2
commit 462f50e9db
Signed by: sam
GPG key ID: 4D8B07C18F31ACBD
5 changed files with 20 additions and 4 deletions

View file

@ -1,6 +1,6 @@
import { requestFollow, requestUnfollow } from '../../services/follow_manipulate/follow_manipulate'
export default {
props: ['relationship', 'labelFollowing', 'buttonClass'],
props: ['relationship', 'user', 'labelFollowing', 'buttonClass'],
data () {
return {
inProgress: false
@ -29,6 +29,9 @@ export default {
} else {
return this.$t('user_card.follow')
}
},
disabled () {
return this.inProgress || this.user.deactivated
}
},
methods: {

View file

@ -2,7 +2,7 @@
<button
class="btn button-default follow-button"
:class="{ toggled: isPressed }"
:disabled="inProgress"
:disabled="disabled"
:title="title"
@click="onClick"
>

View file

@ -82,6 +82,12 @@
@{{ user.screen_name_ui }}
</router-link>
<template v-if="!hideBio">
<span
v-if="user.deactivated"
class="alert user-role"
>
{{ $t('user_card.deactivated') }}
</span>
<span
v-if="!!visibleRole"
class="alert user-role"
@ -160,7 +166,10 @@
class="user-interactions"
>
<div class="btn-group">
<FollowButton :relationship="relationship" />
<FollowButton
:relationship="relationship"
:user="user"
/>
<template v-if="relationship.following">
<ProgressButton
v-if="!relationship.subscribing"
@ -195,6 +204,7 @@
<button
v-if="relationship.muting"
class="btn button-default btn-block toggled"
:disabled="user.deactivated"
@click="unmuteUser"
>
{{ $t('user_card.muted') }}
@ -202,6 +212,7 @@
<button
v-else
class="btn button-default btn-block"
:disabled="user.deactivated"
@click="muteUser"
>
{{ $t('user_card.mute') }}
@ -210,6 +221,7 @@
<div>
<button
class="btn button-default btn-block"
:disabled="user.deactivated"
@click="mentionUser"
>
{{ $t('user_card.mention') }}

View file

@ -752,6 +752,7 @@
"approve": "Approve",
"block": "Block",
"blocked": "Blocked!",
"deactivated": "Deactivated",
"deny": "Deny",
"edit_profile": "Edit profile",
"favorites": "Favorites",

View file

@ -399,7 +399,7 @@ const users = {
toggleActivationStatus ({ rootState, commit }, { user }) {
const api = user.deactivated ? rootState.api.backendInteractor.activateUser : rootState.api.backendInteractor.deactivateUser
api({ user })
.then(({ deactivated }) => commit('updateActivationStatus', { user, deactivated }))
.then((user) => { let deactivated = !user.is_active; commit('updateActivationStatus', { user, deactivated }) })
},
registerPushNotifications (store) {
const token = store.state.currentUser.credentials