Skip to content

Commit

Permalink
Improved: reverted logic to split toName to firstName and lastName, a…
Browse files Browse the repository at this point in the history
…dded entry in locale for translation for static text (hotwax#92)
  • Loading branch information
amansinghbais committed Dec 2, 2024
1 parent e32f0a6 commit 0a84415
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
13 changes: 11 additions & 2 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"Are you sure you want to save the changes?": "Are you sure you want to save the changes?",
"Are you sure you want to cancel the order items?": "Are you sure you want to cancel the order items?",
"Cancel": "Cancel",
"Cancel item": "Cancel item",
"Cancel items": "Cancel items",
"Change pickup location": "Change pickup location",
"Change Store": "Change Store",
"Changes saved": "Changes saved",
"City": "City",
Expand All @@ -18,7 +20,7 @@
"Fetching order details.": "Fetching order details.",
"Fetching stores.": "Fetching stores.",
"First name": "First name",
"Failed to cancel the order": "Failed to cancel the order",
"Failed to cancel the order.": "Failed to cancel the order.",
"Failed to update the pickup store": "Failed to update the pickup store",
"Failed to update the shipping addess": "Failed to update the shipping addess",
"Fetching address": "Fetching address",
Expand All @@ -30,22 +32,29 @@
"Nearby stores": "Nearby stores",
"OMS": "OMS",
"Order ID": "Order ID",
"Order cancelled successfully": "Order cancelled successfully",
"Order cancelled successfully.": "Order cancelled successfully.",
"Order item not eligible for reroute fulfilment": "Order item not eligible for reroute fulfilment",
"Order not found": "Order not found",
"Out of stock": "Out of stock",
"Shipment has been cancelled": "Shipment has been cancelled",
"Password": "Password",
"Please fill all the fields": "Please fill all the fields",
"Request cancel": "Request cancel",
"Request cancelation": "Request cancelation",
"Save changes": "Save changes",
"Save shipping address": "Save shipping address",
"Select pickup location": "Select pickup location",
"Separate": "Separate",
"Shipping address": "Shipping address",
"Showing pickup locations near": "Showing pickup locations near",
"Showing pickup locations near your saved address": "Showing pickup locations near your saved address",
"Something went wrong while fetching stores": "Something went wrong while fetching stores",
"Something went wrong while fetching the order details": "Something went wrong while fetching the order details",
"Settings": "Settings",
"State": "State",
"Street": "Street",
"These products are not available at a single store for pickup. Please select alternate options for items individually.": "These products are not available at a single store for pickup. Please select alternate options for items individually.",
"Together": "Together",
"Tracking code": "Tracking code",
"Username": "Username",
"was unable to prepare your order. Please select alternate options.": "{facilityName} was unable to prepare your order. Please select alternate options.",
Expand Down
12 changes: 3 additions & 9 deletions src/views/Order.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@
<p>{{ selectedFacility.city }} {{ selectedFacility.stateCode }} {{ order.shipGroup.shipTo.postalAddress.country }} {{ selectedFacility.postalCode }}</p>
</ion-label>
</ion-item>
<ion-item v-else-if="order.shipGroup.selectedShipmentMethodTypeId !== 'STOREPICKUP' && customerAddress.firstName">
<ion-item v-else-if="order.shipGroup.selectedShipmentMethodTypeId !== 'STOREPICKUP' && customerAddress.toName">
<ion-label>
{{ customerAddress.firstName }} {{ customerAddress.lastName }}
{{ customerAddress.toName }}
<p>{{ customerAddress.address1 }}</p>
<p>{{ customerAddress.city }} {{ customerAddress.stateCode }} {{ customerAddress.postalCode }}</p>
</ion-label>
Expand Down Expand Up @@ -282,12 +282,6 @@ export default defineComponent({
this.fetchOrderFacilityChangeHistory()
if(this.order?.shipGroup && Object.keys(this.order.shipGroup).length){
this.customerAddress = this.order.shipGroup.shipTo?.postalAddress ? this.order.shipGroup.shipTo.postalAddress : {}
if (this.order.shipGroup.shipTo.postalAddress.toName) {
const toNameSplit = this.order.shipGroup.shipTo.postalAddress.toName.split(" ");
toNameSplit.length > 0 && (this.customerAddress.firstName = toNameSplit[0]);
toNameSplit.length > 1 && (this.customerAddress.lastName = toNameSplit[1]);
}
await this.getPickupStores();
if(!this.nearbyStores.length) {
this.selectedSegment = "separate";
Expand Down Expand Up @@ -715,7 +709,7 @@ export default defineComponent({
"shipmentMethod": `${this.deliveryMethod}@_NA_`,
"contactMechPurposeTypeId": "SHIPPING_LOCATION",
"facilityId": "_NA_",
"toName": `${this.customerAddress.firstName} ${this.customerAddress.lastName}`,
"toName": this.customerAddress.toName,
"address1": this.customerAddress.address1,
"city": this.customerAddress.city,
"stateProvinceGeoId": this.customerAddress.stateProvinceGeoId,
Expand Down
2 changes: 1 addition & 1 deletion src/views/PickupLocationModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<ion-accordion>
<ion-item slot="header" color="light">
<ion-icon :icon="locationOutline" slot="start" />
<ion-label>{{ translate("Showing pickup location near your saved address") }}</ion-label>
<ion-label>{{ translate("Showing pickup locations near your saved address") }}</ion-label>
</ion-item>
<ion-item slot="content">
<ion-label>
Expand Down

0 comments on commit 0a84415

Please sign in to comment.