From 9f203cda3bc7acbd1fd16fb6ab4b8a580fce0a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Mon, 9 Sep 2019 13:03:43 +0200 Subject: [PATCH] Refactor by melting `EditCommentForm.vue` into `CommentForm.vue` --- webapp/components/Comment.vue | 9 +- .../CommentForm/CommentForm.spec.js | 3 + webapp/components/CommentForm/CommentForm.vue | 82 ++++++++++++---- .../EditCommentForm/EditCommentForm.vue | 96 ------------------- webapp/constants/comment.js | 1 + webapp/plugins/vue-filters.js | 9 +- 6 files changed, 76 insertions(+), 124 deletions(-) delete mode 100644 webapp/components/EditCommentForm/EditCommentForm.vue create mode 100644 webapp/constants/comment.js diff --git a/webapp/components/Comment.vue b/webapp/components/Comment.vue index fbb39c094..4d71025f9 100644 --- a/webapp/components/Comment.vue +++ b/webapp/components/Comment.vue @@ -29,9 +29,10 @@
-
@@ -62,7 +63,7 @@ import { mapGetters } from 'vuex' import HcUser from '~/components/User/User' import ContentMenu from '~/components/ContentMenu' import ContentViewer from '~/components/Editor/ContentViewer' -import HcEditCommentForm from '~/components/EditCommentForm/EditCommentForm' +import HcCommentForm from '~/components/CommentForm/CommentForm' import CommentMutations from '~/graphql/CommentMutations' export default { @@ -76,7 +77,7 @@ export default { HcUser, ContentMenu, ContentViewer, - HcEditCommentForm, + HcCommentForm, }, props: { post: { type: Object, default: () => {} }, diff --git a/webapp/components/CommentForm/CommentForm.spec.js b/webapp/components/CommentForm/CommentForm.spec.js index 594c6e45b..964730b5f 100644 --- a/webapp/components/CommentForm/CommentForm.spec.js +++ b/webapp/components/CommentForm/CommentForm.spec.js @@ -41,6 +41,9 @@ describe('CommentForm.vue', () => { error: jest.fn(), success: jest.fn(), }, + $filters: { + removeHtml: a => a, + }, } propsData = { post: { diff --git a/webapp/components/CommentForm/CommentForm.vue b/webapp/components/CommentForm/CommentForm.vue index 765bb22af..5712536a6 100644 --- a/webapp/components/CommentForm/CommentForm.vue +++ b/webapp/components/CommentForm/CommentForm.vue @@ -2,18 +2,18 @@