Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/hotwax/job-manager into hot…
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Nov 26, 2024
2 parents 54259ee + ad6e02d commit 27ac99e
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 65 deletions.
33 changes: 16 additions & 17 deletions src/views/Fulfillment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,16 @@
</ion-header>

<ion-content>
<div class="empty-state" v-if="jobsLoading">
<ion-item lines="none">
<ion-spinner name="crescent" slot="start" />
{{ translate("Fetching jobs") }}
</ion-item>
</div>
<main v-else>
<main>
<section>
<ion-card>
<ion-card-header>
<ion-card-title>{{ translate("Shipping") }}</ion-card-title>
</ion-card-header>
<ion-item button @click="viewJobConfiguration({ id: 'SHIP_PKD_ODRS', status: getJobStatus(jobEnums['SHIP_PKD_ODRS']) })" detail>
<ion-label class="ion-text-wrap">{{ translate("Ship packed orders") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('SHIP_PKD_ODRS') }}</ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('SHIP_PKD_ODRS') }}</ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
<ion-item lines="none">
<ion-label class="ion-text-wrap">
Expand All @@ -37,7 +32,8 @@
</ion-card-header>
<ion-item button @click="viewJobConfiguration({ id: 'ODR_FLMNT_HST', status: getJobStatus(jobEnums['ODR_FLMNT_HST']) })" detail>
<ion-label class="ion-text-wrap">{{ translate("Order fulfillment") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('ODR_FLMNT_HST') }}</ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('ODR_FLMNT_HST') }}</ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
<ion-item lines="none">
<ion-label class="ion-text-wrap">
Expand All @@ -52,15 +48,18 @@
</ion-card-header>
<ion-item button @click="viewJobConfiguration({ id: 'OPN_BOPIS_ORD_NT', status: getJobStatus(jobEnums['OPN_BOPIS_ORD_NT']) })" detail>
<ion-label class="ion-text-wrap">{{ translate("Open BOPIS order notification") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('OPN_BOPIS_ORD_NT') }}</ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('OPN_BOPIS_ORD_NT') }}</ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
<ion-item button @click="viewJobConfiguration({ id: 'READYPICK_BOPIS_ORD_NT', status: getJobStatus(jobEnums['READYPICK_BOPIS_ORD_NT']) })" detail>
<ion-label class="ion-text-wrap">{{ translate("Ready to pick BOPIS order notification") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('READYPICK_BOPIS_ORD_NT') }}</ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('READYPICK_BOPIS_ORD_NT') }}</ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
<ion-item button @click="viewJobConfiguration({ id: 'OPEN_SHIPPING_ORD_NT', status: getJobStatus(jobEnums['OPEN_SHIPPING_ORD_NT']) })" detail>
<ion-label class="ion-text-wrap">{{ translate("Open shipping order notification") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('OPEN_SHIPPING_ORD_NT') }}</ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('OPEN_SHIPPING_ORD_NT') }}</ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
<ion-item lines="none">
<ion-label class="ion-text-wrap">
Expand Down Expand Up @@ -116,7 +115,7 @@ import {
IonLabel,
IonMenuButton,
IonPage,
IonSpinner,
IonSkeletonText,
IonTitle,
IonToggle,
IonToolbar,
Expand Down Expand Up @@ -149,7 +148,7 @@ export default defineComponent({
IonLabel,
IonMenuButton,
IonPage,
IonSpinner,
IonSkeletonText,
IonTitle,
IonToggle,
IonToolbar,
Expand All @@ -168,7 +167,7 @@ export default defineComponent({
autoCancelDays: '',
enumTypeId: 'FULFILLMENT_SYS_JOB',
initialLoadJobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any,
jobsLoading: false
isLoading: false
}
},
computed: {
Expand Down Expand Up @@ -242,8 +241,8 @@ export default defineComponent({
}
},
async fetchJobs(JobDetailDismissRequired = false){
this.isLoading = true;
if(JobDetailDismissRequired) {
this.jobsLoading = true;
this.currentJob = "";
await this.store.dispatch('job/updateCurrentJob', { });
this.currentJobStatus = "";
Expand All @@ -258,7 +257,7 @@ export default defineComponent({
if (this.currentEComStore.productStoreId) {
this.getAutoCancelDays();
}
this.jobsLoading = false;
this.isLoading = false
},
async getAutoCancelDays(){
const payload = {
Expand Down
21 changes: 8 additions & 13 deletions src/views/Inventory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,16 @@
</ion-header>

<ion-content>
<div class="empty-state" v-if="jobsLoading">
<ion-item lines="none">
<ion-spinner name="crescent" slot="start" />
{{ translate("Fetching jobs") }}
</ion-item>
</div>
<main v-else>
<main>
<section>
<ion-card>
<ion-card-header>
<ion-card-title>{{ translate("Adjustments") }}</ion-card-title>
</ion-card-header>
<ion-item button @click="viewJobConfiguration({ id: 'HARD_SYNC', status: getJobStatus(jobEnums['HARD_SYNC'])})" detail>
<ion-label class="ion-text-wrap">{{ translate("Hard sync") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('HARD_SYNC') }}</ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('HARD_SYNC') }}</ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
<ion-item lines="none">
<ion-label class="ion-text-wrap">
Expand Down Expand Up @@ -62,7 +57,7 @@ import {
IonLabel,
IonMenuButton,
IonPage,
IonSpinner,
IonSkeletonText,
IonTitle,
IonToggle,
IonToolbar,
Expand Down Expand Up @@ -90,7 +85,7 @@ export default defineComponent({
IonLabel,
IonMenuButton,
IonPage,
IonSpinner,
IonSkeletonText,
IonTitle,
IonToggle,
IonToolbar,
Expand All @@ -108,7 +103,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
isLoading: false
}
},
computed: {
Expand Down Expand Up @@ -175,15 +170,16 @@ export default defineComponent({
translate('Disabled')
},
async fetchJobs(){
this.isLoading = true
await this.store.dispatch("job/fetchJobs", {
"inputFields":{
"enumTypeId": "INVENTORY_SYS_JOB"
}
});
this.isLoading = false
},
async fetchData(JobDetailDismissRequired = false) {
if(JobDetailDismissRequired) {
this.jobsLoading = true;
this.currentJob = "";
await this.store.dispatch('job/updateCurrentJob', { });
this.currentJobStatus = "";
Expand All @@ -192,7 +188,6 @@ export default defineComponent({
}
this.store.dispatch('webhook/fetchWebhooks')
await this.fetchJobs()
this.jobsLoading = false;
}
},
mounted () {
Expand Down
45 changes: 24 additions & 21 deletions src/views/Orders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,41 @@
</ion-header>

<ion-content>
<div class="empty-state" v-if="jobsLoading">
<ion-item lines="none">
<ion-spinner name="crescent" slot="start" />
{{ translate("Fetching jobs") }}
</ion-item>
</div>
<main v-else>
<main>
<section>
<ion-card>
<ion-card-header>
<ion-card-title>{{ translate("Import") }}</ion-card-title>
</ion-card-header>
<ion-item @click="viewJobConfiguration({ id: 'IMP_NEW_ORDERS', status: getJobStatus(jobEnums['IMP_NEW_ORDERS'])})" detail button>
<ion-label class="ion-text-wrap">{{ translate("New orders") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('IMP_NEW_ORDERS') }}</ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('IMP_NEW_ORDERS') }}</ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
<ion-item @click="viewJobConfiguration({ id: 'APR_ORD', status: getJobStatus(jobEnums['APR_ORD'])})" detail button>
<ion-label class="ion-text-wrap">{{ translate("Approve orders") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('APR_ORD') }}</ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('APR_ORD') }}</ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
<ion-item @click="viewJobConfiguration({ id: 'UPDT_ORDS', status: getJobStatus(jobEnums['UPDT_ORDS'])})" detail button>
<ion-label class="ion-text-wrap">{{ translate("Update orders") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('UPDT_ORDS') }}</ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('UPDT_ORDS') }}</ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
<ion-item @click="viewJobConfiguration({ id: 'IMP_CANCELLED_ORDERS', status: getJobStatus(jobEnums['IMP_CANCELLED_ORDERS'])})" detail button>
<ion-label class="ion-text-wrap">{{ translate("Cancelled orders") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('IMP_CANCELLED_ORDERS') }}</ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('IMP_CANCELLED_ORDERS') }}</ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
<ion-item @click="viewJobConfiguration({ id: 'IMP_CANCELLED_ITEMS', status: getJobStatus(jobEnums['IMP_CANCELLED_ITEMS'])})" detail button>
<ion-label class="ion-text-wrap">{{ translate("Cancelled items") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('IMP_CANCELLED_ITEMS') }}</ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('IMP_CANCELLED_ITEMS') }}</ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
<ion-item @click="viewJobConfiguration({ id: 'IMP_RETURNS', status: getJobStatus(jobEnums['IMP_RETURNS'])})" detail button>
<ion-label class="ion-text-wrap">{{ translate("Returns") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('IMP_RETURNS') }}</ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('IMP_RETURNS') }}</ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
</ion-card>

