diff --git a/explorer/Explorer.tsx b/explorer/Explorer.tsx index e3bdeda19f..427aa5d3ed 100644 --- a/explorer/Explorer.tsx +++ b/explorer/Explorer.tsx @@ -561,6 +561,7 @@ export class Explorer ...this.explorerProgram.grapherConfigOnlyGrapherProps, bakedGrapherURL: BAKED_GRAPHER_URL, dataApiUrl: DATA_API_URL, + adminBaseUrl: ADMIN_BASE_URL, hideEntityControls: this.showExplorerControls, manuallyProvideData: false, } @@ -606,6 +607,7 @@ export class Explorer ...this.explorerProgram.grapherConfigOnlyGrapherProps, bakedGrapherURL: BAKED_GRAPHER_URL, dataApiUrl: DATA_API_URL, + adminBaseUrl: ADMIN_BASE_URL, hideEntityControls: this.showExplorerControls, manuallyProvideData: false, } @@ -757,6 +759,7 @@ export class Explorer ...this.explorerProgram.grapherConfigOnlyGrapherProps, bakedGrapherURL: BAKED_GRAPHER_URL, dataApiUrl: DATA_API_URL, + adminBaseUrl: ADMIN_BASE_URL, hideEntityControls: this.showExplorerControls, manuallyProvideData: true, } diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index f285401a03..3d0564fa28 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -882,18 +882,10 @@ export class Grapher } @computed get editUrl(): string | undefined { - const yColumnSlugs = this.yColumnSlugs if (this.showAdminControls) { - // This is a workaround to make the edit button work for MDims. We - // probably want to do this in a more general way. - if (window._OWID_MULTI_DIM_PROPS) { - const varId = yColumnSlugs[0] - - return `${this.adminBaseUrl ?? ""}/admin/variables/${varId}/config` - } else - return `${this.adminBaseUrl}/admin/${ - this.manager?.editUrl ?? `charts/${this.id}/edit` - }` + return `${this.adminBaseUrl}/admin/${ + this.manager?.editUrl ?? `charts/${this.id}/edit` + }` } return undefined }