diff options
Diffstat (limited to 'app/assets/javascripts/vue_shared/issuable/list/components/issuable_item.vue')
-rw-r--r-- | app/assets/javascripts/vue_shared/issuable/list/components/issuable_item.vue | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/app/assets/javascripts/vue_shared/issuable/list/components/issuable_item.vue b/app/assets/javascripts/vue_shared/issuable/list/components/issuable_item.vue index a9f8caa3e1f..b616b390032 100644 --- a/app/assets/javascripts/vue_shared/issuable/list/components/issuable_item.vue +++ b/app/assets/javascripts/vue_shared/issuable/list/components/issuable_item.vue @@ -86,7 +86,18 @@ export default { createdAt() { return getTimeago().format(this.issuable.createdAt); }, - updatedAt() { + timestamp() { + if (this.issuable.state === 'closed' && this.issuable.closedAt) { + return this.issuable.closedAt; + } + return this.issuable.updatedAt; + }, + formattedTimestamp() { + if (this.issuable.state === 'closed' && this.issuable.closedAt) { + return sprintf(__('closed %{timeago}'), { + timeago: getTimeago().format(this.issuable.closedAt), + }); + } return sprintf(__('updated %{timeAgo}'), { timeAgo: getTimeago().format(this.issuable.updatedAt), }); @@ -134,6 +145,7 @@ export default { }, methods: { hasSlotContents(slotName) { + // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots return Boolean(this.$slots[slotName]); }, scopedLabel(label) { @@ -311,10 +323,10 @@ export default { <div v-gl-tooltip.bottom class="gl-text-gray-500 gl-display-none gl-sm-display-inline-block" - :title="tooltipTitle(issuable.updatedAt)" - data-testid="issuable-updated-at" + :title="tooltipTitle(timestamp)" + data-testid="issuable-timestamp" > - {{ updatedAt }} + {{ formattedTimestamp }} </div> </div> </li> |