From d42baa5160d7bab5cc47b565c5e20a4efa7914a0 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Wed, 4 Sep 2019 17:55:02 +0200 Subject: [PATCH 1/3] Hide `show more` link if the content is shorter than 180 characters --- webapp/components/Comment.vue | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/webapp/components/Comment.vue b/webapp/components/Comment.vue index e4df37693..3b2170661 100644 --- a/webapp/components/Comment.vue +++ b/webapp/components/Comment.vue @@ -38,18 +38,14 @@
{{ $t('comment.show.more') }}
- +
{{ $t('comment.show.less') }} From e5198babf0db263553f49987c013fab4c8144119 Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Wed, 4 Sep 2019 18:01:47 +0200 Subject: [PATCH 2/3] Update the tests with comment.content --- webapp/components/Comment.spec.js | 1 + webapp/components/CommentList/CommentList.spec.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/components/Comment.spec.js b/webapp/components/Comment.spec.js index 23e72f9d6..6303989f3 100644 --- a/webapp/components/Comment.spec.js +++ b/webapp/components/Comment.spec.js @@ -63,6 +63,7 @@ describe('Comment.vue', () => { propsData.comment = { id: '2', contentExcerpt: 'Hello I am a comment content', + content: 'Hello I am comment content' } }) diff --git a/webapp/components/CommentList/CommentList.spec.js b/webapp/components/CommentList/CommentList.spec.js index 5551227a1..902770e53 100644 --- a/webapp/components/CommentList/CommentList.spec.js +++ b/webapp/components/CommentList/CommentList.spec.js @@ -27,7 +27,7 @@ describe('CommentList.vue', () => { propsData = { post: { id: 1, - comments: [{ id: 'comment134', contentExcerpt: 'this is a comment' }], + comments: [{ id: 'comment134', contentExcerpt: 'this is a comment', content: 'this is a comment' }], }, } store = new Vuex.Store({ From c2c165c362b460a5e71c4d11e7d7483addd4846d Mon Sep 17 00:00:00 2001 From: mattwr18 Date: Wed, 4 Sep 2019 18:45:52 +0200 Subject: [PATCH 3/3] Fix lint --- webapp/components/Comment.spec.js | 2 +- webapp/components/CommentList/CommentList.spec.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/webapp/components/Comment.spec.js b/webapp/components/Comment.spec.js index 6303989f3..375280cea 100644 --- a/webapp/components/Comment.spec.js +++ b/webapp/components/Comment.spec.js @@ -63,7 +63,7 @@ describe('Comment.vue', () => { propsData.comment = { id: '2', contentExcerpt: 'Hello I am a comment content', - content: 'Hello I am comment content' + content: 'Hello I am comment content', } }) diff --git a/webapp/components/CommentList/CommentList.spec.js b/webapp/components/CommentList/CommentList.spec.js index 902770e53..0fa1e8b81 100644 --- a/webapp/components/CommentList/CommentList.spec.js +++ b/webapp/components/CommentList/CommentList.spec.js @@ -27,7 +27,9 @@ describe('CommentList.vue', () => { propsData = { post: { id: 1, - comments: [{ id: 'comment134', contentExcerpt: 'this is a comment', content: 'this is a comment' }], + comments: [ + { id: 'comment134', contentExcerpt: 'this is a comment', content: 'this is a comment' }, + ], }, } store = new Vuex.Store({