Skip to content

Commit

Permalink
Merge pull request #868 from ymaheshwari1/#86cx82032
Browse files Browse the repository at this point in the history
Implemented: support to define custom component as a separate item in the additional details card(#86cx82032)
  • Loading branch information
ymaheshwari1 authored Dec 9, 2024
2 parents 17926aa + 959b714 commit df8dff9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/store/modules/orderLookup/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ const actions: ActionTree<OrderLookupState, RootState> = {
})

commit(types.ORDERLOOKUP_CARRIER_TRACKING_URLS_UPDATED, carriersTrackingInfo);
return carriersTrackingInfo;
},

async getOrderDetails({ commit, dispatch }, orderId) {
Expand Down Expand Up @@ -394,7 +395,13 @@ const actions: ActionTree<OrderLookupState, RootState> = {
}
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"] = {}
Expand Down
10 changes: 8 additions & 2 deletions src/views/OrderLookupDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,11 @@
<ion-label class="ion-text-wrap">{{ translate("Municipio") }}</ion-label>
<ion-label slot="end">{{ order.orderAttributes.municipio || "-" }}</ion-label>
</ion-item>
<ion-item lines="none">
<ion-item>
<ion-label class="ion-text-wrap">{{ translate("Invoicing facility") }}</ion-label>
<ion-label class="ion-text-wrap" slot="end">{{ (invoicingFacility.facilityName ? invoicingFacility.facilityName : invoicingFacility.facilityId) || '-' }}</ion-label>
</ion-item>
<Component :is="additionalDetailItemExt" :order="order" :invoicingFacilityId="invoicingFacility.facilityId"/>
</ion-list>
</ion-card>
</div>
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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: {
Expand All @@ -333,12 +336,15 @@ export default defineComponent({
getShipmentMethodDesc: "util/getShipmentMethodDesc",
getPaymentMethodDesc: 'util/getPaymentMethodDesc',
userProfile: 'user/getUserProfile',
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}_OrderLookupAdditionalDetailItem`})
this.isFetchingOrderInfo = false
},
methods: {
Expand Down

0 comments on commit df8dff9

Please sign in to comment.