From 5cf3afcfa0d09643d049c5811616d71be259e2cc Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 21 Dec 2023 15:31:33 +0530 Subject: [PATCH 01/32] Implemented: skeleton text in detail items to displayed till job fetched (#524) --- src/views/Fulfillment.vue | 12 +++++++++--- src/views/Inventory.vue | 5 ++++- src/views/Orders.vue | 33 +++++++++++++++++++++++---------- src/views/Product.vue | 14 +++++++++----- 4 files changed, 45 insertions(+), 19 deletions(-) diff --git a/src/views/Fulfillment.vue b/src/views/Fulfillment.vue index 5bbf32a0..a9cb0234 100644 --- a/src/views/Fulfillment.vue +++ b/src/views/Fulfillment.vue @@ -16,7 +16,8 @@ {{ $t("Ship packed orders") }} - {{ getTemporalExpression('SHIP_PKD_ODRS') }} + {{ getTemporalExpression('SHIP_PKD_ODRS') }} + @@ -31,7 +32,8 @@ {{ $t("Order fulfillment") }} - {{ getTemporalExpression('ODR_FLMNT_HST') }} + {{ getTemporalExpression('ODR_FLMNT_HST') }} + @@ -85,6 +87,7 @@ import { IonLabel, IonMenuButton, IonPage, + IonSkeletonText, IonTitle, IonToggle, IonToolbar, @@ -117,6 +120,7 @@ export default defineComponent({ IonLabel, IonMenuButton, IonPage, + IonSkeletonText, IonTitle, IonToggle, IonToolbar, @@ -134,7 +138,8 @@ export default defineComponent({ isDesktop: isPlatform('desktop'), autoCancelDays: '', enumTypeId: 'FULFILLMENT_SYS_JOB', - initialLoadJobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any + initialLoadJobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any, + isLoading: true } }, computed: { @@ -216,6 +221,7 @@ export default defineComponent({ if (this.currentEComStore.productStoreId) { this.getAutoCancelDays(); } + this.isLoading = false }, async getAutoCancelDays(){ const payload = { diff --git a/src/views/Inventory.vue b/src/views/Inventory.vue index 16c76f30..58b57e03 100644 --- a/src/views/Inventory.vue +++ b/src/views/Inventory.vue @@ -25,7 +25,8 @@ {{ $t("Hard sync") }} - {{ getTemporalExpression('HARD_SYNC') }} + {{ getTemporalExpression('HARD_SYNC') }} + @@ -108,6 +109,7 @@ export default defineComponent({ isDesktop: isPlatform('desktop'), enumTypeId: 'INVENTORY_SYS_JOB', webhookEnums: JSON.parse(process.env?.VUE_APP_WEBHOOK_ENUMS as string) as any, + isLoading: true } }, computed: { @@ -218,6 +220,7 @@ export default defineComponent({ "enumTypeId": "INVENTORY_SYS_JOB" } }); + this.isLoading = false }, fetchData() { this.store.dispatch('webhook/fetchWebhooks') diff --git a/src/views/Orders.vue b/src/views/Orders.vue index f5435858..1a362d1e 100644 --- a/src/views/Orders.vue +++ b/src/views/Orders.vue @@ -16,27 +16,33 @@ {{ $t("New orders") }} - {{ getTemporalExpression('IMP_NEW_ORDERS') }} + {{ getTemporalExpression('IMP_NEW_ORDERS') }} + {{ $t("Approve orders") }} - {{ getTemporalExpression('APR_ORD') }} + {{ getTemporalExpression('APR_ORD') }} + {{ $t("Update orders") }} - {{ getTemporalExpression('UPDT_ORDS') }} + {{ getTemporalExpression('UPDT_ORDS') }} + {{ $t("Cancelled orders") }} - {{ getTemporalExpression('IMP_CANCELLED_ORDERS') }} + {{ getTemporalExpression('IMP_CANCELLED_ORDERS') }} + {{ $t("Cancelled items") }} - {{ getTemporalExpression('IMP_CANCELLED_ITEMS') }} + {{ getTemporalExpression('IMP_CANCELLED_ITEMS') }} + {{ $t("Returns") }} - {{ getTemporalExpression('IMP_RETURNS') }} + {{ getTemporalExpression('IMP_RETURNS') }} + @@ -68,15 +74,18 @@ {{ $t("Completed orders") }} - {{ getTemporalExpression('UPLD_CMPLT_ORDRS') }} + {{ getTemporalExpression('UPLD_CMPLT_ORDRS') }} + {{ $t("Cancelled orders") }} - {{ getTemporalExpression('UPLD_CNCLD_ORDRS') }} + {{ getTemporalExpression('UPLD_CNCLD_ORDRS') }} + {{ $t("Refunds") }} - {{ getTemporalExpression('UPLD_REFUNDS') }} + {{ getTemporalExpression('UPLD_REFUNDS') }} + @@ -101,6 +110,7 @@ import { IonLabel, IonMenuButton, IonPage, + IonSkeletonText, IonTitle, IonToggle, IonToolbar, @@ -129,6 +139,7 @@ export default defineComponent({ IonLabel, IonMenuButton, IonPage, + IonSkeletonText, IonTitle, IonToggle, IonToolbar, @@ -146,7 +157,8 @@ export default defineComponent({ isJobDetailAnimationCompleted: false, isDesktop: isPlatform('desktop'), enumTypeId: 'ORDER_SYS_JOB', - initialLoadJobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any + initialLoadJobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any, + isLoading: true } }, computed: { @@ -270,6 +282,7 @@ export default defineComponent({ "enumTypeId": "ORDER_SYS_JOB" } }); + this.isLoading = false } }, mounted () { diff --git a/src/views/Product.vue b/src/views/Product.vue index 01358e12..d040f7d2 100644 --- a/src/views/Product.vue +++ b/src/views/Product.vue @@ -16,11 +16,13 @@ {{ $t("Import products") }} - {{ getTemporalExpression('IMP_PRDTS') }} + {{ getTemporalExpression('IMP_PRDTS') }} + {{ $t("Sync products") }} - {{ getTemporalExpression('SYNC_PRDTS') }} + {{ getTemporalExpression('SYNC_PRDTS') }} +

{{ $t("Sync products and category structures from Shopify into HotWax Commerce and keep them up to date.") }}

@@ -124,7 +126,8 @@ export default defineComponent({ isDesktop: isPlatform('desktop'), webhookEnums: JSON.parse(process.env?.VUE_APP_WEBHOOK_ENUMS as string) as any, enumTypeId: 'PRODUCT_SYS_JOB', - initialLoadJobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any + initialLoadJobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any, + isLoading: true } }, mounted () { @@ -185,13 +188,14 @@ export default defineComponent({ this.getTemporalExpr(this.getJobStatus(this.jobEnums[enumId]))?.description : this.$t('Disabled') }, - fetchJobs(){ - this.store.dispatch("job/fetchJobs", { + async fetchJobs(){ + await this.store.dispatch("job/fetchJobs", { "inputFields":{ "enumTypeId": "PRODUCT_SYS_JOB" } }); this.store.dispatch('webhook/fetchWebhooks') + this.isLoading = false } }, setup() { From 3d5f71e747e1e7a4916e8cdf0edcc91b054f718f Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Thu, 21 Dec 2023 15:49:14 +0530 Subject: [PATCH 02/32] Improved: code to fetch job using async await (#524) --- src/views/Inventory.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/Inventory.vue b/src/views/Inventory.vue index 58b57e03..af1bda7a 100644 --- a/src/views/Inventory.vue +++ b/src/views/Inventory.vue @@ -214,8 +214,8 @@ export default defineComponent({ this.getTemporalExpr(this.getJobStatus(this.jobEnums[enumId]))?.description : this.$t('Disabled') }, - fetchJobs(){ - this.store.dispatch("job/fetchJobs", { + async fetchJobs(){ + await this.store.dispatch("job/fetchJobs", { "inputFields":{ "enumTypeId": "INVENTORY_SYS_JOB" } From 68d636beb530716f25fd1740efc34ca2137dafbf Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 9 Aug 2024 12:27:03 +0530 Subject: [PATCH 03/32] Improved: logic to show spinner and close configuration card in case of product store change (#720) --- src/views/Brokering.vue | 22 +++++++++++++++++++--- src/views/Fulfillment.vue | 20 ++++++++++++++++++-- src/views/InitialLoad.vue | 24 ++++++++++++++++++++---- src/views/Inventory.vue | 26 +++++++++++++++++++++----- src/views/Miscellaneous.vue | 15 ++++++++++++++- src/views/Orders.vue | 20 ++++++++++++++++++-- src/views/Pipeline.vue | 30 +++++++++++++++++++++++------- src/views/PreOrder.vue | 30 +++++++++++++++++++++++------- src/views/Product.vue | 24 ++++++++++++++++++++---- src/views/Reports.vue | 15 ++++++++++++++- 10 files changed, 190 insertions(+), 36 deletions(-) diff --git a/src/views/Brokering.vue b/src/views/Brokering.vue index 828fdb3d..186c253f 100644 --- a/src/views/Brokering.vue +++ b/src/views/Brokering.vue @@ -8,7 +8,13 @@ -
+
+ + + {{ translate("Fetching jobs") }} + +
+
{{ translate('Create new brokering job') }} @@ -58,7 +64,7 @@
-
@@ -83,6 +89,7 @@ import { IonMenuButton, IonPage, IonRow, + IonSpinner, IonTitle, IonToggle, IonToolbar, @@ -121,6 +128,7 @@ export default defineComponent({ IonMenuButton, IonPage, IonRow, + IonSpinner, IonTitle, IonToggle, IonToolbar, @@ -138,7 +146,8 @@ export default defineComponent({ isJobDetailAnimationCompleted: false, isDesktop: isPlatform('desktop'), enumTypeId: 'BROKER_SYS_JOB', - initialLoadJobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any + initialLoadJobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any, + jobsLoading: false } }, computed: { @@ -209,6 +218,12 @@ export default defineComponent({ translate('Disabled') }, async fetchJobs() { + 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 @@ -225,6 +240,7 @@ export default defineComponent({ "systemJobEnumId_op": "in" } }); + this.jobsLoading = false; }, timeFromNow(time: any) { const timeDiff = DateTime.fromMillis(time).diff(DateTime.local()); diff --git a/src/views/Fulfillment.vue b/src/views/Fulfillment.vue index e1becc8e..ae112ad4 100644 --- a/src/views/Fulfillment.vue +++ b/src/views/Fulfillment.vue @@ -8,7 +8,13 @@ -
+
+ + + {{ translate("Fetching jobs") }} + +
+
@@ -110,6 +116,7 @@ import { IonLabel, IonMenuButton, IonPage, + IonSpinner, IonTitle, IonToggle, IonToolbar, @@ -142,6 +149,7 @@ export default defineComponent({ IonLabel, IonMenuButton, IonPage, + IonSpinner, IonTitle, IonToggle, IonToolbar, @@ -159,7 +167,8 @@ export default defineComponent({ isDesktop: isPlatform('desktop'), autoCancelDays: '', enumTypeId: 'FULFILLMENT_SYS_JOB', - initialLoadJobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any + initialLoadJobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any, + jobsLoading: false } }, computed: { @@ -233,6 +242,12 @@ export default defineComponent({ } }, async fetchJobs(){ + 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" @@ -241,6 +256,7 @@ export default defineComponent({ if (this.currentEComStore.productStoreId) { this.getAutoCancelDays(); } + this.jobsLoading = false; }, async getAutoCancelDays(){ const payload = { diff --git a/src/views/InitialLoad.vue b/src/views/InitialLoad.vue index e1ec23dc..c7e62a8b 100644 --- a/src/views/InitialLoad.vue +++ b/src/views/InitialLoad.vue @@ -8,7 +8,13 @@ -
+
+ + + {{ translate("Fetching jobs") }} + +
+
@@ -74,6 +80,7 @@ import { IonLabel, IonMenuButton, IonPage, + IonSpinner, IonTitle, IonToggle, IonToolbar, @@ -103,6 +110,7 @@ export default defineComponent({ IonLabel, IonMenuButton, IonPage, + IonSpinner, IonTitle, IonToggle, IonToolbar @@ -115,7 +123,8 @@ export default defineComponent({ job: {} as any, lastShopifyOrderId: '', isJobDetailAnimationCompleted: false, - isDesktop: isPlatform('desktop') + isDesktop: isPlatform('desktop'), + jobsLoading: false } }, mounted() { @@ -207,14 +216,21 @@ export default defineComponent({ this.isJobDetailAnimationCompleted = true; } }, - fetchJobs(){ - this.store.dispatch("job/fetchJobs", { + async fetchJobs(){ + 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), "systemJobEnumId_op": "in" } }) this.store.dispatch('webhook/fetchWebhooks') + this.jobsLoading = false; }, async updateWebhook(checked: boolean, enumId: string) { const webhook = this.getCachedWebhook[this.webhookEnums[enumId]] diff --git a/src/views/Inventory.vue b/src/views/Inventory.vue index 877f055c..77384625 100644 --- a/src/views/Inventory.vue +++ b/src/views/Inventory.vue @@ -8,7 +8,13 @@ -
+
+ + + {{ translate("Fetching jobs") }} + +
+
@@ -56,6 +62,7 @@ import { IonLabel, IonMenuButton, IonPage, + IonSpinner, IonTitle, IonToggle, IonToolbar, @@ -83,6 +90,7 @@ export default defineComponent({ IonLabel, IonMenuButton, IonPage, + IonSpinner, IonTitle, IonToggle, IonToolbar, @@ -100,6 +108,7 @@ export default defineComponent({ isDesktop: isPlatform('desktop'), enumTypeId: 'INVENTORY_SYS_JOB', webhookEnums: JSON.parse(process.env?.VUE_APP_WEBHOOK_ENUMS as string) as any, + jobsLoading: false } }, computed: { @@ -165,16 +174,23 @@ export default defineComponent({ this.getTemporalExpr(this.getJobStatus(this.jobEnums[enumId]))?.description : translate('Disabled') }, - fetchJobs(){ - this.store.dispatch("job/fetchJobs", { + async fetchJobs(){ + await this.store.dispatch("job/fetchJobs", { "inputFields":{ "enumTypeId": "INVENTORY_SYS_JOB" } }); }, - fetchData() { + async fetchData() { + this.jobsLoading = true; + this.currentJob = ""; + await this.store.dispatch('job/updateCurrentJob', { }); + this.currentJobStatus = ""; + this.freqType = ""; + this.isJobDetailAnimationCompleted = false; this.store.dispatch('webhook/fetchWebhooks') - this.fetchJobs() + await this.fetchJobs() + this.jobsLoading = false; } }, mounted () { diff --git a/src/views/Miscellaneous.vue b/src/views/Miscellaneous.vue index eaba4aad..b29bd5d2 100644 --- a/src/views/Miscellaneous.vue +++ b/src/views/Miscellaneous.vue @@ -8,7 +8,13 @@ -
+
+ + + {{ translate("Fetching jobs") }} + +
+
@@ -108,6 +114,7 @@ export default defineComponent({ isJobDetailAnimationCompleted: false, isDesktop: isPlatform('desktop'), isRetrying: false, + jobsLoading: false } }, computed: { @@ -150,7 +157,13 @@ 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}); + this.jobsLoading = false; }, async loadMoreMiscellaneousJobs (event: any) { this.getMiscellaneousJobs( diff --git a/src/views/Orders.vue b/src/views/Orders.vue index 91adf507..f8dc427f 100644 --- a/src/views/Orders.vue +++ b/src/views/Orders.vue @@ -8,7 +8,13 @@ -
+
+ + + {{ translate("Fetching jobs") }} + +
+
@@ -105,6 +111,7 @@ import { IonLabel, IonMenuButton, IonPage, + IonSpinner, IonTitle, IonToggle, IonToolbar, @@ -133,6 +140,7 @@ export default defineComponent({ IonLabel, IonMenuButton, IonPage, + IonSpinner, IonTitle, IonToggle, IonToolbar, @@ -150,7 +158,8 @@ export default defineComponent({ isJobDetailAnimationCompleted: false, isDesktop: isPlatform('desktop'), enumTypeId: 'ORDER_SYS_JOB', - initialLoadJobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any + initialLoadJobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any, + jobsLoading: false } }, computed: { @@ -268,12 +277,19 @@ export default defineComponent({ translate('Disabled') }, async fetchJobs(){ + 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": { "enumTypeId": "ORDER_SYS_JOB" } }); + this.jobsLoading = false; } }, mounted () { diff --git a/src/views/Pipeline.vue b/src/views/Pipeline.vue index 2e8164fd..968c2159 100644 --- a/src/views/Pipeline.vue +++ b/src/views/Pipeline.vue @@ -31,7 +31,13 @@ -
+
+ + + {{ translate("Fetching jobs") }} + +
+
@@ -360,7 +366,8 @@ export default defineComponent({ isDesktop: isPlatform('desktop'), isRetrying: false, queryString: '' as any, - isScrollingEnabled: false + isScrollingEnabled: false, + jobsLoading: false } }, computed: { @@ -501,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; }); @@ -635,6 +642,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 + await this.refreshJobs(undefined, false); + this.jobsLoading = false; + } }, async created() { this.getPendingJobs(); @@ -646,11 +662,11 @@ export default defineComponent({ await this.store.dispatch('job/updateCurrentJob', { job: {} }); }, mounted(){ - emitter.on("productStoreOrConfigChanged", this.refreshJobs); + emitter.on("productStoreOrConfigChanged", this.updateProductStoreConfig); emitter.on("pinnedJobsUpdated", (this as any).updateSelectedPinnedJob); }, unmounted(){ - emitter.off("productStoreOrConfigChanged", this.refreshJobs); + emitter.off("productStoreOrConfigChanged", this.updateProductStoreConfig); emitter.off('jobUpdated', this.updateJobs); emitter.off("pinnedJobsUpdated", (this as any).updateSelectedPinnedJob); }, diff --git a/src/views/PreOrder.vue b/src/views/PreOrder.vue index ec1d0cbb..78823eb9 100644 --- a/src/views/PreOrder.vue +++ b/src/views/PreOrder.vue @@ -8,7 +8,13 @@ -
+
+ + + {{ translate("Fetching jobs") }} + +
+
@@ -185,6 +191,7 @@ import { IonLabel, IonMenuButton, IonPage, + IonSpinner, IonTitle, IonToolbar, isPlatform @@ -218,6 +225,7 @@ export default defineComponent({ IonLabel, IonMenuButton, IonPage, + IonSpinner, IonTitle, IonToolbar, JobConfiguration, @@ -244,7 +252,8 @@ export default defineComponent({ isJobDetailAnimationCompleted: false, isDesktop: isPlatform('desktop'), enumTypeId: 'PRE_ORD_SYS_JOB', - preOrderBackorderCategory: {} as any + preOrderBackorderCategory: {} as any, + jobsLoading: false } }, methods: { @@ -356,16 +365,23 @@ export default defineComponent({ this.getTemporalExpr(this.getJobStatus(this.jobEnums[enumId]))?.description : translate('Disabled') }, - fetchJobs(){ - this.store.dispatch("job/fetchJobs", { + async fetchJobs(){ + await this.store.dispatch("job/fetchJobs", { "inputFields":{ "enumTypeId": "PRE_ORD_SYS_JOB" } }); }, - fetchInitialData() { - this.fetchJobs(); - this.getPreOrderBackorderCategory(); + async fetchInitialData() { + 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; } }, mounted () { diff --git a/src/views/Product.vue b/src/views/Product.vue index 07515198..a502098f 100644 --- a/src/views/Product.vue +++ b/src/views/Product.vue @@ -8,7 +8,13 @@ -
+
+ + + {{ translate("Fetching jobs") }} + +
+
@@ -64,6 +70,7 @@ import { IonLabel, IonMenuButton, IonPage, + IonSpinner, IonTitle, IonToolbar, IonToggle, @@ -91,6 +98,7 @@ export default defineComponent({ IonLabel, IonMenuButton, IonPage, + IonSpinner, IonTitle, IonToolbar, IonToggle, @@ -126,7 +134,8 @@ export default defineComponent({ isDesktop: isPlatform('desktop'), webhookEnums: JSON.parse(process.env?.VUE_APP_WEBHOOK_ENUMS as string) as any, enumTypeId: 'PRODUCT_SYS_JOB', - initialLoadJobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any + initialLoadJobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any, + jobsLoading: false } }, mounted () { @@ -187,13 +196,20 @@ export default defineComponent({ this.getTemporalExpr(this.getJobStatus(this.jobEnums[enumId]))?.description : translate('Disabled') }, - fetchJobs(){ - this.store.dispatch("job/fetchJobs", { + async fetchJobs(){ + 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" } }); this.store.dispatch('webhook/fetchWebhooks') + this.jobsLoading = false; } }, setup() { diff --git a/src/views/Reports.vue b/src/views/Reports.vue index e83e0204..80fb169f 100644 --- a/src/views/Reports.vue +++ b/src/views/Reports.vue @@ -8,7 +8,13 @@ -
+
+ + + {{ translate("Fetching jobs") }} + +
+

{{ translate("There are no reports jobs right now") }}

@@ -98,6 +104,7 @@ export default defineComponent({ isJobDetailAnimationCompleted: false, isDesktop: isPlatform('desktop'), isRetrying: false, + jobsLoading: false } }, computed: { @@ -138,7 +145,13 @@ 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 }); + this.jobsLoading = false; }, async loadMoreReportsJobs(event: any) { this.getReportsJobs( From b682ade02795819d4b818cd8107743ed387c9d2f Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Fri, 9 Aug 2024 12:28:22 +0530 Subject: [PATCH 04/32] Improved: added missing locale entry for the spinner static text (#720) --- src/locales/en.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/locales/en.json b/src/locales/en.json index a0250ee1..d4648be1 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -90,6 +90,7 @@ "Failed": "Failed", "Failed job reason": "Failed job reason", "Failed to schedule service(s)": "Failed to schedule {count} service(s)", + "Fetching jobs": "Fetching jobs", "Fetching TimeZones": "Fetching TimeZones", "File upload status": "File upload status", "Filters": "Filters", From a159f5831b359730eb1dfdf7f50b73e506024964 Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Tue, 8 Oct 2024 16:09:05 +0530 Subject: [PATCH 05/32] Implemented: 'Learn More' functionality that generates job info from GitBook Lens APIs (#726) --- src/adapter/index.ts | 4 +- src/components/JobConfiguration.vue | 21 +++- src/components/LeareMoreModal.vue | 168 ++++++++++++++++++++++++++++ src/locales/en.json | 3 + src/views/Pipeline.vue | 17 ++- 5 files changed, 209 insertions(+), 4 deletions(-) create mode 100644 src/components/LeareMoreModal.vue diff --git a/src/adapter/index.ts b/src/adapter/index.ts index a31b0067..60edcc82 100644 --- a/src/adapter/index.ts +++ b/src/adapter/index.ts @@ -1,7 +1,8 @@ -import { api, client, getConfig, initialise, logout, resetConfig, updateInstanceUrl, updateToken, setUserTimeZone, getAvailableTimeZones} from '@hotwax/oms-api' +import { api, askQuery, client, getConfig, initialise, logout, resetConfig, searchQuery, updateInstanceUrl, updateToken, setUserTimeZone, getAvailableTimeZones} from '@hotwax/oms-api' export { api, + askQuery, client, getConfig, initialise, @@ -9,6 +10,7 @@ export { resetConfig, updateInstanceUrl, updateToken, + searchQuery, setUserTimeZone, getAvailableTimeZones } \ No newline at end of file diff --git a/src/components/JobConfiguration.vue b/src/components/JobConfiguration.vue index 77926a83..edb3e0c1 100644 --- a/src/components/JobConfiguration.vue +++ b/src/components/JobConfiguration.vue @@ -13,7 +13,9 @@ -

{{ currentJob.description }}

+

{{ currentJob.description }} + Learn more +

@@ -132,6 +134,7 @@ import { IonRow, IonSelect, IonSelectOption, + IonText, alertController, modalController, } from "@ionic/vue"; @@ -159,6 +162,7 @@ import emitter from '@/event-bus'; import { Actions, hasPermission } from '@/authorization' import CustomFrequencyModal from '@/components/CustomFrequencyModal.vue'; import JobParameterModal from '@/components/JobParameterModal.vue' +import LeareMoreModal from "./LeareMoreModal.vue"; export default defineComponent({ name: "JobConfiguration", @@ -176,7 +180,8 @@ export default defineComponent({ IonRow, IonSelect, IonSelectOption, - IonCheckbox + IonCheckbox, + IonText }, data() { return { @@ -225,6 +230,13 @@ export default defineComponent({ } }, methods: { + async openLearnMoreModal() { + const openLearnMoreModal = await modalController.create({ + component: LeareMoreModal, + componentProps: {currentJob: this.currentJob} + }) + return openLearnMoreModal.present() + }, getDateTime(time: any) { return DateTime.fromMillis(time).toISO() }, @@ -547,6 +559,11 @@ export default defineComponent({