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' }"
/>
{{
$t(`notifications.reason.${notificationData.reason}` + notificationData.reasonExtention)
$t(`notifications.reason.${notificationData.reason}` + notificationData.reasonTranslationExtention)
}}
</ds-text>
</client-only>

View File

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

View File

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