mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Merge branch 'master' of github.com:Human-Connection/Human-Connection into 1017-send-out-notifications-on-create-omment
This commit is contained in:
commit
caff74e58b
@ -151,7 +151,6 @@ export default {
|
|||||||
friendsCount: '<-[:FRIENDS]->(related:User)',
|
friendsCount: '<-[:FRIENDS]->(related:User)',
|
||||||
followingCount: '-[:FOLLOWS]->(related:User)',
|
followingCount: '-[:FOLLOWS]->(related:User)',
|
||||||
followedByCount: '<-[:FOLLOWS]-(related:User)',
|
followedByCount: '<-[:FOLLOWS]-(related:User)',
|
||||||
commentsCount: '-[:WROTE]->(r:Comment)',
|
|
||||||
commentedCount: '-[:WROTE]->(:Comment)-[:COMMENTS]->(related:Post)',
|
commentedCount: '-[:WROTE]->(:Comment)-[:COMMENTS]->(related:Post)',
|
||||||
shoutedCount: '-[:SHOUTED]->(related:Post)',
|
shoutedCount: '-[:SHOUTED]->(related:Post)',
|
||||||
badgesCount: '<-[:REWARDED]-(related:Badge)',
|
badgesCount: '<-[:REWARDED]-(related:Badge)',
|
||||||
|
|||||||
@ -29,11 +29,6 @@ type Post {
|
|||||||
categories: [Category]! @relation(name: "CATEGORIZED", direction: "OUT")
|
categories: [Category]! @relation(name: "CATEGORIZED", direction: "OUT")
|
||||||
|
|
||||||
comments: [Comment]! @relation(name: "COMMENTS", direction: "IN")
|
comments: [Comment]! @relation(name: "COMMENTS", direction: "IN")
|
||||||
commentsCount: Int!
|
|
||||||
@cypher(
|
|
||||||
statement: "MATCH (this)<-[:COMMENTS]-(r:Comment) WHERE NOT r.deleted = true AND NOT r.disabled = true RETURN COUNT(r)"
|
|
||||||
)
|
|
||||||
|
|
||||||
shoutedBy: [User]! @relation(name: "SHOUTED", direction: "IN")
|
shoutedBy: [User]! @relation(name: "SHOUTED", direction: "IN")
|
||||||
shoutedCount: Int!
|
shoutedCount: Int!
|
||||||
@cypher(
|
@cypher(
|
||||||
|
|||||||
@ -64,7 +64,6 @@ type User {
|
|||||||
)
|
)
|
||||||
|
|
||||||
comments: [Comment]! @relation(name: "WROTE", direction: "OUT")
|
comments: [Comment]! @relation(name: "WROTE", direction: "OUT")
|
||||||
commentsCount: Int! @cypher(statement: "MATCH (this)-[:WROTE]->(r:Comment) WHERE NOT r.deleted = true AND NOT r.disabled = true RETURN COUNT(r)")
|
|
||||||
commentedCount: Int! @cypher(statement: "MATCH (this)-[:WROTE]->(r:Comment)-[:COMMENTS]->(p:Post) WHERE NOT r.deleted = true AND NOT r.disabled = true AND NOT p.deleted = true AND NOT p.disabled = true RETURN COUNT(DISTINCT(p))")
|
commentedCount: Int! @cypher(statement: "MATCH (this)-[:WROTE]->(r:Comment)-[:COMMENTS]->(p:Post) WHERE NOT r.deleted = true AND NOT r.disabled = true AND NOT p.deleted = true AND NOT p.disabled = true RETURN COUNT(DISTINCT(p))")
|
||||||
|
|
||||||
shouted: [Post]! @relation(name: "SHOUTED", direction: "OUT")
|
shouted: [Post]! @relation(name: "SHOUTED", direction: "OUT")
|
||||||
@ -143,7 +142,6 @@ type Query {
|
|||||||
followedByCount: Int
|
followedByCount: Int
|
||||||
followedByCurrentUser: Boolean
|
followedByCurrentUser: Boolean
|
||||||
contributionsCount: Int
|
contributionsCount: Int
|
||||||
commentsCount: Int
|
|
||||||
commentedCount: Int
|
commentedCount: Int
|
||||||
shoutedCount: Int
|
shoutedCount: Int
|
||||||
badgesCount: Int
|
badgesCount: Int
|
||||||
|
|||||||
@ -260,7 +260,7 @@ Then("the first post on the landing page has the title:", title => {
|
|||||||
Then(
|
Then(
|
||||||
"the page {string} returns a 404 error with a message:",
|
"the page {string} returns a 404 error with a message:",
|
||||||
(route, message) => {
|
(route, message) => {
|
||||||
// TODO: how can we check HTTP codes with cypress?
|
cy.request({ url: route, failOnStatusCode: false }).its('status').should('eq', 404)
|
||||||
cy.visit(route, { failOnStatusCode: false });
|
cy.visit(route, { failOnStatusCode: false });
|
||||||
cy.get(".error").should("contain", message);
|
cy.get(".error").should("contain", message);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,7 +67,7 @@ import { mapGetters, mapMutations } from 'vuex'
|
|||||||
import HcUser from '~/components/User'
|
import HcUser from '~/components/User'
|
||||||
import ContentMenu from '~/components/ContentMenu'
|
import ContentMenu from '~/components/ContentMenu'
|
||||||
import ContentViewer from '~/components/Editor/ContentViewer'
|
import ContentViewer from '~/components/Editor/ContentViewer'
|
||||||
import HcEditCommentForm from '~/components/comments/EditCommentForm/EditCommentForm'
|
import HcEditCommentForm from '~/components/EditCommentForm/EditCommentForm'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data: function() {
|
data: function() {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { mount, createLocalVue } from '@vue/test-utils'
|
import { mount, createLocalVue } from '@vue/test-utils'
|
||||||
import CommentForm from './CommentForm.vue'
|
import CommentForm from './CommentForm'
|
||||||
import Styleguide from '@human-connection/styleguide'
|
import Styleguide from '@human-connection/styleguide'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
import MutationObserver from 'mutation-observer'
|
import MutationObserver from 'mutation-observer'
|
||||||
@ -30,10 +30,10 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import HcEditor from '~/components/Editor/Editor'
|
|
||||||
import PostCommentsQuery from '~/graphql/PostCommentsQuery.js'
|
|
||||||
import CommentMutations from '~/graphql/CommentMutations.js'
|
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
import HcEditor from '~/components/Editor/Editor'
|
||||||
|
import PostQuery from '~/graphql/PostQuery'
|
||||||
|
import CommentMutations from '~/graphql/CommentMutations'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -41,7 +41,6 @@ export default {
|
|||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
post: { type: Object, default: () => {} },
|
post: { type: Object, default: () => {} },
|
||||||
comments: { type: Array, default: () => [] },
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -76,18 +75,18 @@ export default {
|
|||||||
this.disabled = true
|
this.disabled = true
|
||||||
this.$apollo
|
this.$apollo
|
||||||
.mutate({
|
.mutate({
|
||||||
mutation: CommentMutations().CreateComment,
|
mutation: CommentMutations(this.$i18n).CreateComment,
|
||||||
variables: {
|
variables: {
|
||||||
postId: this.post.id,
|
postId: this.post.id,
|
||||||
content: this.form.content,
|
content: this.form.content,
|
||||||
},
|
},
|
||||||
update: (store, { data: { CreateComment } }) => {
|
update: (store, { data: { CreateComment } }) => {
|
||||||
const data = store.readQuery({
|
const data = store.readQuery({
|
||||||
query: PostCommentsQuery(this.$i18n),
|
query: PostQuery(this.$i18n),
|
||||||
variables: { slug: this.post.slug },
|
variables: { slug: this.post.slug },
|
||||||
})
|
})
|
||||||
data.Post[0].comments.push(CreateComment)
|
data.Post[0].comments.push(CreateComment)
|
||||||
store.writeQuery({ query: PostCommentsQuery(this.$i18n), data })
|
store.writeQuery({ query: PostQuery(this.$i18n), data })
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { config, mount, createLocalVue } from '@vue/test-utils'
|
import { config, mount, createLocalVue } from '@vue/test-utils'
|
||||||
import CommentList from '.'
|
import CommentList from './CommentList'
|
||||||
import Empty from '~/components/Empty'
|
import Empty from '~/components/Empty'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
import Styleguide from '@human-connection/styleguide'
|
import Styleguide from '@human-connection/styleguide'
|
||||||
@ -21,63 +21,52 @@ describe('CommentList.vue', () => {
|
|||||||
let store
|
let store
|
||||||
let wrapper
|
let wrapper
|
||||||
let propsData
|
let propsData
|
||||||
let data
|
|
||||||
|
|
||||||
propsData = {
|
|
||||||
post: {
|
|
||||||
id: 1,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
store = new Vuex.Store({
|
|
||||||
getters: {
|
|
||||||
'auth/user': () => {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
mocks = {
|
|
||||||
$t: jest.fn(),
|
|
||||||
$filters: {
|
|
||||||
truncate: a => a,
|
|
||||||
},
|
|
||||||
$apollo: {
|
|
||||||
queries: {
|
|
||||||
Post: {
|
|
||||||
refetch: jest.fn(),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
data = () => {
|
|
||||||
return {
|
|
||||||
comments: [],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
describe('shallowMount', () => {
|
describe('shallowMount', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
propsData = {
|
||||||
|
post: {
|
||||||
|
id: 1,
|
||||||
|
comments: [{ id: 'comment134', contentExcerpt: 'this is a comment' }],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
store = new Vuex.Store({
|
||||||
|
getters: {
|
||||||
|
'auth/user': () => {
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
mocks = {
|
||||||
|
$t: jest.fn(),
|
||||||
|
$filters: {
|
||||||
|
truncate: a => a,
|
||||||
|
},
|
||||||
|
$apollo: {
|
||||||
|
queries: {
|
||||||
|
Post: {
|
||||||
|
refetch: jest.fn(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const Wrapper = () => {
|
const Wrapper = () => {
|
||||||
return mount(CommentList, {
|
return mount(CommentList, {
|
||||||
store,
|
store,
|
||||||
mocks,
|
mocks,
|
||||||
localVue,
|
localVue,
|
||||||
propsData,
|
propsData,
|
||||||
data,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = Wrapper()
|
wrapper = Wrapper()
|
||||||
wrapper.setData({
|
|
||||||
comments: [
|
|
||||||
{
|
|
||||||
id: 'c1',
|
|
||||||
contentExcerpt: 'this is a comment',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('displays a message icon when there are no comments to display', () => {
|
it('displays a message icon when there are no comments to display', () => {
|
||||||
|
propsData.post.comments = []
|
||||||
expect(Wrapper().findAll(Empty)).toHaveLength(1)
|
expect(Wrapper().findAll(Empty)).toHaveLength(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -4,25 +4,25 @@
|
|||||||
<span>
|
<span>
|
||||||
<ds-icon name="comments" />
|
<ds-icon name="comments" />
|
||||||
<ds-tag
|
<ds-tag
|
||||||
v-if="comments"
|
v-if="post.comments.length"
|
||||||
style="margin-top: -4px; margin-left: -12px; position: absolute;"
|
style="margin-top: -4px; margin-left: -12px; position: absolute;"
|
||||||
color="primary"
|
color="primary"
|
||||||
size="small"
|
size="small"
|
||||||
round
|
round
|
||||||
>
|
>
|
||||||
{{ comments.length }}
|
{{ post.comments.length }}
|
||||||
</ds-tag>
|
</ds-tag>
|
||||||
Comments
|
Comments
|
||||||
</span>
|
</span>
|
||||||
</h3>
|
</h3>
|
||||||
<ds-space margin-bottom="large" />
|
<ds-space margin-bottom="large" />
|
||||||
<div v-if="comments && comments.length" id="comments" class="comments">
|
<div v-if="post.comments && post.comments.length" id="comments" class="comments">
|
||||||
<comment
|
<comment
|
||||||
v-for="(comment, index) in comments"
|
v-for="(comment, index) in post.comments"
|
||||||
:key="comment.id"
|
:key="comment.id"
|
||||||
:comment="comment"
|
:comment="comment"
|
||||||
:post="post"
|
:post="post"
|
||||||
@deleteComment="comments.splice(index, 1)"
|
@deleteComment="post.comments.splice(index, 1)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<hc-empty v-else name="empty" icon="messages" />
|
<hc-empty v-else name="empty" icon="messages" />
|
||||||
@ -31,7 +31,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import Comment from '~/components/Comment.vue'
|
import Comment from '~/components/Comment.vue'
|
||||||
import HcEmpty from '~/components/Empty.vue'
|
import HcEmpty from '~/components/Empty.vue'
|
||||||
import PostCommentsQuery from '~/graphql/PostCommentsQuery.js'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -41,29 +40,5 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
post: { type: Object, default: () => {} },
|
post: { type: Object, default: () => {} },
|
||||||
},
|
},
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
comments: [],
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
Post(post) {
|
|
||||||
const [first] = post
|
|
||||||
this.comments = (first && first.comments) || []
|
|
||||||
},
|
|
||||||
},
|
|
||||||
apollo: {
|
|
||||||
Post: {
|
|
||||||
query() {
|
|
||||||
return PostCommentsQuery(this.$i18n)
|
|
||||||
},
|
|
||||||
variables() {
|
|
||||||
return {
|
|
||||||
slug: this.post.slug,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fetchPolicy: 'cache-and-network',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -20,7 +20,7 @@ export default {
|
|||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
startVal: { type: Number, default: 0 },
|
startVal: { type: Number, default: 0 },
|
||||||
endVal: { type: Number, required: true },
|
endVal: { type: Number, default: 0 },
|
||||||
duration: { type: Number, default: 3000 },
|
duration: { type: Number, default: 3000 },
|
||||||
autoplay: { type: Boolean, default: true },
|
autoplay: { type: Boolean, default: true },
|
||||||
separator: { type: String, default: '.' },
|
separator: { type: String, default: '.' },
|
||||||
|
|||||||
@ -48,7 +48,7 @@ describe('DeleteData.vue', () => {
|
|||||||
}
|
}
|
||||||
getters = {
|
getters = {
|
||||||
'auth/user': () => {
|
'auth/user': () => {
|
||||||
return { id: 'u343', name: deleteAccountName, contributionsCount: 2, commentsCount: 3 }
|
return { id: 'u343', name: deleteAccountName, contributionsCount: 2, commentedCount: 3 }
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
actions = { 'auth/logout': jest.fn() }
|
actions = { 'auth/logout': jest.fn() }
|
||||||
|
|||||||
@ -30,12 +30,12 @@
|
|||||||
}}
|
}}
|
||||||
</label>
|
</label>
|
||||||
<ds-space margin-bottom="small" />
|
<ds-space margin-bottom="small" />
|
||||||
<label v-if="currentUser.commentsCount" class="checkbox-container">
|
<label v-if="currentUser.commentedCount" class="checkbox-container">
|
||||||
<input type="checkbox" v-model="deleteComments" />
|
<input type="checkbox" v-model="deleteComments" />
|
||||||
<span class="checkmark"></span>
|
<span class="checkmark"></span>
|
||||||
{{
|
{{
|
||||||
$t('settings.deleteUserAccount.commentsCount', {
|
$t('settings.deleteUserAccount.commentedCount', {
|
||||||
count: currentUser.commentsCount,
|
count: currentUser.commentedCount,
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
</label>
|
</label>
|
||||||
|
|||||||
@ -24,7 +24,7 @@ const post = {
|
|||||||
deleted: false,
|
deleted: false,
|
||||||
contributionsCount: 25,
|
contributionsCount: 25,
|
||||||
shoutedCount: 5,
|
shoutedCount: 5,
|
||||||
commentsCount: 39,
|
commentedCount: 39,
|
||||||
followedByCount: 2,
|
followedByCount: 2,
|
||||||
followedByCurrentUser: true,
|
followedByCurrentUser: true,
|
||||||
location: null,
|
location: null,
|
||||||
@ -38,7 +38,7 @@ const post = {
|
|||||||
],
|
],
|
||||||
__typename: 'User',
|
__typename: 'User',
|
||||||
},
|
},
|
||||||
commentsCount: 12,
|
commentedCount: 12,
|
||||||
categories: [],
|
categories: [],
|
||||||
shoutedCount: 421,
|
shoutedCount: 421,
|
||||||
__typename: 'Post',
|
__typename: 'Post',
|
||||||
|
|||||||
@ -48,9 +48,9 @@
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
<!-- Comments Count -->
|
<!-- Comments Count -->
|
||||||
<span :style="{ opacity: post.commentsCount ? 1 : 0.5 }">
|
<span :style="{ opacity: post.commentedCount ? 1 : 0.5 }">
|
||||||
<ds-icon name="comments" />
|
<ds-icon name="comments" />
|
||||||
<small>{{ post.commentsCount }}</small>
|
<small>{{ post.commentedCount }}</small>
|
||||||
</span>
|
</span>
|
||||||
<!-- Menu -->
|
<!-- Menu -->
|
||||||
<content-menu
|
<content-menu
|
||||||
|
|||||||
@ -122,7 +122,7 @@ describe('SearchInput.vue', () => {
|
|||||||
name: 'Trick',
|
name: 'Trick',
|
||||||
slug: 'trick',
|
slug: 'trick',
|
||||||
},
|
},
|
||||||
commentsCount: 0,
|
commentedCount: 0,
|
||||||
createdAt: '2019-03-13T11:00:20.835Z',
|
createdAt: '2019-03-13T11:00:20.835Z',
|
||||||
id: 'p10',
|
id: 'p10',
|
||||||
label: 'Eos aut illo omnis quis eaque et iure aut.',
|
label: 'Eos aut illo omnis quis eaque et iure aut.',
|
||||||
|
|||||||
@ -46,7 +46,7 @@
|
|||||||
<ds-flex-item>
|
<ds-flex-item>
|
||||||
<ds-text size="small" color="softer" class="search-meta">
|
<ds-text size="small" color="softer" class="search-meta">
|
||||||
<span style="text-align: right;">
|
<span style="text-align: right;">
|
||||||
<b>{{ option.commentsCount }}</b>
|
<b>{{ option.commentedCount }}</b>
|
||||||
<ds-icon name="comments" />
|
<ds-icon name="comments" />
|
||||||
</span>
|
</span>
|
||||||
<span style="width: 36px; display: inline-block; text-align: right;">
|
<span style="width: 36px; display: inline-block; text-align: right;">
|
||||||
|
|||||||
@ -50,7 +50,11 @@
|
|||||||
<ds-flex style="margin-top: -10px">
|
<ds-flex style="margin-top: -10px">
|
||||||
<ds-flex-item class="ds-tab-nav-item">
|
<ds-flex-item class="ds-tab-nav-item">
|
||||||
<ds-space margin="small">
|
<ds-space margin="small">
|
||||||
<ds-number :count="fanCount" :label="$t('profile.followers')" size="x-large" />
|
<ds-number
|
||||||
|
:count="user.followedByCount"
|
||||||
|
:label="$t('profile.followers')"
|
||||||
|
size="x-large"
|
||||||
|
/>
|
||||||
</ds-space>
|
</ds-space>
|
||||||
</ds-flex-item>
|
</ds-flex-item>
|
||||||
<ds-flex-item class="ds-tab-nav-item ds-tab-nav-item-active">
|
<ds-flex-item class="ds-tab-nav-item ds-tab-nav-item-active">
|
||||||
@ -64,8 +68,8 @@
|
|||||||
<ds-flex-item class="ds-tab-nav-item">
|
<ds-flex-item class="ds-tab-nav-item">
|
||||||
<ds-space margin="small">
|
<ds-space margin="small">
|
||||||
<ds-number
|
<ds-number
|
||||||
:count="user.commentsCount"
|
:count="user.commentedCount"
|
||||||
:label="$t('common.comment', null, user.commentsCount)"
|
:label="$t('common.comment', null, user.commentedCount)"
|
||||||
/>
|
/>
|
||||||
</ds-space>
|
</ds-space>
|
||||||
</ds-flex-item>
|
</ds-flex-item>
|
||||||
@ -121,10 +125,6 @@ export default {
|
|||||||
itsMe() {
|
itsMe() {
|
||||||
return this.user.slug === this.$store.getters['auth/user'].slug
|
return this.user.slug === this.$store.getters['auth/user'].slug
|
||||||
},
|
},
|
||||||
fanCount() {
|
|
||||||
let count = Number(this.user.followedByCount) || 0
|
|
||||||
return count
|
|
||||||
},
|
|
||||||
userLink() {
|
userLink() {
|
||||||
const { id, slug } = this.user
|
const { id, slug } = this.user
|
||||||
if (!(id && slug)) return ''
|
if (!(id && slug)) return ''
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
export default () => {
|
export default i18n => {
|
||||||
return {
|
return {
|
||||||
CreateComment: gql`
|
CreateComment: gql`
|
||||||
mutation($postId: ID!, $content: String!) {
|
mutation($postId: ID!, $content: String!) {
|
||||||
@ -8,15 +8,26 @@ export default () => {
|
|||||||
id
|
id
|
||||||
contentExcerpt
|
contentExcerpt
|
||||||
content
|
content
|
||||||
|
createdAt
|
||||||
|
disabled
|
||||||
|
deleted
|
||||||
author {
|
author {
|
||||||
id
|
id
|
||||||
slug
|
slug
|
||||||
name
|
name
|
||||||
avatar
|
avatar
|
||||||
|
disabled
|
||||||
|
deleted
|
||||||
|
shoutedCount
|
||||||
|
contributionsCount
|
||||||
|
commentedCount
|
||||||
|
followedByCount
|
||||||
|
followedByCurrentUser
|
||||||
|
badges {
|
||||||
|
id
|
||||||
|
icon
|
||||||
|
}
|
||||||
}
|
}
|
||||||
createdAt
|
|
||||||
deleted
|
|
||||||
disabled
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
@ -24,8 +35,19 @@ export default () => {
|
|||||||
mutation($content: String!, $id: ID!) {
|
mutation($content: String!, $id: ID!) {
|
||||||
UpdateComment(content: $content, id: $id) {
|
UpdateComment(content: $content, id: $id) {
|
||||||
id
|
id
|
||||||
content
|
|
||||||
contentExcerpt
|
contentExcerpt
|
||||||
|
content
|
||||||
|
createdAt
|
||||||
|
disabled
|
||||||
|
deleted
|
||||||
|
author {
|
||||||
|
id
|
||||||
|
slug
|
||||||
|
name
|
||||||
|
avatar
|
||||||
|
disabled
|
||||||
|
deleted
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
|
|||||||
@ -17,7 +17,7 @@ export default app => {
|
|||||||
deleted
|
deleted
|
||||||
shoutedCount
|
shoutedCount
|
||||||
contributionsCount
|
contributionsCount
|
||||||
commentsCount
|
commentedCount
|
||||||
followedByCount
|
followedByCount
|
||||||
followedByCurrentUser
|
followedByCurrentUser
|
||||||
location {
|
location {
|
||||||
|
|||||||
@ -1,39 +0,0 @@
|
|||||||
import gql from 'graphql-tag'
|
|
||||||
|
|
||||||
export default i18n => {
|
|
||||||
const lang = i18n.locale().toUpperCase()
|
|
||||||
return gql(`
|
|
||||||
query Post($slug: String!) {
|
|
||||||
Post(slug: $slug) {
|
|
||||||
comments(orderBy: createdAt_asc) {
|
|
||||||
id
|
|
||||||
contentExcerpt
|
|
||||||
content
|
|
||||||
createdAt
|
|
||||||
disabled
|
|
||||||
deleted
|
|
||||||
author {
|
|
||||||
id
|
|
||||||
slug
|
|
||||||
name
|
|
||||||
avatar
|
|
||||||
disabled
|
|
||||||
deleted
|
|
||||||
shoutedCount
|
|
||||||
contributionsCount
|
|
||||||
commentsCount
|
|
||||||
followedByCount
|
|
||||||
followedByCurrentUser
|
|
||||||
location {
|
|
||||||
name: name${lang}
|
|
||||||
}
|
|
||||||
badges {
|
|
||||||
id
|
|
||||||
icon
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`)
|
|
||||||
}
|
|
||||||
@ -22,7 +22,7 @@ export default i18n => {
|
|||||||
deleted
|
deleted
|
||||||
shoutedCount
|
shoutedCount
|
||||||
contributionsCount
|
contributionsCount
|
||||||
commentsCount
|
commentedCount
|
||||||
followedByCount
|
followedByCount
|
||||||
followedByCurrentUser
|
followedByCurrentUser
|
||||||
location {
|
location {
|
||||||
@ -36,10 +36,10 @@ export default i18n => {
|
|||||||
tags {
|
tags {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
commentsCount
|
comments(orderBy: createdAt_asc) {
|
||||||
comments(orderBy: createdAt_desc) {
|
|
||||||
id
|
id
|
||||||
contentExcerpt
|
contentExcerpt
|
||||||
|
content
|
||||||
createdAt
|
createdAt
|
||||||
disabled
|
disabled
|
||||||
deleted
|
deleted
|
||||||
@ -52,7 +52,7 @@ export default i18n => {
|
|||||||
deleted
|
deleted
|
||||||
shoutedCount
|
shoutedCount
|
||||||
contributionsCount
|
contributionsCount
|
||||||
commentsCount
|
commentedCount
|
||||||
followedByCount
|
followedByCount
|
||||||
followedByCurrentUser
|
followedByCurrentUser
|
||||||
location {
|
location {
|
||||||
@ -99,7 +99,7 @@ export const filterPosts = i18n => {
|
|||||||
deleted
|
deleted
|
||||||
contributionsCount
|
contributionsCount
|
||||||
shoutedCount
|
shoutedCount
|
||||||
commentsCount
|
commentedCount
|
||||||
followedByCount
|
followedByCount
|
||||||
followedByCurrentUser
|
followedByCurrentUser
|
||||||
location {
|
location {
|
||||||
@ -110,7 +110,6 @@ export const filterPosts = i18n => {
|
|||||||
icon
|
icon
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
commentsCount
|
|
||||||
categories {
|
categories {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
|
|||||||
@ -1,38 +0,0 @@
|
|||||||
import gql from 'graphql-tag'
|
|
||||||
|
|
||||||
export default i18n => {
|
|
||||||
const lang = i18n.locale().toUpperCase()
|
|
||||||
return gql(`
|
|
||||||
query Post($filter: _PostFilter, $first: Int, $offset: Int) {
|
|
||||||
Post(filter: $filter, first: $first, offset: $offset, orderBy: createdAt_desc) {
|
|
||||||
id
|
|
||||||
slug
|
|
||||||
title
|
|
||||||
contentExcerpt
|
|
||||||
shoutedCount
|
|
||||||
commentsCount
|
|
||||||
deleted
|
|
||||||
image
|
|
||||||
createdAt
|
|
||||||
disabled
|
|
||||||
deleted
|
|
||||||
categories {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
icon
|
|
||||||
}
|
|
||||||
author {
|
|
||||||
id
|
|
||||||
slug
|
|
||||||
avatar
|
|
||||||
name
|
|
||||||
disabled
|
|
||||||
deleted
|
|
||||||
location {
|
|
||||||
name: name${lang}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`)
|
|
||||||
}
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
|
|
||||||
export const BlockedUsers = () => {
|
export const BlockedUsers = () => {
|
||||||
return gql(`
|
return gql`
|
||||||
{
|
{
|
||||||
blockedUsers {
|
blockedUsers {
|
||||||
id
|
id
|
||||||
@ -13,27 +13,31 @@ export const BlockedUsers = () => {
|
|||||||
deleted
|
deleted
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`)
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Block = () => {
|
export const Block = () => {
|
||||||
return gql(`mutation($id:ID!) {
|
return gql`
|
||||||
block(id: $id) {
|
mutation($id: ID!) {
|
||||||
id
|
block(id: $id) {
|
||||||
name
|
id
|
||||||
isBlocked
|
name
|
||||||
followedByCurrentUser
|
isBlocked
|
||||||
|
followedByCurrentUser
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}`)
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Unblock = () => {
|
export const Unblock = () => {
|
||||||
return gql(`mutation($id:ID!) {
|
return gql`
|
||||||
unblock(id: $id) {
|
mutation($id: ID!) {
|
||||||
id
|
unblock(id: $id) {
|
||||||
name
|
id
|
||||||
isBlocked
|
name
|
||||||
followedByCurrentUser
|
isBlocked
|
||||||
|
followedByCurrentUser
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}`)
|
`
|
||||||
}
|
}
|
||||||
|
|||||||
@ -171,7 +171,7 @@
|
|||||||
"deleteUserAccount": {
|
"deleteUserAccount": {
|
||||||
"name": "Daten löschen",
|
"name": "Daten löschen",
|
||||||
"contributionsCount": "Meine {count} Beiträge löschen",
|
"contributionsCount": "Meine {count} Beiträge löschen",
|
||||||
"commentsCount": "Meine {count} Kommentare löschen",
|
"commentedCount": "Meine {count} Kommentare löschen",
|
||||||
"accountDescription": "Sei dir bewusst, dass deine Beiträge und Kommentare für unsere Community wichtig sind. Wenn du sie trotzdem löschen möchtest, musst du sie unten markieren.",
|
"accountDescription": "Sei dir bewusst, dass deine Beiträge und Kommentare für unsere Community wichtig sind. Wenn du sie trotzdem löschen möchtest, musst du sie unten markieren.",
|
||||||
"accountWarning": "Dein Konto, deine Beiträge oder Kommentare kannst du nach dem Löschen <b>WEDER VERWALTEN NOCH WIEDERHERSTELLEN!</b>",
|
"accountWarning": "Dein Konto, deine Beiträge oder Kommentare kannst du nach dem Löschen <b>WEDER VERWALTEN NOCH WIEDERHERSTELLEN!</b>",
|
||||||
"success": "Konto erfolgreich gelöscht!",
|
"success": "Konto erfolgreich gelöscht!",
|
||||||
|
|||||||
@ -171,7 +171,7 @@
|
|||||||
"deleteUserAccount": {
|
"deleteUserAccount": {
|
||||||
"name": "Delete data",
|
"name": "Delete data",
|
||||||
"contributionsCount": "Delete my {count} posts",
|
"contributionsCount": "Delete my {count} posts",
|
||||||
"commentsCount": "Delete my {count} comments",
|
"commentedCount": "Delete my {count} comments",
|
||||||
"accountDescription": "Be aware that your Post and Comments are important to our community. If you still choose to delete them, you have to mark them below.",
|
"accountDescription": "Be aware that your Post and Comments are important to our community. If you still choose to delete them, you have to mark them below.",
|
||||||
"accountWarning": "You <b>CAN'T MANAGE</b> and <b>CAN'T RECOVER</b> your Account, Posts, or Comments after deleting your account!",
|
"accountWarning": "You <b>CAN'T MANAGE</b> and <b>CAN'T RECOVER</b> your Account, Posts, or Comments after deleting your account!",
|
||||||
"success": "Account successfully deleted!",
|
"success": "Account successfully deleted!",
|
||||||
|
|||||||
@ -121,7 +121,7 @@
|
|||||||
"deleteUserAccount": {
|
"deleteUserAccount": {
|
||||||
"name": "Usuń dane",
|
"name": "Usuń dane",
|
||||||
"contributionsCount": "Usuń {count} moich postów",
|
"contributionsCount": "Usuń {count} moich postów",
|
||||||
"commentsCount": "Usuń {count} moich komentarzy",
|
"commentedCount": "Usuń {count} moich komentarzy",
|
||||||
"accountDescription": "Be aware that your Post and Comments are important to our community. If you still choose to delete them, you have to mark them below.",
|
"accountDescription": "Be aware that your Post and Comments are important to our community. If you still choose to delete them, you have to mark them below.",
|
||||||
"accountWarning": "Po usunięcie Twojego konta, nie możesz <b>ZARZĄDZAĆ</b> ani <b>ODZYSKAĆ</b> danych, wpisów oraz komentarzy!",
|
"accountWarning": "Po usunięcie Twojego konta, nie możesz <b>ZARZĄDZAĆ</b> ani <b>ODZYSKAĆ</b> danych, wpisów oraz komentarzy!",
|
||||||
"success": "Konto zostało usunięte",
|
"success": "Konto zostało usunięte",
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
<ds-space margin="small">
|
<ds-space margin="small">
|
||||||
<ds-number :count="0" :label="$t('admin.dashboard.users')" size="x-large" uppercase>
|
<ds-number :count="0" :label="$t('admin.dashboard.users')" size="x-large" uppercase>
|
||||||
<no-ssr slot="count">
|
<no-ssr slot="count">
|
||||||
<hc-count-to :end-val="statistics.countUsers || 0" />
|
<hc-count-to :end-val="statistics.countUsers" />
|
||||||
</no-ssr>
|
</no-ssr>
|
||||||
</ds-number>
|
</ds-number>
|
||||||
</ds-space>
|
</ds-space>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
<ds-space margin="small">
|
<ds-space margin="small">
|
||||||
<ds-number :count="0" :label="$t('admin.dashboard.posts')" size="x-large" uppercase>
|
<ds-number :count="0" :label="$t('admin.dashboard.posts')" size="x-large" uppercase>
|
||||||
<no-ssr slot="count">
|
<no-ssr slot="count">
|
||||||
<hc-count-to :end-val="statistics.countPosts || 0" />
|
<hc-count-to :end-val="statistics.countPosts" />
|
||||||
</no-ssr>
|
</no-ssr>
|
||||||
</ds-number>
|
</ds-number>
|
||||||
</ds-space>
|
</ds-space>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
uppercase
|
uppercase
|
||||||
>
|
>
|
||||||
<no-ssr slot="count">
|
<no-ssr slot="count">
|
||||||
<hc-count-to :end-val="statistics.countComments || 0" />
|
<hc-count-to :end-val="statistics.countComments" />
|
||||||
</no-ssr>
|
</no-ssr>
|
||||||
</ds-number>
|
</ds-number>
|
||||||
</ds-space>
|
</ds-space>
|
||||||
@ -44,7 +44,7 @@
|
|||||||
uppercase
|
uppercase
|
||||||
>
|
>
|
||||||
<no-ssr slot="count">
|
<no-ssr slot="count">
|
||||||
<hc-count-to :end-val="statistics.countNotifications || 0" />
|
<hc-count-to :end-val="statistics.countNotifications" />
|
||||||
</no-ssr>
|
</no-ssr>
|
||||||
</ds-number>
|
</ds-number>
|
||||||
</ds-space>
|
</ds-space>
|
||||||
@ -58,7 +58,7 @@
|
|||||||
uppercase
|
uppercase
|
||||||
>
|
>
|
||||||
<no-ssr slot="count">
|
<no-ssr slot="count">
|
||||||
<hc-count-to :end-val="statistics.countOrganizations || 0" />
|
<hc-count-to :end-val="statistics.countOrganizations" />
|
||||||
</no-ssr>
|
</no-ssr>
|
||||||
</ds-number>
|
</ds-number>
|
||||||
</ds-space>
|
</ds-space>
|
||||||
@ -72,7 +72,7 @@
|
|||||||
uppercase
|
uppercase
|
||||||
>
|
>
|
||||||
<no-ssr slot="count">
|
<no-ssr slot="count">
|
||||||
<hc-count-to :end-val="statistics.countProjects || 0" />
|
<hc-count-to :end-val="statistics.countProjects" />
|
||||||
</no-ssr>
|
</no-ssr>
|
||||||
</ds-number>
|
</ds-number>
|
||||||
</ds-space>
|
</ds-space>
|
||||||
@ -81,7 +81,7 @@
|
|||||||
<ds-space margin="small">
|
<ds-space margin="small">
|
||||||
<ds-number :count="0" :label="$t('admin.dashboard.invites')" size="x-large" uppercase>
|
<ds-number :count="0" :label="$t('admin.dashboard.invites')" size="x-large" uppercase>
|
||||||
<no-ssr slot="count">
|
<no-ssr slot="count">
|
||||||
<hc-count-to :end-val="statistics.countInvites || 0" />
|
<hc-count-to :end-val="statistics.countInvites" />
|
||||||
</no-ssr>
|
</no-ssr>
|
||||||
</ds-number>
|
</ds-number>
|
||||||
</ds-space>
|
</ds-space>
|
||||||
@ -90,7 +90,7 @@
|
|||||||
<ds-space margin="small">
|
<ds-space margin="small">
|
||||||
<ds-number :count="0" :label="$t('admin.dashboard.follows')" size="x-large" uppercase>
|
<ds-number :count="0" :label="$t('admin.dashboard.follows')" size="x-large" uppercase>
|
||||||
<no-ssr slot="count">
|
<no-ssr slot="count">
|
||||||
<hc-count-to :end-val="statistics.countFollows || 0" />
|
<hc-count-to :end-val="statistics.countFollows" />
|
||||||
</no-ssr>
|
</no-ssr>
|
||||||
</ds-number>
|
</ds-number>
|
||||||
</ds-space>
|
</ds-space>
|
||||||
@ -99,7 +99,7 @@
|
|||||||
<ds-space margin="small">
|
<ds-space margin="small">
|
||||||
<ds-number :count="0" :label="$t('admin.dashboard.shouts')" size="x-large" uppercase>
|
<ds-number :count="0" :label="$t('admin.dashboard.shouts')" size="x-large" uppercase>
|
||||||
<no-ssr slot="count">
|
<no-ssr slot="count">
|
||||||
<hc-count-to :end-val="statistics.countShouts || 0" />
|
<hc-count-to :end-val="statistics.countShouts" />
|
||||||
</no-ssr>
|
</no-ssr>
|
||||||
</ds-number>
|
</ds-number>
|
||||||
</ds-space>
|
</ds-space>
|
||||||
|
|||||||
@ -96,7 +96,7 @@ export default {
|
|||||||
label: this.$t('sorting.commented'),
|
label: this.$t('sorting.commented'),
|
||||||
value: 'Commented',
|
value: 'Commented',
|
||||||
icons: 'comment',
|
icons: 'comment',
|
||||||
order: 'commentsCount_desc',
|
order: 'commentedCount_desc',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,10 +81,10 @@ import HcTag from '~/components/Tag'
|
|||||||
import ContentMenu from '~/components/ContentMenu'
|
import ContentMenu from '~/components/ContentMenu'
|
||||||
import HcUser from '~/components/User'
|
import HcUser from '~/components/User'
|
||||||
import HcShoutButton from '~/components/ShoutButton.vue'
|
import HcShoutButton from '~/components/ShoutButton.vue'
|
||||||
import HcCommentForm from '~/components/comments/CommentForm/CommentForm'
|
import HcCommentForm from '~/components/CommentForm/CommentForm'
|
||||||
import HcCommentList from '~/components/comments/CommentList'
|
import HcCommentList from '~/components/CommentList/CommentList'
|
||||||
import { postMenuModalsData, deletePostMutation } from '~/components/utils/PostHelpers'
|
import { postMenuModalsData, deletePostMutation } from '~/components/utils/PostHelpers'
|
||||||
import PostQuery from '~/graphql/PostQuery.js'
|
import PostQuery from '~/graphql/PostQuery'
|
||||||
import HcEmotions from '~/components/Emotions/Emotions'
|
import HcEmotions from '~/components/Emotions/Emotions'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -122,29 +122,6 @@ export default {
|
|||||||
this.title = this.post.title
|
this.title = this.post.title
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
async asyncData(context) {
|
|
||||||
const {
|
|
||||||
params,
|
|
||||||
error,
|
|
||||||
app: { apolloProvider, $i18n },
|
|
||||||
} = context
|
|
||||||
const client = apolloProvider.defaultClient
|
|
||||||
const query = PostQuery($i18n)
|
|
||||||
const variables = { slug: params.slug }
|
|
||||||
const {
|
|
||||||
data: { Post },
|
|
||||||
} = await client.query({ query, variables })
|
|
||||||
if (Post.length <= 0) {
|
|
||||||
// TODO: custom 404 error page with translations
|
|
||||||
const message = 'This post could not be found'
|
|
||||||
return error({ statusCode: 404, message })
|
|
||||||
}
|
|
||||||
const [post] = Post
|
|
||||||
return {
|
|
||||||
post,
|
|
||||||
title: post.title,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// NOTE: quick fix for jumping flexbox implementation
|
// NOTE: quick fix for jumping flexbox implementation
|
||||||
@ -175,6 +152,19 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
apollo: {
|
||||||
|
Post: {
|
||||||
|
query() {
|
||||||
|
return PostQuery(this.$i18n)
|
||||||
|
},
|
||||||
|
variables() {
|
||||||
|
return {
|
||||||
|
slug: this.$route.params.slug,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fetchPolicy: 'cache-and-network',
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -187,7 +177,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.post-card {
|
.post-card {
|
||||||
// max-width: 800px;
|
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
|
||||||
.comments {
|
.comments {
|
||||||
|
|||||||
@ -91,7 +91,7 @@ export default {
|
|||||||
slug
|
slug
|
||||||
contentExcerpt
|
contentExcerpt
|
||||||
shoutedCount
|
shoutedCount
|
||||||
commentsCount
|
commentedCount
|
||||||
categories {
|
categories {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
@ -105,7 +105,7 @@ export default {
|
|||||||
contributionsCount
|
contributionsCount
|
||||||
followedByCount
|
followedByCount
|
||||||
followedByCurrentUser
|
followedByCurrentUser
|
||||||
commentsCount
|
commentedCount
|
||||||
location {
|
location {
|
||||||
name: name${this.$i18n.locale().toUpperCase()}
|
name: name${this.$i18n.locale().toUpperCase()}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,14 +43,14 @@
|
|||||||
<ds-flex-item>
|
<ds-flex-item>
|
||||||
<no-ssr>
|
<no-ssr>
|
||||||
<ds-number :label="$t('profile.followers')">
|
<ds-number :label="$t('profile.followers')">
|
||||||
<hc-count-to slot="count" :end-val="followedByCount" />
|
<hc-count-to slot="count" :end-val="user.followedByCount" />
|
||||||
</ds-number>
|
</ds-number>
|
||||||
</no-ssr>
|
</no-ssr>
|
||||||
</ds-flex-item>
|
</ds-flex-item>
|
||||||
<ds-flex-item>
|
<ds-flex-item>
|
||||||
<no-ssr>
|
<no-ssr>
|
||||||
<ds-number :label="$t('profile.following')">
|
<ds-number :label="$t('profile.following')">
|
||||||
<hc-count-to slot="count" :end-val="Number(user.followingCount) || 0" />
|
<hc-count-to slot="count" :end-val="user.followingCount" />
|
||||||
</ds-number>
|
</ds-number>
|
||||||
</no-ssr>
|
</no-ssr>
|
||||||
</ds-flex-item>
|
</ds-flex-item>
|
||||||
@ -254,9 +254,9 @@ import HcEmpty from '~/components/Empty.vue'
|
|||||||
import ContentMenu from '~/components/ContentMenu'
|
import ContentMenu from '~/components/ContentMenu'
|
||||||
import HcUpload from '~/components/Upload'
|
import HcUpload from '~/components/Upload'
|
||||||
import HcAvatar from '~/components/Avatar/Avatar.vue'
|
import HcAvatar from '~/components/Avatar/Avatar.vue'
|
||||||
import PostQuery from '~/graphql/UserProfile/Post.js'
|
import { filterPosts } from '~/graphql/PostQuery'
|
||||||
import UserQuery from '~/graphql/User.js'
|
import UserQuery from '~/graphql/User'
|
||||||
import { Block, Unblock } from '~/graphql/settings/BlockedUsers.js'
|
import { Block, Unblock } from '~/graphql/settings/BlockedUsers'
|
||||||
|
|
||||||
const tabToFilterMapping = ({ tab, id }) => {
|
const tabToFilterMapping = ({ tab, id }) => {
|
||||||
return {
|
return {
|
||||||
@ -309,10 +309,6 @@ export default {
|
|||||||
myProfile() {
|
myProfile() {
|
||||||
return this.$route.params.id === this.$store.getters['auth/user'].id
|
return this.$route.params.id === this.$store.getters['auth/user'].id
|
||||||
},
|
},
|
||||||
followedByCount() {
|
|
||||||
let count = Number(this.user.followedByCount) || 0
|
|
||||||
return count
|
|
||||||
},
|
|
||||||
user() {
|
user() {
|
||||||
return this.User ? this.User[0] : {}
|
return this.User ? this.User[0] : {}
|
||||||
},
|
},
|
||||||
@ -401,7 +397,7 @@ export default {
|
|||||||
apollo: {
|
apollo: {
|
||||||
Post: {
|
Post: {
|
||||||
query() {
|
query() {
|
||||||
return PostQuery(this.$i18n)
|
return filterPosts(this.$i18n)
|
||||||
},
|
},
|
||||||
variables() {
|
variables() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -70,7 +70,7 @@ export const actions = {
|
|||||||
data: { currentUser },
|
data: { currentUser },
|
||||||
} = await client.query({
|
} = await client.query({
|
||||||
query: gql`
|
query: gql`
|
||||||
{
|
query {
|
||||||
currentUser {
|
currentUser {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
@ -81,7 +81,7 @@ export const actions = {
|
|||||||
about
|
about
|
||||||
locationName
|
locationName
|
||||||
contributionsCount
|
contributionsCount
|
||||||
commentsCount
|
commentedCount
|
||||||
socialMedia {
|
socialMedia {
|
||||||
id
|
id
|
||||||
url
|
url
|
||||||
|
|||||||
@ -88,7 +88,7 @@ export const actions = {
|
|||||||
deleted
|
deleted
|
||||||
contributionsCount
|
contributionsCount
|
||||||
shoutedCount
|
shoutedCount
|
||||||
commentsCount
|
commentedCount
|
||||||
followedByCount
|
followedByCount
|
||||||
followedByCurrentUser
|
followedByCurrentUser
|
||||||
location {
|
location {
|
||||||
@ -99,7 +99,6 @@ export const actions = {
|
|||||||
icon
|
icon
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
commentsCount
|
|
||||||
categories {
|
categories {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
|
|||||||
@ -45,15 +45,14 @@ export const actions = {
|
|||||||
commit('SET_QUICK_PENDING', true)
|
commit('SET_QUICK_PENDING', true)
|
||||||
await this.app.apolloProvider.defaultClient
|
await this.app.apolloProvider.defaultClient
|
||||||
.query({
|
.query({
|
||||||
query: gql(`
|
query: gql`
|
||||||
query findPosts($query: String!) {
|
query findPosts($query: String!) {
|
||||||
findPosts(query: $query, limit: 10) {
|
findPosts(query: $query, limit: 10) {
|
||||||
id
|
id
|
||||||
slug
|
slug
|
||||||
label: title
|
label: title
|
||||||
value: title,
|
value: title
|
||||||
shoutedCount
|
shoutedCount
|
||||||
commentsCount
|
|
||||||
createdAt
|
createdAt
|
||||||
author {
|
author {
|
||||||
id
|
id
|
||||||
@ -62,7 +61,7 @@ export const actions = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`),
|
`,
|
||||||
variables: {
|
variables: {
|
||||||
query: value.replace(/\s/g, '~ ') + '~',
|
query: value.replace(/\s/g, '~ ') + '~',
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user