diff --git a/backend/src/schema/resolvers/users.js b/backend/src/schema/resolvers/users.js
index 74561c5fe..4710942b6 100644
--- a/backend/src/schema/resolvers/users.js
+++ b/backend/src/schema/resolvers/users.js
@@ -151,7 +151,6 @@ export default {
friendsCount: '<-[:FRIENDS]->(related:User)',
followingCount: '-[:FOLLOWS]->(related:User)',
followedByCount: '<-[:FOLLOWS]-(related:User)',
- commentsCount: '-[:WROTE]->(r:Comment)',
commentedCount: '-[:WROTE]->(:Comment)-[:COMMENTS]->(related:Post)',
shoutedCount: '-[:SHOUTED]->(related:Post)',
badgesCount: '<-[:REWARDED]-(related:Badge)',
diff --git a/backend/src/schema/types/type/Post.gql b/backend/src/schema/types/type/Post.gql
index 519af14ae..cbbcddfc9 100644
--- a/backend/src/schema/types/type/Post.gql
+++ b/backend/src/schema/types/type/Post.gql
@@ -29,11 +29,6 @@ type Post {
categories: [Category]! @relation(name: "CATEGORIZED", direction: "OUT")
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")
shoutedCount: Int!
@cypher(
diff --git a/backend/src/schema/types/type/User.gql b/backend/src/schema/types/type/User.gql
index e3e8f8450..46e699410 100644
--- a/backend/src/schema/types/type/User.gql
+++ b/backend/src/schema/types/type/User.gql
@@ -64,7 +64,6 @@ type User {
)
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))")
shouted: [Post]! @relation(name: "SHOUTED", direction: "OUT")
@@ -143,7 +142,6 @@ type Query {
followedByCount: Int
followedByCurrentUser: Boolean
contributionsCount: Int
- commentsCount: Int
commentedCount: Int
shoutedCount: Int
badgesCount: Int
diff --git a/cypress/integration/common/steps.js b/cypress/integration/common/steps.js
index 25c87d600..7192b097b 100644
--- a/cypress/integration/common/steps.js
+++ b/cypress/integration/common/steps.js
@@ -260,7 +260,7 @@ Then("the first post on the landing page has the title:", title => {
Then(
"the page {string} returns a 404 error with a 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.get(".error").should("contain", message);
}
diff --git a/webapp/components/Comment.vue b/webapp/components/Comment.vue
index 9d273cca9..6d3b05eff 100644
--- a/webapp/components/Comment.vue
+++ b/webapp/components/Comment.vue
@@ -67,7 +67,7 @@ import { mapGetters, mapMutations } from 'vuex'
import HcUser from '~/components/User'
import ContentMenu from '~/components/ContentMenu'
import ContentViewer from '~/components/Editor/ContentViewer'
-import HcEditCommentForm from '~/components/comments/EditCommentForm/EditCommentForm'
+import HcEditCommentForm from '~/components/EditCommentForm/EditCommentForm'
export default {
data: function() {
diff --git a/webapp/components/comments/CommentForm/CommentForm.spec.js b/webapp/components/CommentForm/CommentForm.spec.js
similarity index 98%
rename from webapp/components/comments/CommentForm/CommentForm.spec.js
rename to webapp/components/CommentForm/CommentForm.spec.js
index 5cc274ce2..07069e2d5 100644
--- a/webapp/components/comments/CommentForm/CommentForm.spec.js
+++ b/webapp/components/CommentForm/CommentForm.spec.js
@@ -1,5 +1,5 @@
import { mount, createLocalVue } from '@vue/test-utils'
-import CommentForm from './CommentForm.vue'
+import CommentForm from './CommentForm'
import Styleguide from '@human-connection/styleguide'
import Vuex from 'vuex'
import MutationObserver from 'mutation-observer'
diff --git a/webapp/components/comments/CommentForm/CommentForm.vue b/webapp/components/CommentForm/CommentForm.vue
similarity index 89%
rename from webapp/components/comments/CommentForm/CommentForm.vue
rename to webapp/components/CommentForm/CommentForm.vue
index d863a7e4d..823b47fa6 100644
--- a/webapp/components/comments/CommentForm/CommentForm.vue
+++ b/webapp/components/CommentForm/CommentForm.vue
@@ -30,10 +30,10 @@
diff --git a/webapp/components/CountTo.vue b/webapp/components/CountTo.vue
index 65ad84b56..3210944c8 100644
--- a/webapp/components/CountTo.vue
+++ b/webapp/components/CountTo.vue
@@ -20,7 +20,7 @@ export default {
},
props: {
startVal: { type: Number, default: 0 },
- endVal: { type: Number, required: true },
+ endVal: { type: Number, default: 0 },
duration: { type: Number, default: 3000 },
autoplay: { type: Boolean, default: true },
separator: { type: String, default: '.' },
diff --git a/webapp/components/DeleteData/DeleteData.spec.js b/webapp/components/DeleteData/DeleteData.spec.js
index 139316ed2..73ca985fa 100644
--- a/webapp/components/DeleteData/DeleteData.spec.js
+++ b/webapp/components/DeleteData/DeleteData.spec.js
@@ -48,7 +48,7 @@ describe('DeleteData.vue', () => {
}
getters = {
'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() }
diff --git a/webapp/components/DeleteData/DeleteData.vue b/webapp/components/DeleteData/DeleteData.vue
index 293e65221..f6e6d47f0 100644
--- a/webapp/components/DeleteData/DeleteData.vue
+++ b/webapp/components/DeleteData/DeleteData.vue
@@ -30,12 +30,12 @@
}}
-