Expand Down Expand Up @@ -78,15 +78,18 @@
</ion-card-header>
<ion-item @click="viewJobConfiguration({ id: 'UPLD_CMPLT_ORDRS', status: getJobStatus(jobEnums['UPLD_CMPLT_ORDRS'])})" detail button>
<ion-label class="ion-text-wrap">{{ translate("Completed orders") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('UPLD_CMPLT_ORDRS') }}</ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('UPLD_CMPLT_ORDRS') }}</ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
<ion-item @click="viewJobConfiguration({ id: 'UPLD_CNCLD_ORDRS', status: getJobStatus(jobEnums['UPLD_CNCLD_ORDRS'])})" detail button>
<ion-label class="ion-text-wrap">{{ translate("Cancelled orders") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('UPLD_CNCLD_ORDRS') }}</ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('UPLD_CNCLD_ORDRS') }}</ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
<ion-item @click="viewJobConfiguration({ id: 'UPLD_REFUNDS', status: getJobStatus(jobEnums['UPLD_REFUNDS'])})" detail button>
<ion-label class="ion-text-wrap">{{ translate("Refunds") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('UPLD_REFUNDS') }}</ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('UPLD_REFUNDS') }}</ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
</ion-card>
<MoreJobs v-if="getMoreJobs({...jobEnums, ...initialLoadJobEnums}, enumTypeId).length" :jobs="getMoreJobs({...jobEnums, ...initialLoadJobEnums}, enumTypeId)" />
Expand All @@ -111,7 +114,7 @@ import {
IonLabel,
IonMenuButton,
IonPage,
IonSpinner,
IonSkeletonText,
IonTitle,
IonToggle,
IonToolbar,
Expand Down Expand Up @@ -140,7 +143,7 @@ export default defineComponent({
IonLabel,
IonMenuButton,
IonPage,
IonSpinner,
IonSkeletonText,
IonTitle,
IonToggle,
IonToolbar,
Expand All @@ -159,7 +162,7 @@ export default defineComponent({
isDesktop: isPlatform('desktop'),
enumTypeId: 'ORDER_SYS_JOB',
initialLoadJobEnums: JSON.parse(process.env?.VUE_APP_INITIAL_JOB_ENUMS as string) as any,
jobsLoading: false
isLoading: false
}
},
computed: {
Expand Down Expand Up @@ -277,8 +280,8 @@ export default defineComponent({
translate('Disabled')
},
async fetchJobs(JobDetailDismissRequired = false){
this.isLoading = true;
if(JobDetailDismissRequired) {
this.jobsLoading = true;
this.currentJob = ""
await this.store.dispatch('job/updateCurrentJob', { });
this.currentJobStatus = ""
Expand All @@ -291,7 +294,7 @@ export default defineComponent({
"enumTypeId": "ORDER_SYS_JOB"
}
});
this.jobsLoading = false;
this.isLoading = false
}
},
mounted () {
Expand Down
24 changes: 10 additions & 14 deletions src/views/Product.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,21 @@
</ion-header>

<ion-content>
<div class="empty-state" v-if="jobsLoading">
<ion-item lines="none">
<ion-spinner name="crescent" slot="start" />
{{ translate("Fetching jobs") }}
</ion-item>
</div>
<main v-else>
<main>
<section>
<ion-card>
<ion-card-header>
<ion-card-title>{{ translate("Sync") }}</ion-card-title>
</ion-card-header>
<ion-item button @click="viewJobConfiguration({ id: 'IMP_PRDTS', status: getJobStatus(jobEnums['IMP_PRDTS'])})" detail>
<ion-label class="ion-text-wrap">{{ translate("Import products") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('IMP_PRDTS') }}</ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('IMP_PRDTS') }}</ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
<ion-item button @click="viewJobConfiguration({ id: 'SYNC_PRDTS', status: getJobStatus(jobEnums['SYNC_PRDTS'])})" detail>
<ion-label class="ion-text-wrap">{{ translate("Sync products") }}</ion-label>
<ion-label slot="end">{{ getTemporalExpression('SYNC_PRDTS') }} </ion-label>
<ion-label v-if="!isLoading" slot="end">{{ getTemporalExpression('SYNC_PRDTS') }} </ion-label>
<ion-skeleton-text v-else style="width: 30%;" animated />
</ion-item>
<ion-item lines="none">
<ion-label class="ion-text-wrap"><p>{{ translate("Sync products and category structures from Shopify into HotWax Commerce and keep them up to date.") }}</p></ion-label>
Expand Down Expand Up @@ -70,7 +66,7 @@ import {
IonLabel,
IonMenuButton,
IonPage,
IonSpinner,
IonSkeletonText,
IonTitle,
IonToolbar,
IonToggle,
Expand Down Expand Up @@ -98,7 +94,7 @@ export default defineComponent({
IonLabel,
IonMenuButton,
IonPage,
IonSpinner,
IonSkeletonText,
IonTitle,
IonToolbar,
IonToggle,
Expand Down Expand Up @@ -135,7 +131,7 @@ export default defineComponent({
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,
jobsLoading: false
isLoading: false
}
},
mounted () {
Expand Down Expand Up @@ -197,8 +193,8 @@ export default defineComponent({
translate('Disabled')
},
async fetchJobs(JobDetailDismissRequired = false){
this.isLoading = true;
if(JobDetailDismissRequired) {
this.jobsLoading = true;
this.currentJob = ""
await this.store.dispatch('job/updateCurrentJob', { });
this.currentJobStatus = ""
Expand All @@ -211,7 +207,7 @@ export default defineComponent({
}
});
this.store.dispatch('webhook/fetchWebhooks')
this.jobsLoading = false;
this.isLoading = false
}
},
setup() {
Expand Down

0 comments on commit 27ac99e

Please sign in to comment.