From 7b08666d837d7a0bfa073fa02b0f05d381df7bb2 Mon Sep 17 00:00:00 2001 From: Ike Saunders Date: Thu, 4 Apr 2024 17:00:16 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20remove=20logic=20for=20images=20?= =?UTF-8?q?in=20faqs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- baker/GrapherBaker.tsx | 14 +------------- .../types/src/gdocTypes/Datapage.ts | 1 - 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/baker/GrapherBaker.tsx b/baker/GrapherBaker.tsx index 1d9ace41fe2..a453d17370a 100644 --- a/baker/GrapherBaker.tsx +++ b/baker/GrapherBaker.tsx @@ -11,9 +11,7 @@ import { keyBy, mergePartialGrapherConfigs, compact, - merge, partition, - traverseEnrichedBlock, } from "@ourworldindata/utils" import fs from "fs-extra" import * as lodash from "lodash" @@ -39,13 +37,11 @@ import { DimensionProperty, OwidVariableWithSource, OwidChartDimensionInterface, - OwidGdocPostInterface, EnrichedFaq, FaqEntryData, FaqDictionary, ImageMetadata, OwidGdocBaseInterface, - OwidGdocMinimalPostInterface, } from "@ourworldindata/types" import ProgressBar from "progress" import { @@ -64,7 +60,6 @@ import { knexRaw } from "../db/db.js" import { getRelatedChartsForVariable } from "../db/model/Chart.js" import pMap from "p-map" import { getGdocBaseObjectBySlug } from "../db/model/Gdoc/GdocFactory.js" -import { extractFilenamesFromBlock } from "../db/model/Gdoc/gdocUtils.js" const renderDatapageIfApplicable = async ( grapher: GrapherInterface, @@ -295,16 +290,9 @@ export async function renderDataPageV2( .map((r) => r.imageUrl) .filter((f): f is string => !!f) - const faqEntryFilenames: string[] = [] - faqEntries.faqs.forEach((f) => { - traverseEnrichedBlock(f, (block) => { - faqEntryFilenames.push(...extractFilenamesFromBlock(block)) - }) - }) - const imageMetadata = lodash.pick( imageMetadataDictionary, - uniq([...relatedResearchFilenames, ...faqEntryFilenames]) + uniq(relatedResearchFilenames) ) const tagToSlugMap = await getTagToSlugMap(knex) diff --git a/packages/@ourworldindata/types/src/gdocTypes/Datapage.ts b/packages/@ourworldindata/types/src/gdocTypes/Datapage.ts index 07df132cf36..cf5a856eeed 100644 --- a/packages/@ourworldindata/types/src/gdocTypes/Datapage.ts +++ b/packages/@ourworldindata/types/src/gdocTypes/Datapage.ts @@ -7,7 +7,6 @@ import { } from "../OwidVariable.js" import { RelatedChart } from "../grapherTypes/GrapherTypes.js" import { Static, Type } from "@sinclair/typebox" -import { OwidGdocPostInterface } from "./Gdoc.js" import { OwidEnrichedGdocBlock } from "./ArchieMlComponents.js" import { ImageMetadata } from "./Image.js"