Skip to content

Commit

Permalink
Merge pull request #263 from MichaelChung123/update-button
Browse files Browse the repository at this point in the history
Fixing Update button
  • Loading branch information
loneil authored Dec 16, 2021
2 parents f89e02f + 02d21f1 commit 44929a5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions app/frontend/src/components/forms/submission/StatusPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@
</v-col>

<v-col cols="12" sm="6" xl="4" order="first" order-sm="last">
<v-btn block color="primary" v-on="on" @click="updateStatus">
<span>UPDATE</span>
<v-btn block :disabled="!this.statusToSet" color="primary" v-on="on" @click="updateStatus">
<span>{{ statusAction }}</span>
</v-btn>
</v-col>
</v-row>
Expand Down Expand Up @@ -223,6 +223,15 @@ export default {
showActionDate() {
return ['ASSIGNED', 'COMPLETED'].includes(this.statusToSet);
},
statusAction() {
const obj = Object.freeze({
ASSIGNED: 'ASSIGN',
COMPLETED: 'COMPLETE',
REVISING: 'REVISE',
DEFAULT: 'UPDATE'
});
return obj[this.statusToSet] ? obj[this.statusToSet] : obj['DEFAULT'];
},
},
methods: {
...mapActions('notifications', ['addNotification']),
Expand Down Expand Up @@ -317,7 +326,6 @@ export default {
this.$refs.form.resetValidation();
this.revisionEmail = '';
this.statusToSet = null;
this.statusFields = false;
this.note = '';
},
async updateStatus() {
Expand Down

0 comments on commit 44929a5

Please sign in to comment.