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

Fixed: old jobs not listed in more jobs (#476) #499

Merged
merged 3 commits into from
May 23, 2023
Merged
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
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ VUE_APP_I18N_LOCALE=en
VUE_APP_I18N_FALLBACK_LOCALE=en
VUE_APP_CACHE_MAX_AGE=3600
VUE_APP_VIEW_SIZE=10
VUE_APP_JOB_FREQUENCY_TYPE={"BOPIS_CORRECTION":"default","PRE_ORDER_CTLG":"default","ADD_PRODR_TG_SHPFY":"default","REMV_PRODR_TG_SHPFY":"default","ADD_PRODR_SHPG_DTE_SHPFY":"default","REMV_PRODR_SHPG_DTE_SHPFY":"default","BACK_ORDER_CTLG":"default","ADD_BACKODR_TG_SHPFY":"default","IMP_NEW_ORDERS":"default","IMP_CANCELLED_ORDERS":"default","REMV_BACKODR_TG_SHPFY":"default","ADD_BACKODR_SHPG_DTE_SHPFY":"default","IMP_CANCELLED_ITEMS":"default","REMV_BACKODR_SHPG_DTE_SHPFY":"default","AUTO_RELSE_DAILY":"default","IMP_RETURNS":"default","UPLD_CMPLT_ORDRS":"default","UPLD_CNCLD_ORDRS":"default","UPLD_REFUNDS":"default","NTS_PRMS_DT_CHNG":"default","REJ_ORDR":"default","UNFIL_ORDERS":"default","AUTO_CNCL_DAL":"default","BTCH_BRKR_ORD":"default","LIST_PRE_ORDER":"slow","LIST_BACK_ORDER":"slow","IMP_PRDTS":"default","SYNC_PRDTS":"slow","HARD_SYNC":"slow","IMP_PRDTS_BLK":"default","IMP_ORDERS_BLK":"default"}
VUE_APP_JOB_FREQUENCY_TYPE={"BOPIS_CORRECTION":"default","PRE_ORDER_CTLG":"default","ADD_PRODR_TG_SHPFY":"default","REMV_PRODR_TG_SHPFY":"default","ADD_PRODR_SHPG_DTE_SHPFY":"default","ADD_BACKODR_TG_SHPFY":"default","IMP_NEW_ORDERS":"default","IMP_CANCELLED_ORDERS":"default","REMV_BACKODR_TG_SHPFY":"default","IMP_CANCELLED_ITEMS":"default","AUTO_RELSE_DAILY":"default","IMP_RETURNS":"default","UPLD_CMPLT_ORDRS":"default","UPLD_CNCLD_ORDRS":"default","UPLD_REFUNDS":"default","NTS_PRMS_DT_CHNG":"default","REJ_ORDR":"default","UNFIL_ORDERS":"default","AUTO_CNCL_DAL":"default","BTCH_BRKR_ORD":"default","LIST_PRE_ORDER":"slow","LIST_BACK_ORDER":"slow","IMP_PRDTS":"default","SYNC_PRDTS":"slow","HARD_SYNC":"slow","IMP_PRDTS_BLK":"default","IMP_ORDERS_BLK":"default"}
VUE_APP_ODR_JOB_ENUMS={"IMP_NEW_ORDERS":"JOB_IMP_ORD","IMP_CANCELLED_ORDERS":"JOB_IMP_ORD_CNCL","IMP_CANCELLED_ITEMS":"JOB_IMP_ITM_CNCL","IMP_RETURNS":"JOB_IMP_RTN","UPLD_CMPLT_ORDRS":"JOB_UL_CMPLT_ORD","UPLD_CNCLD_ORDRS":"JOB_UL_CNCLD_ORD","UPLD_REFUNDS":"JOB_UL_REFUNDS","NTS_PRMS_DT_CHNG":"JOB_UL_PRMS_DTE_ORD","REJ_ORDR":"JOB_BKR_REJ_ORD","UNFIL_ORDERS":"JOB_BKR_ORD_UNF","AUTO_CNCL_DAL":"JOB_CNCL_ORD_DTE","BTCH_BRKR_ORD":"JOB_BKR_ORD"}
VUE_APP_PRODR_JOB_ENUMS={"PRE_ORDER_CTLG":"JOB_CAT_REL_PREODR","ADD_PRODR_TG_SHPFY":"JOB_ADD_PREORD_VRT","REMV_PRODR_TG_SHPFY":"JOB_RMV_PREORD_VRT","ADD_PRODR_SHPG_DTE_SHPFY":"JOB_ADD_PREORD_SKU","JOB_UPD_PREORD_SKU":"JOB_UPD_PREORD_SKU","REMV_PRODR_SHPG_DTE_SHPFY":"JOB_RMV_PREORD_SKU","BACK_ORDER_CTLG":"JOB_CAT_REL_BACKORD","ADD_BACKODR_TG_SHPFY":"JOB_ADD_BACKORD_VRT","REMV_BACKODR_TG_SHPFY":"JOB_RMV_BACKORD_VRT","ADD_BACKODR_SHPG_DTE_SHPFY":"JOB_ADD_BACKORD_SKU","JOB_UPD_BACKORD_SKU":"JOB_UPD_BACKORD_SKU","REMV_BACKODR_SHPG_DTE_SHPFY":"JOB_RMV_BACKORD_SKU","AUTO_RELSE_DAILY":"JOB_RLS_ORD_DTE", "REL_PREODR_CAT": "JOB_REL_PREODR_CAT", "PREORDER_CAT_SYC": "JOB_PREORDER_CAT_SYC", "ADD_TAG_BACKORD": "JOB_ADD_TAG_BACKORD", "ADD_TAG_PREORD": "JOB_ADD_TAG_PREORD", "UL_PRMS_DTE": "JOB_UL_PRMS_DTE", "UL_PRMS_DTE_UPD": "JOB_UL_PRMS_DTE_UPD", "SD_PRMSDDTE_CNG_NOTI": "SD_PRMSDDTE_CNG_NOTI", "UL_PRMS_DTE_UPD": "JOB_UL_PRMS_DTE_UPD" }
VUE_APP_PRODR_JOB_ENUMS={"ADD_PRODR_TG_SHPFY":"JOB_ADD_PREORD_VRT","REMV_PRODR_TG_SHPFY":"JOB_RMV_PREORD_VRT", "ADD_BACKODR_TG_SHPFY":"JOB_ADD_BACKORD_VRT","REMV_BACKODR_TG_SHPFY":"JOB_RMV_BACKORD_VRT","AUTO_RELSE_DAILY":"JOB_RLS_ORD_DTE", "REL_PREODR_CAT": "JOB_REL_PREODR_CAT", "PREORDER_CAT_SYC": "JOB_PREORDER_CAT_SYC", "ADD_TAG_BACKORD": "JOB_ADD_TAG_BACKORD", "ADD_TAG_PREORD": "JOB_ADD_TAG_PREORD", "UL_PRMS_DTE": "JOB_UL_PRMS_DTE", "UL_PRMS_DTE_UPD": "JOB_UL_PRMS_DTE_UPD", "SD_PRMSDDTE_CNG_NOTI": "SD_PRMSDDTE_CNG_NOTI", "UL_PRMS_DTE_UPD": "JOB_UL_PRMS_DTE_UPD" }
VUE_APP_PRD_JOB_ENUMS={"IMP_PRDTS":"JOB_IMP_PROD_NEW","SYNC_PRDTS":"JOB_IMP_PROD_UPD"}
VUE_APP_INV_JOB_ENUMS={"HARD_SYNC":"JOB_UL_INV","BOPIS_CORRECTION":"JOB_BOPIS_RALC"}
VUE_APP_INITIAL_JOB_ENUMS={"IMP_PRDTS_BLK":"JOB_IMP_PROD_NEW_BLK","IMP_ORDERS_BLK":"JOB_IMP_ORD_BLK","UL_PRCS":"JOB_UL_PRCS"}
Expand Down
69 changes: 11 additions & 58 deletions src/views/PreOrder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@
</ion-item>
<ion-item>
<ion-label class="ion-text-wrap">{{ $t("Add pre-order tags") }}</ion-label>
<ion-checkbox :disabled="!hasPermission(Actions.APP_JOB_UPDATE)" slot="end" :checked="addPreOrderTagInShopify" @ionChange="updateJob($event['detail'].checked, jobEnums['ADD_PRODR_TG_SHPFY'])"/>
<ion-checkbox :disabled="!hasPermission(Actions.APP_JOB_UPDATE)" slot="end" :checked="getStatus(jobEnums['ADD_PRODR_TG_SHPFY'])" @ionChange="updateJob($event['detail'].checked, jobEnums['ADD_PRODR_TG_SHPFY'])"/>
</ion-item>
<ion-item>
<ion-label class="ion-text-wrap">{{ $t("Remove pre-order tags") }}</ion-label>
<ion-checkbox :disabled="!hasPermission(Actions.APP_JOB_UPDATE)" slot="end" :checked="removePreOrderTagInShopify" @ionChange="updateJob($event['detail'].checked, jobEnums['REMV_PRODR_TG_SHPFY'])"/>
<ion-checkbox :disabled="!hasPermission(Actions.APP_JOB_UPDATE)" slot="end" :checked="getStatus(jobEnums['REMV_PRODR_TG_SHPFY'])" @ionChange="updateJob($event['detail'].checked, jobEnums['REMV_PRODR_TG_SHPFY'])"/>
</ion-item>
<ion-item>
<ion-label class="ion-text-wrap">{{ $t("Add backorder tags") }}</ion-label>
<ion-checkbox :disabled="!hasPermission(Actions.APP_JOB_UPDATE)" slot="end" :checked="addBackOrderTagInShopify" @ionChange="updateJob($event['detail'].checked, jobEnums['ADD_BACKODR_TG_SHPFY'])"/>
<ion-checkbox :disabled="!hasPermission(Actions.APP_JOB_UPDATE)" slot="end" :checked="getStatus(jobEnums['ADD_BACKODR_TG_SHPFY'])" @ionChange="updateJob($event['detail'].checked, jobEnums['ADD_BACKODR_TG_SHPFY'])"/>
</ion-item>
<ion-item>
<ion-label class="ion-text-wrap">{{ $t("Remove backorder tags") }}</ion-label>
<ion-checkbox :disabled="!hasPermission(Actions.APP_JOB_UPDATE)" slot="end" :checked="removeBackOrderTagInShopify" @ionChange="updateJob($event['detail'].checked, jobEnums['REMV_BACKODR_TG_SHPFY'])"/>
<ion-checkbox :disabled="!hasPermission(Actions.APP_JOB_UPDATE)" slot="end" :checked="getStatus(jobEnums['REMV_BACKODR_TG_SHPFY'])" @ionChange="updateJob($event['detail'].checked, jobEnums['REMV_BACKODR_TG_SHPFY'])"/>
</ion-item>
<ion-item lines="none">
<ion-label>
Expand Down Expand Up @@ -133,7 +133,7 @@
</ion-card-header>
<ion-item>
<ion-label class="ion-text-wrap">{{ $t("Run daily") }}</ion-label>
<ion-checkbox :disabled="!hasPermission(Actions.APP_JOB_UPDATE)" :checked="autoReleaseRunDaily" @ionChange="updateJob($event['detail'].checked, jobEnums['AUTO_RELSE_DAILY'], 'EVERYDAY')" />
<ion-checkbox :disabled="!hasPermission(Actions.APP_JOB_UPDATE)" :checked="getStatus(jobEnums['AUTO_RELSE_DAILY'])" @ionChange="updateJob($event['detail'].checked, jobEnums['AUTO_RELSE_DAILY'], 'EVERYDAY')" />
</ion-item>
<ion-item>
<ion-label class="ion-text-wrap">{{ $t("Release preorders")}}</ion-label>
Expand Down Expand Up @@ -219,59 +219,7 @@ export default defineComponent({
currentEComStore: 'user/getCurrentEComStore',
getTemporalExpr: 'job/getTemporalExpr',
getMoreJobs: 'job/getMoreJobs'
}),
preOrderManageCatalog(): boolean {
const status = this.getJobStatus(this.jobEnums["PRE_ORDER_CTLG"]);
return status && status !== "SERVICE_DRAFT";
},
addPreOrderTagInShopify(): boolean {
const status = this.getJobStatus(this.jobEnums["ADD_PRODR_TG_SHPFY"]);
return status && status !== "SERVICE_DRAFT";
},
removePreOrderTagInShopify(): boolean {
const status = this.getJobStatus(this.jobEnums["REMV_PRODR_TG_SHPFY"]);
return status && status !== "SERVICE_DRAFT";
},
addPreOrderShippingDateInShopify(): boolean {
const status = this.getJobStatus(this.jobEnums["ADD_PRODR_SHPG_DTE_SHPFY"]);
return status && status !== "SERVICE_DRAFT";
},
updatePreOrderShippingDateInShopify(): boolean {
const status = this.getJobStatus(this.jobEnums["JOB_UPD_PREORD_SKU"]);
return status && status !== "SERVICE_DRAFT";
},
removePreOrderShippingDateInShopify(): boolean {
const status = this.getJobStatus(this.jobEnums["REMV_PRODR_SHPG_DTE_SHPFY"]);
return status && status !== "SERVICE_DRAFT";
},
backOrderManageCatalog(): boolean {
const status = this.getJobStatus(this.jobEnums["BACK_ORDER_CTLG"]);
return status && status !== "SERVICE_DRAFT";
},
addBackOrderTagInShopify(): boolean {
const status = this.getJobStatus(this.jobEnums["ADD_BACKODR_TG_SHPFY"]);
return status && status !== "SERVICE_DRAFT";
},
removeBackOrderTagInShopify(): boolean {
const status = this.getJobStatus(this.jobEnums["REMV_BACKODR_TG_SHPFY"]);
return status && status !== "SERVICE_DRAFT";
},
addBackOrderShippingDateInShopify(): boolean {
const status = this.getJobStatus(this.jobEnums["ADD_BACKODR_SHPG_DTE_SHPFY"]);
return status && status !== "SERVICE_DRAFT";
},
updateBackOrderShippingDateInShopify(): boolean {
const status = this.getJobStatus(this.jobEnums["JOB_UPD_BACKORD_SKU"]);
return status && status !== "SERVICE_DRAFT";
},
removeBackOrderShippingDateInShopify(): boolean {
const status = this.getJobStatus(this.jobEnums["REMV_BACKODR_SHPG_DTE_SHPFY"]);
return status && status !== "SERVICE_DRAFT";
},
autoReleaseRunDaily(): boolean {
const status = this.getJobStatus(this.jobEnums["AUTO_RELSE_DAILY"]);
return status && status !== "SERVICE_DRAFT";
}
})
},
data() {
return {
Expand Down Expand Up @@ -301,6 +249,11 @@ export default defineComponent({
async updateJob(checked: boolean, id: string, status = 'EVERY_15_MIN') {
const job = this.getJob(id);

// This handles programmatic change on page load. Skips 'Configuration missing' error
if (!job && !checked) {
return;
}

// added check that if the job is not present, then display a toast and then return
if (!job) {
showToast(translate('Configuration missing'))
Expand Down