From 2a469758b9ec8f5f064fa0b4c1731a216e02a24b Mon Sep 17 00:00:00 2001 From: del15881 Date: Wed, 9 Oct 2024 19:01:04 +0530 Subject: [PATCH 1/2] PWA-3359 : Allowing null values into the Product Thumbnail GrapQL in orderRow.pql.js and Adding Transparent Placeholder image for deleted products on order history screen in collapsedImageGallery.js file. --- packages/peregrine/lib/talons/OrderHistoryPage/orderRow.gql.js | 2 +- .../lib/components/OrderHistoryPage/collapsedImageGallery.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/peregrine/lib/talons/OrderHistoryPage/orderRow.gql.js b/packages/peregrine/lib/talons/OrderHistoryPage/orderRow.gql.js index 34afed7f8c..f9dcebe428 100644 --- a/packages/peregrine/lib/talons/OrderHistoryPage/orderRow.gql.js +++ b/packages/peregrine/lib/talons/OrderHistoryPage/orderRow.gql.js @@ -11,7 +11,7 @@ export const GET_CONFIGURABLE_THUMBNAIL_SOURCE = gql` `; export const GET_PRODUCT_THUMBNAILS_BY_URL_KEY = gql` - query GetProductThumbnailsByURLKey($urlKeys: [String!]!) { + query GetProductThumbnailsByURLKey($urlKeys: [String]!) { products(filter: { url_key: { in: $urlKeys } }) { # eslint-disable-next-line @graphql-eslint/require-id-when-available items { diff --git a/packages/venia-ui/lib/components/OrderHistoryPage/collapsedImageGallery.js b/packages/venia-ui/lib/components/OrderHistoryPage/collapsedImageGallery.js index 8e0fdbca96..5dd5ed3d04 100644 --- a/packages/venia-ui/lib/components/OrderHistoryPage/collapsedImageGallery.js +++ b/packages/venia-ui/lib/components/OrderHistoryPage/collapsedImageGallery.js @@ -19,6 +19,9 @@ const CollapsedImageGallery = props => { const baseImageElements = Object.values(items) .slice(0, DISPLAY_COUNT) .map((item, index) => { + if (!item){ + return null; + } const { thumbnail, name } = item; const { url } = thumbnail; From ddba300441571935a3de66b9938becf2b5036c90 Mon Sep 17 00:00:00 2001 From: del15881 Date: Thu, 10 Oct 2024 12:25:19 +0530 Subject: [PATCH 2/2] Prettify the code changes --- .../lib/components/OrderHistoryPage/collapsedImageGallery.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/venia-ui/lib/components/OrderHistoryPage/collapsedImageGallery.js b/packages/venia-ui/lib/components/OrderHistoryPage/collapsedImageGallery.js index 5dd5ed3d04..14707d0d5e 100644 --- a/packages/venia-ui/lib/components/OrderHistoryPage/collapsedImageGallery.js +++ b/packages/venia-ui/lib/components/OrderHistoryPage/collapsedImageGallery.js @@ -19,7 +19,7 @@ const CollapsedImageGallery = props => { const baseImageElements = Object.values(items) .slice(0, DISPLAY_COUNT) .map((item, index) => { - if (!item){ + if (!item) { return null; } const { thumbnail, name } = item;