Skip to content

Commit 44929a5

Browse files
authored
Merge pull request #263 from MichaelChung123/update-button
Fixing Update button
2 parents f89e02f + 02d21f1 commit 44929a5

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

app/frontend/src/components/forms/submission/StatusPanel.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@
159159
</v-col>
160160

161161
<v-col cols="12" sm="6" xl="4" order="first" order-sm="last">
162-
<v-btn block color="primary" v-on="on" @click="updateStatus">
163-
<span>UPDATE</span>
162+
<v-btn block :disabled="!this.statusToSet" color="primary" v-on="on" @click="updateStatus">
163+
<span>{{ statusAction }}</span>
164164
</v-btn>
165165
</v-col>
166166
</v-row>
@@ -223,6 +223,15 @@ export default {
223223
showActionDate() {
224224
return ['ASSIGNED', 'COMPLETED'].includes(this.statusToSet);
225225
},
226+
statusAction() {
227+
const obj = Object.freeze({
228+
ASSIGNED: 'ASSIGN',
229+
COMPLETED: 'COMPLETE',
230+
REVISING: 'REVISE',
231+
DEFAULT: 'UPDATE'
232+
});
233+
return obj[this.statusToSet] ? obj[this.statusToSet] : obj['DEFAULT'];
234+
},
226235
},
227236
methods: {
228237
...mapActions('notifications', ['addNotification']),
@@ -317,7 +326,6 @@ export default {
317326
this.$refs.form.resetValidation();
318327
this.revisionEmail = '';
319328
this.statusToSet = null;
320-
this.statusFields = false;
321329
this.note = '';
322330
},
323331
async updateStatus() {

0 commit comments

Comments
 (0)