Skip to content

Commit

Permalink
Fixed: If the shipment has labelImageUrl set then always open it in n…
Browse files Browse the repository at this point in the history
…ew tab (#873).
  • Loading branch information
ravilodhi committed Dec 11, 2024
1 parent ceb7bcf commit 16ac85f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/components/OrderLookupLabelActionsPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { documentOutline, openOutline } from "ionicons/icons";
import { translate } from "@hotwax/dxp-components";
import { mapGetters, useStore } from "vuex";
import { OrderService } from '@/services/OrderService';
import { isPdf } from '@/utils'
export default defineComponent({
name: "OrderLookupLabelActionsPopover",
Expand All @@ -53,7 +52,7 @@ export default defineComponent({
shipmentPackages.map((shipmentPackage: any) => {
shipmentIds.push(shipmentPackage.shipmentId)
this.isPdf(shipmentPackage.labelImageUrl) && shippingLabelPdfUrls.push(shipmentPackage.labelImageUrl)
shippingLabelPdfUrls.push(shipmentPackage.labelImageUrl)
})
await OrderService.printShippingLabel(shipmentIds, shippingLabelPdfUrls)
Expand All @@ -72,7 +71,6 @@ export default defineComponent({
return {
documentOutline,
isPdf,
openOutline,
store,
translate
Expand Down
3 changes: 1 addition & 2 deletions src/services/UtilService.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { api, hasError } from '@/adapter';
import logger from '@/logger';
import store from '@/store';
import { isPdf } from '@/utils';

const fetchShipmentMethods = async (query: any): Promise <any> => {
return api({
Expand Down Expand Up @@ -106,7 +105,7 @@ const findShipmentPackages = async(shipmentIds: Array<string>): Promise<any> =>
shipmentPackage.labelImageUrl = ""
shipmentPackage.internationalInvoiceUrl = ""
}
if (shipmentPackage.labelImageUrl && isPdf(shipmentPackage.labelImageUrl)) {
if (shipmentPackage.labelImageUrl) {
shipmentPackage.labelPdfUrl = shipmentPackage.labelImageUrl;
}
if(shipmentForOrders[key]) {
Expand Down

0 comments on commit 16ac85f

Please sign in to comment.