Skip to content

Commit

Permalink
🐛 (chart-admin) only show DoD toggle if the chart has details
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Dec 15, 2023
1 parent a97ee71 commit 29f3827
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions adminSiteClient/EditorExportTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type OriginalGrapher = Pick<
| "note"
| "originUrl"
| "shouldIncludeDetailsInStaticExport"
| "detailsOrderedByReference"
>

type ExportSettingsByChartId = Record<number, ExportSettings>
Expand Down Expand Up @@ -133,6 +134,7 @@ export class EditorExportTab extends React.Component<EditorExportTabProps> {
originUrl: this.grapher.originUrl,
shouldIncludeDetailsInStaticExport:
this.grapher.shouldIncludeDetailsInStaticExport,
detailsOrderedByReference: this.grapher.detailsOrderedByReference,
}
}

Expand Down Expand Up @@ -286,14 +288,19 @@ export class EditorExportTab extends React.Component<EditorExportTabProps> {
}
/>
)}
<Toggle
label="Details on demand"
value={this.settings.shouldIncludeDetailsInStaticExport}
onValue={(value) =>
(this.settings.shouldIncludeDetailsInStaticExport =
value)
}
/>
{this.originalGrapher.detailsOrderedByReference.size >
0 && (
<Toggle
label="Details on demand"
value={
this.settings.shouldIncludeDetailsInStaticExport
}
onValue={(value) =>
(this.settings.shouldIncludeDetailsInStaticExport =
value)
}
/>
)}
</Section>
<Section name="Export static chart">
<div className="DownloadButtons">
Expand Down

0 comments on commit 29f3827

Please sign in to comment.