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

Fix data pages embedding all image metadata #3451

Merged
merged 7 commits into from
Apr 16, 2024
Merged

Conversation

ikesau
Copy link
Member

@ikesau ikesau commented Apr 4, 2024

Fixes #3301

I remember taking a road trip that passed through a town with an odd bend in the highway as you exited. Apparently they'd started constructing the road from both ends, and only realized that they weren't aligned by the time they were in sight of each other.

image

This part of the datapage code feels a bit like that, except the two bits of road aren't even connected 😄 (All due respect to Daniel, who was under an enormous time crunch to get data pages implemented across the entire stack)

Changes:

  • Removes the exhaustive imageMetadataDicitionary and other unused properties from FAQ documents that were being attached to the datapage's embedded JSON
  • Attaches image metadata for the related research & writing's featured images (which are the only images we currently ned for datapages)
  • renames traverseEnrichedBlockstraverseEnrichedBlock (because it only takes a single block as an argument, even if that block contains multiple child blocks)

I decided not to refactor anything else to wait till #3426

@ikesau ikesau requested a review from danyx23 April 4, 2024 21:18
Copy link
Member

@marcelgerber marcelgerber left a comment

Choose a reason for hiding this comment

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

Will need to look at this again (because I lack some understanding of the gdocs code), but these are the things I noticed just now.

baker/GrapherBaker.tsx Show resolved Hide resolved
baker/GrapherBaker.tsx Outdated Show resolved Hide resolved
site/DataPageV2Content.tsx Outdated Show resolved Hide resolved
@marcelgerber
Copy link
Member

Nice storytelling in the PR description, would read again 😁

@ikesau
Copy link
Member Author

ikesau commented Apr 11, 2024

@marcelgerber now's your time to read it again! 🙂

We can go through it on a call together if you'd like

Copy link
Member

@marcelgerber marcelgerber left a comment

Choose a reason for hiding this comment

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

This time it all made sense, must've been the early morning last time around ;)

@ikesau ikesau merged commit e748595 into master Apr 16, 2024
20 of 22 checks passed
@ikesau ikesau deleted the datapage-image-attachments branch April 16, 2024 20:10
Copy link
Contributor

@danyx23 danyx23 left a comment

Choose a reason for hiding this comment

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

Thanks a lot for cleaning this up after me! This looks good. I looked at http://localhost:3030/grapher/co-emissions-per-capita but the images don't show but this is probably because my local images aren't up to date - the paths seem right and the page size is smaller now.

I had a look at your staging server, at http://staging-site-datapage-image-attachments/grapher/co-emissions-per-capita , but that seems broken. Is that unrelated or is there an issue to look at still?

Otherwise it looks good to merge!

@danyx23
Copy link
Contributor

danyx23 commented Apr 16, 2024

Ah, I missed that this is already merged - thanks a lot :)

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.

Data page source code always contains info about every single published image
3 participants