From c6f6cd5c8af6edfe37bcdcc7b0812309a5a513f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Rod=C3=A9s-Guirao?= Date: Thu, 9 Jan 2025 22:49:17 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20wizard=20link=20for=20chart?= =?UTF-8?q?=20animation=20(#4407)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Co-authored-by: Marcel Gerber * add chart type explicitly * refactor: conditionally render chart animation link for published graphs * refactor: remove commented-out code for chart animation tab --- adminSiteClient/EditorExportTab.tsx | 51 ++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/adminSiteClient/EditorExportTab.tsx b/adminSiteClient/EditorExportTab.tsx index ccbd59d7f3..426d9cae7d 100644 --- a/adminSiteClient/EditorExportTab.tsx +++ b/adminSiteClient/EditorExportTab.tsx @@ -8,6 +8,10 @@ import { GrapherStaticFormat, } from "@ourworldindata/utils" import { AbstractChartEditor } from "./AbstractChartEditor.js" +import { ETL_WIZARD_URL } from "../settings/clientSettings.js" +import { faHatWizard, faDownload } from "@fortawesome/free-solid-svg-icons" +import { Button } from "antd" +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" type ExportSettings = Required< Pick< @@ -227,6 +231,18 @@ export class EditorExportTab< } render() { + const chartAnimationUrl = new URL(`${ETL_WIZARD_URL}chart-animation`) + if (this.grapher.canonicalUrl) + chartAnimationUrl.searchParams.set( + "animation_chart_url", + this.grapher.canonicalUrl + ) + chartAnimationUrl.searchParams.set("animation_skip_button", "True") + // chartAnimationUrl.searchParams.set( + // "animation_chart_tab", + // this.grapher.tab ?? "" + // ) + return (
@@ -309,40 +325,65 @@ export class EditorExportTab< /> )}
+
+ + {/* Link to Wizard dataset preview */} + {this.grapher.isPublished && ( +
+ + + +
+ )}
) }