2106-unblock a user in the user settings

This commit is contained in:
ogerly 2019-11-02 07:59:35 +01:00 committed by roschaefer
parent 90211b878c
commit 958b88ceda
3 changed files with 22 additions and 5 deletions

View File

@ -313,12 +313,14 @@
},
"columns": {
"name": "Name",
"slug": "Alias"
"slug": "Alias",
"unblk": "Entblocken"
},
"empty": "Bislang hast du niemanden blockiert.",
"how-to": "Du kannst andere Benutzer auf deren Profilseite über das Inhaltsmenü blockieren.",
"block": "Nutzer blockieren",
"unblock": "Nutzer entblocken"
"unblock": "Nutzer entblocken",
"unblocked": " ist wieder entblockt"
}
},
"admin": {

View File

@ -314,12 +314,14 @@
},
"columns": {
"name": "Name",
"slug": "Slug"
"slug": "Slug",
"unblk": "Unblock"
},
"empty": "So far, you have not blocked anybody.",
"how-to": "You can block other users on their profile page via the content menu.",
"block": "Block user",
"unblock": "Unblock user"
"unblock": "Unblock user",
"unblocked": " is unblocked again"
}
},
"admin": {

View File

@ -56,6 +56,11 @@
<b>{{ scope.row.slug | truncate(20) }}</b>
</nuxt-link>
</template>
<template slot="unblock" slot-scope="scope" >
<ds-button size="small" @click="unblock(scope)"><ds-icon name="power-off" /></ds-button>
</template>
</ds-table>
</ds-card>
<ds-card v-else>
@ -74,7 +79,7 @@
</template>
<script>
import { BlockedUsers } from '~/graphql/settings/BlockedUsers'
import { BlockedUsers, Unblock} from '~/graphql/settings/BlockedUsers'
import HcAvatar from '~/components/Avatar/Avatar.vue'
export default {
@ -92,12 +97,20 @@ export default {
avatar: '',
name: this.$t('settings.blocked-users.columns.name'),
slug: this.$t('settings.blocked-users.columns.slug'),
unblock: this.$t('settings.blocked-users.columns.unblock'),
}
},
},
apollo: {
blockedUsers: { query: BlockedUsers, fetchPolicy: 'cache-and-network' },
},
methods: {
async unblock(user) {
await this.$apollo.mutate({ mutation: Unblock(), variables: { id: user.row.id } })
this.$apollo.queries.blockedUsers.refetch()
this.$toast.success(user.row.slug + " " + this.$t('settings.blocked-users.unblocked'))
},
},
}
</script>