Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add entityDetails computed property to SubmissionFeedEntry #1073

Merged
merged 2 commits into from
Dec 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -151,6 +147,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