Skip to content

Commit

Permalink
Merge pull request #576 from ymaheshwari1/#575
Browse files Browse the repository at this point in the history
Implemented: support to include a custom field using address1 and city(#575)
  • Loading branch information
ymaheshwari1 authored Jun 6, 2024
2 parents c96a2bc + 3a73df1 commit f09b3a9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@
"Standard": "Standard",
"STANDARD": "STANDARD",
"State": "State",
"State + City": "State + City",
"Status": "Status",
"store name": "store name",
"Store": "Store",
Expand Down
1 change: 1 addition & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@
"Standard": "Standard",
"STANDARD": "STANDARD",
"State": "Estado",
"State + City": "State + City",
"Status": "Estatus",
"STAY": "STAY",
"Store name": "Nombre de la tienda",
Expand Down
1 change: 1 addition & 0 deletions src/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@
"Standard": "Standard",
"STANDARD": "STANDARD",
"State": "State",
"State + City": "State + City",
"Status": "Status",
"store name": "store name",
"Store": "Store",
Expand Down
11 changes: 9 additions & 2 deletions src/views/DownloadPackedOrders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<ion-button v-else slot="start" fill="clear" @click="removeCustomField(field)">
<ion-icon :icon="trashOutline" />
</ion-button>
<ion-label>{{ fields[field] ? fields[field].label : field }}</ion-label>
<ion-label>{{ fields[field] ? translate(fields[field].label) : field }}</ion-label>
<ion-button v-if="!customFields[field] && value === field" fill="outline" @click="addCustomLabel(field)">{{ translate('Custom Label') }}</ion-button>
<!-- Using multiple if's instead of wrapping in a single parent div, to style the component properly without adding any extra css -->
<ion-label v-if="!customFields[field] && value !== field" slot="end">{{ value }}</ion-label>
Expand All @@ -56,7 +56,7 @@
<ion-button slot="start" fill="clear" @click="updateSelectedData(field)">
<ion-icon color="success" :icon="addCircleOutline"/>
</ion-button>
<ion-label>{{ fields[field] ? fields[field].label : field }}</ion-label>
<ion-label>{{ fields[field] ? translate(fields[field].label) : field }}</ion-label>
</ion-item>
</ion-list>
</main>
Expand Down Expand Up @@ -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 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"] : "")
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
Expand Down

0 comments on commit f09b3a9

Please sign in to comment.