From 08e587796c0ceaf6fc7768ca2020122634f1fe0a Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Tue, 31 Oct 2023 12:05:31 +0530 Subject: [PATCH 1/3] Improved: job fetching query when clicking on a job to open configuration (#619) --- src/views/Brokering.vue | 5 ++++- src/views/Fulfillment.vue | 5 ++++- src/views/Orders.vue | 5 ++++- src/views/Product.vue | 7 +++++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/views/Brokering.vue b/src/views/Brokering.vue index 1f8149b7..5073a3ac 100644 --- a/src/views/Brokering.vue +++ b/src/views/Brokering.vue @@ -222,7 +222,10 @@ export default defineComponent({ this.currentJob.runTime = '' } - await this.store.dispatch('job/updateCurrentJob', { job: this.currentJob }); + const job = await this.store.dispatch('job/updateCurrentJob', { job: this.currentJob, jobId: this.jobEnums[jobInformation.id] }); + + if(job) this.currentJob = job; + if(!this.isDesktop && this.currentJob) { this.router.push({ name: 'JobDetails', params: { jobId: this.currentJob.jobId, category: "orders" } }); return; diff --git a/src/views/Fulfillment.vue b/src/views/Fulfillment.vue index b18b7fed..5ceee002 100644 --- a/src/views/Fulfillment.vue +++ b/src/views/Fulfillment.vue @@ -249,7 +249,10 @@ export default defineComponent({ this.currentJob.runTime = '' } - await this.store.dispatch('job/updateCurrentJob', { job: this.currentJob }); + const job = await this.store.dispatch('job/updateCurrentJob', { job: this.currentJob, jobId: this.jobEnums[jobInformation.id] }); + + if(job) this.currentJob = job; + if(!this.isDesktop && this.currentJob) { this.router.push({ name: 'JobDetails', params: { jobId: this.currentJob.jobId, category: "orders" } }); return; diff --git a/src/views/Orders.vue b/src/views/Orders.vue index 8b15633e..8803b123 100644 --- a/src/views/Orders.vue +++ b/src/views/Orders.vue @@ -241,7 +241,10 @@ export default defineComponent({ this.currentJob.runTime = '' } - await this.store.dispatch('job/updateCurrentJob', { job: this.currentJob }); + const job = await this.store.dispatch('job/updateCurrentJob', { job: this.currentJob, jobId: this.jobEnums[jobInformation.id] }); + + if(job) this.currentJob = job; + if(!this.isDesktop && this.currentJob) { this.router.push({ name: 'JobDetails', params: { jobId: this.currentJob.jobId, category: "orders" } }); return; diff --git a/src/views/Product.vue b/src/views/Product.vue index 7fd59746..1e17b100 100644 --- a/src/views/Product.vue +++ b/src/views/Product.vue @@ -40,7 +40,7 @@ - +