From b7c2a9aca159db666cccc572a2b30addab043f51 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Wed, 5 Jun 2024 10:44:37 +0530 Subject: [PATCH 1/4] Implemented: support to include a custom field using address1 and city(#575) --- src/views/DownloadPackedOrders.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/views/DownloadPackedOrders.vue b/src/views/DownloadPackedOrders.vue index 3df589ef..7d8f0a7d 100644 --- a/src/views/DownloadPackedOrders.vue +++ b/src/views/DownloadPackedOrders.vue @@ -168,6 +168,13 @@ export default defineComponent({ async parse(data: any) { try { this.content = await parseCsv(data).then(res => res); + + // Creating a new field by combining the address1 and city field + this.content = this.content.map((contentData: any) => { + contentData["custom-address"] = (contentData["address1"] ? contentData["address1"] : "") + (contentData["address1"] && contentData["city"] ? " " : "") + (contentData["city"] ? contentData["city"] : "") + + return contentData + }) // get the column names from the data this.dataColumns = Object.keys(this.content[0]); // generating mapping only when we get the packed orders information and parsing of data is successfull From 9e9d5162a2597f30183860fa04758a3c8aeef24a Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Wed, 5 Jun 2024 12:46:40 +0530 Subject: [PATCH 2/4] Improved: field name and merged columns(#575) --- .env.example | 2 +- src/views/DownloadPackedOrders.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 9e1f3493..eb3f1a64 100644 --- a/.env.example +++ b/.env.example @@ -7,7 +7,7 @@ VUE_APP_PERMISSION_ID= VUE_APP_ALIAS={} VUE_APP_MAPPING_TYPES={"IMPORD": "IMP_ORD_MAPPING_PREF","EXPORD": "EXP_PKD_ORD_MAP_PREF"} VUE_APP_MAPPING_IMPORD={"orderId": { "label": "Order ID", "value": "" }, "facilityId": { "label": "Facility ID", "value": "" },"trackingCode": { "label": "Tracking Code", "value": "" }} -VUE_APP_MAPPING_EXPORD={"shipment-id": { "label": "Shipment ID", "value": "" }, "order-id": { "label": "Order ID", "value": "" },"to-name": { "label": "To Name", "value": "" },"address1": { "label": "Address 1", "value": "" },"address2": { "label": "Address 2", "value": "" },"city": { "label": "City", "value": "" },"state": { "label": "State", "value": "" },"zip-code": { "label": "Zip Code", "value": "" },"country-code": { "label": "Country Code", "value": "" },"full-to-address": { "label": "Full Address", "value": "" },"phone-number": { "label": "Phone Number", "value": "" },"email-address": { "label": "Email", "value": "" },"weight": { "label": "Weight", "value": "" },"quantity": { "label": "Quantity", "value": "" },"product-name": { "label": "Product Name", "value": "" },"product-sku": { "label": "Product Sku", "value": "" },"shipping-method": { "label": "Shipping Method", "value": "" },"facility-name": { "label": "Facility Name", "value": "" },"facility-address1": { "label": "Facility Address 1", "value": "" },"facility-address2": { "label": "Facility Address 2", "value": "" },"facility-city": { "label": "Facility City", "value": "" },"facility-state": { "label": "Facility State", "value": "" },"facility-zip-code": { "label": "Facility Zip Code", "value": "" },"facility-phone": { "label": "Facility Phone", "value": "" },"facility-full-address": { "label": "Facility Full Address", "value": "" }, "order-name": { "label": "Order Name", "value": "" }, "customer-name": { "label": "Customer Name", "value": "" }, "first-name": { "label": "First Name", "value": "" }, "last-name": { "label": "Last Name", "value": "" }, "billing-address1": { "label": "Billing Address 1", "value": "" }, "billing-address2": { "label": "Billing Address 2", "value": "" }, "billing-city": { "label": "Billing City", "value": "" }, "billing-state": { "label": "Billing State", "value": "" }, "billing-zip-code": { "label": "Billing Zip Code", "value": "" }, "billing-country-code": { "label": "Billing Country Code", "value": "" }, "billing-phone-number": { "label": "Billing Phone Number", "value": "" }, "delivery-date": { "label": "Delivery Date", "value": "" }, "delivery-time": { "label": "Delivery Time", "value": "" }, "cod-fee": { "label": "COD Fee", "value": "" }, "cod-fee-tax": { "label": "COD Fee Tax", "value": "" }} +VUE_APP_MAPPING_EXPORD={"shipment-id": { "label": "Shipment ID", "value": "" }, "order-id": { "label": "Order ID", "value": "" },"to-name": { "label": "To Name", "value": "" }, "state+city": { "label": "State + City", "value": "" }, "address1": { "label": "Address 1", "value": "" },"address2": { "label": "Address 2", "value": "" },"city": { "label": "City", "value": "" },"state": { "label": "State", "value": "" },"zip-code": { "label": "Zip Code", "value": "" },"country-code": { "label": "Country Code", "value": "" },"full-to-address": { "label": "Full Address", "value": "" },"phone-number": { "label": "Phone Number", "value": "" },"email-address": { "label": "Email", "value": "" },"weight": { "label": "Weight", "value": "" },"quantity": { "label": "Quantity", "value": "" },"product-name": { "label": "Product Name", "value": "" },"product-sku": { "label": "Product Sku", "value": "" },"shipping-method": { "label": "Shipping Method", "value": "" },"facility-name": { "label": "Facility Name", "value": "" },"facility-address1": { "label": "Facility Address 1", "value": "" },"facility-address2": { "label": "Facility Address 2", "value": "" },"facility-city": { "label": "Facility City", "value": "" },"facility-state": { "label": "Facility State", "value": "" },"facility-zip-code": { "label": "Facility Zip Code", "value": "" },"facility-phone": { "label": "Facility Phone", "value": "" },"facility-full-address": { "label": "Facility Full Address", "value": "" }, "order-name": { "label": "Order Name", "value": "" }, "customer-name": { "label": "Customer Name", "value": "" }, "billing-address1": { "label": "Billing Address 1", "value": "" }, "billing-address2": { "label": "Billing Address 2", "value": "" }, "billing-city": { "label": "Billing City", "value": "" }, "billing-state": { "label": "Billing State", "value": "" }, "billing-zip-code": { "label": "Billing Zip Code", "value": "" }, "billing-country-code": { "label": "Billing Country Code", "value": "" }, "billing-phone-number": { "label": "Billing Phone Number", "value": "" }, "delivery-date": { "label": "Delivery Date", "value": "" }, "delivery-time": { "label": "Delivery Time", "value": "" }, "cod-fee": { "label": "COD Fee", "value": "" }, "cod-fee-tax": { "label": "COD Fee Tax", "value": "" }} VUE_APP_LOCALES={"en-US": "English", "es-ES": "EspaƱol", "ja-JP": "Japanese"} VUE_APP_DEFAULT_LOG_LEVEL="error" VUE_APP_LOGIN_URL="http://launchpad.hotwax.io/login" diff --git a/src/views/DownloadPackedOrders.vue b/src/views/DownloadPackedOrders.vue index 7d8f0a7d..5fb39685 100644 --- a/src/views/DownloadPackedOrders.vue +++ b/src/views/DownloadPackedOrders.vue @@ -171,7 +171,7 @@ export default defineComponent({ // Creating a new field by combining the address1 and city field this.content = this.content.map((contentData: any) => { - contentData["custom-address"] = (contentData["address1"] ? contentData["address1"] : "") + (contentData["address1"] && contentData["city"] ? " " : "") + (contentData["city"] ? contentData["city"] : "") + contentData["state+city"] = (contentData["state"] ? contentData["state"] : "") + (contentData["state"] && contentData["city"] ? " " : "") + (contentData["city"] ? contentData["city"] : "") return contentData }) From 90bbcfdb60cc60902337553ebb5836fa11fd783e Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Wed, 5 Jun 2024 12:52:39 +0530 Subject: [PATCH 3/4] Implemented: intenationalization support for field labels(#575) --- src/locales/en.json | 1 + src/locales/es.json | 1 + src/locales/ja.json | 1 + src/views/DownloadPackedOrders.vue | 4 ++-- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/locales/en.json b/src/locales/en.json index e7dfe626..d02487a3 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -485,6 +485,7 @@ "Standard": "Standard", "STANDARD": "STANDARD", "State": "State", + "State + City": "State + City", "Status": "Status", "store name": "store name", "Store": "Store", diff --git a/src/locales/es.json b/src/locales/es.json index a7abdfd7..f4d2fc42 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -482,6 +482,7 @@ "Standard": "Standard", "STANDARD": "STANDARD", "State": "Estado", + "State + City": "State + City", "Status": "Estatus", "STAY": "STAY", "Store name": "Nombre de la tienda", diff --git a/src/locales/ja.json b/src/locales/ja.json index 0fcb60ca..01817dc8 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -480,6 +480,7 @@ "Standard": "Standard", "STANDARD": "STANDARD", "State": "State", + "State + City": "State + City", "Status": "Status", "store name": "store name", "Store": "Store", diff --git a/src/views/DownloadPackedOrders.vue b/src/views/DownloadPackedOrders.vue index 5fb39685..2452e075 100644 --- a/src/views/DownloadPackedOrders.vue +++ b/src/views/DownloadPackedOrders.vue @@ -35,7 +35,7 @@ - {{ fields[field] ? fields[field].label : field }} + {{ fields[field] ? translate(fields[field].label) : field }} {{ translate('Custom Label') }} {{ value }} @@ -56,7 +56,7 @@ - {{ fields[field] ? fields[field].label : field }} + {{ fields[field] ? translate(fields[field].label) : field }} From 3a73df1df4cb7f07ea7023af7d36bd41e873dd3e Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Wed, 5 Jun 2024 12:55:20 +0530 Subject: [PATCH 4/4] Improved: comment(#575) --- src/views/DownloadPackedOrders.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/DownloadPackedOrders.vue b/src/views/DownloadPackedOrders.vue index 2452e075..bba7f726 100644 --- a/src/views/DownloadPackedOrders.vue +++ b/src/views/DownloadPackedOrders.vue @@ -169,7 +169,7 @@ export default defineComponent({ try { this.content = await parseCsv(data).then(res => res); - // Creating a new field by combining the address1 and city field + // Creating a new field by combining the state and city field this.content = this.content.map((contentData: any) => { contentData["state+city"] = (contentData["state"] ? contentData["state"] : "") + (contentData["state"] && contentData["city"] ? " " : "") + (contentData["city"] ? contentData["city"] : "")