Clarified variable naming

This commit is contained in:
Wolfgang Huß 2020-02-06 09:52:18 +01:00
parent ff620171b2
commit 63f36f02b4
3 changed files with 9 additions and 9 deletions

View File

@ -21,7 +21,7 @@
v-tooltip="{ content: $t('notifications.post'), placement: 'right' }" v-tooltip="{ content: $t('notifications.post'), placement: 'right' }"
/> />
{{ {{
$t(`notifications.reason.${notificationData.reason}` + notificationData.reasonExtention) $t(`notifications.reason.${notificationData.reason}` + notificationData.reasonTranslationExtention)
}} }}
</ds-text> </ds-text>
</client-only> </client-only>

View File

@ -35,7 +35,7 @@
</client-only> </client-only>
</ds-space> </ds-space>
<ds-text :class="{ 'notification-status': scope.row.read, reason: true }"> <ds-text :class="{ 'notification-status': scope.row.read, reason: true }">
{{ $t(`notifications.reason.${scope.row.reason}` + scope.row.reasonExtention) }} {{ $t(`notifications.reason.${scope.row.reason}` + scope.row.reasonTranslationExtention) }}
</ds-text> </ds-text>
</template> </template>
<template #post="scope"> <template #post="scope">
@ -43,7 +43,7 @@
data-test="notification-title-link" data-test="notification-title-link"
:class="{ 'notification-status': scope.row.read }" :class="{ 'notification-status': scope.row.read }"
:to="scope.row.linkTo" :to="scope.row.linkTo"
@click.native="markNotificationAsRead(scope.row.id)" @click.native="markNotificationAsRead(scope.row.notificationSourceId)"
> >
<b>{{ scope.row.title | truncate(50) }}</b> <b>{{ scope.row.title | truncate(50) }}</b>
</nuxt-link> </nuxt-link>

View File

@ -69,7 +69,7 @@ export const extractNotificationDataOfCurrentUser = (notification, currentUser)
let comment = null let comment = null
let contentExcerpt = null let contentExcerpt = null
let report = null let report = null
let reasonExtention = '' let reasonTranslationExtention = ''
let triggerer let triggerer
let title let title
let author let author
@ -101,16 +101,16 @@ export const extractNotificationDataOfCurrentUser = (notification, currentUser)
switch (filed.reportedResource.__typename) { switch (filed.reportedResource.__typename) {
case 'User': case 'User':
user = filed.reportedResource user = filed.reportedResource
reasonExtention = '.user' reasonTranslationExtention = '.user'
break break
case 'Comment': case 'Comment':
comment = filed.reportedResource comment = filed.reportedResource
post = filed.reportedResource.post post = filed.reportedResource.post
reasonExtention = '.comment' reasonTranslationExtention = '.comment'
break break
case 'Post': case 'Post':
post = filed.reportedResource post = filed.reportedResource
reasonExtention = '.post' reasonTranslationExtention = '.post'
break break
} }
} }
@ -146,7 +146,7 @@ export const extractNotificationDataOfCurrentUser = (notification, currentUser)
createdAt: notification.createdAt, createdAt: notification.createdAt,
read: notification.read, read: notification.read,
reason: notification.reason, reason: notification.reason,
id: from.id, notificationSourceId: from.id,
triggerer, triggerer,
user, user,
comment, comment,
@ -155,7 +155,7 @@ export const extractNotificationDataOfCurrentUser = (notification, currentUser)
title, title,
contentExcerpt, contentExcerpt,
report, report,
reasonExtention, reasonTranslationExtention,
linkTo: { name: linkName, params: linkParams, ...linkHashParam }, linkTo: { name: linkName, params: linkParams, ...linkHashParam },
} }
return data return data