diff --git a/src/components/Menu.vue b/src/components/Menu.vue index f5388823..b31672c2 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -83,12 +83,12 @@ export default defineComponent({ async setEComStore(event: CustomEvent) { if(this.userProfile && this.eComStore?.productStoreId !== event.detail.value) { await this.store.dispatch('user/setEcomStore', { 'productStoreId': event.detail.value }) - emitter.emit("productStoreOrConfigChanged") + emitter.emit("productStoreOrConfigChanged", true) } }, async setShopifyConfig(event: CustomEvent){ await this.store.dispatch('user/setCurrentShopifyConfig', { 'shopifyConfigId': event.detail.value }); - emitter.emit("productStoreOrConfigChanged") + emitter.emit("productStoreOrConfigChanged", true) } }, setup() { diff --git a/src/views/Brokering.vue b/src/views/Brokering.vue index 186c253f..9e3c293a 100644 --- a/src/views/Brokering.vue +++ b/src/views/Brokering.vue @@ -217,13 +217,15 @@ export default defineComponent({ this.getTemporalExpr(this.getJobStatus(this.jobEnums[enumId]))?.description : translate('Disabled') }, - async fetchJobs() { - this.jobsLoading = true; - this.currentJob = ""; - await this.store.dispatch('job/updateCurrentJob', { }); - this.currentJobStatus = ""; - this.freqType = ""; - this.isJobDetailAnimationCompleted = false; + async fetchJobs(JobDetailDismissRequired = false) { + if(JobDetailDismissRequired) { + this.jobsLoading = true; + this.currentJob = ""; + await this.store.dispatch('job/updateCurrentJob', { }); + this.currentJobStatus = ""; + this.freqType = ""; + this.isJobDetailAnimationCompleted = false; + } await this.store.dispatch("job/fetchJobs", { "inputFields": { // If we fetch broker sys job by not passing systemJobEnumId filter then this api diff --git a/src/views/Fulfillment.vue b/src/views/Fulfillment.vue index ae112ad4..9303dd88 100644 --- a/src/views/Fulfillment.vue +++ b/src/views/Fulfillment.vue @@ -241,13 +241,15 @@ export default defineComponent({ this.store.dispatch('job/updateJob', job) } }, - async fetchJobs(){ - this.jobsLoading = true; - this.currentJob = ""; - await this.store.dispatch('job/updateCurrentJob', { }); - this.currentJobStatus = ""; - this.freqType = ""; - this.isJobDetailAnimationCompleted = false; + async fetchJobs(JobDetailDismissRequired = false){ + if(JobDetailDismissRequired) { + this.jobsLoading = true; + this.currentJob = ""; + await this.store.dispatch('job/updateCurrentJob', { }); + this.currentJobStatus = ""; + this.freqType = ""; + this.isJobDetailAnimationCompleted = false; + } await this.store.dispatch("job/fetchJobs", { "inputFields": { "enumTypeId": "FULFILLMENT_SYS_JOB" diff --git a/src/views/InitialLoad.vue b/src/views/InitialLoad.vue index c7e62a8b..84d3de1e 100644 --- a/src/views/InitialLoad.vue +++ b/src/views/InitialLoad.vue @@ -216,13 +216,15 @@ export default defineComponent({ this.isJobDetailAnimationCompleted = true; } }, - async fetchJobs(){ - this.jobsLoading = true; - this.currentSelectedJobModal = ""; - await this.store.dispatch('job/updateCurrentJob', { }); - this.job = {}; - this.lastShopifyOrderId = ""; - this.isJobDetailAnimationCompleted = false; + async fetchJobs(JobDetailDismissRequired = false){ + if(JobDetailDismissRequired) { + this.jobsLoading = true; + this.currentSelectedJobModal = ""; + await this.store.dispatch('job/updateCurrentJob', { }); + this.job = {}; + this.lastShopifyOrderId = ""; + this.isJobDetailAnimationCompleted = false; + } await this.store.dispatch("job/fetchJobs", { "inputFields":{ "systemJobEnumId": Object.values(this.jobEnums), diff --git a/src/views/Inventory.vue b/src/views/Inventory.vue index 77384625..c7816ae3 100644 --- a/src/views/Inventory.vue +++ b/src/views/Inventory.vue @@ -181,13 +181,15 @@ export default defineComponent({ } }); }, - async fetchData() { - this.jobsLoading = true; - this.currentJob = ""; - await this.store.dispatch('job/updateCurrentJob', { }); - this.currentJobStatus = ""; - this.freqType = ""; - this.isJobDetailAnimationCompleted = false; + async fetchData(JobDetailDismissRequired = false) { + if(JobDetailDismissRequired) { + this.jobsLoading = true; + this.currentJob = ""; + await this.store.dispatch('job/updateCurrentJob', { }); + this.currentJobStatus = ""; + this.freqType = ""; + this.isJobDetailAnimationCompleted = false; + } this.store.dispatch('webhook/fetchWebhooks') await this.fetchJobs() this.jobsLoading = false; diff --git a/src/views/Miscellaneous.vue b/src/views/Miscellaneous.vue index b29bd5d2..02f44eda 100644 --- a/src/views/Miscellaneous.vue +++ b/src/views/Miscellaneous.vue @@ -101,10 +101,10 @@ export default defineComponent({ mounted() { emitter.on('jobUpdated', this.getMiscellaneousJobs); this.getMiscellaneousJobs(); - emitter.on("productStoreOrConfigChanged", this.getMiscellaneousJobs); + emitter.on("productStoreOrConfigChanged", this.updateProductStoreConfig); }, unmounted() { - emitter.off("productStoreOrConfigChanged", this.getMiscellaneousJobs); + emitter.off("productStoreOrConfigChanged", this.updateProductStoreConfig); emitter.off('jobUpdated', this.getMiscellaneousJobs); }, data() { @@ -157,12 +157,17 @@ export default defineComponent({ } }, async getMiscellaneousJobs(viewSize = 100, viewIndex = 0) { - this.jobsLoading = true; - this.currentJob = ""; - await this.store.dispatch('job/updateCurrentJob', { }); - this.currentJobStatus = ""; - this.isJobDetailAnimationCompleted = false; await this.store.dispatch('job/fetchMiscellaneousJobs', {eComStoreId: this.getCurrentEComStore.productStoreId, viewSize, viewIndex}); + }, + async updateProductStoreConfig(JobDetailDismissRequired = false) { + if(JobDetailDismissRequired) { + this.jobsLoading = true; + this.currentJob = ""; + await this.store.dispatch('job/updateCurrentJob', { }); + this.currentJobStatus = ""; + this.isJobDetailAnimationCompleted = false; + } + this.getMiscellaneousJobs(); this.jobsLoading = false; }, async loadMoreMiscellaneousJobs (event: any) { diff --git a/src/views/Orders.vue b/src/views/Orders.vue index f8dc427f..643f3843 100644 --- a/src/views/Orders.vue +++ b/src/views/Orders.vue @@ -276,13 +276,15 @@ export default defineComponent({ this.getTemporalExpr(this.getJobStatus(this.jobEnums[enumId]))?.description : translate('Disabled') }, - async fetchJobs(){ - this.jobsLoading = true; - this.currentJob = "" - await this.store.dispatch('job/updateCurrentJob', { }); - this.currentJobStatus = "" - this.freqType = "" - this.isJobDetailAnimationCompleted = false + async fetchJobs(JobDetailDismissRequired = false){ + if(JobDetailDismissRequired) { + this.jobsLoading = true; + this.currentJob = "" + await this.store.dispatch('job/updateCurrentJob', { }); + this.currentJobStatus = "" + this.freqType = "" + this.isJobDetailAnimationCompleted = false + } this.store.dispatch('webhook/fetchWebhooks') await this.store.dispatch("job/fetchJobs", { "inputFields": { diff --git a/src/views/Pipeline.vue b/src/views/Pipeline.vue index f0874d7f..ce407222 100644 --- a/src/views/Pipeline.vue +++ b/src/views/Pipeline.vue @@ -508,17 +508,17 @@ export default defineComponent({ async refreshJobs(event: any, isRetrying = false ) { this.isRetrying = isRetrying; if(this.segmentSelected === 'pending') { - this.getPendingJobs().then(() => { + await this.getPendingJobs().then(() => { if(event) event.target.complete(); this.isRetrying = false; }); } else if(this.segmentSelected === 'running') { - this.getRunningJobs().then(() => { + await this.getRunningJobs().then(() => { if(event) event.target.complete(); this.isRetrying = false; }); } else { - this.getJobHistory().then(() => { + await this.getJobHistory().then(() => { if(event) event.target.complete(); this.isRetrying = false; }); @@ -645,12 +645,15 @@ export default defineComponent({ this.getPendingJobs(); } }, - async updateProductStoreConfig() { - this.jobsLoading = true; - await this.store.dispatch('job/updateCurrentJob', { job: {} }); - this.currentJobStatus = "" - this.freqType = "" - this.isJobDetailAnimationCompleted = false + async updateProductStoreConfig(JobDetailDismissRequired = false) { + if(JobDetailDismissRequired) { + this.jobsLoading = true; + console.log('if') + await this.store.dispatch('job/updateCurrentJob', { job: {} }); + this.currentJobStatus = "" + this.freqType = "" + this.isJobDetailAnimationCompleted = false + } await this.refreshJobs(undefined); this.jobsLoading = false; } diff --git a/src/views/PreOrder.vue b/src/views/PreOrder.vue index 78823eb9..b1adcf3a 100644 --- a/src/views/PreOrder.vue +++ b/src/views/PreOrder.vue @@ -372,13 +372,15 @@ export default defineComponent({ } }); }, - async fetchInitialData() { - this.jobsLoading = true; - this.currentJob = ""; - await this.store.dispatch('job/updateCurrentJob', { }); - this.currentJobStatus = "" - this.freqType = ''; - this.isJobDetailAnimationCompleted = false; + async fetchInitialData(JobDetailDismissRequired = false) { + if(JobDetailDismissRequired) { + this.jobsLoading = true; + this.currentJob = ""; + await this.store.dispatch('job/updateCurrentJob', { }); + this.currentJobStatus = "" + this.freqType = ''; + this.isJobDetailAnimationCompleted = false; + } await this.fetchJobs(); await this.getPreOrderBackorderCategory(); this.jobsLoading = false; diff --git a/src/views/Product.vue b/src/views/Product.vue index a502098f..1f63b10e 100644 --- a/src/views/Product.vue +++ b/src/views/Product.vue @@ -196,13 +196,15 @@ export default defineComponent({ this.getTemporalExpr(this.getJobStatus(this.jobEnums[enumId]))?.description : translate('Disabled') }, - async fetchJobs(){ - this.jobsLoading = true; - this.currentJob = "" - await this.store.dispatch('job/updateCurrentJob', { }); - this.currentJobStatus = "" - this.freqType = "" - this.isJobDetailAnimationCompleted = false + async fetchJobs(JobDetailDismissRequired = false){ + if(JobDetailDismissRequired) { + this.jobsLoading = true; + this.currentJob = "" + await this.store.dispatch('job/updateCurrentJob', { }); + this.currentJobStatus = "" + this.freqType = "" + this.isJobDetailAnimationCompleted = false + } await this.store.dispatch("job/fetchJobs", { "inputFields":{ "enumTypeId": "PRODUCT_SYS_JOB" diff --git a/src/views/Reports.vue b/src/views/Reports.vue index 80fb169f..ac6dc03b 100644 --- a/src/views/Reports.vue +++ b/src/views/Reports.vue @@ -117,11 +117,11 @@ export default defineComponent({ mounted() { emitter.on('jobUpdated', this.getReportsJobs); this.getReportsJobs(); - emitter.on("productStoreOrConfigChanged", this.getReportsJobs); + emitter.on("productStoreOrConfigChanged", this.updateProductStoreConfig); }, unmounted() { emitter.on('jobUpdated', this.getReportsJobs); - emitter.off("productStoreOrConfigChanged", this.getReportsJobs); + emitter.off("productStoreOrConfigChanged", this.updateProductStoreConfig); }, methods: { async viewJobConfiguration(job: any) { @@ -145,12 +145,17 @@ export default defineComponent({ } }, async getReportsJobs(viewSize = 200, viewIndex = 0) { - this.jobsLoading = true; - this.currentJob = ""; - await this.store.dispatch('job/updateCurrentJob', { }); - this.currentJobStatus = ""; - this.isJobDetailAnimationCompleted = false; await this.store.dispatch('job/fetchReportsJobs', { eComStoreId: this.getCurrentEComStore.productStoreId, viewSize, viewIndex }); + }, + async updateProductStoreConfig(JobDetailDismissRequired = false) { + if(JobDetailDismissRequired) { + this.jobsLoading = true; + this.currentJob = ""; + await this.store.dispatch('job/updateCurrentJob', { }); + this.currentJobStatus = ""; + this.isJobDetailAnimationCompleted = false; + } + await this.getReportsJobs() this.jobsLoading = false; }, async loadMoreReportsJobs(event: any) {