logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 6509542dbdb22d7df0d6994fa6af9aaa4df1d700
parent 756f7bf7c2ee1beb7b43227271942130fd03c7cb
Author: HJ <30-hj@users.noreply.git.pleroma.social>
Date:   Wed, 19 Jan 2022 13:09:49 +0000

Merge branch 'fixes_for_deactivated_profile' into 'develop'

Improve the user card for deactivated users

See merge request pleroma/pleroma-fe!1417

Diffstat:

Msrc/components/follow_button/follow_button.js5++++-
Msrc/components/follow_button/follow_button.vue2+-
Msrc/components/user_card/user_card.vue14+++++++++++++-
Msrc/i18n/en.json1+
Msrc/modules/users.js2+-
5 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/src/components/follow_button/follow_button.js b/src/components/follow_button/follow_button.js @@ -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: { diff --git a/src/components/follow_button/follow_button.vue b/src/components/follow_button/follow_button.vue @@ -2,7 +2,7 @@ <button class="btn button-default follow-button" :class="{ toggled: isPressed }" - :disabled="inProgress" + :disabled="disabled" :title="title" @click="onClick" > diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue @@ -83,6 +83,12 @@ </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') }} diff --git a/src/i18n/en.json b/src/i18n/en.json @@ -727,6 +727,7 @@ "approve": "Approve", "block": "Block", "blocked": "Blocked!", + "deactivated": "Deactivated", "deny": "Deny", "edit_profile": "Edit profile", "favorites": "Favorites", diff --git a/src/modules/users.js b/src/modules/users.js @@ -393,7 +393,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