mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
group settings add sidemenu
This commit is contained in:
parent
571e8fbddc
commit
e5a969b3f7
@ -46,7 +46,6 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleCategory(id) {
|
toggleCategory(id) {
|
||||||
console.log('toggleCategory', id)
|
|
||||||
this.selectedCategoryIds = xor(this.selectedCategoryIds, [id])
|
this.selectedCategoryIds = xor(this.selectedCategoryIds, [id])
|
||||||
if (this.$parentForm) {
|
if (this.$parentForm) {
|
||||||
this.$parentForm.update(this.model, this.selectedCategoryIds)
|
this.$parentForm.update(this.model, this.selectedCategoryIds)
|
||||||
|
|||||||
@ -18,7 +18,8 @@ const comment = {
|
|||||||
author: {
|
author: {
|
||||||
id: '1',
|
id: '1',
|
||||||
avatar: {
|
avatar: {
|
||||||
url: 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg',
|
url:
|
||||||
|
'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg',
|
||||||
},
|
},
|
||||||
slug: 'jenny-rostock',
|
slug: 'jenny-rostock',
|
||||||
name: 'Rainer Unsinn',
|
name: 'Rainer Unsinn',
|
||||||
|
|||||||
@ -103,7 +103,7 @@ export default {
|
|||||||
this.$apollo
|
this.$apollo
|
||||||
.mutate({
|
.mutate({
|
||||||
mutation: gql`
|
mutation: gql`
|
||||||
mutation ($id: ID!, $resource: [Deletable]) {
|
mutation($id: ID!, $resource: [Deletable]) {
|
||||||
DeleteUser(id: $id, resource: $resource) {
|
DeleteUser(id: $id, resource: $resource) {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,8 @@ const embed = {
|
|||||||
title: 'Video Titel',
|
title: 'Video Titel',
|
||||||
// html: null,
|
// html: null,
|
||||||
description: 'Video Description',
|
description: 'Video Description',
|
||||||
html: '<iframe width="auto" height="250" src="https://www.youtube.com/embed/qkdXAtO40Fo?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>',
|
html:
|
||||||
|
'<iframe width="auto" height="250" src="https://www.youtube.com/embed/qkdXAtO40Fo?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>',
|
||||||
}
|
}
|
||||||
|
|
||||||
const plugins = [
|
const plugins = [
|
||||||
|
|||||||
@ -33,7 +33,8 @@ describe('Embed.vue', () => {
|
|||||||
video: null,
|
video: null,
|
||||||
lang: 'de',
|
lang: 'de',
|
||||||
sources: ['resource', 'oembed'],
|
sources: ['resource', 'oembed'],
|
||||||
html: '<iframe width="480" height="270" src="https://www.youtube.com/embed/qkdXAtO40Fo?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>',
|
html:
|
||||||
|
'<iframe width="480" height="270" src="https://www.youtube.com/embed/qkdXAtO40Fo?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>',
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -114,7 +114,8 @@ describe('EmbedComponent.vue', () => {
|
|||||||
video: null,
|
video: null,
|
||||||
lang: 'de',
|
lang: 'de',
|
||||||
sources: ['resource', 'oembed'],
|
sources: ['resource', 'oembed'],
|
||||||
html: '<iframe width="480" height="270" src="https://www.youtube.com/embed/qkdXAtO40Fo?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>',
|
html:
|
||||||
|
'<iframe width="480" height="270" src="https://www.youtube.com/embed/qkdXAtO40Fo?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>',
|
||||||
}
|
}
|
||||||
wrapper = Wrapper()
|
wrapper = Wrapper()
|
||||||
})
|
})
|
||||||
|
|||||||
@ -83,7 +83,7 @@ export default {
|
|||||||
this.$apollo
|
this.$apollo
|
||||||
.query({
|
.query({
|
||||||
query: gql`
|
query: gql`
|
||||||
query ($postId: ID!, $data: _EMOTEDInput!) {
|
query($postId: ID!, $data: _EMOTEDInput!) {
|
||||||
PostsEmotionsCountByEmotion(postId: $postId, data: $data)
|
PostsEmotionsCountByEmotion(postId: $postId, data: $data)
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
|||||||
@ -1,24 +1,39 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<ds-container class="group-card">
|
<ds-container class="group-card">
|
||||||
{{ responseGroupListQuery }}
|
<ds-page-title heading="Groups"></ds-page-title>
|
||||||
<ds-space><h2>Group Card</h2></ds-space>
|
<ds-card v-for="item in items" :key="item.id" space="xx-small">
|
||||||
<ds-grid>
|
<nuxt-link to="/group/g1/testgruppe">{{ item.name }}</nuxt-link>
|
||||||
<ds-grid-item v-for="item in items" :key="item.id" :row-span="8">
|
{{ item.categories ? item.categories.map((category) => category.name) : [] }}
|
||||||
<ds-placeholder>
|
<div>{{ item }}</div>
|
||||||
<base-button v-if="item.owner" icon="trash" @click="deleteGroup(item)"></base-button>
|
<ds-space>
|
||||||
<nuxt-link to="/group/g1/testgruppe">{{ item.name }}</nuxt-link>
|
<base-button
|
||||||
<base-button
|
v-if="item.myRole === 'owner'"
|
||||||
v-if="!item.owner"
|
icon="trash"
|
||||||
icon="close"
|
@click="deleteGroup(item)"
|
||||||
@click="unfollowGroup(item.row)"
|
></base-button>
|
||||||
></base-button>
|
<base-button
|
||||||
<nuxt-link :to="{ name: 'group-create' }">
|
v-if="item.myRole === 'pending'"
|
||||||
<ds-icon v-show="item.owner" name="ellipsis-v"></ds-icon>
|
icon="question-circle"
|
||||||
</nuxt-link>
|
@click="removePending(item)"
|
||||||
</ds-placeholder>
|
></base-button>
|
||||||
</ds-grid-item>
|
<base-button
|
||||||
</ds-grid>
|
v-if="item.myRole === 'owner'"
|
||||||
|
icon="edit"
|
||||||
|
@click="editGroup(item)"
|
||||||
|
></base-button>
|
||||||
|
<base-button
|
||||||
|
v-if="item.myRole === 'usual'"
|
||||||
|
icon="close"
|
||||||
|
@click="unfollowGroup(item)"
|
||||||
|
></base-button>
|
||||||
|
<base-button
|
||||||
|
v-if="item.myRole === null"
|
||||||
|
icon="plus"
|
||||||
|
@click="addMemeberToGroup(item)"
|
||||||
|
></base-button>
|
||||||
|
</ds-space>
|
||||||
|
</ds-card>
|
||||||
</ds-container>
|
</ds-container>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -27,15 +42,23 @@ export default {
|
|||||||
name: 'GroupList',
|
name: 'GroupList',
|
||||||
props: {
|
props: {
|
||||||
items: { type: Array, default: () => [] },
|
items: { type: Array, default: () => [] },
|
||||||
responseGroupListQuery: { type: Array, default: () => [] },
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
removePending() {
|
||||||
|
alert('removePending group')
|
||||||
|
},
|
||||||
|
editGroup(item) {
|
||||||
|
this.$router.push({ path: `/group/edit/${item.id}` })
|
||||||
|
},
|
||||||
deleteGroup() {
|
deleteGroup() {
|
||||||
alert('delete group')
|
alert('delete group')
|
||||||
},
|
},
|
||||||
unfollowGroup() {
|
unfollowGroup() {
|
||||||
alert('unfollow group')
|
alert('unfollow group')
|
||||||
},
|
},
|
||||||
|
addMemeberToGroup() {
|
||||||
|
alert('addMemeberToGroup group')
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<ds-container>
|
<ds-container>
|
||||||
update: {{ update }}
|
|
||||||
<br />
|
|
||||||
this group: {{this.group}}
|
|
||||||
<ds-form
|
<ds-form
|
||||||
class="group-form"
|
class="group-form"
|
||||||
ref="groupForm"
|
ref="groupForm"
|
||||||
@ -91,7 +88,6 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
console.log('GroupForm group', this.group)
|
|
||||||
const { name, groupType, about, description, actionRadius, categories } = this.group
|
const { name, groupType, about, description, actionRadius, categories } = this.group
|
||||||
return {
|
return {
|
||||||
categoriesActive: this.$env.CATEGORIES_ACTIVE,
|
categoriesActive: this.$env.CATEGORIES_ACTIVE,
|
||||||
@ -126,14 +122,27 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
submit() {
|
submit() {
|
||||||
console.log('submit', this.formData)
|
const { name, about, description, groupType, actionRadius, categoryIds } = this.formData
|
||||||
const { name, about, description, actionRadius, categoryIds } = this.formData
|
|
||||||
this.update
|
this.update
|
||||||
? this.$emit('updateGroup', { name, about, description, actionRadius, categoryIds, id: this.group.id })
|
? this.$emit('updateGroup', {
|
||||||
: this.$emit('createGroup', this.formData)
|
name,
|
||||||
|
about,
|
||||||
|
description,
|
||||||
|
actionRadius,
|
||||||
|
categoryIds,
|
||||||
|
id: this.group.id,
|
||||||
|
})
|
||||||
|
: this.$emit('createGroup', {
|
||||||
|
name,
|
||||||
|
about,
|
||||||
|
description,
|
||||||
|
groupType,
|
||||||
|
actionRadius,
|
||||||
|
categoryIds,
|
||||||
|
})
|
||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
console.log('reset')
|
alert('reset')
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
15
webapp/components/Group/GroupLink.vue
Normal file
15
webapp/components/Group/GroupLink.vue
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div>
|
||||||
|
<ds-space><h3>Link zur Gruppe</h3></ds-space>
|
||||||
|
<ds-space>
|
||||||
|
<ds-copy-field>Copy Link for Invite Member please!</ds-copy-field>
|
||||||
|
</ds-space>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'GroupLink',
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -1,72 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<ds-container class="group-list">
|
|
||||||
<ds-space><h2>Group List</h2></ds-space>
|
|
||||||
<ds-table :data="items" :fields="fields">
|
|
||||||
<template slot="delete" slot-scope="scope">
|
|
||||||
<base-button
|
|
||||||
v-if="scope.row.myRole === 'owner'"
|
|
||||||
icon="trash"
|
|
||||||
@click="deleteGroup(scope.row)"
|
|
||||||
></base-button>
|
|
||||||
</template>
|
|
||||||
<template slot="name" slot-scope="scope">
|
|
||||||
<nuxt-link :to="`/group/g1/${scope.row.name}`">{{ scope.row.name }}</nuxt-link>
|
|
||||||
<small>{{ scope.row }}</small>
|
|
||||||
</template>
|
|
||||||
<template slot="categories" slot-scope="scope">
|
|
||||||
<ds-tag v-for="categorie in scope.row.categories" :key="categorie.id" color="primary">
|
|
||||||
{{ categorie.name }}
|
|
||||||
</ds-tag>
|
|
||||||
</template>
|
|
||||||
<template slot="edit" slot-scope="scope">
|
|
||||||
<base-button
|
|
||||||
v-if="scope.row.myRole === 'owner'"
|
|
||||||
icon="edit"
|
|
||||||
@click="editGroup(scope.row)"
|
|
||||||
></base-button>
|
|
||||||
|
|
||||||
<nuxt-link :to="{ name: 'group-create' }">
|
|
||||||
<ds-icon v-show="scope.row.owner" name="ellipsis-v"></ds-icon>
|
|
||||||
</nuxt-link>
|
|
||||||
</template>
|
|
||||||
<template slot="unfollow" slot-scope="scope">
|
|
||||||
<base-button
|
|
||||||
v-if="scope.row.myRole === 'usual'"
|
|
||||||
icon="close"
|
|
||||||
@click="unfollowGroup(scope.row)"
|
|
||||||
></base-button>
|
|
||||||
<base-button
|
|
||||||
v-if="scope.row.myRole === null"
|
|
||||||
icon="plus"
|
|
||||||
@click="addMemeberToGroup(scope.row)"
|
|
||||||
></base-button>
|
|
||||||
</template>
|
|
||||||
</ds-table>
|
|
||||||
</ds-container>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script lang="ts">
|
|
||||||
export default {
|
|
||||||
name: 'GroupList',
|
|
||||||
props: {
|
|
||||||
items: { type: Array, default: () => [] },
|
|
||||||
fields: { type: Array, default: () => [] },
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
editGroup(formData) {
|
|
||||||
this.$router.push({ path: `/group/edit/${formData.id}` })
|
|
||||||
},
|
|
||||||
deleteGroup() {
|
|
||||||
alert('delete group')
|
|
||||||
},
|
|
||||||
unfollowGroup() {
|
|
||||||
alert('unfollow group')
|
|
||||||
},
|
|
||||||
addMemeberToGroup() {
|
|
||||||
alert('addMemeberToGroup group')
|
|
||||||
},
|
|
||||||
},
|
|
||||||
computed: {},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@ -1,14 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div>
|
|
||||||
<ds-space><h3>Link zur Gruppe</h3></ds-space>
|
|
||||||
<ds-space>
|
|
||||||
<ds-copy-field>Copy Link for Invite Member please!</ds-copy-field>
|
|
||||||
</ds-space>
|
|
||||||
</div>
|
|
||||||
<br />
|
|
||||||
<hr />
|
|
||||||
<br />
|
|
||||||
<ds-space><h3>Members</h3></ds-space>
|
<ds-space><h3>Members</h3></ds-space>
|
||||||
<ds-table :data="tableData" :fields="tableFields">
|
<ds-table :data="tableData" :fields="tableFields">
|
||||||
<template slot="avatar">
|
<template slot="avatar">
|
||||||
|
|||||||
@ -82,7 +82,7 @@ export default {
|
|||||||
try {
|
try {
|
||||||
await this.$apollo.mutate({
|
await this.$apollo.mutate({
|
||||||
mutation: gql`
|
mutation: gql`
|
||||||
mutation ($id: ID!, $locale: String) {
|
mutation($id: ID!, $locale: String) {
|
||||||
UpdateUser(id: $id, locale: $locale) {
|
UpdateUser(id: $id, locale: $locale) {
|
||||||
id
|
id
|
||||||
locale
|
locale
|
||||||
|
|||||||
@ -127,7 +127,7 @@ export default {
|
|||||||
this.$apollo
|
this.$apollo
|
||||||
.mutate({
|
.mutate({
|
||||||
mutation: gql`
|
mutation: gql`
|
||||||
mutation ($id: ID!, $resource: [Deletable]) {
|
mutation($id: ID!, $resource: [Deletable]) {
|
||||||
DeleteUser(id: $id, resource: $resource) {
|
DeleteUser(id: $id, resource: $resource) {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,7 @@ export default {
|
|||||||
// await this.modalData.buttons.confirm.callback()
|
// await this.modalData.buttons.confirm.callback()
|
||||||
await this.$apollo.mutate({
|
await this.$apollo.mutate({
|
||||||
mutation: gql`
|
mutation: gql`
|
||||||
mutation ($resourceId: ID!, $disable: Boolean, $closed: Boolean) {
|
mutation($resourceId: ID!, $disable: Boolean, $closed: Boolean) {
|
||||||
review(resourceId: $resourceId, disable: $disable, closed: $closed) {
|
review(resourceId: $resourceId, disable: $disable, closed: $closed) {
|
||||||
disable
|
disable
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,7 +65,7 @@ export default {
|
|||||||
async handleSubmit(data) {
|
async handleSubmit(data) {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
const mutation = gql`
|
const mutation = gql`
|
||||||
mutation ($oldPassword: String!, $password: String!) {
|
mutation($oldPassword: String!, $password: String!) {
|
||||||
changePassword(oldPassword: $oldPassword, newPassword: $password)
|
changePassword(oldPassword: $oldPassword, newPassword: $password)
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
@ -93,7 +93,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
async handleSubmitPassword() {
|
async handleSubmitPassword() {
|
||||||
const mutation = gql`
|
const mutation = gql`
|
||||||
mutation ($nonce: String!, $email: String!, $password: String!) {
|
mutation($nonce: String!, $email: String!, $password: String!) {
|
||||||
resetPassword(nonce: $nonce, email: $email, newPassword: $password)
|
resetPassword(nonce: $nonce, email: $email, newPassword: $password)
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
@ -85,7 +85,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async handleSubmit() {
|
async handleSubmit() {
|
||||||
const mutation = gql`
|
const mutation = gql`
|
||||||
mutation ($email: String!) {
|
mutation($email: String!) {
|
||||||
requestPasswordReset(email: $email)
|
requestPasswordReset(email: $email)
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
@ -17,7 +17,8 @@ export const post = {
|
|||||||
author: {
|
author: {
|
||||||
id: 'u3',
|
id: 'u3',
|
||||||
avatar: {
|
avatar: {
|
||||||
url: 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg',
|
url:
|
||||||
|
'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg',
|
||||||
},
|
},
|
||||||
slug: 'jenny-rostock',
|
slug: 'jenny-rostock',
|
||||||
name: 'Rainer Unsinn',
|
name: 'Rainer Unsinn',
|
||||||
|
|||||||
@ -35,7 +35,7 @@ import normalizeEmail from '~/components/utils/NormalizeEmail'
|
|||||||
import translateErrorMessage from '~/components/utils/TranslateErrorMessage'
|
import translateErrorMessage from '~/components/utils/TranslateErrorMessage'
|
||||||
|
|
||||||
export const SignupMutation = gql`
|
export const SignupMutation = gql`
|
||||||
mutation ($email: String!, $inviteCode: String) {
|
mutation($email: String!, $inviteCode: String) {
|
||||||
Signup(email: $email, inviteCode: $inviteCode) {
|
Signup(email: $email, inviteCode: $inviteCode) {
|
||||||
email
|
email
|
||||||
}
|
}
|
||||||
@ -165,8 +165,9 @@ export default {
|
|||||||
})
|
})
|
||||||
this.setButtonValues()
|
this.setButtonValues()
|
||||||
|
|
||||||
const { email: responseEmail } =
|
const { email: responseEmail } = this.sliderData.sliders[
|
||||||
this.sliderData.sliders[this.sliderIndex].data.response.Signup
|
this.sliderIndex
|
||||||
|
].data.response.Signup
|
||||||
this.$toast.success(
|
this.$toast.success(
|
||||||
this.$t('components.registration.email.form.success', { email: responseEmail }),
|
this.$t('components.registration.email.form.success', { email: responseEmail }),
|
||||||
)
|
)
|
||||||
|
|||||||
@ -25,7 +25,7 @@ import gql from 'graphql-tag'
|
|||||||
import CONSTANTS_REGISTRATION from './../../constants/registration'
|
import CONSTANTS_REGISTRATION from './../../constants/registration'
|
||||||
|
|
||||||
export const isValidInviteCodeQuery = gql`
|
export const isValidInviteCodeQuery = gql`
|
||||||
query ($code: ID!) {
|
query($code: ID!) {
|
||||||
isValidInviteCode(code: $code)
|
isValidInviteCode(code: $code)
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
@ -30,7 +30,7 @@ import CONSTANTS_REGISTRATION from './../../constants/registration'
|
|||||||
import EmailDisplayAndVerify from './EmailDisplayAndVerify'
|
import EmailDisplayAndVerify from './EmailDisplayAndVerify'
|
||||||
|
|
||||||
export const verifyNonceQuery = gql`
|
export const verifyNonceQuery = gql`
|
||||||
query ($email: String!, $nonce: String!) {
|
query($email: String!, $nonce: String!) {
|
||||||
VerifyNonce(email: $email, nonce: $nonce)
|
VerifyNonce(email: $email, nonce: $nonce)
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
@ -70,7 +70,7 @@ import { SweetalertIcon } from 'vue-sweetalert-icons'
|
|||||||
import translateErrorMessage from '~/components/utils/TranslateErrorMessage'
|
import translateErrorMessage from '~/components/utils/TranslateErrorMessage'
|
||||||
|
|
||||||
export const SignupMutation = gql`
|
export const SignupMutation = gql`
|
||||||
mutation ($email: String!, $inviteCode: String) {
|
mutation($email: String!, $inviteCode: String) {
|
||||||
Signup(email: $email, inviteCode: $inviteCode) {
|
Signup(email: $email, inviteCode: $inviteCode) {
|
||||||
email
|
email
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,7 @@ export default {
|
|||||||
// await this.modalData.buttons.confirm.callback()
|
// await this.modalData.buttons.confirm.callback()
|
||||||
await this.$apollo.mutate({
|
await this.$apollo.mutate({
|
||||||
mutation: gql`
|
mutation: gql`
|
||||||
mutation ($resourceId: ID!, $disable: Boolean, $closed: Boolean) {
|
mutation($resourceId: ID!, $disable: Boolean, $closed: Boolean) {
|
||||||
review(resourceId: $resourceId, disable: $disable, closed: $closed) {
|
review(resourceId: $resourceId, disable: $disable, closed: $closed) {
|
||||||
disable
|
disable
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,7 +78,8 @@ export const searchResults = [
|
|||||||
id: 'u1',
|
id: 'u1',
|
||||||
__typename: 'User',
|
__typename: 'User',
|
||||||
avatar: {
|
avatar: {
|
||||||
url: 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg',
|
url:
|
||||||
|
'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg',
|
||||||
},
|
},
|
||||||
name: 'Peter Lustig',
|
name: 'Peter Lustig',
|
||||||
slug: 'peter-lustig',
|
slug: 'peter-lustig',
|
||||||
@ -87,7 +88,8 @@ export const searchResults = [
|
|||||||
id: 'cdbca762-0632-4564-b646-415a0c42d8b8',
|
id: 'cdbca762-0632-4564-b646-415a0c42d8b8',
|
||||||
__typename: 'User',
|
__typename: 'User',
|
||||||
avatar: {
|
avatar: {
|
||||||
url: 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg',
|
url:
|
||||||
|
'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg',
|
||||||
},
|
},
|
||||||
name: 'Herbert Schultz',
|
name: 'Herbert Schultz',
|
||||||
slug: 'herbert-schultz',
|
slug: 'herbert-schultz',
|
||||||
@ -96,7 +98,8 @@ export const searchResults = [
|
|||||||
id: 'u2',
|
id: 'u2',
|
||||||
__typename: 'User',
|
__typename: 'User',
|
||||||
avatar: {
|
avatar: {
|
||||||
url: 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg',
|
url:
|
||||||
|
'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg',
|
||||||
},
|
},
|
||||||
name: 'Bob der Baumeister',
|
name: 'Bob der Baumeister',
|
||||||
slug: 'bob-der-baumeister',
|
slug: 'bob-der-baumeister',
|
||||||
@ -105,7 +108,8 @@ export const searchResults = [
|
|||||||
id: '7b654f72-f4da-4315-8bed-39de0859754b',
|
id: '7b654f72-f4da-4315-8bed-39de0859754b',
|
||||||
__typename: 'User',
|
__typename: 'User',
|
||||||
avatar: {
|
avatar: {
|
||||||
url: 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg',
|
url:
|
||||||
|
'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg',
|
||||||
},
|
},
|
||||||
name: 'Tonya Mohr',
|
name: 'Tonya Mohr',
|
||||||
slug: 'tonya-mohr',
|
slug: 'tonya-mohr',
|
||||||
|
|||||||
@ -4,7 +4,7 @@ export default (i18n) => {
|
|||||||
const lang = i18n.locale().toUpperCase()
|
const lang = i18n.locale().toUpperCase()
|
||||||
return {
|
return {
|
||||||
CreateComment: gql`
|
CreateComment: gql`
|
||||||
mutation ($postId: ID!, $content: String!) {
|
mutation($postId: ID!, $content: String!) {
|
||||||
CreateComment(postId: $postId, content: $content) {
|
CreateComment(postId: $postId, content: $content) {
|
||||||
id
|
id
|
||||||
contentExcerpt
|
contentExcerpt
|
||||||
@ -36,7 +36,7 @@ export default (i18n) => {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
UpdateComment: gql`
|
UpdateComment: gql`
|
||||||
mutation ($content: String!, $id: ID!) {
|
mutation($content: String!, $id: ID!) {
|
||||||
UpdateComment(content: $content, id: $id) {
|
UpdateComment(content: $content, id: $id) {
|
||||||
id
|
id
|
||||||
contentExcerpt
|
contentExcerpt
|
||||||
|
|||||||
@ -13,7 +13,7 @@ export const DonationsQuery = () => gql`
|
|||||||
|
|
||||||
export const UpdateDonations = () => {
|
export const UpdateDonations = () => {
|
||||||
return gql`
|
return gql`
|
||||||
mutation ($showDonations: Boolean, $goal: Int, $progress: Int) {
|
mutation($showDonations: Boolean, $goal: Int, $progress: Int) {
|
||||||
UpdateDonations(showDonations: $showDonations, goal: $goal, progress: $progress) {
|
UpdateDonations(showDonations: $showDonations, goal: $goal, progress: $progress) {
|
||||||
id
|
id
|
||||||
showDonations
|
showDonations
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
export const AddEmailAddressMutation = gql`
|
export const AddEmailAddressMutation = gql`
|
||||||
mutation ($email: String!) {
|
mutation($email: String!) {
|
||||||
AddEmailAddress(email: $email) {
|
AddEmailAddress(email: $email) {
|
||||||
email
|
email
|
||||||
createdAt
|
createdAt
|
||||||
@ -10,7 +10,7 @@ export const AddEmailAddressMutation = gql`
|
|||||||
`
|
`
|
||||||
|
|
||||||
export const VerifyEmailAddressMutation = gql`
|
export const VerifyEmailAddressMutation = gql`
|
||||||
mutation ($email: String!, $nonce: String!) {
|
mutation($email: String!, $nonce: String!) {
|
||||||
VerifyEmailAddress(email: $email, nonce: $nonce) {
|
VerifyEmailAddress(email: $email, nonce: $nonce) {
|
||||||
email
|
email
|
||||||
verifiedAt
|
verifiedAt
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import gql from 'graphql-tag'
|
|||||||
|
|
||||||
export default function () {
|
export default function () {
|
||||||
return gql`
|
return gql`
|
||||||
query ($url: String!) {
|
query($url: String!) {
|
||||||
embed(url: $url) {
|
embed(url: $url) {
|
||||||
type
|
type
|
||||||
title
|
title
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import gql from 'graphql-tag'
|
|||||||
export const reportsListQuery = () => {
|
export const reportsListQuery = () => {
|
||||||
// no limit for the moment like before: "reports(first: 20, orderBy: createdAt_desc)"
|
// no limit for the moment like before: "reports(first: 20, orderBy: createdAt_desc)"
|
||||||
return gql`
|
return gql`
|
||||||
query (
|
query(
|
||||||
$orderBy: ReportOrdering
|
$orderBy: ReportOrdering
|
||||||
$first: Int
|
$first: Int
|
||||||
$offset: Int
|
$offset: Int
|
||||||
@ -94,7 +94,7 @@ export const reportsListQuery = () => {
|
|||||||
|
|
||||||
export const reportMutation = () => {
|
export const reportMutation = () => {
|
||||||
return gql`
|
return gql`
|
||||||
mutation ($resourceId: ID!, $reasonCategory: ReasonCategory!, $reasonDescription: String!) {
|
mutation($resourceId: ID!, $reasonCategory: ReasonCategory!, $reasonDescription: String!) {
|
||||||
fileReport(
|
fileReport(
|
||||||
resourceId: $resourceId
|
resourceId: $resourceId
|
||||||
reasonCategory: $reasonCategory
|
reasonCategory: $reasonCategory
|
||||||
@ -108,7 +108,7 @@ export const reportMutation = () => {
|
|||||||
|
|
||||||
export const reviewMutation = () => {
|
export const reviewMutation = () => {
|
||||||
return gql`
|
return gql`
|
||||||
mutation ($resourceId: ID!, $disable: Boolean, $closed: Boolean) {
|
mutation($resourceId: ID!, $disable: Boolean, $closed: Boolean) {
|
||||||
review(resourceId: $resourceId, disable: $disable, closed: $closed) {
|
review(resourceId: $resourceId, disable: $disable, closed: $closed) {
|
||||||
disable
|
disable
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import gql from 'graphql-tag'
|
|||||||
export default () => {
|
export default () => {
|
||||||
return {
|
return {
|
||||||
CreatePost: gql`
|
CreatePost: gql`
|
||||||
mutation ($title: String!, $content: String!, $categoryIds: [ID], $image: ImageInput) {
|
mutation($title: String!, $content: String!, $categoryIds: [ID], $image: ImageInput) {
|
||||||
CreatePost(title: $title, content: $content, categoryIds: $categoryIds, image: $image) {
|
CreatePost(title: $title, content: $content, categoryIds: $categoryIds, image: $image) {
|
||||||
title
|
title
|
||||||
slug
|
slug
|
||||||
@ -18,7 +18,7 @@ export default () => {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
UpdatePost: gql`
|
UpdatePost: gql`
|
||||||
mutation (
|
mutation(
|
||||||
$id: ID!
|
$id: ID!
|
||||||
$title: String!
|
$title: String!
|
||||||
$content: String!
|
$content: String!
|
||||||
@ -52,14 +52,14 @@ export default () => {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
DeletePost: gql`
|
DeletePost: gql`
|
||||||
mutation ($id: ID!) {
|
mutation($id: ID!) {
|
||||||
DeletePost(id: $id) {
|
DeletePost(id: $id) {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
AddPostEmotionsMutation: gql`
|
AddPostEmotionsMutation: gql`
|
||||||
mutation ($to: _PostInput!, $data: _EMOTEDInput!) {
|
mutation($to: _PostInput!, $data: _EMOTEDInput!) {
|
||||||
AddPostEmotions(to: $to, data: $data) {
|
AddPostEmotions(to: $to, data: $data) {
|
||||||
emotion
|
emotion
|
||||||
from {
|
from {
|
||||||
@ -72,7 +72,7 @@ export default () => {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
RemovePostEmotionsMutation: gql`
|
RemovePostEmotionsMutation: gql`
|
||||||
mutation ($to: _PostInput!, $data: _EMOTEDInput!) {
|
mutation($to: _PostInput!, $data: _EMOTEDInput!) {
|
||||||
RemovePostEmotions(to: $to, data: $data) {
|
RemovePostEmotions(to: $to, data: $data) {
|
||||||
emotion
|
emotion
|
||||||
from {
|
from {
|
||||||
@ -85,7 +85,7 @@ export default () => {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
pinPost: gql`
|
pinPost: gql`
|
||||||
mutation ($id: ID!) {
|
mutation($id: ID!) {
|
||||||
pinPost(id: $id) {
|
pinPost(id: $id) {
|
||||||
id
|
id
|
||||||
title
|
title
|
||||||
@ -102,7 +102,7 @@ export default () => {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
unpinPost: gql`
|
unpinPost: gql`
|
||||||
mutation ($id: ID!) {
|
mutation($id: ID!) {
|
||||||
unpinPost(id: $id) {
|
unpinPost(id: $id) {
|
||||||
id
|
id
|
||||||
title
|
title
|
||||||
@ -119,7 +119,7 @@ export default () => {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
markTeaserAsViewed: gql`
|
markTeaserAsViewed: gql`
|
||||||
mutation ($id: ID!) {
|
mutation($id: ID!) {
|
||||||
markTeaserAsViewed(id: $id) {
|
markTeaserAsViewed(id: $id) {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
export const SignupVerificationMutation = gql`
|
export const SignupVerificationMutation = gql`
|
||||||
mutation (
|
mutation(
|
||||||
$nonce: String!
|
$nonce: String!
|
||||||
$name: String!
|
$name: String!
|
||||||
$email: String!
|
$email: String!
|
||||||
|
|||||||
@ -5,7 +5,7 @@ export const searchQuery = gql`
|
|||||||
${userFragment}
|
${userFragment}
|
||||||
${postFragment}
|
${postFragment}
|
||||||
|
|
||||||
query ($query: String!) {
|
query($query: String!) {
|
||||||
searchResults(query: $query, limit: 5) {
|
searchResults(query: $query, limit: 5) {
|
||||||
__typename
|
__typename
|
||||||
... on Post {
|
... on Post {
|
||||||
@ -33,7 +33,7 @@ export const searchPosts = gql`
|
|||||||
${postFragment}
|
${postFragment}
|
||||||
${tagsCategoriesAndPinnedFragment}
|
${tagsCategoriesAndPinnedFragment}
|
||||||
|
|
||||||
query ($query: String!, $firstPosts: Int, $postsOffset: Int) {
|
query($query: String!, $firstPosts: Int, $postsOffset: Int) {
|
||||||
searchPosts(query: $query, firstPosts: $firstPosts, postsOffset: $postsOffset) {
|
searchPosts(query: $query, firstPosts: $firstPosts, postsOffset: $postsOffset) {
|
||||||
postCount
|
postCount
|
||||||
posts {
|
posts {
|
||||||
@ -55,7 +55,7 @@ export const searchPosts = gql`
|
|||||||
export const searchUsers = gql`
|
export const searchUsers = gql`
|
||||||
${userFragment}
|
${userFragment}
|
||||||
|
|
||||||
query ($query: String!, $firstUsers: Int, $usersOffset: Int) {
|
query($query: String!, $firstUsers: Int, $usersOffset: Int) {
|
||||||
searchUsers(query: $query, firstUsers: $firstUsers, usersOffset: $usersOffset) {
|
searchUsers(query: $query, firstUsers: $firstUsers, usersOffset: $usersOffset) {
|
||||||
userCount
|
userCount
|
||||||
users {
|
users {
|
||||||
@ -67,7 +67,7 @@ export const searchUsers = gql`
|
|||||||
`
|
`
|
||||||
|
|
||||||
export const searchHashtags = gql`
|
export const searchHashtags = gql`
|
||||||
query ($query: String!, $firstHashtags: Int, $hashtagsOffset: Int) {
|
query($query: String!, $firstHashtags: Int, $hashtagsOffset: Int) {
|
||||||
searchHashtags(query: $query, firstHashtags: $firstHashtags, hashtagsOffset: $hashtagsOffset) {
|
searchHashtags(query: $query, firstHashtags: $firstHashtags, hashtagsOffset: $hashtagsOffset) {
|
||||||
hashtagCount
|
hashtagCount
|
||||||
hashtags {
|
hashtags {
|
||||||
|
|||||||
@ -68,7 +68,7 @@ export const notificationQuery = (i18n) => {
|
|||||||
${commentFragment}
|
${commentFragment}
|
||||||
${postFragment}
|
${postFragment}
|
||||||
|
|
||||||
query ($read: Boolean, $orderBy: NotificationOrdering, $first: Int, $offset: Int) {
|
query($read: Boolean, $orderBy: NotificationOrdering, $first: Int, $offset: Int) {
|
||||||
notifications(read: $read, orderBy: $orderBy, first: $first, offset: $offset) {
|
notifications(read: $read, orderBy: $orderBy, first: $first, offset: $offset) {
|
||||||
id
|
id
|
||||||
read
|
read
|
||||||
@ -107,7 +107,7 @@ export const markAsReadMutation = (i18n) => {
|
|||||||
${commentFragment}
|
${commentFragment}
|
||||||
${postFragment}
|
${postFragment}
|
||||||
|
|
||||||
mutation ($id: ID!) {
|
mutation($id: ID!) {
|
||||||
markAsRead(id: $id) {
|
markAsRead(id: $id) {
|
||||||
id
|
id
|
||||||
read
|
read
|
||||||
@ -180,7 +180,7 @@ export const followUserMutation = (i18n) => {
|
|||||||
${userFragment}
|
${userFragment}
|
||||||
${userCountsFragment}
|
${userCountsFragment}
|
||||||
|
|
||||||
mutation ($id: ID!) {
|
mutation($id: ID!) {
|
||||||
followUser(id: $id) {
|
followUser(id: $id) {
|
||||||
...user
|
...user
|
||||||
...userCounts
|
...userCounts
|
||||||
@ -200,7 +200,7 @@ export const unfollowUserMutation = (i18n) => {
|
|||||||
${userFragment}
|
${userFragment}
|
||||||
${userCountsFragment}
|
${userCountsFragment}
|
||||||
|
|
||||||
mutation ($id: ID!) {
|
mutation($id: ID!) {
|
||||||
unfollowUser(id: $id) {
|
unfollowUser(id: $id) {
|
||||||
...user
|
...user
|
||||||
...userCounts
|
...userCounts
|
||||||
@ -217,7 +217,7 @@ export const unfollowUserMutation = (i18n) => {
|
|||||||
|
|
||||||
export const updateUserMutation = () => {
|
export const updateUserMutation = () => {
|
||||||
return gql`
|
return gql`
|
||||||
mutation (
|
mutation(
|
||||||
$id: ID!
|
$id: ID!
|
||||||
$slug: String
|
$slug: String
|
||||||
$name: String
|
$name: String
|
||||||
@ -260,7 +260,7 @@ export const updateUserMutation = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const checkSlugAvailableQuery = gql`
|
export const checkSlugAvailableQuery = gql`
|
||||||
query ($slug: String!) {
|
query($slug: String!) {
|
||||||
User(slug: $slug) {
|
User(slug: $slug) {
|
||||||
slug
|
slug
|
||||||
}
|
}
|
||||||
@ -303,7 +303,7 @@ export const userDataQuery = (i18n) => {
|
|||||||
${userFragment}
|
${userFragment}
|
||||||
${postFragment}
|
${postFragment}
|
||||||
${commentFragment}
|
${commentFragment}
|
||||||
query ($id: ID!) {
|
query($id: ID!) {
|
||||||
userData(id: $id) {
|
userData(id: $id) {
|
||||||
user {
|
user {
|
||||||
...user
|
...user
|
||||||
|
|||||||
@ -10,7 +10,7 @@ export const FetchAllRoles = () => {
|
|||||||
|
|
||||||
export const updateUserRole = (role, id) => {
|
export const updateUserRole = (role, id) => {
|
||||||
return gql`
|
return gql`
|
||||||
mutation ($role: UserRole!, $id: ID!) {
|
mutation($role: UserRole!, $id: ID!) {
|
||||||
switchUserRole(role: $role, id: $id) {
|
switchUserRole(role: $role, id: $id) {
|
||||||
name
|
name
|
||||||
role
|
role
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import gql from 'graphql-tag'
|
|||||||
// ------ mutations
|
// ------ mutations
|
||||||
|
|
||||||
export const createGroupMutation = gql`
|
export const createGroupMutation = gql`
|
||||||
mutation (
|
mutation(
|
||||||
$id: ID
|
$id: ID
|
||||||
$name: String!
|
$name: String!
|
||||||
$slug: String
|
$slug: String
|
||||||
@ -49,7 +49,7 @@ export const createGroupMutation = gql`
|
|||||||
`
|
`
|
||||||
|
|
||||||
export const updateGroupMutation = gql`
|
export const updateGroupMutation = gql`
|
||||||
mutation (
|
mutation(
|
||||||
$id: ID!
|
$id: ID!
|
||||||
$name: String
|
$name: String
|
||||||
$slug: String
|
$slug: String
|
||||||
@ -96,7 +96,7 @@ export const updateGroupMutation = gql`
|
|||||||
`
|
`
|
||||||
|
|
||||||
export const joinGroupMutation = gql`
|
export const joinGroupMutation = gql`
|
||||||
mutation ($groupId: ID!, $userId: ID!) {
|
mutation($groupId: ID!, $userId: ID!) {
|
||||||
JoinGroup(groupId: $groupId, userId: $userId) {
|
JoinGroup(groupId: $groupId, userId: $userId) {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
@ -107,7 +107,7 @@ export const joinGroupMutation = gql`
|
|||||||
`
|
`
|
||||||
|
|
||||||
export const changeGroupMemberRoleMutation = gql`
|
export const changeGroupMemberRoleMutation = gql`
|
||||||
mutation ($groupId: ID!, $userId: ID!, $roleInGroup: GroupMemberRole!) {
|
mutation($groupId: ID!, $userId: ID!, $roleInGroup: GroupMemberRole!) {
|
||||||
ChangeGroupMemberRole(groupId: $groupId, userId: $userId, roleInGroup: $roleInGroup) {
|
ChangeGroupMemberRole(groupId: $groupId, userId: $userId, roleInGroup: $roleInGroup) {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
@ -120,7 +120,7 @@ export const changeGroupMemberRoleMutation = gql`
|
|||||||
// ------ queries
|
// ------ queries
|
||||||
|
|
||||||
export const groupQuery = gql`
|
export const groupQuery = gql`
|
||||||
query (
|
query(
|
||||||
$isMember: Boolean
|
$isMember: Boolean
|
||||||
$id: ID
|
$id: ID
|
||||||
$name: String
|
$name: String
|
||||||
@ -177,7 +177,7 @@ export const groupQuery = gql`
|
|||||||
`
|
`
|
||||||
|
|
||||||
export const groupMembersQuery = gql`
|
export const groupMembersQuery = gql`
|
||||||
query ($id: ID!, $first: Int, $offset: Int, $orderBy: [_UserOrdering], $filter: _UserFilter) {
|
query($id: ID!, $first: Int, $offset: Int, $orderBy: [_UserOrdering], $filter: _UserFilter) {
|
||||||
GroupMembers(id: $id, first: $first, offset: $offset, orderBy: $orderBy, filter: $filter) {
|
GroupMembers(id: $id, first: $first, offset: $offset, orderBy: $orderBy, filter: $filter) {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
export const queryLocations = () => gql`
|
export const queryLocations = () => gql`
|
||||||
query ($place: String!, $lang: String!) {
|
query($place: String!, $lang: String!) {
|
||||||
queryLocations(place: $place, lang: $lang) {
|
queryLocations(place: $place, lang: $lang) {
|
||||||
place_name
|
place_name
|
||||||
id
|
id
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export const blockedUsers = () => {
|
|||||||
|
|
||||||
export const blockUser = () => {
|
export const blockUser = () => {
|
||||||
return gql`
|
return gql`
|
||||||
mutation ($id: ID!) {
|
mutation($id: ID!) {
|
||||||
blockUser(id: $id) {
|
blockUser(id: $id) {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
@ -33,7 +33,7 @@ export const blockUser = () => {
|
|||||||
|
|
||||||
export const unblockUser = () => {
|
export const unblockUser = () => {
|
||||||
return gql`
|
return gql`
|
||||||
mutation ($id: ID!) {
|
mutation($id: ID!) {
|
||||||
unblockUser(id: $id) {
|
unblockUser(id: $id) {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export const mutedUsers = () => {
|
|||||||
|
|
||||||
export const muteUser = () => {
|
export const muteUser = () => {
|
||||||
return gql`
|
return gql`
|
||||||
mutation ($id: ID!) {
|
mutation($id: ID!) {
|
||||||
muteUser(id: $id) {
|
muteUser(id: $id) {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
@ -33,7 +33,7 @@ export const muteUser = () => {
|
|||||||
|
|
||||||
export const unmuteUser = () => {
|
export const unmuteUser = () => {
|
||||||
return gql`
|
return gql`
|
||||||
mutation ($id: ID!) {
|
mutation($id: ID!) {
|
||||||
unmuteUser(id: $id) {
|
unmuteUser(id: $id) {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
|
|||||||
@ -139,7 +139,7 @@ export default {
|
|||||||
User: {
|
User: {
|
||||||
query() {
|
query() {
|
||||||
return gql`
|
return gql`
|
||||||
query ($filter: _UserFilter, $first: Int, $offset: Int, $email: String) {
|
query($filter: _UserFilter, $first: Int, $offset: Int, $email: String) {
|
||||||
User(
|
User(
|
||||||
email: $email
|
email: $email
|
||||||
filter: $filter
|
filter: $filter
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import PersistentLinks from '~/mixins/persistentLinks.js'
|
|||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
queryId: gql`
|
queryId: gql`
|
||||||
query ($idOrSlug: ID) {
|
query($idOrSlug: ID) {
|
||||||
Group(id: $idOrSlug) {
|
Group(id: $idOrSlug) {
|
||||||
id
|
id
|
||||||
slug
|
slug
|
||||||
@ -16,7 +16,7 @@ const options = {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
querySlug: gql`
|
querySlug: gql`
|
||||||
query ($idOrSlug: String) {
|
query($idOrSlug: String) {
|
||||||
Group(slug: $idOrSlug) {
|
Group(slug: $idOrSlug) {
|
||||||
id
|
id
|
||||||
slug
|
slug
|
||||||
|
|||||||
@ -28,18 +28,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async createGroup(form) {
|
async createGroup(value) {
|
||||||
try {
|
try {
|
||||||
await this.$apollo.mutate({
|
await this.$apollo.mutate({
|
||||||
mutation: createGroupMutation,
|
mutation: createGroupMutation,
|
||||||
variables: {
|
variables: value,
|
||||||
name: form.name,
|
|
||||||
about: form.about,
|
|
||||||
description: form.description,
|
|
||||||
groupType: form.groupType,
|
|
||||||
actionRadius: form.actionRadius,
|
|
||||||
categoryIds: form.formData.categoryIds,
|
|
||||||
},
|
|
||||||
update: (_, { data: { createGroupData } }) => {
|
update: (_, { data: { createGroupData } }) => {
|
||||||
// const { sendNotificationEmails } = createGroup
|
// const { sendNotificationEmails } = createGroup
|
||||||
// this.setCreateGroup({
|
// this.setCreateGroup({
|
||||||
|
|||||||
@ -1,52 +1,72 @@
|
|||||||
<template>
|
<template>
|
||||||
<ds-flex gutter="small">
|
<div>
|
||||||
<ds-flex-item :width="{ base: '100%', md: '200px' }">
|
<ds-page-title heading="Group Setting"></ds-page-title>
|
||||||
<ds-menu :routes="routes" :is-exact="() => true" />
|
<ds-flex gutter="small">
|
||||||
</ds-flex-item>
|
<ds-flex-item :width="{ base: '100%', md: '200px' }">
|
||||||
<ds-flex-item :width="{ base: '100%', md: 1 }">
|
<ds-list>
|
||||||
<transition name="slide-up" appear>
|
<ds-list-item>
|
||||||
<group-form @updateGroup="updateGroup" :group="group" :update="true" />
|
<div @click="menu = 'default'">
|
||||||
</transition>
|
<ds-text :color="menu === 'default' ? 'primary' : ''" Group data>Group Data</ds-text>
|
||||||
</ds-flex-item>
|
</div>
|
||||||
</ds-flex>
|
</ds-list-item>
|
||||||
|
<ds-list-item>
|
||||||
|
<div @click="menu = 'members'">
|
||||||
|
<ds-text :color="menu === 'members' ? 'primary' : ''" Group data>Members</ds-text>
|
||||||
|
</div>
|
||||||
|
</ds-list-item>
|
||||||
|
<ds-list-item>
|
||||||
|
<div @click="menu = 'socialMedia'">
|
||||||
|
<ds-text :color="menu === 'socialMedia' ? 'primary' : ''" Group data>
|
||||||
|
Social Media
|
||||||
|
</ds-text>
|
||||||
|
</div>
|
||||||
|
</ds-list-item>
|
||||||
|
<ds-list-item>
|
||||||
|
<div @click="menu = 'links'">
|
||||||
|
<ds-text :color="menu === 'links' ? 'primary' : ''" Group data>Links</ds-text>
|
||||||
|
</div>
|
||||||
|
</ds-list-item>
|
||||||
|
</ds-list>
|
||||||
|
</ds-flex-item>
|
||||||
|
<ds-flex-item :width="{ base: '100%', md: 1 }">
|
||||||
|
<group-form
|
||||||
|
v-show="menu === 'default'"
|
||||||
|
@updateGroup="updateGroup"
|
||||||
|
:group="group"
|
||||||
|
:update="true"
|
||||||
|
/>
|
||||||
|
<group-member v-show="menu === 'members'" />
|
||||||
|
<div v-show="menu === 'socialMedia'">Social Media</div>
|
||||||
|
<group-link v-show="menu === 'links'" />
|
||||||
|
</ds-flex-item>
|
||||||
|
</ds-flex>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import GroupForm from '~/components/Group/GroupForm'
|
import GroupForm from '~/components/Group/GroupForm'
|
||||||
|
import GroupMember from '~/components/Group/GroupMember'
|
||||||
|
import GroupLink from '~/components/Group/GroupLink'
|
||||||
import { groupQuery, updateGroupMutation } from '~/graphql/groups.js'
|
import { groupQuery, updateGroupMutation } from '~/graphql/groups.js'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
GroupForm,
|
GroupForm,
|
||||||
|
GroupMember,
|
||||||
|
GroupLink,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
menu: 'default',
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
routes() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
name: 'default',
|
|
||||||
path: ``,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'members',
|
|
||||||
path: ``,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'social media',
|
|
||||||
path: ``,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'invite link',
|
|
||||||
path: ``,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
...mapGetters({
|
...mapGetters({
|
||||||
user: 'auth/user',
|
user: 'auth/user',
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
async asyncData(context) {
|
async asyncData(context) {
|
||||||
console.log('asyncData start')
|
|
||||||
const {
|
const {
|
||||||
app,
|
app,
|
||||||
error,
|
error,
|
||||||
@ -61,9 +81,6 @@ export default {
|
|||||||
query: groupQuery,
|
query: groupQuery,
|
||||||
variables: { id },
|
variables: { id },
|
||||||
})
|
})
|
||||||
console.log('asyncData group', group)
|
|
||||||
console.log('asyncData id', id)
|
|
||||||
console.log('asyncData group.myRole', group.myRole)
|
|
||||||
if (group.myRole !== 'owner') {
|
if (group.myRole !== 'owner') {
|
||||||
error({ statusCode: 403, message: 'NONONNNO' })
|
error({ statusCode: 403, message: 'NONONNNO' })
|
||||||
}
|
}
|
||||||
@ -71,7 +88,6 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async updateGroup(value) {
|
async updateGroup(value) {
|
||||||
console.log('updateGroup form', value)
|
|
||||||
try {
|
try {
|
||||||
await this.$apollo.mutate({
|
await this.$apollo.mutate({
|
||||||
mutation: updateGroupMutation,
|
mutation: updateGroupMutation,
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
<div>
|
<div>
|
||||||
<div>my groups</div>
|
<div>my groups</div>
|
||||||
<group-teaser />
|
<group-teaser />
|
||||||
<group-list :items="responseGroupListQuery" :fields="fields" />
|
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<group-card :items="responseGroupListQuery" />
|
<group-card :items="responseGroupListQuery" />
|
||||||
@ -10,28 +9,18 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import GroupTeaser from '~/components/Group/GroupTeaser.vue'
|
import GroupTeaser from '~/components/Group/GroupTeaser.vue'
|
||||||
import GroupList from '~/components/Group/GroupList.vue'
|
|
||||||
import GroupCard from '~/components/Group/GroupCard.vue'
|
import GroupCard from '~/components/Group/GroupCard.vue'
|
||||||
import { groupQuery } from '~/graphql/groups.js'
|
import { groupQuery } from '~/graphql/groups.js'
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* groupType: { public, closed, hidden }
|
|
||||||
* myRole: { pending, usual, admin, owner }
|
|
||||||
* actionRadius { regional, national, continental, global, interplanetary
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MyGroups',
|
name: 'MyGroups',
|
||||||
components: {
|
components: {
|
||||||
GroupTeaser,
|
GroupTeaser,
|
||||||
GroupList,
|
|
||||||
GroupCard,
|
GroupCard,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
responseGroupListQuery: [],
|
responseGroupListQuery: [],
|
||||||
fields: ['delete', 'name', 'about', 'categories', 'edit', 'unfollow'],
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import PersistentLinks from '~/mixins/persistentLinks.js'
|
|||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
queryId: gql`
|
queryId: gql`
|
||||||
query ($idOrSlug: ID) {
|
query($idOrSlug: ID) {
|
||||||
Post(id: $idOrSlug) {
|
Post(id: $idOrSlug) {
|
||||||
id
|
id
|
||||||
slug
|
slug
|
||||||
@ -27,7 +27,7 @@ const options = {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
querySlug: gql`
|
querySlug: gql`
|
||||||
query ($idOrSlug: String) {
|
query($idOrSlug: String) {
|
||||||
Post(slug: $idOrSlug) {
|
Post(slug: $idOrSlug) {
|
||||||
id
|
id
|
||||||
slug
|
slug
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import PersistentLinks from '~/mixins/persistentLinks.js'
|
|||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
queryId: gql`
|
queryId: gql`
|
||||||
query ($idOrSlug: ID) {
|
query($idOrSlug: ID) {
|
||||||
User(id: $idOrSlug) {
|
User(id: $idOrSlug) {
|
||||||
id
|
id
|
||||||
slug
|
slug
|
||||||
@ -16,7 +16,7 @@ const options = {
|
|||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
querySlug: gql`
|
querySlug: gql`
|
||||||
query ($idOrSlug: String) {
|
query($idOrSlug: String) {
|
||||||
User(slug: $idOrSlug) {
|
User(slug: $idOrSlug) {
|
||||||
id
|
id
|
||||||
slug
|
slug
|
||||||
|
|||||||
@ -112,7 +112,7 @@ export default {
|
|||||||
let mutation, variables, successMessage
|
let mutation, variables, successMessage
|
||||||
if (isCreation) {
|
if (isCreation) {
|
||||||
mutation = gql`
|
mutation = gql`
|
||||||
mutation ($url: String!) {
|
mutation($url: String!) {
|
||||||
CreateSocialMedia(url: $url) {
|
CreateSocialMedia(url: $url) {
|
||||||
id
|
id
|
||||||
url
|
url
|
||||||
@ -123,7 +123,7 @@ export default {
|
|||||||
successMessage = thisList.$t('settings.social-media.successAdd')
|
successMessage = thisList.$t('settings.social-media.successAdd')
|
||||||
} else {
|
} else {
|
||||||
mutation = gql`
|
mutation = gql`
|
||||||
mutation ($id: ID!, $url: String!) {
|
mutation($id: ID!, $url: String!) {
|
||||||
UpdateSocialMedia(id: $id, url: $url) {
|
UpdateSocialMedia(id: $id, url: $url) {
|
||||||
id
|
id
|
||||||
url
|
url
|
||||||
@ -160,7 +160,7 @@ export default {
|
|||||||
try {
|
try {
|
||||||
await thisList.$apollo.mutate({
|
await thisList.$apollo.mutate({
|
||||||
mutation: gql`
|
mutation: gql`
|
||||||
mutation ($id: ID!) {
|
mutation($id: ID!) {
|
||||||
DeleteSocialMedia(id: $id) {
|
DeleteSocialMedia(id: $id) {
|
||||||
id
|
id
|
||||||
url
|
url
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user