This commit is contained in:
Wolfgang Huß 2019-11-23 11:40:21 +01:00
parent 8a4ca956e8
commit 4c91675838
2 changed files with 24 additions and 18 deletions

View File

@ -828,7 +828,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
variables: { variables: {
resourceId: 'p2', resourceId: 'p2',
reasonCategory: 'doxing', reasonCategory: 'doxing',
reasonDescription: "I think it is my friends data!", reasonDescription: 'I think it is my friends data!',
}, },
}), }),
]) ])
@ -869,7 +869,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
variables: { variables: {
resourceId: 'p2', resourceId: 'p2',
reasonCategory: 'doxing', reasonCategory: 'doxing',
reasonDescription: "I think it is my friends data again!", reasonDescription: 'I think it is my friends data again!',
}, },
}), }),
]) ])

View File

@ -64,15 +64,27 @@
:to="{ :to="{
name: 'post-id-slug', name: 'post-id-slug',
params: { params: {
id: resourceClaims.type === 'Post' ? resourceClaims.post.id : resourceClaims.comment.post.id, id:
slug: resourceClaims.type === 'Post' ? resourceClaims.post.slug : resourceClaims.comment.post.slug, resourceClaims.type === 'Post'
? resourceClaims.post.id
: resourceClaims.comment.post.id,
slug:
resourceClaims.type === 'Post'
? resourceClaims.post.slug
: resourceClaims.comment.post.slug,
}, },
hash: hash:
resourceClaims.type === 'Comment' ? `#commentId-${resourceClaims.comment.id}` : undefined, resourceClaims.type === 'Comment'
? `#commentId-${resourceClaims.comment.id}`
: undefined,
}" }"
> >
<b v-if="resourceClaims.type === 'Post'">{{ resourceClaims.post.title | truncate(100) }}</b> <b v-if="resourceClaims.type === 'Post'">
<b v-else>{{ resourceClaims.comment.contentExcerpt | removeHtml | truncate(100) }}</b> {{ resourceClaims.post.title | truncate(100) }}
</b>
<b v-else>
{{ resourceClaims.comment.contentExcerpt | removeHtml | truncate(100) }}
</b>
</nuxt-link> </nuxt-link>
</div> </div>
<div v-else> <div v-else>
@ -279,9 +291,7 @@ export default {
// sorting of resource claims and their reports // sorting of resource claims and their reports
newResourcesClaims.forEach(resourceClaims => { newResourcesClaims.forEach(resourceClaims => {
// latestClaim by updatedAt rules // latestClaim by updatedAt rules
resourceClaims.claims.sort( resourceClaims.claims.sort((a, b) => new Date(b.updatedAt) - new Date(a.updatedAt))
(a, b) => new Date(b.updatedAt) - new Date(a.updatedAt),
)
resourceClaims.latestClaim = { resourceClaims.latestClaim = {
id: resourceClaims.claims[0].id, id: resourceClaims.claims[0].id,
createdAt: resourceClaims.claims[0].createdAt, createdAt: resourceClaims.claims[0].createdAt,
@ -290,15 +300,11 @@ export default {
closed: resourceClaims.claims[0].closed, closed: resourceClaims.claims[0].closed,
} }
// display claims always by starting with latest createdAt // display claims always by starting with latest createdAt
resourceClaims.claims.sort( resourceClaims.claims.sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt))
(a, b) => new Date(b.createdAt) - new Date(a.createdAt),
)
resourceClaims.claims.forEach(claim => { resourceClaims.claims.forEach(claim => {
// display reports always by starting with latest createdAt // display reports always by starting with latest createdAt
claim.reports.sort( claim.reports.sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt))
(a, b) => new Date(b.createdAt) - new Date(a.createdAt),
)
}) })
}) })
// display resources by starting with claims by their latest createdAt // display resources by starting with claims by their latest createdAt