Skip to content

Commit 012713d

Browse files
committed
Merge history state info in the same alert
1 parent 194ca53 commit 012713d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

client/src/components/History/HistoryView.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<template>
22
<div v-if="currentUser && history" class="d-flex flex-column h-100">
3-
<b-alert v-if="history.archived" variant="warning" show>This history has been archived.</b-alert>
4-
<b-alert v-if="history.purged" variant="info" show>This history has been purged.</b-alert>
3+
<b-alert v-if="showHistoryStateInfo" variant="info" show>{{ historyStateInfoMessage }}</b-alert>
54
<div v-else class="flex-row flex-grow-0">
65
<b-button
76
v-if="userOwnsHistory"
@@ -72,6 +71,19 @@ export default {
7271
canEditHistory() {
7372
return this.userOwnsHistory && !this.history.archived && !this.history.purged;
7473
},
74+
showHistoryStateInfo() {
75+
return this.history.archived || this.history.purged;
76+
},
77+
historyStateInfoMessage() {
78+
if (this.history.archived && this.history.purged) {
79+
return "This history has been archived and purged.";
80+
} else if (this.history.archived) {
81+
return "This history has been archived.";
82+
} else if (this.history.purged) {
83+
return "This history has been purged.";
84+
}
85+
return "";
86+
},
7587
},
7688
created() {
7789
this.loadHistoryById(this.id);

0 commit comments

Comments
 (0)