From 0d5471fee47a5d3637da87082515ab3f77eea9b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 16 Jul 2019 19:25:03 +0200 Subject: [PATCH] Try to implement scrollBehavior for Mentions of User in Comment of a Post Co-Authored-By: mattwr18 --- webapp/components/Comment.vue | 18 ++-- .../notifications/Notification/index.vue | 39 ++++++-- .../notifications/NotificationMenu/index.vue | 16 ++-- webapp/locales/de.json | 2 +- webapp/locales/en.json | 2 +- webapp/nuxt.config.js | 90 +++++++++++++------ webapp/pages/post/_id.vue | 6 ++ webapp/pages/post/_id/_slug/index.vue | 3 + 8 files changed, 130 insertions(+), 46 deletions(-) diff --git a/webapp/components/Comment.vue b/webapp/components/Comment.vue index d8f63526f..aba055a60 100644 --- a/webapp/components/Comment.vue +++ b/webapp/components/Comment.vue @@ -10,7 +10,7 @@
- + @@ -33,15 +33,19 @@ v-show="comment.content !== comment.contentExcerpt" style="text-align: right; margin-right: 20px; margin-top: -12px;" > - - {{ $t('comment.show.more') }} - + {{ $t('comment.show.more') }}
- - {{ $t('comment.show.less') }} - + {{ $t('comment.show.less') }}
diff --git a/webapp/components/notifications/Notification/index.vue b/webapp/components/notifications/Notification/index.vue index 336e6b332..cf6f34381 100644 --- a/webapp/components/notifications/Notification/index.vue +++ b/webapp/components/notifications/Notification/index.vue @@ -2,18 +2,29 @@ - + - {{ $t('notifications.menu.mentioned') }} + {{ $t('notifications.menu.mentioned', { resource: post.id ? 'post' : 'comment' }) }} - +
@@ -40,7 +51,10 @@ export default { }, computed: { excerpt() { - return this.$filters.removeLinks(this.post.contentExcerpt) + const excerpt = this.post.id ? this.post.contentExcerpt : this.comment.contentExcerpt + return ( + (!this.post.id ? 'Comment: ' : '') + excerpt.replace(/<(?:.|\n)*?>/gm, '').trim() + ) }, post() { return this.notification.post || {} @@ -48,6 +62,18 @@ export default { comment() { return this.notification.comment || {} }, + postParams() { + return { + id: this.post.id || this.comment.post.id, + } + }, + queryParams() { + return this.post.id + ? {} + : { + query: { commentId: this.comment.id }, + } + }, }, } @@ -57,4 +83,7 @@ export default { opacity: 0.6; /* Real browsers */ filter: alpha(opacity = 60); /* MSIE */ } +.notifications-card { + min-width: 500px; +} diff --git a/webapp/components/notifications/NotificationMenu/index.vue b/webapp/components/notifications/NotificationMenu/index.vue index a3f637d14..983b0c49b 100644 --- a/webapp/components/notifications/NotificationMenu/index.vue +++ b/webapp/components/notifications/NotificationMenu/index.vue @@ -1,12 +1,13 @@