Skip to content

Commit 81fe925

Browse files
author
Hrvoje Vucic
committed
Display published status in Progress page data table and sidebar
1 parent 2d9ff15 commit 81fe925

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
<template #item.dueDate="{ value }">
2323
<overview-due-date v-if="value" :value="value" />
2424
</template>
25+
<template v-if="isAdmin || isRepositoryAdmin" #item.publishedAt="{ item }">
26+
<publishing-badge :activity="item" />
27+
<span>{{ item.publishedAt ? 'Published' : 'Not published' }}</span>
28+
</template>
2529
</v-data-table>
2630
</template>
2731

@@ -33,6 +37,7 @@ import OverviewDueDate from './DueDate';
3337
import OverviewName from './Name';
3438
import OverviewPriority from './Priority';
3539
import OverviewStatus from './Status';
40+
import PublishingBadge from '@/components/repository/common/Sidebar/Badge';
3641
import selectActivity from '@/components/repository/common/selectActivity';
3742
3843
export default {
@@ -42,7 +47,8 @@ export default {
4247
activities: { type: Array, default: () => [] }
4348
},
4449
computed: {
45-
...mapGetters('repository', ['workflow']),
50+
...mapGetters(['isAdmin']),
51+
...mapGetters('repository', ['isRepositoryAdmin', 'workflow']),
4652
headers() {
4753
return [{
4854
text: 'Name',
@@ -62,13 +68,18 @@ export default {
6268
}, {
6369
text: 'Due date',
6470
value: 'dueDate'
71+
}, {
72+
text: 'Publish state',
73+
value: 'publishedAt'
6574
}];
6675
},
6776
items() {
68-
return this.activities.map(({ id, data, status }) => ({
77+
return this.activities.map(({ id, data, publishedAt, status, type }) => ({
6978
...status,
7079
id,
7180
name: data.name,
81+
publishedAt,
82+
type,
7283
status: this.getStatusById(status.status),
7384
priority: getPriority(status.priority),
7485
class: this.isActivitySelected(id) && 'selected'
@@ -97,6 +108,7 @@ export default {
97108
}
98109
},
99110
components: {
111+
PublishingBadge,
100112
OverviewAssignee,
101113
OverviewDueDate,
102114
OverviewName,

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
:type-label="activityConfig.label"
1010
:color="activityConfig.color" />
1111
</div>
12+
<publishing
13+
v-if="isAdmin || isRepositoryAdmin"
14+
:activity="{ publishedAt, type }"
15+
:outline-activities="outlineActivities"
16+
hide-publish />
1217
<div class="mt-8">
1318
<v-tooltip open-delay="500" bottom>
1419
<template #activator="{ on }">
@@ -58,6 +63,7 @@ import { getLevel } from 'shared/activities';
5863
import isBefore from 'date-fns/isBefore';
5964
import LabelChip from '@/components/repository/common/LabelChip';
6065
import { mapGetters } from 'vuex';
66+
import Publishing from '@/components/repository/common/Sidebar/Publishing';
6167
6268
export default {
6369
props: {
@@ -67,10 +73,12 @@ export default {
6773
name: { type: String, required: true },
6874
type: { type: String, required: true },
6975
createdAt: { type: String, required: true },
70-
updatedAt: { type: String, default: null }
76+
updatedAt: { type: String, default: null },
77+
publishedAt: { type: String, default: null }
7178
},
7279
computed: {
73-
...mapGetters('repository', ['structure']),
80+
...mapGetters(['isAdmin']),
81+
...mapGetters('repository', ['structure', 'outlineActivities', 'isRepositoryAdmin']),
7482
activityConfig: vm => getLevel(vm.type),
7583
isUpdated() {
7684
if (!this.updatedAt) return false;
@@ -86,6 +94,6 @@ export default {
8694
return fecha.parse(fecha.format(date, format), format);
8795
}
8896
},
89-
components: { ActivityCard, LabelChip }
97+
components: { ActivityCard, LabelChip, Publishing }
9098
};
9199
</script>

client/components/repository/common/Sidebar/Publishing.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<span class="publish-container">
3-
<v-menu offset-y left>
3+
<v-menu v-if="!hidePublish" offset-y left>
44
<template v-slot:activator="{ on }">
55
<v-btn
66
v-on="on"
@@ -43,7 +43,8 @@ export default {
4343
mixins: [publishMixin],
4444
props: {
4545
activity: { type: Object, required: true },
46-
outlineActivities: { type: Array, required: true }
46+
outlineActivities: { type: Array, required: true },
47+
hidePublish: { type: Boolean, default: false }
4748
},
4849
computed: {
4950
config: vm => getLevel(vm.activity.type),

0 commit comments

Comments
 (0)