From e9a303e22dd80660f21ef63735fc2154c11d47b3 Mon Sep 17 00:00:00 2001 From: Ike Saunders Date: Mon, 13 Jan 2025 16:34:51 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20post-rebase=20code=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adminSiteServer/mockSiteRouter.ts | 2 +- db/db.ts | 6 +++--- db/model/Post.ts | 3 +-- site/runSiteNavigation.tsx | 1 + 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/adminSiteServer/mockSiteRouter.ts b/adminSiteServer/mockSiteRouter.ts index 3e387d55ee..60202554ad 100644 --- a/adminSiteServer/mockSiteRouter.ts +++ b/adminSiteServer/mockSiteRouter.ts @@ -553,7 +553,7 @@ async function getTombstoneAttachments( } } -getPlainRouteNonIdempotentWithRWTransaction( +getPlainRouteWithROTransaction( mockSiteRouter, "/deleted/:tombstoneSlug", async (req, res, trx) => { diff --git a/db/db.ts b/db/db.ts index 18d9a75868..1f59317829 100644 --- a/db/db.ts +++ b/db/db.ts @@ -812,12 +812,12 @@ export function getImageUsage(trx: KnexReadonlyTransaction): Promise< export async function generateTopicTagGraph( knex: KnexReadonlyTransaction ): Promise { - const { __rootId: rootId, ...parents } = await getFlatTagGraph(knex) + const { __rootId, ...parents } = await getFlatTagGraph(knex) const tagGraphTopicsOnly = Object.entries(parents).reduce( (acc: FlatTagGraph, [parentId, children]) => { acc[Number(parentId)] = children.filter((child) => { - if (child.parentId === rootId) return true + if (child.parentId === __rootId) return true return child.isTopic }) return acc @@ -825,7 +825,7 @@ export async function generateTopicTagGraph( {} as FlatTagGraph ) - return createTagGraph(tagGraphTopicsOnly, rootId) + return createTagGraph(tagGraphTopicsOnly, __rootId) } export const getUniqueTopicCount = ( diff --git a/db/model/Post.ts b/db/model/Post.ts index c9f7399911..72eb07ed98 100644 --- a/db/model/Post.ts +++ b/db/model/Post.ts @@ -183,8 +183,7 @@ export const getFullPostByIdFromSnapshot = async ( return getFullPost(trx, postEnriched.wpApiSnapshot) } -// kicking this can till WP posts kick the bucket -// COVID pages are the only WP pages left that are citable, grep "pageOverrides" to see more +// This function used to be more complicated, but now the only citable WP post is the COVID page export const isPostSlugCitable = (slug: string): boolean => { return slug === "coronavirus" } diff --git a/site/runSiteNavigation.tsx b/site/runSiteNavigation.tsx index 8447e329ad..40e3ed3799 100644 --- a/site/runSiteNavigation.tsx +++ b/site/runSiteNavigation.tsx @@ -6,6 +6,7 @@ export const runSiteNavigation = ( baseUrl: string, hideDonationFlag?: boolean ) => { + // Used to determine whether or not to show the searchbar in the header let isOnHomepage = false if (window._OWID_GDOC_PROPS) { const props = getOwidGdocFromJSON(window._OWID_GDOC_PROPS)