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