Skip to content

Commit

Permalink
Improved: logic to get tracking url on the orderlookup page (hotwax#777)
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Oct 16, 2024
1 parent b41d446 commit 019d291
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/OrderLookupLabelActionsPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ion-content>
<ion-list>
<ion-list-header>{{ currentOrder.shipGroups[shipGroupSeqId][0]?.trackingIdNumber }}</ion-list-header>
<ion-item button :disabled="getCarriersTrackingInfo(carrierPartyId)?.trackingUrl" @click="redirectToTrackingUrl()">
<ion-item button :disabled="!getCarriersTrackingInfo(carrierPartyId)?.trackingUrl" @click="redirectToTrackingUrl()">
{{ getCarriersTrackingInfo(carrierPartyId)?.carrierName ? getCarriersTrackingInfo(carrierPartyId).carrierName : carrierPartyId }}
<ion-icon slot="end" :icon="openOutline" />
</ion-item>
Expand Down Expand Up @@ -61,7 +61,7 @@ export default defineComponent({
},

redirectToTrackingUrl() {
const trackingUrl = this.getCarriersTrackingInfo(this.carrierPartyId)
const trackingUrl = this.getCarriersTrackingInfo(this.carrierPartyId)?.trackingUrl
const trackingCode = this.currentOrder.shipGroups[this.shipGroupSeqId][0]?.trackingIdNumber
window.open(trackingUrl.replace("${trackingNumber}", trackingCode), "_blank");
popoverController.dismiss()
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/orderLookup/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const actions: ActionTree<OrderLookupState, RootState> = {
carrierPartyIds.map((partyId: any) => {
carriersTrackingInfo[partyId] = {
carrierName: store.getters["util/getPartyName"](partyId),
trackingUrl: systemProperties[partyId.toUpperCase()]?.trackingUrl ? systemProperties[partyId.toUpperCase()].trackingUrl : ""
trackingUrl: systemProperties[partyId.toUpperCase()] ? systemProperties[partyId.toUpperCase()] : ""
}
})

Expand Down

0 comments on commit 019d291

Please sign in to comment.