From 2ec12d2a580f3b6211845851394d3a3daab52ff7 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Mon, 9 Dec 2024 15:28:12 +0530 Subject: [PATCH 1/3] Implemented: support to define custom component as a separate item in the additional details card(#86cx82032) --- src/store/modules/orderLookup/actions.ts | 9 ++++++++- src/views/OrderLookupDetail.vue | 11 +++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/store/modules/orderLookup/actions.ts b/src/store/modules/orderLookup/actions.ts index 1595f108..58606f8c 100644 --- a/src/store/modules/orderLookup/actions.ts +++ b/src/store/modules/orderLookup/actions.ts @@ -124,6 +124,7 @@ const actions: ActionTree = { }) commit(types.ORDERLOOKUP_CARRIER_TRACKING_URLS_UPDATED, carriersTrackingInfo); + return carriersTrackingInfo; }, async getOrderDetails({ commit, dispatch }, orderId) { @@ -394,7 +395,13 @@ const actions: ActionTree = { } order["shipGroups"] = shipGroups - dispatch("fetchCarriersTrackingInfo", Array.from(new Set(carrierPartyIds))); + const carrierInfo = await dispatch("fetchCarriersTrackingInfo", Array.from(new Set(carrierPartyIds))); + + Object.keys(order["shipGroups"]).map((shipGroupId: any) => { + const shipGroup = order["shipGroups"][shipGroupId] + shipGroup.map((item: any) => item["carrierPartyName"] = carrierInfo[item.carrierPartyId]?.carrierName || "") + }) + this.dispatch("util/fetchShipmentMethodTypeDesc", shipmentMethodIds) order["shipGroupFulfillmentStatus"] = {} diff --git a/src/views/OrderLookupDetail.vue b/src/views/OrderLookupDetail.vue index 4df9145f..e0df27ff 100644 --- a/src/views/OrderLookupDetail.vue +++ b/src/views/OrderLookupDetail.vue @@ -179,10 +179,11 @@ {{ translate("Municipio") }} {{ order.orderAttributes.municipio || "-" }} - + {{ translate("Invoicing facility") }} {{ (invoicingFacility.facilityName ? invoicingFacility.facilityName : invoicingFacility.facilityId) || '-' }} + @@ -290,6 +291,7 @@ import OrderLookupLabelActionsPopover from '@/components/OrderLookupLabelActions import { hasError } from "@hotwax/oms-api"; import logger from "@/logger"; import { OrderService } from "@/services/OrderService"; +import { useDynamicImport } from "@/utils/moduleFederation"; export default defineComponent({ name: "OrderLookupDetail", @@ -320,7 +322,8 @@ export default defineComponent({ itemStatuses: JSON.parse(process.env.VUE_APP_ITEM_STATUS as any), isFetchingStock: false, isFetchingOrderInfo: false, - invoicingFacility: {} as any + invoicingFacility: {} as any, + additionalDetailItemExt: "" as any } }, computed: { @@ -333,12 +336,16 @@ export default defineComponent({ getShipmentMethodDesc: "util/getShipmentMethodDesc", getPaymentMethodDesc: 'util/getPaymentMethodDesc', userProfile: 'user/getUserProfile', + getPartyName: 'util/getPartyName', + instanceUrl: "user/getInstanceUrl" }) }, async ionViewWillEnter() { this.isFetchingOrderInfo = true await this.store.dispatch("orderLookup/getOrderDetails", this.orderId) await this.fetchOrderInvoicingFacility() + const instance = this.instanceUrl.split("-")[0] + this.additionalDetailItemExt = await useDynamicImport({ scope: "fulfillment_extensions", module: `${instance}_AdditionalDetailItem`}) this.isFetchingOrderInfo = false }, methods: { From 56ec9da103c58d2adea197faf128a9afc4222343 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Mon, 9 Dec 2024 15:37:58 +0530 Subject: [PATCH 2/3] Removed: unused getter usage(#86cx82032) --- src/views/OrderLookupDetail.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/OrderLookupDetail.vue b/src/views/OrderLookupDetail.vue index e0df27ff..5be48ce2 100644 --- a/src/views/OrderLookupDetail.vue +++ b/src/views/OrderLookupDetail.vue @@ -336,7 +336,6 @@ export default defineComponent({ getShipmentMethodDesc: "util/getShipmentMethodDesc", getPaymentMethodDesc: 'util/getPaymentMethodDesc', userProfile: 'user/getUserProfile', - getPartyName: 'util/getPartyName', instanceUrl: "user/getInstanceUrl" }) }, From 959b714bda10f20b1fc932a516f15f130fa311d7 Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Mon, 9 Dec 2024 18:50:11 +0530 Subject: [PATCH 3/3] Improved: code by updating the name of remote component(#86cx82032) --- src/views/OrderLookupDetail.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/OrderLookupDetail.vue b/src/views/OrderLookupDetail.vue index 5be48ce2..935790b7 100644 --- a/src/views/OrderLookupDetail.vue +++ b/src/views/OrderLookupDetail.vue @@ -344,7 +344,7 @@ export default defineComponent({ await this.store.dispatch("orderLookup/getOrderDetails", this.orderId) await this.fetchOrderInvoicingFacility() const instance = this.instanceUrl.split("-")[0] - this.additionalDetailItemExt = await useDynamicImport({ scope: "fulfillment_extensions", module: `${instance}_AdditionalDetailItem`}) + this.additionalDetailItemExt = await useDynamicImport({ scope: "fulfillment_extensions", module: `${instance}_OrderLookupAdditionalDetailItem`}) this.isFetchingOrderInfo = false }, methods: {