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": { "columns": {
"name": "Name", "name": "Name",
"slug": "Alias" "slug": "Alias",
"unblk": "Entblocken"
}, },
"empty": "Bislang hast du niemanden blockiert.", "empty": "Bislang hast du niemanden blockiert.",
"how-to": "Du kannst andere Benutzer auf deren Profilseite über das Inhaltsmenü blockieren.", "how-to": "Du kannst andere Benutzer auf deren Profilseite über das Inhaltsmenü blockieren.",
"block": "Nutzer blockieren", "block": "Nutzer blockieren",
"unblock": "Nutzer entblocken" "unblock": "Nutzer entblocken",
"unblocked": " ist wieder entblockt"
} }
}, },
"admin": { "admin": {

View File

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

View File

@ -56,6 +56,11 @@
<b>{{ scope.row.slug | truncate(20) }}</b> <b>{{ scope.row.slug | truncate(20) }}</b>
</nuxt-link> </nuxt-link>
</template> </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-table>
</ds-card> </ds-card>
<ds-card v-else> <ds-card v-else>
@ -74,7 +79,7 @@
</template> </template>
<script> <script>
import { BlockedUsers } from '~/graphql/settings/BlockedUsers' import { BlockedUsers, Unblock} from '~/graphql/settings/BlockedUsers'
import HcAvatar from '~/components/Avatar/Avatar.vue' import HcAvatar from '~/components/Avatar/Avatar.vue'
export default { export default {
@ -92,12 +97,20 @@ export default {
avatar: '', avatar: '',
name: this.$t('settings.blocked-users.columns.name'), name: this.$t('settings.blocked-users.columns.name'),
slug: this.$t('settings.blocked-users.columns.slug'), slug: this.$t('settings.blocked-users.columns.slug'),
unblock: this.$t('settings.blocked-users.columns.unblock'),
} }
}, },
}, },
apollo: { apollo: {
blockedUsers: { query: BlockedUsers, fetchPolicy: 'cache-and-network' }, 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> </script>