From f34128120e9af33df245879a555e1dfca0f7c9c5 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 24 Dec 2024 12:11:47 +0100 Subject: [PATCH 01/30] init From 4aa695c5558e875be9a74cdfc259c1fe0295f731 Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Tue, 24 Dec 2024 12:56:48 +0100 Subject: [PATCH 02/30] test --- adminSiteClient/DatasetEditPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminSiteClient/DatasetEditPage.tsx b/adminSiteClient/DatasetEditPage.tsx index ca076d32719..ec99decd974 100644 --- a/adminSiteClient/DatasetEditPage.tsx +++ b/adminSiteClient/DatasetEditPage.tsx @@ -212,7 +212,6 @@ class DatasetEditor extends React.Component<{ dataset: DatasetPageData }> { const { dataset } = this.props const { newDataset } = this const isBulkImport = dataset.namespace !== "owid" - return (
{

) : (

+ {dataset.isArchived} Before archiving, ensure that:

  • From 3eda0e1e67bbe6a535365bc5d02736c7f2f5b37c Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Thu, 2 Jan 2025 13:35:41 +0100 Subject: [PATCH 03/30] =?UTF-8?q?=F0=9F=90=9B=20(explorer)=20dismiss=20foc?= =?UTF-8?q?us=20state=20after=20unselecting=20an=20entity=20(#4365)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/@ourworldindata/explorer/src/Explorer.tsx | 3 +++ .../grapher/src/controls/entityPicker/EntityPicker.tsx | 10 ++++++++-- .../src/controls/entityPicker/EntityPickerConstants.ts | 2 ++ packages/@ourworldindata/grapher/src/core/Grapher.tsx | 3 ++- packages/@ourworldindata/grapher/src/index.ts | 1 + 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/@ourworldindata/explorer/src/Explorer.tsx b/packages/@ourworldindata/explorer/src/Explorer.tsx index da070a9e21a..8a9b232f4ba 100644 --- a/packages/@ourworldindata/explorer/src/Explorer.tsx +++ b/packages/@ourworldindata/explorer/src/Explorer.tsx @@ -27,6 +27,7 @@ import { SlideShowManager, DEFAULT_GRAPHER_ENTITY_TYPE, GrapherAnalytics, + FocusArray, } from "@ourworldindata/grapher" import { Bounds, @@ -277,6 +278,8 @@ export class Explorer ? this.props.selection : new SelectionArray(this.explorerProgram.selection) + focusArray = new FocusArray() + entityType = this.explorerProgram.entityType ?? DEFAULT_GRAPHER_ENTITY_TYPE @observable.ref grapher?: Grapher diff --git a/packages/@ourworldindata/grapher/src/controls/entityPicker/EntityPicker.tsx b/packages/@ourworldindata/grapher/src/controls/entityPicker/EntityPicker.tsx index 754584323a4..0f8a7fae886 100644 --- a/packages/@ourworldindata/grapher/src/controls/entityPicker/EntityPicker.tsx +++ b/packages/@ourworldindata/grapher/src/controls/entityPicker/EntityPicker.tsx @@ -95,6 +95,11 @@ export class EntityPicker extends React.Component<{ ): void { this.manager.selection.toggleSelection(name) + // Remove focus from an entity that has been removed from the selection + if (!this.manager.selection.selectedSet.has(name)) { + this.manager.focusArray?.remove(name) + } + // Clear search input this.searchInput = "" this.manager.analytics?.logEntityPickerEvent( @@ -644,9 +649,10 @@ export class EntityPicker extends React.Component<{ title={selectedDebugMessage} className="ClearSelectionButton" data-track-note="entity_picker_clear_selection" - onClick={(): void => + onClick={(): void => { selection.clearSelection() - } + this.manager.focusArray?.clear() + }} > Clear selection diff --git a/packages/@ourworldindata/grapher/src/controls/entityPicker/EntityPickerConstants.ts b/packages/@ourworldindata/grapher/src/controls/entityPicker/EntityPickerConstants.ts index 2370530d877..cdd1d2e6cea 100644 --- a/packages/@ourworldindata/grapher/src/controls/entityPicker/EntityPickerConstants.ts +++ b/packages/@ourworldindata/grapher/src/controls/entityPicker/EntityPickerConstants.ts @@ -3,6 +3,7 @@ import { GrapherAnalytics } from "../../core/GrapherAnalytics" import { OwidTable } from "@ourworldindata/core-table" import { CoreColumnDef, SortOrder } from "@ourworldindata/types" import { SelectionArray } from "../../selection/SelectionArray" +import { FocusArray } from "../../focus/FocusArray" export interface EntityPickerManager { entityPickerMetric?: ColumnSlug @@ -19,4 +20,5 @@ export interface EntityPickerManager { selection: SelectionArray entityType?: string analytics?: GrapherAnalytics + focusArray?: FocusArray } diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index 8cbd4e22d1f..9ac3eaf20eb 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -341,6 +341,7 @@ export interface GrapherManager { embedDialogUrl?: string embedDialogAdditionalElements?: React.ReactElement selection?: SelectionArray + focusArray?: FocusArray editUrl?: string } @@ -512,7 +513,7 @@ export class Grapher this.props.table?.availableEntities ?? [] ) - focusArray = new FocusArray() + focusArray = this.manager?.focusArray ?? new FocusArray() /** * todo: factor this out and make more RAII. diff --git a/packages/@ourworldindata/grapher/src/index.ts b/packages/@ourworldindata/grapher/src/index.ts index b9b100cdf1e..8d52675e86c 100644 --- a/packages/@ourworldindata/grapher/src/index.ts +++ b/packages/@ourworldindata/grapher/src/index.ts @@ -72,6 +72,7 @@ export { MapProjectionGeos, } from "./mapCharts/MapProjections" export { SelectionArray } from "./selection/SelectionArray" +export { FocusArray } from "./focus/FocusArray" export { setSelectedEntityNamesParam, migrateSelectedEntityNamesParam, From 162e43f6fe249cdc2b7b5ba18fc8c2843ec7eaba Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Thu, 2 Jan 2025 14:15:42 +0100 Subject: [PATCH 04/30] =?UTF-8?q?=F0=9F=90=9B=20clear=20focus=20when=20cle?= =?UTF-8?q?aring=20query=20params=20(#4366)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit clear focus --- .../grapher/src/core/Grapher.tsx | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.tsx index 9ac3eaf20eb..a7d8a97493b 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.tsx @@ -1210,6 +1210,11 @@ export class Grapher this.selection.setSelectedEntities(this.selectedEntityNames) } + @action.bound private applyOriginalFocusAsAuthored(): void { + if (this.focusedSeriesNames?.length) + this.focusArray.clearAllAndAdd(...this.focusedSeriesNames) + } + @computed get hasData(): boolean { return this.dimensions.length > 0 || this.newSlugs.length > 0 } @@ -2641,10 +2646,14 @@ export class Grapher }, { combo: "a", - fn: (): void | SelectionArray => - this.selection.hasSelection - ? this.selection.clearSelection() - : this.selection.selectAll(), + fn: (): void => { + if (this.selection.hasSelection) { + this.selection.clearSelection() + this.focusArray.clear() + } else { + this.selection.selectAll() + } + }, title: this.selection.hasSelection ? `Select None` : `Select All`, @@ -3354,6 +3363,11 @@ export class Grapher this.applyOriginalSelectionAsAuthored() } + @action.bound clearFocus(): void { + this.focusArray.clear() + this.applyOriginalFocusAsAuthored() + } + @action.bound clearQueryParams(): void { const { authorsVersion } = this this.tab = authorsVersion.tab @@ -3370,6 +3384,7 @@ export class Grapher authorsVersion.showSelectionOnlyInDataTable this.showNoDataArea = authorsVersion.showNoDataArea this.clearSelection() + this.clearFocus() } // Todo: come up with a more general pattern? @@ -3388,6 +3403,7 @@ export class Grapher this.sizeSlug = grapher.sizeSlug this.selection.clearSelection() + this.focusArray.clear() } debounceMode = false From 9319dae3fdf3e8bc12579c360224056337bbe9ca Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Thu, 2 Jan 2025 15:40:05 +0100 Subject: [PATCH 05/30] =?UTF-8?q?=F0=9F=A7=AA=20fix=20flaky=20test=20(#436?= =?UTF-8?q?7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One test in the Marimekko test suite is flaky and (sometimes) fails. It seems to be a rounding issue. Instead of rounding the values ourselves, I use jest's `toBeCloseTo` that compares floating point values allowing for imprecision. --- .../MarimekkoChart.jsdom.test.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.jsdom.test.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.jsdom.test.tsx index c20ed644b8f..899997644bf 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.jsdom.test.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/MarimekkoChart.jsdom.test.tsx @@ -1,6 +1,6 @@ #! /usr/bin/env jest -import { Bounds, ColumnTypeNames } from "@ourworldindata/utils" +import { Bounds, ColumnTypeNames, omit } from "@ourworldindata/utils" import { OwidTable } from "@ourworldindata/core-table" import { DefaultColorScheme } from "../color/CustomSchemes" import { Grapher } from "../core/Grapher" @@ -408,8 +408,15 @@ it("can deal with y columns with missing values", () => { expect(chart.series[0].points).toEqual(expectedYPoints1) expect(chart.series[1].points).toEqual(expectedYPoints2) expect(chart.xSeries!.points).toEqual(expectedXPoints) + + const placedItemsWithoutXPosition = chart.placedItems.map((placedItem) => + omit(placedItem, "xPosition") + ) + const xPositions = chart.placedItems.map( + (placedItem) => placedItem.xPosition + ) // placedItems should be in default sort order - expect(chart.placedItems.map(roundXPosition)).toEqual([ + expect(placedItemsWithoutXPosition).toEqual([ { entityName: "medium", entityColor: undefined, @@ -428,7 +435,6 @@ it("can deal with y columns with missing values", () => { }, ], xPoint: expectedXPoints[0], - xPosition: 0, }, { entityName: "small", @@ -448,7 +454,6 @@ it("can deal with y columns with missing values", () => { }, ], xPoint: expectedXPoints[2], - xPosition: Math.round(xAxisRange * 0.4), }, { entityName: "big", @@ -462,9 +467,12 @@ it("can deal with y columns with missing values", () => { }, ], xPoint: expectedXPoints[1], - xPosition: Math.round(xAxisRange * 0.5), }, ]) + + expect(xPositions[0]).toEqual(0) + expect(xPositions[1]).toBeCloseTo(xAxisRange * 0.4, 0) + expect(xPositions[2]).toBeCloseTo(xAxisRange * 0.5, 0) }) function roundXPosition(item: PlacedItem): PlacedItem { From 57ea52e475d34d0d5f0b8c1463e6d47610a2620a Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Thu, 2 Jan 2025 16:56:38 +0100 Subject: [PATCH 06/30] =?UTF-8?q?=F0=9F=90=9B=20(facet)=20make=20legend=20?= =?UTF-8?q?clickable=20for=20line=20and=20slope=20charts=20only=20(#4370)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/facetChart/FacetChart.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/@ourworldindata/grapher/src/facetChart/FacetChart.tsx b/packages/@ourworldindata/grapher/src/facetChart/FacetChart.tsx index ef091fb9110..e66b7faa5b1 100644 --- a/packages/@ourworldindata/grapher/src/facetChart/FacetChart.tsx +++ b/packages/@ourworldindata/grapher/src/facetChart/FacetChart.tsx @@ -799,7 +799,8 @@ export class FacetChart } @action.bound onLegendClick(bin: ColorScaleBin): void { - if (!this.manager.focusArray) return + if (!this.manager.focusArray || !this.isFocusModeSupported) return + // find all series (of all facets) that are contained in the bin const seriesNames = uniq( this.intermediateChartInstances.flatMap((chartInstance) => @@ -817,6 +818,13 @@ export class FacetChart return new this.LegendClass({ manager: this }) } + @computed private get isFocusModeSupported(): boolean { + return ( + this.chartTypeName === GRAPHER_CHART_TYPES.LineChart || + this.chartTypeName === GRAPHER_CHART_TYPES.SlopeChart + ) + } + /** * In order to display a potentially long facet label in the potentially tight space, we * shrink and shorten the label as follows to prevent overlap between neighbouring labels: From 0fbc2ea1c00335ec32fde8774e05279bb39ff9ca Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Fri, 3 Jan 2025 13:32:56 +0100 Subject: [PATCH 07/30] =?UTF-8?q?=E2=9C=A8=20(discrete=20bar)=20hide=20hor?= =?UTF-8?q?izontal=20axis=20(#4371)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ✨ (discrete bar) hide horizontal axis * 🔨 remove relative mode from discrete bar chart configs * 🤖 style: prettify code --- ...RemoveRelativeModeFromDiscreteBarCharts.ts | 21 ++++++++++++++ .../src/barCharts/DiscreteBarChart.tsx | 29 ++----------------- 2 files changed, 23 insertions(+), 27 deletions(-) create mode 100644 db/migration/1735896576517-RemoveRelativeModeFromDiscreteBarCharts.ts diff --git a/db/migration/1735896576517-RemoveRelativeModeFromDiscreteBarCharts.ts b/db/migration/1735896576517-RemoveRelativeModeFromDiscreteBarCharts.ts new file mode 100644 index 00000000000..b2aff926b03 --- /dev/null +++ b/db/migration/1735896576517-RemoveRelativeModeFromDiscreteBarCharts.ts @@ -0,0 +1,21 @@ +import { MigrationInterface, QueryRunner } from "typeorm" + +export class RemoveRelativeModeFromDiscreteBarCharts1735896576517 + implements MigrationInterface +{ + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + -- sql + update chart_configs + set + patch = json_remove(patch, '$.stackMode'), + full = json_remove(full, '$.stackMode') + where + chartType = 'DiscreteBar' + and full ->> '$.stackMode' = 'relative'; + `) + } + + // eslint-disable-next-line @typescript-eslint/no-empty-function + public async down(): Promise {} +} diff --git a/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx b/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx index 3f79cc7bdec..e83be28e48d 100644 --- a/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx +++ b/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx @@ -37,11 +37,7 @@ import { GRAPHER_AREA_OPACITY_DEFAULT, GRAPHER_FONT_SCALE_12, } from "../core/GrapherConstants" -import { - HorizontalAxisComponent, - HorizontalAxisGridLines, - HorizontalAxisZeroLine, -} from "../axis/AxisViews" +import { HorizontalAxisZeroLine } from "../axis/AxisViews" import { NoDataModal } from "../noDataModal/NoDataModal" import { AxisConfig, AxisManager } from "../axis/AxisConfig" import { ColorSchemes } from "../color/ColorSchemes" @@ -305,7 +301,6 @@ export class DiscreteBarChart @computed private get innerBounds(): Bounds { return this.boundsWithoutColorLegend .padLeft(Math.max(this.seriesLegendWidth, this.leftValueLabelWidth)) - .padBottom(this.showHorizontalAxis ? this.yAxis.height : 0) .padRight(this.rightValueLabelWidth) } @@ -350,10 +345,6 @@ export class DiscreteBarChart return this.barPlacements.map((b) => b.width) } - @computed private get showHorizontalAxis(): boolean | undefined { - return this.manager.isRelativeMode - } - private d3Bars(): Selection< BaseType, unknown, @@ -504,7 +495,7 @@ export class DiscreteBarChart } renderChartArea(): React.ReactElement { - const { manager, boundsWithoutColorLegend, yAxis, innerBounds } = this + const { manager, yAxis, innerBounds } = this const axisLineWidth = manager.isStaticAndSmall ? GRAPHER_AXIS_LINE_WIDTH_THICK @@ -516,22 +507,6 @@ export class DiscreteBarChart {this.showColorLegend && ( )} - {this.showHorizontalAxis && ( - <> - - - - )} {!this.isLogScale && ( Date: Fri, 3 Jan 2025 15:15:36 +0100 Subject: [PATCH 08/30] =?UTF-8?q?=E2=9C=A8=20(discrete=20bar)=20thin=20zer?= =?UTF-8?q?o=20line=20(#4372)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/barCharts/DiscreteBarChart.tsx | 12 ++++++++++-- .../src/stackedCharts/StackedDiscreteBarChart.tsx | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx b/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx index e83be28e48d..4b0857a882a 100644 --- a/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx +++ b/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx @@ -498,8 +498,8 @@ export class DiscreteBarChart const { manager, yAxis, innerBounds } = this const axisLineWidth = manager.isStaticAndSmall - ? GRAPHER_AXIS_LINE_WIDTH_THICK - : GRAPHER_AXIS_LINE_WIDTH_DEFAULT + ? 0.5 * GRAPHER_AXIS_LINE_WIDTH_THICK + : 0.5 * GRAPHER_AXIS_LINE_WIDTH_DEFAULT return ( <> @@ -512,6 +512,14 @@ export class DiscreteBarChart horizontalAxis={yAxis} bounds={innerBounds} strokeWidth={axisLineWidth} + // if the chart doesn't have negative values, then we + // move the zero line a little to the left to avoid + // overlap with the bars + align={ + this.hasNegative + ? HorizontalAlign.center + : HorizontalAlign.right + } /> )} {this.renderBars()} diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.tsx index b298d2ae160..63317a0eae4 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.tsx @@ -713,7 +713,7 @@ export class StackedDiscreteBarChart Date: Fri, 3 Jan 2025 15:37:38 +0100 Subject: [PATCH 09/30] link to Wizard, archive label --- adminSiteClient/DatasetEditPage.tsx | 49 ++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/adminSiteClient/DatasetEditPage.tsx b/adminSiteClient/DatasetEditPage.tsx index ec99decd974..8890b687053 100644 --- a/adminSiteClient/DatasetEditPage.tsx +++ b/adminSiteClient/DatasetEditPage.tsx @@ -17,9 +17,12 @@ import { SourceList } from "./SourceList.js" import { VariableList, VariableListItem } from "./VariableList.js" import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" -import { faDownload } from "@fortawesome/free-solid-svg-icons" +import { faDownload, faHatWizard } from "@fortawesome/free-solid-svg-icons" import { faGithub } from "@fortawesome/free-brands-svg-icons" - +import { ETL_WIZARD_URL } from "../settings/clientSettings.js" +import { + Button, +} from "antd" interface DatasetPageData { id: number name: string @@ -28,6 +31,7 @@ interface DatasetPageData { shortName: string version: string isPrivate: boolean + isArchived: boolean nonRedistributable: boolean updatePeriodDays: number @@ -218,8 +222,14 @@ class DatasetEditor extends React.Component<{ dataset: DatasetPageData }> { when={this.isModified} message="Are you sure you want to leave? Unsaved changes will be lost." /> + + {/* HEADER */}
    -

    {dataset.name}

    + {dataset.isArchived? +

    + Archived: {dataset.name} +

    :

    {dataset.name}

    + } {dataset.shortName && (

    {dataset.namespace}/{dataset.version}/ @@ -233,6 +243,7 @@ class DatasetEditor extends React.Component<{ dataset: DatasetPageData }> { by={dataset.dataEditedByUserName} />

    + { > Download CSV + {/* Link to Wizard dataset preview */} + + + + {/* View on GitHub link (old) */} {!isBulkImport && !dataset.isPrivate && ( { View on GitHub )} + {/* Download additional content (old) */} {dataset.zipFile && ( { )}

    + + {/* DATASET METADATA */}

    Dataset metadata

    { />
    + + {/* ORIGINS */}

    Origins

    + + {/* SOURCES */} {dataset.variableSources && dataset.variableSources.length > 0 && (
    @@ -344,10 +377,14 @@ class DatasetEditor extends React.Component<{ dataset: DatasetPageData }> {
    )} + + {/* INDICATORS */}

    Indicators

    + + {/* CHARTS */}
    -
    + + {/* ARCHIVE DATASET */} + {!dataset.isArchived && ( +

    Archive

    Archive this grapher dataset to remove it from the main @@ -399,6 +439,7 @@ class DatasetEditor extends React.Component<{ dataset: DatasetPageData }> { Archive dataset

    + )}
) } From 41bdb9af43586aad09d6abcb02edac615c1c02bc Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Fri, 3 Jan 2025 15:39:29 +0100 Subject: [PATCH 10/30] white space --- adminSiteClient/VariableEditPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminSiteClient/VariableEditPage.tsx b/adminSiteClient/VariableEditPage.tsx index c819d0d9730..163c8124051 100644 --- a/adminSiteClient/VariableEditPage.tsx +++ b/adminSiteClient/VariableEditPage.tsx @@ -212,7 +212,7 @@ class VariableEditor extends React.Component<{ target="_blank" rel="noopener" > - garden level + {" "}garden level ,{" "} Date: Fri, 3 Jan 2025 14:39:55 +0000 Subject: [PATCH 11/30] =?UTF-8?q?=F0=9F=A4=96=20style:=20prettify=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adminSiteClient/DatasetEditPage.tsx | 98 +++++++++++++++-------------- 1 file changed, 51 insertions(+), 47 deletions(-) diff --git a/adminSiteClient/DatasetEditPage.tsx b/adminSiteClient/DatasetEditPage.tsx index 8890b687053..61fbb84881a 100644 --- a/adminSiteClient/DatasetEditPage.tsx +++ b/adminSiteClient/DatasetEditPage.tsx @@ -20,9 +20,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faDownload, faHatWizard } from "@fortawesome/free-solid-svg-icons" import { faGithub } from "@fortawesome/free-brands-svg-icons" import { ETL_WIZARD_URL } from "../settings/clientSettings.js" -import { - Button, -} from "antd" +import { Button } from "antd" interface DatasetPageData { id: number name: string @@ -225,11 +223,14 @@ class DatasetEditor extends React.Component<{ dataset: DatasetPageData }> { {/* HEADER */}
- {dataset.isArchived? -

- Archived: {dataset.name} -

:

{dataset.name}

- } + {dataset.isArchived ? ( +

+ Archived:{" "} + {dataset.name} +

+ ) : ( +

{dataset.name}

+ )} {dataset.shortName && (

{dataset.namespace}/{dataset.version}/ @@ -377,7 +378,7 @@ class DatasetEditor extends React.Component<{ dataset: DatasetPageData }> {

)} - + {/* INDICATORS */}

Indicators

@@ -399,46 +400,49 @@ class DatasetEditor extends React.Component<{ dataset: DatasetPageData }> { {/* ARCHIVE DATASET */} {!dataset.isArchived && (
-

Archive

-

- Archive this grapher dataset to remove it from the main - list of active datasets. -

- {dataset.charts && dataset.charts.length > 0 ? ( -

- - This dataset cannot be archived because it - contains charts. - -

- ) : ( +

Archive

- {dataset.isArchived} - Before archiving, ensure that: -

    -
  • - The corresponding ETL grapher step has been - archived:{" "} - - grapher/{dataset.namespace}/ - {dataset.version}/{dataset.shortName} - -
  • -
  • - The dataset is not used in any - indicator-based explorers. -
  • -
+ Archive this grapher dataset to remove it from the + main list of active datasets.

- )} - -
+ {dataset.charts && dataset.charts.length > 0 ? ( +

+ + This dataset cannot be archived because it + contains charts. + +

+ ) : ( +

+ {dataset.isArchived} + Before archiving, ensure that: +

    +
  • + The corresponding ETL grapher step has + been archived:{" "} + + grapher/{dataset.namespace}/ + {dataset.version}/ + {dataset.shortName} + +
  • +
  • + The dataset is not used in any + indicator-based explorers. +
  • +
+

+ )} + +
)} ) From b93973c15193ce0dac50750bc654b6cf04060f5d Mon Sep 17 00:00:00 2001 From: lucasrodes Date: Fri, 3 Jan 2025 14:46:45 +0000 Subject: [PATCH 12/30] =?UTF-8?q?=F0=9F=A4=96=20style:=20prettify=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adminSiteClient/VariableEditPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adminSiteClient/VariableEditPage.tsx b/adminSiteClient/VariableEditPage.tsx index 163c8124051..3632ce1b585 100644 --- a/adminSiteClient/VariableEditPage.tsx +++ b/adminSiteClient/VariableEditPage.tsx @@ -212,7 +212,8 @@ class VariableEditor extends React.Component<{ target="_blank" rel="noopener" > - {" "}garden level + {" "} + garden level
,{" "} Date: Fri, 3 Jan 2025 15:51:13 +0100 Subject: [PATCH 13/30] prettier --- adminSiteClient/VariableEditPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adminSiteClient/VariableEditPage.tsx b/adminSiteClient/VariableEditPage.tsx index 163c8124051..3632ce1b585 100644 --- a/adminSiteClient/VariableEditPage.tsx +++ b/adminSiteClient/VariableEditPage.tsx @@ -212,7 +212,8 @@ class VariableEditor extends React.Component<{ target="_blank" rel="noopener" > - {" "}garden level + {" "} + garden level ,{" "} Date: Mon, 6 Jan 2025 11:20:54 +0100 Subject: [PATCH 14/30] removing debug line --- adminSiteClient/DatasetEditPage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/adminSiteClient/DatasetEditPage.tsx b/adminSiteClient/DatasetEditPage.tsx index 61fbb84881a..143f0261fe5 100644 --- a/adminSiteClient/DatasetEditPage.tsx +++ b/adminSiteClient/DatasetEditPage.tsx @@ -414,7 +414,6 @@ class DatasetEditor extends React.Component<{ dataset: DatasetPageData }> {

) : (

- {dataset.isArchived} Before archiving, ensure that: