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

Data page FAQ images are not shown #3862

Open
marcelgerber opened this issue Aug 9, 2024 · 1 comment
Open

Data page FAQ images are not shown #3862

marcelgerber opened this issue Aug 9, 2024 · 1 comment

Comments

@marcelgerber
Copy link
Member

Description

The data page on stunting is supposed to look like it is on the left (with image); however, in actuality, the image is missing.

CleanShot 2024-08-09 at 12 12 10

Additional context

The imageMetadata field is populated here:

const relatedResearchFilenames = datapageData.relatedResearch
.map((r) => r.imageUrl)
.filter((f): f is string => !!f)
const imageMetadata = lodash.pick(
imageMetadataDictionary,
uniq(relatedResearchFilenames)
)

As we can see, it only takes into account the filenames present in the "Related research" section, but not the FAQs.

Simple fix

We can just incorporate the whole imageMetadata dicts of gdocs (the gdocs containing the FAQs).

However, this may result in too many images: The Data Page FAQ gdoc contains all FAQs, and only some of them are shown on a particular data page.

More comprehensive fix

The more comprehensive fix will probably entail calling traverseEnrichedBlocks / extractFilenamesFromBlock on faqEntries to collect the filenames that are actually in use in these blocks.

@ikesau
Copy link
Member

ikesau commented Aug 13, 2024

There appear to be 6 FAQ entries ATM that include images (Cmd - F "image" on the admin preview for the gdoc)

I think the more granular traversal solution is the better of the two 👍

larsyencken added a commit that referenced this issue Nov 8, 2024
Related to #3862

(Lars experimenting with Copilot Workspace)

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/owid/owid-grapher/issues/3862?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants