Skip to content

Commit

Permalink
Add entityDetails computed property to SubmissionFeedEntry (#1073)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-white authored Dec 7, 2024
1 parent b6098dc commit 4158cd0
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/components/submission/feed-entry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,14 @@ except according to the terms contained in the LICENSE file.
<span class="icon-magic-wand entity-icon"></span>
<i18n-t keypath="title.entity.create">
<template #label>
<router-link v-if="entry.details?.entity?.currentVersion?.label != null" :to="entityPath(projectId, entry.details.entity.dataset, entry.details.entity.uuid)">
{{ entry.details.entity.currentVersion.label }}
<router-link v-if="entityDetails?.currentVersion?.label != null" :to="entityPath(projectId, entityDetails.dataset, entityDetails.uuid)">
{{ entityDetails.currentVersion.label }}
</router-link>
<template v-else>
<span class="entity-label">{{ entry.details.entity.uuid }}</span>
</template>
<span v-else class="entity-label">{{ entityDetails.uuid }}</span>
</template>
<template #dataset>
<router-link :to="datasetPath(projectId, entry.details.entity.dataset)">
{{ entry.details.entity.dataset }}
<router-link :to="datasetPath(projectId, entityDetails.dataset)">
{{ entityDetails.dataset }}
</router-link>
</template>
</i18n-t>
Expand All @@ -65,16 +63,14 @@ except according to the terms contained in the LICENSE file.
<span class="icon-magic-wand entity-icon"></span>
<i18n-t keypath="title.entity.update">
<template #label>
<router-link v-if="entry.details?.entity?.currentVersion?.label != null" :to="entityPath(projectId, entry.details.entity.dataset, entry.details.entity.uuid)">
{{ entry.details.entity.currentVersion.label }}
<router-link v-if="entityDetails?.currentVersion?.label != null" :to="entityPath(projectId, entityDetails.dataset, entityDetails.uuid)">
{{ entityDetails.currentVersion.label }}
</router-link>
<template v-else>
<span class="entity-label">{{ entry.details.entity.uuid }}</span>
</template>
<span v-else class="entity-label">{{ entityDetails.uuid }}</span>
</template>
<template #dataset>
<router-link :to="datasetPath(projectId, entry.details.entity.dataset)">
{{ entry.details.entity.dataset }}
<router-link :to="datasetPath(projectId, entityDetails.dataset)">
{{ entityDetails.dataset }}
</router-link>
</template>
</i18n-t>
Expand Down Expand Up @@ -159,6 +155,9 @@ export default {
? this.entry.details.reviewState
: 'edited';
},
entityDetails() {
return this.entry.details.entity;
},
comment() {
return this.entry.notes != null ? this.entry.notes : this.entry.body;
},
Expand Down

0 comments on commit 4158cd0

Please sign in to comment.