From 6435b99b395be9d19e26677728d675c42f5a414e Mon Sep 17 00:00:00 2001 From: MichaelChung123 Date: Wed, 1 Dec 2021 16:25:16 -0800 Subject: [PATCH 1/6] fixing Update button --- app/frontend/src/components/forms/submission/StatusPanel.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/frontend/src/components/forms/submission/StatusPanel.vue b/app/frontend/src/components/forms/submission/StatusPanel.vue index 0b9db691b..557930c88 100644 --- a/app/frontend/src/components/forms/submission/StatusPanel.vue +++ b/app/frontend/src/components/forms/submission/StatusPanel.vue @@ -159,8 +159,8 @@ - - UPDATE + + {{ !this.statusToSet ? 'UPDATE' : this.statusToSet}} From 42b38e3e066be85bf7de720a64c9e5c3771c890d Mon Sep 17 00:00:00 2001 From: MichaelChung123 Date: Thu, 2 Dec 2021 11:16:46 -0800 Subject: [PATCH 2/6] fixing text --- .../forms/submission/StatusPanel.vue | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/app/frontend/src/components/forms/submission/StatusPanel.vue b/app/frontend/src/components/forms/submission/StatusPanel.vue index 557930c88..7503d001d 100644 --- a/app/frontend/src/components/forms/submission/StatusPanel.vue +++ b/app/frontend/src/components/forms/submission/StatusPanel.vue @@ -160,7 +160,7 @@ - {{ !this.statusToSet ? 'UPDATE' : this.statusToSet}} + {{ !this.statusFields ? 'UPDATE' : this.statusUpdateText }} @@ -207,6 +207,7 @@ export default { statusHistory: {}, statusFields: false, statusToSet: '', + statusUpdateText: '', valid: false, }; }, @@ -260,6 +261,21 @@ export default { .includes(queryText.toLocaleLowerCase()) ); }, + changeStatus() { + this.statusFields = true; + + switch (this.statusToSet) { + case 'ASSIGNED': + this.statusUpdateText = 'ASSIGN'; + break; + case 'COMPLETED': + this.statusUpdateText = 'COMPLETE'; + break; + case 'REVISED': + this.statusUpdateText = 'REVISE'; + break; + } + }, async getStatus() { this.loading = true; try { @@ -317,7 +333,6 @@ export default { this.$refs.form.resetValidation(); this.revisionEmail = ''; this.statusToSet = null; - this.statusFields = false; this.note = ''; }, async updateStatus() { From 18ea4dba8cc7a5861a229aa60559c0d3f14e7077 Mon Sep 17 00:00:00 2001 From: MichaelChung123 Date: Wed, 15 Dec 2021 14:19:31 -0800 Subject: [PATCH 3/6] moving to computed value --- .../forms/submission/StatusPanel.vue | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/app/frontend/src/components/forms/submission/StatusPanel.vue b/app/frontend/src/components/forms/submission/StatusPanel.vue index 7503d001d..a469ec616 100644 --- a/app/frontend/src/components/forms/submission/StatusPanel.vue +++ b/app/frontend/src/components/forms/submission/StatusPanel.vue @@ -24,7 +24,7 @@ item-value="code" v-model="statusToSet" :rules="[(v) => !!v || 'Status is required']" - @change="onStatusChange(statusToSet)" + @change="statusFields = true;" />
@@ -160,7 +160,7 @@ - {{ !this.statusFields ? 'UPDATE' : this.statusUpdateText }} + {{ this.statusAction }} @@ -207,7 +207,6 @@ export default { statusHistory: {}, statusFields: false, statusToSet: '', - statusUpdateText: '', valid: false, }; }, @@ -224,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']), @@ -261,21 +269,6 @@ export default { .includes(queryText.toLocaleLowerCase()) ); }, - changeStatus() { - this.statusFields = true; - - switch (this.statusToSet) { - case 'ASSIGNED': - this.statusUpdateText = 'ASSIGN'; - break; - case 'COMPLETED': - this.statusUpdateText = 'COMPLETE'; - break; - case 'REVISED': - this.statusUpdateText = 'REVISE'; - break; - } - }, async getStatus() { this.loading = true; try { From 7bdeb473087a290a8a8e77413f83466945b7c349 Mon Sep 17 00:00:00 2001 From: MichaelChung123 Date: Wed, 15 Dec 2021 14:28:04 -0800 Subject: [PATCH 4/6] removing .this --- app/frontend/src/components/forms/submission/StatusPanel.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/frontend/src/components/forms/submission/StatusPanel.vue b/app/frontend/src/components/forms/submission/StatusPanel.vue index a469ec616..cbde927c9 100644 --- a/app/frontend/src/components/forms/submission/StatusPanel.vue +++ b/app/frontend/src/components/forms/submission/StatusPanel.vue @@ -160,7 +160,7 @@ - {{ this.statusAction }} + {{ statusAction }} From 9f8214552521d7dc2b144d76f6e07eeb74f80825 Mon Sep 17 00:00:00 2001 From: MichaelChung123 Date: Wed, 15 Dec 2021 14:49:38 -0800 Subject: [PATCH 5/6] fixing recipient email --- app/frontend/src/components/forms/submission/StatusPanel.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/frontend/src/components/forms/submission/StatusPanel.vue b/app/frontend/src/components/forms/submission/StatusPanel.vue index cbde927c9..3fc943b79 100644 --- a/app/frontend/src/components/forms/submission/StatusPanel.vue +++ b/app/frontend/src/components/forms/submission/StatusPanel.vue @@ -24,8 +24,9 @@ item-value="code" v-model="statusToSet" :rules="[(v) => !!v || 'Status is required']" - @change="statusFields = true;" + @change="onStatusChange(statusToSet)" /> +
From 02d21f1c02f77204577b0e9e89f0652f88ac0a5c Mon Sep 17 00:00:00 2001 From: MichaelChung123 Date: Wed, 15 Dec 2021 14:56:21 -0800 Subject: [PATCH 6/6] removing comment --- app/frontend/src/components/forms/submission/StatusPanel.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/app/frontend/src/components/forms/submission/StatusPanel.vue b/app/frontend/src/components/forms/submission/StatusPanel.vue index 3fc943b79..81424b878 100644 --- a/app/frontend/src/components/forms/submission/StatusPanel.vue +++ b/app/frontend/src/components/forms/submission/StatusPanel.vue @@ -26,7 +26,6 @@ :rules="[(v) => !!v || 'Status is required']" @change="onStatusChange(statusToSet)" /> -