Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented: skeleton text in detail items to displayed till job fetched (#524) #651

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/views/Fulfillment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
</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">{{ $t("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 @@ -31,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">{{ $t("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 Down Expand Up @@ -85,6 +87,7 @@ import {
IonLabel,
IonMenuButton,
IonPage,
IonSkeletonText,
IonTitle,
IonToggle,
IonToolbar,
Expand Down Expand Up @@ -117,6 +120,7 @@ export default defineComponent({
IonLabel,
IonMenuButton,
IonPage,
IonSkeletonText,
IonTitle,
IonToggle,
IonToolbar,
Expand All @@ -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: {
Expand Down Expand Up @@ -216,6 +221,7 @@ export default defineComponent({
if (this.currentEComStore.productStoreId) {
this.getAutoCancelDays();
}
this.isLoading = false
},
async getAutoCancelDays(){
const payload = {
Expand Down
9 changes: 6 additions & 3 deletions src/views/Inventory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
</ion-item>
<ion-item button @click="viewJobConfiguration({ id: 'HARD_SYNC', status: getJobStatus(jobEnums['HARD_SYNC'])})" detail>
<ion-label class="ion-text-wrap">{{ $t("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 @@ -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: {
Expand Down Expand Up @@ -212,12 +214,13 @@ 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"
}
});
this.isLoading = false
},
fetchData() {
this.store.dispatch('webhook/fetchWebhooks')
Expand Down
33 changes: 23 additions & 10 deletions src/views/Orders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,33 @@
</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">{{ $t("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">{{ $t("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">{{ $t("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">{{ $t("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">{{ $t("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">{{ $t("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 @@ -68,15 +74,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">{{ $t("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">{{ $t("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">{{ $t("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 @@ -101,6 +110,7 @@ import {
IonLabel,
IonMenuButton,
IonPage,
IonSkeletonText,
IonTitle,
IonToggle,
IonToolbar,
Expand Down Expand Up @@ -129,6 +139,7 @@ export default defineComponent({
IonLabel,
IonMenuButton,
IonPage,
IonSkeletonText,
IonTitle,
IonToggle,
IonToolbar,
Expand All @@ -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: {
Expand Down Expand Up @@ -270,6 +282,7 @@ export default defineComponent({
"enumTypeId": "ORDER_SYS_JOB"
}
});
this.isLoading = false
}
},
mounted () {
Expand Down
14 changes: 9 additions & 5 deletions src/views/Product.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
</ion-card-header>
<ion-item button @click="viewJobConfiguration({ id: 'IMP_PRDTS', status: getJobStatus(jobEnums['IMP_PRDTS'])})" detail>
<ion-label class="ion-text-wrap">{{ $t("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">{{ $t("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>{{ $t("Sync products and category structures from Shopify into HotWax Commerce and keep them up to date.") }}</p></ion-label>
Expand Down Expand Up @@ -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 () {
Expand Down Expand Up @@ -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() {
Expand Down
Loading