diff --git a/adminSiteClient/AbstractChartEditor.ts b/adminSiteClient/AbstractChartEditor.ts index 0ae51ca9d1f..8a1b08f8bb3 100644 --- a/adminSiteClient/AbstractChartEditor.ts +++ b/adminSiteClient/AbstractChartEditor.ts @@ -22,6 +22,7 @@ export type EditorTab = | "revisions" | "refs" | "export" + | "inheritance" export interface AbstractChartEditorManager { admin: Admin diff --git a/adminSiteClient/ChartEditor.ts b/adminSiteClient/ChartEditor.ts index f5641a7c487..f6b8138db0a 100644 --- a/adminSiteClient/ChartEditor.ts +++ b/adminSiteClient/ChartEditor.ts @@ -86,6 +86,7 @@ export class ChartEditor extends AbstractChartEditor { if (this.grapher.isMarimekko) tabs.push("marimekko") tabs.push("revisions") tabs.push("refs") + if (this.parentConfig) tabs.push("inheritance") tabs.push("export") return tabs } diff --git a/adminSiteClient/ChartEditorView.tsx b/adminSiteClient/ChartEditorView.tsx index f3d81531be4..82e0a146ff2 100644 --- a/adminSiteClient/ChartEditorView.tsx +++ b/adminSiteClient/ChartEditorView.tsx @@ -35,6 +35,7 @@ import { EditorScatterTab } from "./EditorScatterTab.js" import { EditorMapTab } from "./EditorMapTab.js" import { EditorHistoryTab } from "./EditorHistoryTab.js" import { EditorReferencesTab } from "./EditorReferencesTab.js" +import { EditorInheritanceTab } from "./EditorInheritanceTab.js" import { SaveButtonsForChart, SaveButtonsForIndicatorChart, @@ -463,6 +464,9 @@ export class ChartEditorView< {chartEditor && chartEditor.tab === "refs" && ( )} + {editor.tab === "inheritance" && ( + + )} {editor.tab === "export" && ( )} diff --git a/adminSiteClient/EditorHistoryTab.tsx b/adminSiteClient/EditorHistoryTab.tsx index d9a06c7c8d6..3418c9e2936 100644 --- a/adminSiteClient/EditorHistoryTab.tsx +++ b/adminSiteClient/EditorHistoryTab.tsx @@ -3,15 +3,10 @@ import { observer } from "mobx-react" import { ChartEditor, Log } from "./ChartEditor.js" import { Section, Timeago } from "./Forms.js" import { computed, action, observable } from "mobx" -import { - Json, - copyToClipboard, - diffGrapherConfigs, -} from "@ourworldindata/utils" +import { Json, copyToClipboard } from "@ourworldindata/utils" import YAML from "yaml" import { notification, Modal } from "antd" import ReactDiffViewer, { DiffMethod } from "react-diff-viewer-continued" -import { defaultGrapherConfig } from "@ourworldindata/grapher" function LogCompareModal({ log, @@ -151,7 +146,7 @@ export class EditorHistoryTab extends React.Component<{ editor: ChartEditor }> { } render() { - const { patchConfig, fullConfig, parentConfig } = this.props.editor + const { patchConfig, fullConfig } = this.props.editor return (
{this.logs.map((log, i) => ( @@ -182,24 +177,6 @@ export class EditorHistoryTab extends React.Component<{ editor: ChartEditor }> { value={JSON.stringify(patchConfig, undefined, 2)} /> -
-