From 0a844155af4c1370c4382b25ba86fd6b373ce679 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Mon, 2 Dec 2024 15:08:22 +0530 Subject: [PATCH] Improved: reverted logic to split toName to firstName and lastName, added entry in locale for translation for static text (#92) --- src/i18n/locales/en.json | 13 +++++++++++-- src/views/Order.vue | 12 +++--------- src/views/PickupLocationModal.vue | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 709e0482..894745af 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -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", @@ -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", @@ -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.", diff --git a/src/views/Order.vue b/src/views/Order.vue index 3a0a6ea7..4498d403 100644 --- a/src/views/Order.vue +++ b/src/views/Order.vue @@ -139,9 +139,9 @@

{{ selectedFacility.city }} {{ selectedFacility.stateCode }} {{ order.shipGroup.shipTo.postalAddress.country }} {{ selectedFacility.postalCode }}

- + - {{ customerAddress.firstName }} {{ customerAddress.lastName }} + {{ customerAddress.toName }}

{{ customerAddress.address1 }}

{{ customerAddress.city }} {{ customerAddress.stateCode }} {{ customerAddress.postalCode }}

@@ -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"; @@ -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, diff --git a/src/views/PickupLocationModal.vue b/src/views/PickupLocationModal.vue index b85cbfca..07bba8ff 100644 --- a/src/views/PickupLocationModal.vue +++ b/src/views/PickupLocationModal.vue @@ -15,7 +15,7 @@ - {{ translate("Showing pickup location near your saved address") }} + {{ translate("Showing pickup locations near your saved address") }}