Skip to content

Commit

Permalink
Show delete retore events in Entity feed
Browse files Browse the repository at this point in the history
  • Loading branch information
sadiqkhoja committed Jan 6, 2025
1 parent 1d27e98 commit bbbcc71
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/components/entity/feed-entry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,21 @@ except according to the terms contained in the LICENSE file.
<template #name><actor-link :actor="entry.actor"/></template>
</i18n-t>
</template>
<template v-else-if="entry.action === 'entity.delete'">
<span class="icon-trash"></span>
<i18n-t keypath="title.entity.delete">
<template #name><actor-link :actor="entry.actor"/></template>
</i18n-t>
</template>
<template v-else-if="entry.action === 'entity.restore'">
<span class="icon-recycle"></span>
<i18n-t keypath="title.entity.restore">
<template #label>
<span class="entity-label">{{ entity.currentVersion.label }}</span>
</template>
<template #name><actor-link :actor="entry.actor"/></template>
</i18n-t>
</template>
</template>
<template #body>
<entity-diff v-if="entityVersion != null && entityVersion.version !== 1"/>
Expand Down Expand Up @@ -200,6 +215,8 @@ const showBranchData = () => {
color: #bbb;
vertical-align: -2px;
}
.icon-trash { color: #bbb; }
.icon-recycle {color: #bbb; }

.deleted-submission, .entity-label, .source-name { font-weight: normal; }
.deleted-submission { color: $color-danger; }
Expand Down Expand Up @@ -282,7 +299,13 @@ const showBranchData = () => {
},
// This text is shown in a list of events. {name} is the name of a Web
// User.
"update_resolve": "Conflict warning resolved by {name}"
"update_resolve": "Conflict warning resolved by {name}",
// This text is shown in a list of events. {name} is the name of a Web
// User.
"delete": "Entity {label} deleted by {name}",
// This text is shown in a list of events. {name} is the name of a Web
// User.
"restore": "Entity {label} undeleted by {name}"
}
},
// This is shown for an update to an Entity when the update was made offline
Expand Down
8 changes: 8 additions & 0 deletions transifex/strings_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2021,6 +2021,14 @@
"update_resolve": {
"string": "Conflict warning resolved by {name}",
"developer_comment": "This text is shown in a list of events. {name} is the name of a Web User."
},
"delete": {
"string": "Entity {label} deleted by {name}",
"developer_comment": "This text is shown in a list of events. {name} is the name of a Web User."
},
"restore": {
"string": "Entity {label} undeleted by {name}",
"developer_comment": "This text is shown in a list of events. {name} is the name of a Web User."
}
}
},
Expand Down

0 comments on commit bbbcc71

Please sign in to comment.