Skip to content

Commit 1c9eaeb

Browse files
author
Hrvoje Vucic
committed
Fix incorrect publish state display in sidebar
1 parent 81fe925 commit 1c9eaeb

File tree

2 files changed

+13
-21
lines changed

2 files changed

+13
-21
lines changed

client/components/repository/Workflow/Sidebar/Header.vue

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
Related <span class="text-lowercase">{{ activityConfig.label }}</span>
66
</h5>
77
<activity-card
8-
v-bind="{ id, name, shortId }"
8+
v-bind="{ ...activity, name: activity.data.name }"
99
:type-label="activityConfig.label"
1010
:color="activityConfig.color" />
1111
</div>
1212
<publishing
1313
v-if="isAdmin || isRepositoryAdmin"
14-
:activity="{ publishedAt, type }"
14+
:activity="activity"
1515
:outline-activities="outlineActivities"
1616
hide-publish />
1717
<div class="mt-8">
1818
<v-tooltip open-delay="500" bottom>
1919
<template #activator="{ on }">
20-
<label-chip v-on="on">{{ shortId }}</label-chip>
20+
<label-chip v-on="on">{{ activity.shortId }}</label-chip>
2121
</template>
2222
{{ activityConfig.label }} ID
2323
</v-tooltip>
2424
<v-btn
25-
v-clipboard:copy="shortId"
25+
v-clipboard:copy="activity.shortId"
2626
v-clipboard:success="() => {
2727
$snackbar.show('ID copied to the clipboard', { immediate: true })
2828
}"
@@ -46,10 +46,10 @@
4646
Copy link
4747
</v-btn>
4848
<div class="mt-1 caption grey--text text--darken-1">
49-
Created at {{ createdAt | formatDate }}
49+
Created at {{ activity.createdAt | formatDate }}
5050
<template v-if="isUpdated">
5151
<span class="mx-1">|</span>
52-
Updated at {{ updatedAt | formatDate }}
52+
Updated at {{ activity.status.updatedAt | formatDate }}
5353
</template>
5454
</div>
5555
</div>
@@ -67,23 +67,17 @@ import Publishing from '@/components/repository/common/Sidebar/Publishing';
6767
6868
export default {
6969
props: {
70-
uid: { type: String, required: true },
71-
id: { type: Number, required: true },
72-
shortId: { type: String, required: true },
73-
name: { type: String, required: true },
74-
type: { type: String, required: true },
75-
createdAt: { type: String, required: true },
76-
updatedAt: { type: String, default: null },
77-
publishedAt: { type: String, default: null }
70+
activity: { type: Object, required: true }
7871
},
7972
computed: {
8073
...mapGetters(['isAdmin']),
8174
...mapGetters('repository', ['structure', 'outlineActivities', 'isRepositoryAdmin']),
82-
activityConfig: vm => getLevel(vm.type),
75+
activityConfig: ({ activity }) => getLevel(activity.type),
8376
isUpdated() {
84-
if (!this.updatedAt) return false;
85-
const createdAt = this.truncateSeconds(new Date(this.createdAt));
86-
const updatedAt = this.truncateSeconds(new Date(this.updatedAt));
77+
const { activity } = this;
78+
if (!activity.status.updatedAt) return false;
79+
const createdAt = this.truncateSeconds(new Date(activity.createdAt));
80+
const updatedAt = this.truncateSeconds(new Date(activity.status.updatedAt));
8781
return isBefore(createdAt, updatedAt);
8882
},
8983
statusUrl: () => window.location.href

client/components/repository/Workflow/Sidebar/index.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
class="px-4">
77
<template v-if="isTrackedActivity">
88
<sidebar-header
9-
v-bind="selectedActivity"
10-
:name="selectedActivity.data.name"
11-
:updated-at="selectedActivity.status.updatedAt"
9+
:activity="selectedActivity"
1210
class="pt-4" />
1311
<status-field-group
1412
@update="updateStatus"

0 commit comments

Comments
 (0)