Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulcan: fix missing linkcard images #1793

Merged
merged 2 commits into from
Jun 30, 2023
Merged

Conversation

aburke07
Copy link
Contributor

@aburke07 aburke07 commented Jun 30, 2023

Overview

Some link cards were missing images because the product variant didn't have an image set. The variant image is not guaranteed to exist, and we have always fell back to the first product image. We didn't do that here so we were missing images.

This also removes duplicate link cards from the same solution.

QA

  1. View a Vulcan wiki with a product link card that is missing an image.
    Ex: http://localhost:3000/Vulcan/Nintendo%20Switch%20Blue%20Screen%20of%20Death#display-damage (the Nintendo Switch Screen OLED Assembly product card)
  2. The link card should now have an image.
  3. Viewing a solution with duplicate links should no longer show duplicate link cards
    Ex: http://localhost:3000/Vulcan/Nintendo%20Switch%20Blue%20Screen%20of%20Death#Section_CPU_Disconnect

Closes https://github.com/iFixit/ifixit/issues/48545

1. If a wiki links multiple times to the same guide/product, only show
   the one linkcard to avoid duplcates.
1. The image from a product variant isn't garunteed to exist. In the rest
    of the codebase we always use the first product image (product.image[0])
    in case the variant image doesn't exist.
2. Lets do that here too. We can also prefer the thumbnail image because
    its smaller and we don't need a large image. If that doesn't exist
    either lets fall back to the default product image.
3. The product image isn't garunteed to exist either, but if it doesn't
    that means there is no image associated with the product.
@vercel
Copy link

vercel bot commented Jun 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-commerce ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2023 5:51pm
react-commerce-prod ✅ Ready (Inspect) Visit Preview Jun 30, 2023 5:51pm

@github-actions
Copy link
Contributor

📦 Next.js Bundle Analysis for @ifixit/commerce-frontend

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link
Contributor

@hcutrone hcutrone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR 🌯

@deltuh-vee deltuh-vee self-assigned this Jun 30, 2023
@deltuh-vee deltuh-vee added the QAing Under QA team review label Jun 30, 2023
@deltuh-vee
Copy link
Contributor

QA 🎬

  • Product links with missing images now have images
  • Duplicate links in a solution no longer show multiple link cards

@deltuh-vee deltuh-vee removed the QAing Under QA team review label Jun 30, 2023
@aburke07 aburke07 merged commit 004a281 into main Jun 30, 2023
13 checks passed
@aburke07 aburke07 deleted the vulcan-fix-linkcard-images branch June 30, 2023 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants