From 558d3ad42aade427d2770e44d0c5cafe08bba91d Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Tue, 14 Jan 2025 08:08:01 +0100 Subject: [PATCH] feat(gdocs): narrative charts component (#4295) --- adminSiteClient/AdminSidebar.tsx | 13 +- adminSiteClient/ChartEditor.ts | 26 +- adminSiteClient/ChartViewEditor.ts | 12 +- adminSiteClient/ChartViewEditorPage.tsx | 19 +- adminSiteClient/ChartViewIndexPage.tsx | 6 +- adminSiteClient/EditorReferencesTab.tsx | 28 +- adminSiteClient/EditorTextTab.tsx | 33 +- adminSiteClient/NarrativeChartNameModal.tsx | 64 ++++ adminSiteClient/SaveButtons.tsx | 67 ++-- adminSiteServer/apiRouter.ts | 12 +- adminSiteServer/apiRoutes/chartViews.ts | 83 ++++- adminSiteServer/apiRoutes/charts.ts | 2 +- baker/SiteBaker.tsx | 23 +- baker/siteRenderers.tsx | 1 + ...4454799588-PostsGdocsLinksAddChartViews.ts | 17 ++ db/model/ChartView.ts | 34 +++ db/model/Gdoc/GdocBase.ts | 26 +- db/model/Gdoc/enrichedToMarkdown.ts | 11 + db/model/Gdoc/enrichedToRaw.ts | 15 + db/model/Gdoc/exampleEnrichedBlocks.ts | 10 + db/model/Gdoc/extractGdocComponentInfo.ts | 5 +- db/model/Gdoc/gdocUtils.ts | 1 + db/model/Gdoc/rawToArchie.ts | 20 ++ db/model/Gdoc/rawToEnriched.ts | 64 ++++ db/model/Link.ts | 50 ++- .../grapher/src/controls/ActionButtons.scss | 31 +- .../grapher/src/controls/ActionButtons.tsx | 2 +- .../grapher/src/core/Grapher.tsx | 50 ++- .../grapher/src/core/GrapherAnalytics.ts | 46 ++- .../grapher/src/core/GrapherConstants.ts | 3 + packages/@ourworldindata/grapher/src/index.ts | 1 + .../types/src/gdocTypes/ArchieMlComponents.ts | 27 ++ .../types/src/gdocTypes/Gdoc.ts | 11 + packages/@ourworldindata/types/src/index.ts | 3 + packages/@ourworldindata/utils/src/Util.ts | 1 + site/gdocs/AttachmentsContext.tsx | 3 + site/gdocs/OwidGdoc.tsx | 1 + site/gdocs/components/ArticleBlock.tsx | 10 + site/gdocs/components/NarrativeChart.tsx | 98 ++++++ site/gdocs/utils.ts | 5 + site/multiembedder/MultiEmbedder.tsx | 288 +++++++++++------- 41 files changed, 997 insertions(+), 225 deletions(-) create mode 100644 adminSiteClient/NarrativeChartNameModal.tsx create mode 100644 db/migration/1734454799588-PostsGdocsLinksAddChartViews.ts create mode 100644 db/model/ChartView.ts create mode 100644 site/gdocs/components/NarrativeChart.tsx diff --git a/adminSiteClient/AdminSidebar.tsx b/adminSiteClient/AdminSidebar.tsx index 3b7ad4c2d0c..7b21ab70e40 100644 --- a/adminSiteClient/AdminSidebar.tsx +++ b/adminSiteClient/AdminSidebar.tsx @@ -23,7 +23,6 @@ import { } from "@fortawesome/free-solid-svg-icons" import { ETL_WIZARD_URL } from "../settings/clientSettings.js" -import { chartViewsFeatureEnabled } from "./ChartViewEditor.js" export const AdminSidebar = (): React.ReactElement => (