From 872182581aeda9b2d720e7de793c0defef533357 Mon Sep 17 00:00:00 2001 From: Jo Vuit <jo.vuitton@gmail.com> Date: Thu, 24 Jan 2019 15:18:20 +0100 Subject: [PATCH] Now distinguishes whether the Follow request has been accepted yet or not, and adapts the message displayed in the NotificationData. --- front/src/components/notifications/NotificationRow.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/front/src/components/notifications/NotificationRow.vue b/front/src/components/notifications/NotificationRow.vue index db5918c4..2737d901 100644 --- a/front/src/components/notifications/NotificationRow.vue +++ b/front/src/components/notifications/NotificationRow.vue @@ -38,9 +38,11 @@ export default { labels () { let libraryFollowMessage = this.$gettext('%{ username } followed your library "%{ library }"') let libraryAcceptFollowMessage = this.$gettext('%{ username } accepted your follow on library "%{ library }"') + let libraryPendingFollowMessage = this.$gettext('%{ username } wants to follow your library "%{ library }"') return { libraryFollowMessage, libraryAcceptFollowMessage, + libraryPendingFollowMessage, markRead: this.$gettext('Mark as read'), markUnread: this.$gettext('Mark as unread'), @@ -55,19 +57,23 @@ export default { if (a.type === 'Follow') { if (a.object && a.object.type === 'music.Library') { let action = null + let textmessage = null if (!a.related_object.approved) { + textmessage = this.labels.libraryPendingFollowMessage action = { buttonClass: 'green', icon: 'check', label: this.$gettext('Approve'), handler: () => { self.approveLibraryFollow(a.related_object) } } - } + } else { + textmessage = this.labels.libraryFollowMessage + } return { action, detailUrl: {name: 'content.libraries.detail', params: {id: a.object.uuid}}, message: this.$gettextInterpolate( - this.labels.libraryFollowMessage, + textmessage, {username: this.username, library: a.object.name} ) } -- GitLab