From 1be633b9a00224240960b85cf50e3c023916985c Mon Sep 17 00:00:00 2001 From: R-Sourabh Date: Thu, 6 Jun 2024 18:31:25 +0530 Subject: [PATCH] Updated: resolved the comments regarding the scheduled restock functionality(#285) --- .env.example | 4 +- src/components/CreateMappingModal.vue | 11 ---- src/components/ScheduledRestockPopover.vue | 4 +- src/locales/en.json | 3 +- src/router/index.ts | 2 +- src/store/modules/stock/actions.ts | 3 +- src/store/modules/util/actions.ts | 8 ++- src/views/Inventory.vue | 2 +- src/views/ScheduledRestock.vue | 31 ++++----- src/views/ScheduledRestockReview.vue | 74 +++++++++++----------- 10 files changed, 66 insertions(+), 76 deletions(-) diff --git a/.env.example b/.env.example index 59263584..98c2e210 100644 --- a/.env.example +++ b/.env.example @@ -7,7 +7,7 @@ VUE_APP_PERMISSION_ID="IMPORT_APP_VIEW" VUE_APP_ALIAS={} VUE_APP_MAPPING_TYPES={"PO": "PO_MAPPING_PREF","RSTINV": "INV_MAPPING_PREF","RSTSTK": "STK_MAPPING_PREF"} VUE_APP_MAPPING_PO={"orderId": { "label": "Order ID", "required": true }, "productSku": { "label": "Shopify product SKU", "required": true },"orderDate": { "label": "Arrival date", "required": true }, "quantity": { "label": "Ordered quantity", "required": true }, "facility": { "label": "Facility ID", "required": true }} -VUE_APP_MAPPING_RSTINV={"productIdentification": { "label": "Product Identification", "required": true }, "quantity": { "label": "Quantity", "required": true }} -VUE_APP_MAPPING_RSTSTK={"productIdentification": { "label": "Product Identification", "required": true }, "facility": { "label": "Facility", "required": true }, "restockQuantity": { "label": "Restock quantity", "required": true }} +VUE_APP_MAPPING_RSTINV={"productIdentification": { "label": "Product Identification", "required": true }, "quantity": { "label": "Quantity", "required": true }, "facility": { "label": "Facility ID", "required": true }} +VUE_APP_MAPPING_RSTSTK={"productIdentification": { "label": "Product Identification", "required": true }, "restockQuantity": { "label": "Restock quantity", "required": true }} VUE_APP_DEFAULT_LOG_LEVEL="error" VUE_APP_LOGIN_URL="http://launchpad.hotwax.io/login" \ No newline at end of file diff --git a/src/components/CreateMappingModal.vue b/src/components/CreateMappingModal.vue index e449375d..ce5ac899 100644 --- a/src/components/CreateMappingModal.vue +++ b/src/components/CreateMappingModal.vue @@ -107,17 +107,6 @@ export default defineComponent({ methods: { getFields() { const fields = process.env["VUE_APP_MAPPING_" + this.mappingType]; - if (this.mappingType == 'RSTSTK') { - const parsedFields = fields ? JSON.parse(fields) : {}; - const requiredFields: any = {}; - for (const [key, value] of Object.entries(parsedFields)) { - if ((value as any).required == true) { - requiredFields[key] = value; - } - } - return requiredFields; - } - return fields ? JSON.parse(fields) : {}; }, closeModal() { diff --git a/src/components/ScheduledRestockPopover.vue b/src/components/ScheduledRestockPopover.vue index e00edab7..40193b93 100644 --- a/src/components/ScheduledRestockPopover.vue +++ b/src/components/ScheduledRestockPopover.vue @@ -11,7 +11,6 @@ id="schedule-datetime" show-default-buttons hour-cycle="h23" - presentation="date-time" :value="job.runTime ? getDateTime(job.runTime) : getDateTime(DateTime.now().toMillis())" @ionChange="changeJobRunTime($event)" /> @@ -140,7 +139,8 @@ export default defineComponent({ setup() { const store = useStore(); return { - store + store, + translate } }, }); diff --git a/src/locales/en.json b/src/locales/en.json index 4e8ef99b..500aae3e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -97,7 +97,7 @@ "New version available, please update the app.": "New version available, please update the app.", "There are no saved CSV mappings to show. Create a new mapping from a file upload screen": "There are no saved CSV mappings to show. Create a new mapping from a file upload screen", "No new file upload. Please try again": "No new file upload. Please try again", - "No product found": "No product found", + "No products found": "No products found", "No results found": "No results found", "No time zone found": "No time zone found", "of": "of", @@ -114,6 +114,7 @@ "Pending": "Pending", "Please ensure that the uploaded file contains accurate product information. If a product does not exist, the corresponding records will not be processed.": "Please ensure that the uploaded file contains accurate product information. If a product does not exist, the corresponding records will not be processed.", "Please provide a future date and time": "Please provide a future date and time", + "Please select a facility": "Please select a facility", "Please select a schedule time": "Please select a schedule time", "Please select a product store": "Please select a product store", "Please select a shopify shop": "Please select a shopify shop", diff --git a/src/router/index.ts b/src/router/index.ts index 9490497d..caa8eadc 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -82,7 +82,7 @@ const routes: Array = [ }, { path: '/scheduled-restock-review', - name: 'ScheduledRestockDetail', + name: 'ScheduledRestockReview', component: ScheduledRestockReview, beforeEnter: authGuard }, diff --git a/src/store/modules/stock/actions.ts b/src/store/modules/stock/actions.ts index 3559fef1..b144f089 100644 --- a/src/store/modules/stock/actions.ts +++ b/src/store/modules/stock/actions.ts @@ -121,7 +121,7 @@ const actions: ActionTree = { } const payload = { - 'JOB_NAME': restockName || state.schedule.restockName || `Created ${DateTime.fromMillis(+state.schedule.scheduledTime).toLocaleString(DateTime.DATETIME_MED)}`, + 'JOB_NAME': restockName || state.schedule.restockName || `Created ${DateTime.now().toLocaleString(DateTime.DATETIME_MED)}`, 'SERVICE_NAME': job.serviceName, 'SERVICE_COUNT': '0', 'SERVICE_TEMP_EXPR': job.jobStatus, @@ -129,7 +129,6 @@ const actions: ActionTree = { 'jobFields': { 'systemJobEnumId': job.systemJobEnumId, 'tempExprId': job.jobStatus, // Need to remove this as we are passing frequency in SERVICE_TEMP_EXPR, currently kept it for backward compatibility - 'maxRecurrenceCount': '-1', 'parentJobId': job.parentJobId, 'runAsUser': 'system', //default system, but empty in run now. TODO Need to remove this as we are using SERVICE_RUN_AS_SYSTEM, currently kept it for backward compatibility 'recurrenceTimeZone': this.state.user.current.usershipPackedOrdersTimeZone, diff --git a/src/store/modules/util/actions.ts b/src/store/modules/util/actions.ts index 6abc203b..453b2881 100644 --- a/src/store/modules/util/actions.ts +++ b/src/store/modules/util/actions.ts @@ -105,12 +105,13 @@ const actions: ActionTree = { } return state.facilities; }, - async fetchProductStores({ state, commit }) { + async fetchProductStores({ commit }) { let productStores = []; const payload = { "viewSize": 50, "entityName": "ProductStore", + "fieldList": ["storeName", "productStoreId"], "noConditionFind": "Y" } try { @@ -126,6 +127,11 @@ const actions: ActionTree = { commit(types.UTIL_PRODUCT_STORES_UPDATED, productStores); }, + + async clearProductStores({ commit }) { + commit(types.UTIL_PRODUCT_STORES_UPDATED, []); + }, + async updateFileProcessingStatus({ commit }, status){ commit(types.UTIL_FILE_PROCESSING_STATUS_UPDATED, { status }); }, diff --git a/src/views/Inventory.vue b/src/views/Inventory.vue index 7325a52e..421b955c 100644 --- a/src/views/Inventory.vue +++ b/src/views/Inventory.vue @@ -202,7 +202,7 @@ main { margin: var(--spacer-sm) auto 0; } -.review{ +ion-button{ margin: var(--spacer-base) var(--spacer-sm); } diff --git a/src/views/ScheduledRestock.vue b/src/views/ScheduledRestock.vue index eb00c426..abad9250 100644 --- a/src/views/ScheduledRestock.vue +++ b/src/views/ScheduledRestock.vue @@ -1,6 +1,6 @@