Wolfgang Huß 2aa85d7b05 Merge branch '5059-epic-groups' of github.com:Ocelot-Social-Community/Ocelot-Social into 5344-add-group-members-management
# Conflicts:
#	backend/src/db/graphql/groups.js
#	backend/src/schema/resolvers/groups.js
#	webapp/components/Group/GroupCard.vue
#	webapp/components/Group/GroupForm.vue
#	webapp/components/Group/GroupTeaser.vue
#	webapp/graphql/groups.js
#	webapp/locales/de.json
#	webapp/locales/en.json
#	webapp/pages/group/edit/_id.vue
2022-09-23 15:04:49 +02:00

69 lines
1.6 KiB
Vue

<template>
<div>
<ds-section>
<h1 class="ds-heading ds-heading-h1">{{ group.name }}</h1>
<div class="">{{ $t('group.settings') }}</div>
</ds-section>
<ds-space margin="large">
<ds-flex gutter="small">
<ds-flex-item :width="{ base: '100%', md: '200px' }">
<ds-menu :routes="routes" :is-exact="() => true" />
</ds-flex-item>
<ds-flex-item :width="{ base: '100%', md: 1 }">
<transition name="slide-up" appear>
<nuxt-child :group="group" />
</transition>
</ds-flex-item>
</ds-flex>
</ds-space>
<ds-space centered>
<nuxt-link to="/my-groups">{{ $t('group.back') }}</nuxt-link>
</ds-space>
</div>
</template>
<script>
import { groupQuery } from '~/graphql/groups.js'
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters({
user: 'auth/user',
}),
routes() {
return [
{
name: this.$t('group.general'),
path: `/group/edit/${this.group.id}`,
},
{
name: this.$t('group.members'),
path: `/group/edit/${this.group.id}/members`,
},
]
},
},
async asyncData(context) {
const {
app,
error,
params: { id },
} = context
const client = app.apolloProvider.defaultClient
const {
data: {
Group: [group],
},
} = await client.query({
query: groupQuery(), // "this.$i18n" is undefined here, so we use default lang
variables: { id },
})
if (group.myRole !== 'owner') {
error({ statusCode: 403, message: 'NONONNNO' })
}
return { group }
},
}
</script>