diff --git a/cypress/integration/common/post.js b/cypress/integration/common/post.js
index e3a922139..23a7d5764 100644
--- a/cypress/integration/common/post.js
+++ b/cypress/integration/common/post.js
@@ -1,8 +1,6 @@
import { When, Then } from 'cypress-cucumber-preprocessor/steps'
Then('my comment should be successfully created', () => {
- cy.get('.ds-form')
- .submit()
cy.get('.iziToast-message')
.contains('Comment Submitted')
})
diff --git a/webapp/components/CommentForm/index.vue b/webapp/components/CommentForm/index.vue
new file mode 100644
index 000000000..f13ce6927
--- /dev/null
+++ b/webapp/components/CommentForm/index.vue
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('actions.cancel') }}
+
+
+
+
+ {{ $t('post.comment.submit') }}
+
+
+
+
+
+
+
+
+
+
diff --git a/webapp/pages/post/_id/_slug/index.vue b/webapp/pages/post/_id/_slug/index.vue
index c99e4e5be..82de14481 100644
--- a/webapp/pages/post/_id/_slug/index.vue
+++ b/webapp/pages/post/_id/_slug/index.vue
@@ -111,49 +111,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $t('actions.cancel') }}
-
-
-
-
- {{ $t('post.comment.submit') }}
-
-
-
-
-
-
-
+
/gm, '').trim()
- if (content.length < 3) {
- this.disabled = true
- } else {
- this.disabled = false
- }
- console.log(value)
- this.form.content = value
- // this.$refs.commentForm.update('content', value)
- // this.$refs.editor.update(value)
- },
- clear() {
- this.$refs.editor.clear()
- },
addComment(comment) {
this.$apollo.queries.CommentByPost.refetch()
- },
- handleSubmit() {
- console.log('content', this.form.content)
- this.$apollo
- .mutate({
- mutation: gql`
- mutation($postId: ID, $content: String!) {
- CreateComment(postId: $postId, content: $content) {
- id
- content
- }
- }
- `,
- variables: {
- postId: this.post.id,
- content: this.form.content
- }
- })
- .then(res => {
- this.addComment(res.data.CreateComment)
- this.$refs.editor.clear()
- this.$toast.success(this.$t('post.comment.submitted'))
- })
- .catch(err => {
- this.$toast.error(err.message)
- })
}
},
apollo: {
@@ -394,19 +305,6 @@ export default {
}
},
fetchPolicy: 'cache-and-network'
- },
- User: {
- query() {
- return gql(`{
- User(orderBy: slug_asc) {
- id
- slug
- }
- }`)
- },
- result(result) {
- this.users = result.data.User
- }
}
}
}