Skip to content

Commit

Permalink
✅ fix homepage-into roundtrip test
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesau committed Feb 13, 2025
1 parent dfa97e9 commit 4a4850c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions db/model/Gdoc/enrichedToRaw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import {
RawBlockPerson,
RawBlockNarrativeChart,
RawBlockCode,
RawBlockHomepageIntroPost,

Check warning on line 53 in db/model/Gdoc/enrichedToRaw.ts

View workflow job for this annotation

GitHub Actions / eslint

'RawBlockHomepageIntroPost' is defined but never used. Allowed unused vars must match /^_/u

Check warning on line 53 in db/model/Gdoc/enrichedToRaw.ts

View workflow job for this annotation

GitHub Actions / eslint

'RawBlockHomepageIntroPost' is defined but never used. Allowed unused vars must match /^_/u
} from "@ourworldindata/types"
import { spanToHtmlString } from "./gdocUtils.js"
import { match, P } from "ts-pattern"
Expand Down Expand Up @@ -593,9 +594,7 @@ export function enrichedBlockToRawBlock(
type,
value: {
...value,
isNew: value.isNew
? value.isNew.toString()
: "false",
isNew: String(value.isNew),
authors: authors?.join(", "),
},
})
Expand Down
5 changes: 5 additions & 0 deletions db/model/Gdoc/exampleEnrichedBlocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,7 @@ export const enrichedBlockExamples: Record<
kicker: "Article - 10 Mins",
filename: "optimism-and-pessimism.jpg",
authors: ["Our World In Data"],
isNew: false,
},
{
type: "secondary",
Expand All @@ -725,6 +726,7 @@ export const enrichedBlockExamples: Record<
kicker: "Article - 10 Mins",
filename: "optimism-and-pessimism.jpg",
authors: ["Our World In Data"],
isNew: true,
},
{
type: "secondary",
Expand All @@ -734,20 +736,23 @@ export const enrichedBlockExamples: Record<
kicker: "Article - 10 Mins",
filename: "featured-image.jpg",
authors: ["Max Roser"],
isNew: false,
},
{
type: "tertiary",
url: "https://ourworldindata.org/front-end-engineer",
title: "We’re looking for a front-end engineer to join our team.",
kicker: "Announcement",
authors: ["Our World In Data"],
isNew: false,
},
{
type: "tertiary",
url: "https://ourworldindata.org/civil-engineer",
title: "We’re looking to build bridges with a civil engineer.",
kicker: "Announcement",
authors: ["Our World In Data"],
isNew: false,
},
],
parseErrors: [],
Expand Down
1 change: 1 addition & 0 deletions db/model/Gdoc/rawToArchie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,7 @@ function* rawBlockHomepageIntroToArchieMLString(
yield* propertyToArchieMLString("filename", value)
yield* propertyToArchieMLString("kicker", value)
yield* propertyToArchieMLString("authors", value)
yield* propertyToArchieMLString("isNew", value)
yield "{}"
}
}
Expand Down

0 comments on commit 4a4850c

Please sign in to comment.