From 1102cdc30ba8066503a21e7a289cfa7658e67db7 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 21 Feb 2021 14:16:19 +0100 Subject: [PATCH] Show notification text based on their content --- .../notifications/notifications.vue | 6 +++- src/components/tasks/partials/heading.vue | 7 ++--- src/models/notification.js | 31 +++++++++++++++++++ src/models/task.js | 8 +++++ src/styles/components/notifications.scss | 11 ++----- 5 files changed, 48 insertions(+), 15 deletions(-) diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue index a302d8213..f620223ff 100644 --- a/src/components/notifications/notifications.vue +++ b/src/components/notifications/notifications.vue @@ -15,7 +15,7 @@ v-if="n.notification.doer"/> - {{ n.name }} + {{ n.toText(userInfo) }} {{ formatDateSince(n.created) }} @@ -32,6 +32,7 @@ import NotificationService from '@/services/notification' import User from '@/components/misc/user' import names from '@/models/notificationNames.json' import {closeWhenClickedOutside} from '@/helpers/closeWhenClickedOutside' +import {mapState} from 'vuex' export default { name: 'notifications', @@ -53,6 +54,9 @@ export default { beforeDestroy() { document.removeEventListener('click', this.hidePopup) }, + computed: mapState({ + userInfo: state => state.auth.info, + }), methods: { hidePopup(e) { if (this.showNotifications) { diff --git a/src/components/tasks/partials/heading.vue b/src/components/tasks/partials/heading.vue index ac10fd51e..04b748a57 100644 --- a/src/components/tasks/partials/heading.vue +++ b/src/components/tasks/partials/heading.vue @@ -1,10 +1,7 @@