From 616ed35399de8b56f16431fb47ae0ab83758531c Mon Sep 17 00:00:00 2001 From: Ike Saunders <11844404+ikesau@users.noreply.github.com> Date: Fri, 20 Dec 2024 09:28:12 -0500 Subject: [PATCH 01/29] Merge pull request #4342 from owid/persist-alt-text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✨ persist alt text between image revisions --- adminSiteClient/ImagesIndexPage.tsx | 80 ++++++++++++++++++++--------- adminSiteServer/apiRouter.ts | 2 + 2 files changed, 57 insertions(+), 25 deletions(-) diff --git a/adminSiteClient/ImagesIndexPage.tsx b/adminSiteClient/ImagesIndexPage.tsx index 24ba88b42c..ecd8a452f9 100644 --- a/adminSiteClient/ImagesIndexPage.tsx +++ b/adminSiteClient/ImagesIndexPage.tsx @@ -14,6 +14,7 @@ import { Popover, Table, Upload, + notification, } from "antd" import { AdminLayout } from "./AdminLayout.js" import { AdminAppContext } from "./AdminAppContext.js" @@ -31,6 +32,7 @@ import { RcFile } from "antd/es/upload/interface.js" import { CLOUDFLARE_IMAGES_URL } from "../settings/clientSettings.js" import { Dictionary, keyBy } from "lodash" import cx from "classnames" +import { NotificationInstance } from "antd/es/notification/interface.js" type ImageMap = Record @@ -237,10 +239,12 @@ function createColumns({ api, users, usage, + notificationApi, }: { api: ImageEditorApi users: UserMap usage: Dictionary + notificationApi: NotificationInstance }): ColumnsType { return [ { @@ -376,7 +380,11 @@ function createColumns({ return ( - + - - + <> + + + + ) } +const NotificationContext = React.createContext(null) + export function ImageIndexPage() { const { admin } = useContext(AdminAppContext) + const [notificationApi, notificationContextHolder] = + notification.useNotification() const [images, setImages] = useState({}) const [users, setUsers] = useState({}) const [usage, setUsage] = useState>({}) @@ -605,8 +630,8 @@ export function ImageIndexPage() { ) const columns = useMemo( - () => createColumns({ api, users, usage }), - [api, users, usage] + () => createColumns({ api, users, usage, notificationApi }), + [api, users, usage, notificationApi] ) useEffect(() => { @@ -617,18 +642,23 @@ export function ImageIndexPage() { return ( -
- - setFilenameSearchValue(e.target.value)} - style={{ width: 500, marginBottom: 20 }} - /> - - - - + + {notificationContextHolder} +
+ + + setFilenameSearchValue(e.target.value) + } + style={{ width: 500, marginBottom: 20 }} + /> + + +
+ + ) } diff --git a/adminSiteServer/apiRouter.ts b/adminSiteServer/apiRouter.ts index 945d6b6670..5cf0e042bc 100644 --- a/adminSiteServer/apiRouter.ts +++ b/adminSiteServer/apiRouter.ts @@ -3241,6 +3241,7 @@ putRouteWithRWTransaction(apiRouter, "/images/:id", async (req, res, trx) => { const originalCloudflareId = image.cloudflareId const originalFilename = image.filename + const originalAltText = image.defaultAlt if (!originalCloudflareId) { throw new JsonError( @@ -3262,6 +3263,7 @@ putRouteWithRWTransaction(apiRouter, "/images/:id", async (req, res, trx) => { cloudflareId: newCloudflareId, updatedAt: new Date().getTime(), userId: res.locals.user.id, + defaultAlt: originalAltText, hash, version: image.version + 1, }) From 83f62eae736a2ac040d7f451afa7c926805279eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ra=C4=8D=C3=A1k?= Date: Fri, 20 Dec 2024 16:53:59 +0100 Subject: [PATCH 02/29] Add Bluesky to donation sharing options (#4347) --- site/ThankYouPage.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/site/ThankYouPage.tsx b/site/ThankYouPage.tsx index 6e05a7452a..9098aafdf7 100644 --- a/site/ThankYouPage.tsx +++ b/site/ThankYouPage.tsx @@ -3,7 +3,11 @@ import { Head } from "./Head.js" import { SiteHeader } from "./SiteHeader.js" import { SiteFooter } from "./SiteFooter.js" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" -import { faFacebook, faXTwitter } from "@fortawesome/free-brands-svg-icons" +import { + faBluesky, + faFacebook, + faXTwitter, +} from "@fortawesome/free-brands-svg-icons" import { Html } from "./Html.js" const shareMessage = @@ -54,6 +58,16 @@ export const ThankYouPage = (props: { baseUrl: string }) => (
“{shareMessage} {donateLink}
+ + + Date: Fri, 20 Dec 2024 17:13:38 +0100 Subject: [PATCH 03/29] =?UTF-8?q?=F0=9F=90=9B=20(facet)=20show=20swatch=20?= =?UTF-8?q?colour=20on=20hovering=20(#4348)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/horizontalColorLegend/HorizontalColorLegends.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@ourworldindata/grapher/src/horizontalColorLegend/HorizontalColorLegends.tsx b/packages/@ourworldindata/grapher/src/horizontalColorLegend/HorizontalColorLegends.tsx index d53b679238..37ed032586 100644 --- a/packages/@ourworldindata/grapher/src/horizontalColorLegend/HorizontalColorLegends.tsx +++ b/packages/@ourworldindata/grapher/src/horizontalColorLegend/HorizontalColorLegends.tsx @@ -854,6 +854,7 @@ export class HorizontalCategoricalColorLegend extends HorizontalColorLegend { {marks.map((mark, index) => { const isActive = activeColors?.includes(mark.bin.color) + const isHovered = hoverColors.includes(mark.bin.color) const isNotHovered = hoverColors.length > 0 && !hoverColors.includes(mark.bin.color) @@ -863,7 +864,7 @@ export class HorizontalCategoricalColorLegend extends HorizontalColorLegend { : mark.bin.color const fill = - isActive || activeColors === undefined + isHovered || isActive || activeColors === undefined ? color : OWID_NON_FOCUSED_GRAY From 6079a947146723ebc5338df24a0762daf01fde05 Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Fri, 20 Dec 2024 17:27:36 +0100 Subject: [PATCH 04/29] =?UTF-8?q?=F0=9F=90=9B=20(scatter)=20left-align=20n?= =?UTF-8?q?o=20data=20section=20(#4349)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grapher/src/scatterCharts/NoDataSection.tsx | 7 +++++-- .../@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/NoDataSection.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/NoDataSection.tsx index a5862b3172..9041e4ee8f 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/NoDataSection.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/NoDataSection.tsx @@ -1,5 +1,5 @@ import React from "react" -import { Bounds } from "@ourworldindata/utils" +import { Bounds, HorizontalAlign } from "@ourworldindata/utils" import { GRAPHER_FONT_SCALE_11, GRAPHER_FONT_SCALE_12, @@ -9,10 +9,12 @@ import { GRAPHER_LIGHT_TEXT } from "../color/ColorConstants" export function NoDataSection({ seriesNames, bounds, + align = HorizontalAlign.left, baseFontSize = 16, }: { seriesNames: string[] bounds: Bounds + align?: HorizontalAlign baseFontSize?: number }): React.ReactElement { { @@ -30,7 +32,8 @@ export function NoDataSection({ className="NoDataSection" {...bounds.toProps()} style={{ - textAlign: "right", + textAlign: + align === HorizontalAlign.right ? "right" : "left", color: GRAPHER_LIGHT_TEXT, }} > diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx index 3d01ce3607..b713209ebf 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.tsx @@ -35,6 +35,7 @@ import { VerticalAlign, FacetStrategy, InteractionState, + HorizontalAlign, } from "@ourworldindata/types" import { ChartInterface } from "../chart/ChartInterface" import { ChartManager } from "../chart/ChartManager" @@ -1127,6 +1128,7 @@ export class SlopeChart ) From d1bd40b646cd93eed689180ea8f2c4c839be04d9 Mon Sep 17 00:00:00 2001 From: Fiona Spooner Date: Mon, 23 Dec 2024 09:56:16 +0000 Subject: [PATCH 05/29] Merge pull request #4353 from owid/add-antibiotics-topic-list Update SiteNavigation.tsx --- site/SiteNavigation.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/site/SiteNavigation.tsx b/site/SiteNavigation.tsx index 1d19b2acbc..b9d1b000d8 100644 --- a/site/SiteNavigation.tsx +++ b/site/SiteNavigation.tsx @@ -477,6 +477,10 @@ export const SiteNavigationStatic: { categories: CategoryWithEntries[] } = { slug: "vaccination", title: "Vaccination", }, + { + slug: "antibiotics", + title: "Antibiotics & Antibiotic Resistance", + }, { slug: "financing-healthcare", title: "Healthcare Spending", From 58e75de88f0961fb9361d00d17e8b62a31de0430 Mon Sep 17 00:00:00 2001 From: Fiona Spooner Date: Mon, 23 Dec 2024 10:37:15 +0000 Subject: [PATCH 06/29] Merge pull request #4354 from owid/spoonerf-patch-1 Update SiteNavigation.tsx --- site/SiteNavigation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/SiteNavigation.tsx b/site/SiteNavigation.tsx index b9d1b000d8..7d357c46c8 100644 --- a/site/SiteNavigation.tsx +++ b/site/SiteNavigation.tsx @@ -479,7 +479,7 @@ export const SiteNavigationStatic: { categories: CategoryWithEntries[] } = { }, { slug: "antibiotics", - title: "Antibiotics & Antibiotic Resistance", + title: "Antibiotics and Antibiotic Resistance", }, { slug: "financing-healthcare", From a6c11e1fb079895cdb5c415de2028392eebd4719 Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Thu, 2 Jan 2025 13:35:41 +0100 Subject: [PATCH 07/29] =?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 da070a9e21..8a9b232f4b 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 754584323a..0f8a7fae88 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 2370530d87..cdd1d2e6ce 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 8cbd4e22d1..9ac3eaf20e 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 b9b100cdf1..8d52675e86 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 7bee7dbdca2fcb9b9e731f5795868d751a8f9cd9 Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Thu, 2 Jan 2025 14:15:42 +0100 Subject: [PATCH 08/29] =?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 9ac3eaf20e..a7d8a97493 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 efc276ced3af243b5399d83e20ad472b4c5b6178 Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Thu, 2 Jan 2025 15:40:05 +0100 Subject: [PATCH 09/29] =?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 c20ed644b8..899997644b 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 6b4305da88864ece69921399c1fb0dc997c302a8 Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Thu, 2 Jan 2025 16:56:38 +0100 Subject: [PATCH 10/29] =?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 ef091fb911..e66b7faa5b 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 58b0348aeec1c183f0503063265ccbb85b976eda Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Fri, 3 Jan 2025 13:32:56 +0100 Subject: [PATCH 11/29] =?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 0000000000..b2aff926b0 --- /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 3f79cc7bde..e83be28e48 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 12/29] =?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 e83be28e48..4b0857a882 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 b298d2ae16..63317a0eae 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: Mon, 6 Jan 2025 11:48:05 +0100 Subject: [PATCH 13/29] =?UTF-8?q?=E2=9C=A8=20(discrete=20bar)=20add=20more?= =?UTF-8?q?=20whitespace=20between=20bars=20(#4373)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/barCharts/DiscreteBarChart.tsx | 29 ++++++++++++++----- .../stackedCharts/StackedDiscreteBarChart.tsx | 27 ++++++++++++----- 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx b/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx index 4b0857a882..614f65a8ae 100644 --- a/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx +++ b/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.tsx @@ -86,6 +86,8 @@ const DEFAULT_PROJECTED_DATA_COLOR_IN_LEGEND = "#787878" // if an entity name exceeds this width, we use the short name instead (if available) const SOFT_MAX_LABEL_WIDTH = 90 +const BAR_SPACING_FACTOR = 0.35 + export interface Label { valueString: string timeString: string @@ -312,18 +314,29 @@ export class DiscreteBarChart return this.series.length } - @computed private get barHeight(): number { - return (0.8 * this.innerBounds.height) / this.barCount + /** The total height of the series, i.e. the height of the bar + the white space around it */ + @computed private get seriesHeight(): number { + return this.innerBounds.height / this.barCount } - // useful if `this.barHeight` can't be used due to a cyclic dependency - // keep in mind though that this is not exactly the same as `this.barHeight` - @computed private get approximateBarHeight(): number { - return (0.8 * this.boundsWithoutColorLegend.height) / this.barCount + @computed private get barSpacing(): number { + return this.seriesHeight * BAR_SPACING_FACTOR } - @computed private get barSpacing(): number { - return this.innerBounds.height / this.barCount - this.barHeight + @computed private get barHeight(): number { + const totalWhiteSpace = this.barCount * this.barSpacing + return (this.innerBounds.height - totalWhiteSpace) / this.barCount + } + + // useful if `barHeight` can't be used due to a cyclic dependency + // keep in mind though that this is not exactly the same as `barHeight` + @computed private get approximateBarHeight(): number { + const { height } = this.boundsWithoutColorLegend + const approximateMaxBarHeight = height / this.barCount + const approximateBarSpacing = + approximateMaxBarHeight * BAR_SPACING_FACTOR + const totalWhiteSpace = this.barCount * approximateBarSpacing + return (height - totalWhiteSpace) / this.barCount } @computed private get barPlacements(): { x: number; width: number }[] { diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.tsx index 63317a0eae..493cba5fca 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.tsx @@ -84,6 +84,8 @@ import { TextWrap } from "@ourworldindata/components" // if an entity name exceeds this width, we use the short name instead (if available) const SOFT_MAX_LABEL_WIDTH = 90 +const BAR_SPACING_FACTOR = 0.35 + const labelToBarPadding = 5 export interface StackedDiscreteBarChartManager extends ChartManager { @@ -470,18 +472,29 @@ export class StackedDiscreteBarChart })) } - // useful if `this.barHeight` can't be used due to a cyclic dependency - // keep in mind though that this is not exactly the same as `this.barHeight` - @computed private get approximateBarHeight(): number { - return (0.8 * this.boundsWithoutLegend.height) / this.barCount + /** The total height of the series, i.e. the height of the bar + the white space around it */ + @computed private get seriesHeight(): number { + return this.innerBounds.height / this.barCount + } + + @computed private get barSpacing(): number { + return this.seriesHeight * BAR_SPACING_FACTOR } @computed private get barHeight(): number { - return (0.8 * this.innerBounds.height) / this.barCount + const totalWhiteSpace = this.barCount * this.barSpacing + return (this.innerBounds.height - totalWhiteSpace) / this.barCount } - @computed private get barSpacing(): number { - return this.innerBounds.height / this.barCount - this.barHeight + // useful if `barHeight` can't be used due to a cyclic dependency + // keep in mind though that this is not exactly the same as `barHeight` + @computed private get approximateBarHeight(): number { + const { height } = this.boundsWithoutLegend + const approximateMaxBarHeight = height / this.barCount + const approximateBarSpacing = + approximateMaxBarHeight * BAR_SPACING_FACTOR + const totalWhiteSpace = this.barCount * approximateBarSpacing + return (height - totalWhiteSpace) / this.barCount } // legend props From 1118d02f9c7bd08e3a74a7a390beec6d37d89f0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Rod=C3=A9s-Guirao?= Date: Mon, 6 Jan 2025 13:01:21 +0100 Subject: [PATCH 14/29] Merge pull request #4356 from owid/enhance-archive-dataset-ui MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✨ "Archive" label in dataset, link to Dataset preview in Wizard --- adminSiteClient/DatasetEditPage.tsx | 128 ++++--- adminSiteClient/VariableEditPage.tsx | 1 + package.json | 2 +- yarn.lock | 481 +++++++++++++++------------ 4 files changed, 349 insertions(+), 263 deletions(-) diff --git a/adminSiteClient/DatasetEditPage.tsx b/adminSiteClient/DatasetEditPage.tsx index ca076d3271..143f0261fe 100644 --- a/adminSiteClient/DatasetEditPage.tsx +++ b/adminSiteClient/DatasetEditPage.tsx @@ -17,9 +17,10 @@ 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 +29,7 @@ interface DatasetPageData { shortName: string version: string isPrivate: boolean + isArchived: boolean nonRedistributable: boolean updatePeriodDays: number @@ -212,15 +214,23 @@ class DatasetEditor extends React.Component<{ dataset: DatasetPageData }> { const { dataset } = this.props const { newDataset } = this const isBulkImport = dataset.namespace !== "owid" - return (
+ + {/* HEADER */}
-

{dataset.name}

+ {dataset.isArchived ? ( +

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

+ ) : ( +

{dataset.name}

+ )} {dataset.shortName && (

{dataset.namespace}/{dataset.version}/ @@ -234,6 +244,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 && (
@@ -345,10 +378,14 @@ class DatasetEditor extends React.Component<{ dataset: DatasetPageData }> {
)} + + {/* INDICATORS */}

Indicators

+ + {/* CHARTS */}
-
-

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 */} + {!dataset.isArchived && ( +
+

Archive

- 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. + +

+ ) : ( +

+ 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. +
  • +
+

+ )} + +
+ )}
) } diff --git a/adminSiteClient/VariableEditPage.tsx b/adminSiteClient/VariableEditPage.tsx index c819d0d973..3632ce1b58 100644 --- a/adminSiteClient/VariableEditPage.tsx +++ b/adminSiteClient/VariableEditPage.tsx @@ -212,6 +212,7 @@ class VariableEditor extends React.Component<{ target="_blank" rel="noopener" > + {" "} garden level ,{" "} diff --git a/package.json b/package.json index 4ff3b57944..02d066479a 100644 --- a/package.json +++ b/package.json @@ -152,7 +152,7 @@ "s-expression": "^3.1.1", "safe-stable-stringify": "^2.4.1", "search-insights": "^2.14.0", - "sharp": "^0.32.5", + "sharp": "^0.33.5", "shell-quote": "^1.7.3", "shelljs": "^0.8.5", "simple-git": "^3.16.1", diff --git a/yarn.lock b/yarn.lock index ed079a8f19..fd5bece4c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1674,6 +1674,15 @@ __metadata: languageName: node linkType: hard +"@emnapi/runtime@npm:^1.2.0": + version: 1.3.1 + resolution: "@emnapi/runtime@npm:1.3.1" + dependencies: + tslib: "npm:^2.4.0" + checksum: 10/619915ee44682356f77f60455025e667b0b04ad3c95ced36c03782aea9ebc066fa73e86c4a59d221177eba5e5533d40b3a6dbff4e58ee5d81db4270185c21e22 + languageName: node + linkType: hard + "@emotion/babel-plugin@npm:^11.10.0, @emotion/babel-plugin@npm:^11.11.0": version: 11.11.0 resolution: "@emotion/babel-plugin@npm:11.11.0" @@ -2325,6 +2334,181 @@ __metadata: languageName: node linkType: hard +"@img/sharp-darwin-arm64@npm:0.33.5": + version: 0.33.5 + resolution: "@img/sharp-darwin-arm64@npm:0.33.5" + dependencies: + "@img/sharp-libvips-darwin-arm64": "npm:1.0.4" + dependenciesMeta: + "@img/sharp-libvips-darwin-arm64": + optional: true + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@img/sharp-darwin-x64@npm:0.33.5": + version: 0.33.5 + resolution: "@img/sharp-darwin-x64@npm:0.33.5" + dependencies: + "@img/sharp-libvips-darwin-x64": "npm:1.0.4" + dependenciesMeta: + "@img/sharp-libvips-darwin-x64": + optional: true + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@img/sharp-libvips-darwin-arm64@npm:1.0.4": + version: 1.0.4 + resolution: "@img/sharp-libvips-darwin-arm64@npm:1.0.4" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@img/sharp-libvips-darwin-x64@npm:1.0.4": + version: 1.0.4 + resolution: "@img/sharp-libvips-darwin-x64@npm:1.0.4" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@img/sharp-libvips-linux-arm64@npm:1.0.4": + version: 1.0.4 + resolution: "@img/sharp-libvips-linux-arm64@npm:1.0.4" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@img/sharp-libvips-linux-arm@npm:1.0.5": + version: 1.0.5 + resolution: "@img/sharp-libvips-linux-arm@npm:1.0.5" + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + +"@img/sharp-libvips-linux-s390x@npm:1.0.4": + version: 1.0.4 + resolution: "@img/sharp-libvips-linux-s390x@npm:1.0.4" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@img/sharp-libvips-linux-x64@npm:1.0.4": + version: 1.0.4 + resolution: "@img/sharp-libvips-linux-x64@npm:1.0.4" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@img/sharp-libvips-linuxmusl-arm64@npm:1.0.4": + version: 1.0.4 + resolution: "@img/sharp-libvips-linuxmusl-arm64@npm:1.0.4" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@img/sharp-libvips-linuxmusl-x64@npm:1.0.4": + version: 1.0.4 + resolution: "@img/sharp-libvips-linuxmusl-x64@npm:1.0.4" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@img/sharp-linux-arm64@npm:0.33.5": + version: 0.33.5 + resolution: "@img/sharp-linux-arm64@npm:0.33.5" + dependencies: + "@img/sharp-libvips-linux-arm64": "npm:1.0.4" + dependenciesMeta: + "@img/sharp-libvips-linux-arm64": + optional: true + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@img/sharp-linux-arm@npm:0.33.5": + version: 0.33.5 + resolution: "@img/sharp-linux-arm@npm:0.33.5" + dependencies: + "@img/sharp-libvips-linux-arm": "npm:1.0.5" + dependenciesMeta: + "@img/sharp-libvips-linux-arm": + optional: true + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + +"@img/sharp-linux-s390x@npm:0.33.5": + version: 0.33.5 + resolution: "@img/sharp-linux-s390x@npm:0.33.5" + dependencies: + "@img/sharp-libvips-linux-s390x": "npm:1.0.4" + dependenciesMeta: + "@img/sharp-libvips-linux-s390x": + optional: true + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@img/sharp-linux-x64@npm:0.33.5": + version: 0.33.5 + resolution: "@img/sharp-linux-x64@npm:0.33.5" + dependencies: + "@img/sharp-libvips-linux-x64": "npm:1.0.4" + dependenciesMeta: + "@img/sharp-libvips-linux-x64": + optional: true + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@img/sharp-linuxmusl-arm64@npm:0.33.5": + version: 0.33.5 + resolution: "@img/sharp-linuxmusl-arm64@npm:0.33.5" + dependencies: + "@img/sharp-libvips-linuxmusl-arm64": "npm:1.0.4" + dependenciesMeta: + "@img/sharp-libvips-linuxmusl-arm64": + optional: true + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@img/sharp-linuxmusl-x64@npm:0.33.5": + version: 0.33.5 + resolution: "@img/sharp-linuxmusl-x64@npm:0.33.5" + dependencies: + "@img/sharp-libvips-linuxmusl-x64": "npm:1.0.4" + dependenciesMeta: + "@img/sharp-libvips-linuxmusl-x64": + optional: true + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@img/sharp-wasm32@npm:0.33.5": + version: 0.33.5 + resolution: "@img/sharp-wasm32@npm:0.33.5" + dependencies: + "@emnapi/runtime": "npm:^1.2.0" + conditions: cpu=wasm32 + languageName: node + linkType: hard + +"@img/sharp-win32-ia32@npm:0.33.5": + version: 0.33.5 + resolution: "@img/sharp-win32-ia32@npm:0.33.5" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@img/sharp-win32-x64@npm:0.33.5": + version: 0.33.5 + resolution: "@img/sharp-win32-x64@npm:0.33.5" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 resolution: "@isaacs/cliui@npm:8.0.2" @@ -6672,13 +6856,6 @@ __metadata: languageName: node linkType: hard -"b4a@npm:^1.6.4": - version: 1.6.4 - resolution: "b4a@npm:1.6.4" - checksum: 10/223158e626a7e024a8d945ce85e7d8871c0689c0375c5b0df5880eedcb5683a12eeb3557591ff5ccd515f3ee8d1664e370c6ff7917fa257405571b81b946604a - languageName: node - linkType: hard - "babel-jest@npm:^29.7.0": version: 29.7.0 resolution: "babel-jest@npm:29.7.0" @@ -7339,13 +7516,6 @@ __metadata: languageName: node linkType: hard -"chownr@npm:^1.1.1": - version: 1.1.4 - resolution: "chownr@npm:1.1.4" - checksum: 10/115648f8eb38bac5e41c3857f3e663f9c39ed6480d1349977c4d96c95a47266fcacc5a5aabf3cb6c481e22d72f41992827db47301851766c4fd77ac21a4f081d - languageName: node - linkType: hard - "chownr@npm:^2.0.0": version: 2.0.0 resolution: "chownr@npm:2.0.0" @@ -8670,15 +8840,6 @@ __metadata: languageName: node linkType: hard -"decompress-response@npm:^6.0.0": - version: 6.0.0 - resolution: "decompress-response@npm:6.0.0" - dependencies: - mimic-response: "npm:^3.1.0" - checksum: 10/d377cf47e02d805e283866c3f50d3d21578b779731e8c5072d6ce8c13cc31493db1c2f6784da9d1d5250822120cefa44f1deab112d5981015f2e17444b763812 - languageName: node - linkType: hard - "dedent@npm:1.5.3, dedent@npm:^1.0.0": version: 1.5.3 resolution: "dedent@npm:1.5.3" @@ -8691,13 +8852,6 @@ __metadata: languageName: node linkType: hard -"deep-extend@npm:^0.6.0": - version: 0.6.0 - resolution: "deep-extend@npm:0.6.0" - checksum: 10/7be7e5a8d468d6b10e6a67c3de828f55001b6eb515d014f7aeb9066ce36bd5717161eb47d6a0f7bed8a9083935b465bc163ee2581c8b128d29bf61092fdf57a7 - languageName: node - linkType: hard - "deep-is@npm:^0.1.3": version: 0.1.3 resolution: "deep-is@npm:0.1.3" @@ -8813,13 +8967,20 @@ __metadata: languageName: node linkType: hard -"detect-libc@npm:^2.0.0, detect-libc@npm:^2.0.2": +"detect-libc@npm:^2.0.0": version: 2.0.2 resolution: "detect-libc@npm:2.0.2" checksum: 10/6118f30c0c425b1e56b9d2609f29bec50d35a6af0b762b6ad127271478f3bbfda7319ce869230cf1a351f2b219f39332cde290858553336d652c77b970f15de8 languageName: node linkType: hard +"detect-libc@npm:^2.0.3": + version: 2.0.3 + resolution: "detect-libc@npm:2.0.3" + checksum: 10/b4ea018d623e077bd395f168a9e81db77370dde36a5b01d067f2ad7989924a81d31cb547ff764acb2aa25d50bb7fdde0b0a93bec02212b0cb430621623246d39 + languageName: node + linkType: hard + "detect-newline@npm:^3.0.0": version: 3.1.0 resolution: "detect-newline@npm:3.1.0" @@ -9985,13 +10146,6 @@ __metadata: languageName: node linkType: hard -"expand-template@npm:^2.0.3": - version: 2.0.3 - resolution: "expand-template@npm:2.0.3" - checksum: 10/588c19847216421ed92befb521767b7018dc88f88b0576df98cb242f20961425e96a92cbece525ef28cc5becceae5d544ae0f5b9b5e2aa05acb13716ca5b3099 - languageName: node - linkType: hard - "expect@npm:^29.0.0, expect@npm:^29.7.0": version: 29.7.0 resolution: "expect@npm:29.7.0" @@ -10130,13 +10284,6 @@ __metadata: languageName: node linkType: hard -"fast-fifo@npm:^1.1.0, fast-fifo@npm:^1.2.0": - version: 1.3.2 - resolution: "fast-fifo@npm:1.3.2" - checksum: 10/6bfcba3e4df5af7be3332703b69a7898a8ed7020837ec4395bb341bd96cc3a6d86c3f6071dd98da289618cf2234c70d84b2a6f09a33dd6f988b1ff60d8e54275 - languageName: node - linkType: hard - "fast-glob@npm:^3.2.7, fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.2": version: 3.3.2 resolution: "fast-glob@npm:3.3.2" @@ -10821,13 +10968,6 @@ __metadata: languageName: node linkType: hard -"github-from-package@npm:0.0.0": - version: 0.0.0 - resolution: "github-from-package@npm:0.0.0" - checksum: 10/2a091ba07fbce22205642543b4ea8aaf068397e1433c00ae0f9de36a3607baf5bcc14da97fbb798cfca6393b3c402031fca06d8b491a44206d6efef391c58537 - languageName: node - linkType: hard - "glob-parent@npm:6.0.2, glob-parent@npm:^6.0.2": version: 6.0.2 resolution: "glob-parent@npm:6.0.2" @@ -11205,7 +11345,7 @@ __metadata: safe-stable-stringify: "npm:^2.4.1" sass: "npm:^1.77.8" search-insights: "npm:^2.14.0" - sharp: "npm:^0.32.5" + sharp: "npm:^0.33.5" shell-quote: "npm:^1.7.3" shelljs: "npm:^0.8.5" simple-git: "npm:^3.16.1" @@ -11804,7 +11944,7 @@ __metadata: languageName: node linkType: hard -"ini@npm:^1.3.2, ini@npm:^1.3.8, ini@npm:~1.3.0": +"ini@npm:^1.3.2, ini@npm:^1.3.8": version: 1.3.8 resolution: "ini@npm:1.3.8" checksum: 10/314ae176e8d4deb3def56106da8002b462221c174ddb7ce0c49ee72c8cd1f9044f7b10cc555a7d8850982c3b9ca96fc212122749f5234bc2b6fb05fb942ed566 @@ -14252,13 +14392,6 @@ __metadata: languageName: node linkType: hard -"mimic-response@npm:^3.1.0": - version: 3.1.0 - resolution: "mimic-response@npm:3.1.0" - checksum: 10/7e719047612411fe071332a7498cf0448bbe43c485c0d780046c76633a771b223ff49bd00267be122cedebb897037fdb527df72335d0d0f74724604ca70b37ad - languageName: node - linkType: hard - "min-indent@npm:^1.0.0": version: 1.0.1 resolution: "min-indent@npm:1.0.1" @@ -14366,7 +14499,7 @@ __metadata: languageName: node linkType: hard -"minimist@npm:^1.2.0, minimist@npm:^1.2.3, minimist@npm:^1.2.5, minimist@npm:^1.2.6": +"minimist@npm:^1.2.0, minimist@npm:^1.2.5, minimist@npm:^1.2.6": version: 1.2.8 resolution: "minimist@npm:1.2.8" checksum: 10/908491b6cc15a6c440ba5b22780a0ba89b9810e1aea684e253e43c4e3b8d56ec1dcdd7ea96dde119c29df59c936cde16062159eae4225c691e19c70b432b6e6f @@ -14464,13 +14597,6 @@ __metadata: languageName: node linkType: hard -"mkdirp-classic@npm:^0.5.2, mkdirp-classic@npm:^0.5.3": - version: 0.5.3 - resolution: "mkdirp-classic@npm:0.5.3" - checksum: 10/3f4e088208270bbcc148d53b73e9a5bd9eef05ad2cbf3b3d0ff8795278d50dd1d11a8ef1875ff5aea3fa888931f95bfcb2ad5b7c1061cfefd6284d199e6776ac - languageName: node - linkType: hard - "mkdirp@npm:0.3.0": version: 0.3.0 resolution: "mkdirp@npm:0.3.0" @@ -14673,13 +14799,6 @@ __metadata: languageName: node linkType: hard -"napi-build-utils@npm:^1.0.1": - version: 1.0.1 - resolution: "napi-build-utils@npm:1.0.1" - checksum: 10/34fdb8d5b16d59eb4f22af3ab2411241157c5a639d8d8ad25102e8ecc877f1b4e42c68b87cb7eb8b1955adf5b6f2381b9ffcbc2e7b4d3c704908a48add52dd47 - languageName: node - linkType: hard - "natural-compare@npm:^1.4.0": version: 1.4.0 resolution: "natural-compare@npm:1.4.0" @@ -14718,15 +14837,6 @@ __metadata: languageName: node linkType: hard -"node-abi@npm:^3.3.0": - version: 3.8.0 - resolution: "node-abi@npm:3.8.0" - dependencies: - semver: "npm:^7.3.5" - checksum: 10/3b1c02aa2e5fa9c5e4d3c7c0bb33b6b5b7f3d6af42903a05de73c0a810d1015fd05486e3e66962f8d8a524e5e42946a4c50cb1a0d2624212b5b36b7fff18a8b9 - languageName: node - linkType: hard - "node-addon-api@npm:^5.0.0": version: 5.1.0 resolution: "node-addon-api@npm:5.1.0" @@ -14736,15 +14846,6 @@ __metadata: languageName: node linkType: hard -"node-addon-api@npm:^6.1.0": - version: 6.1.0 - resolution: "node-addon-api@npm:6.1.0" - dependencies: - node-gyp: "npm:latest" - checksum: 10/8eea1d4d965930a177a0508695beb0d89b4c1d80bf330646a035357a1e8fc31e0d09686e2374996e96e757b947a7ece319f98ede3146683f162597c0bcb4df90 - languageName: node - linkType: hard - "node-domexception@npm:1.0.0": version: 1.0.0 resolution: "node-domexception@npm:1.0.0" @@ -16027,28 +16128,6 @@ __metadata: languageName: node linkType: hard -"prebuild-install@npm:^7.1.1": - version: 7.1.1 - resolution: "prebuild-install@npm:7.1.1" - dependencies: - detect-libc: "npm:^2.0.0" - expand-template: "npm:^2.0.3" - github-from-package: "npm:0.0.0" - minimist: "npm:^1.2.3" - mkdirp-classic: "npm:^0.5.3" - napi-build-utils: "npm:^1.0.1" - node-abi: "npm:^3.3.0" - pump: "npm:^3.0.0" - rc: "npm:^1.2.7" - simple-get: "npm:^4.0.0" - tar-fs: "npm:^2.0.0" - tunnel-agent: "npm:^0.6.0" - bin: - prebuild-install: bin.js - checksum: 10/6c70a2f82fbda8903497c560a761b000d861a3e772322c8bed012be0f0a084b5aaca4438a3fad1bd3a24210765f4fae06ddd89ea04dc4c034dde693cc0d9d5f4 - languageName: node - linkType: hard - "prelude-ls@npm:^1.2.1": version: 1.2.1 resolution: "prelude-ls@npm:1.2.1" @@ -16323,13 +16402,6 @@ __metadata: languageName: node linkType: hard -"queue-tick@npm:^1.0.1": - version: 1.0.1 - resolution: "queue-tick@npm:1.0.1" - checksum: 10/f447926c513b64a857906f017a3b350f7d11277e3c8d2a21a42b7998fa1a613d7a829091e12d142bb668905c8f68d8103416c7197856efb0c72fa835b8e254b5 - languageName: node - linkType: hard - "quick-lru@npm:^4.0.1": version: 4.0.1 resolution: "quick-lru@npm:4.0.1" @@ -16941,20 +17013,6 @@ __metadata: languageName: node linkType: hard -"rc@npm:^1.2.7": - version: 1.2.8 - resolution: "rc@npm:1.2.8" - dependencies: - deep-extend: "npm:^0.6.0" - ini: "npm:~1.3.0" - minimist: "npm:^1.2.0" - strip-json-comments: "npm:~2.0.1" - bin: - rc: ./cli.js - checksum: 10/5c4d72ae7eec44357171585938c85ce066da8ca79146b5635baf3d55d74584c92575fa4e2c9eac03efbed3b46a0b2e7c30634c012b4b4fa40d654353d3c163eb - languageName: node - linkType: hard - "react-animate-height@npm:^3.1.1": version: 3.1.1 resolution: "react-animate-height@npm:3.1.1" @@ -18244,20 +18302,72 @@ __metadata: languageName: node linkType: hard -"sharp@npm:^0.32.5": - version: 0.32.6 - resolution: "sharp@npm:0.32.6" - dependencies: +"sharp@npm:^0.33.5": + version: 0.33.5 + resolution: "sharp@npm:0.33.5" + dependencies: + "@img/sharp-darwin-arm64": "npm:0.33.5" + "@img/sharp-darwin-x64": "npm:0.33.5" + "@img/sharp-libvips-darwin-arm64": "npm:1.0.4" + "@img/sharp-libvips-darwin-x64": "npm:1.0.4" + "@img/sharp-libvips-linux-arm": "npm:1.0.5" + "@img/sharp-libvips-linux-arm64": "npm:1.0.4" + "@img/sharp-libvips-linux-s390x": "npm:1.0.4" + "@img/sharp-libvips-linux-x64": "npm:1.0.4" + "@img/sharp-libvips-linuxmusl-arm64": "npm:1.0.4" + "@img/sharp-libvips-linuxmusl-x64": "npm:1.0.4" + "@img/sharp-linux-arm": "npm:0.33.5" + "@img/sharp-linux-arm64": "npm:0.33.5" + "@img/sharp-linux-s390x": "npm:0.33.5" + "@img/sharp-linux-x64": "npm:0.33.5" + "@img/sharp-linuxmusl-arm64": "npm:0.33.5" + "@img/sharp-linuxmusl-x64": "npm:0.33.5" + "@img/sharp-wasm32": "npm:0.33.5" + "@img/sharp-win32-ia32": "npm:0.33.5" + "@img/sharp-win32-x64": "npm:0.33.5" color: "npm:^4.2.3" - detect-libc: "npm:^2.0.2" - node-addon-api: "npm:^6.1.0" - node-gyp: "npm:latest" - prebuild-install: "npm:^7.1.1" - semver: "npm:^7.5.4" - simple-get: "npm:^4.0.1" - tar-fs: "npm:^3.0.4" - tunnel-agent: "npm:^0.6.0" - checksum: 10/f0e4a86881e590f86b05ea463229f62cd29afc2dca08b3f597889f872f118c2c456f382bf2c3e90e934b7a1d30f109cf5ed584cf5a23e79d6b6403a8dc0ebe32 + detect-libc: "npm:^2.0.3" + semver: "npm:^7.6.3" + dependenciesMeta: + "@img/sharp-darwin-arm64": + optional: true + "@img/sharp-darwin-x64": + optional: true + "@img/sharp-libvips-darwin-arm64": + optional: true + "@img/sharp-libvips-darwin-x64": + optional: true + "@img/sharp-libvips-linux-arm": + optional: true + "@img/sharp-libvips-linux-arm64": + optional: true + "@img/sharp-libvips-linux-s390x": + optional: true + "@img/sharp-libvips-linux-x64": + optional: true + "@img/sharp-libvips-linuxmusl-arm64": + optional: true + "@img/sharp-libvips-linuxmusl-x64": + optional: true + "@img/sharp-linux-arm": + optional: true + "@img/sharp-linux-arm64": + optional: true + "@img/sharp-linux-s390x": + optional: true + "@img/sharp-linux-x64": + optional: true + "@img/sharp-linuxmusl-arm64": + optional: true + "@img/sharp-linuxmusl-x64": + optional: true + "@img/sharp-wasm32": + optional: true + "@img/sharp-win32-ia32": + optional: true + "@img/sharp-win32-x64": + optional: true + checksum: 10/9f153578cb02735359cbcc874f52b56b8074ed997498c35255c7099d4f4f506f6ddf83a437a55242c7ad4f979336660504b6c78e29d6933f4981dedbdae5ce09 languageName: node linkType: hard @@ -18337,24 +18447,6 @@ __metadata: languageName: node linkType: hard -"simple-concat@npm:^1.0.0": - version: 1.0.1 - resolution: "simple-concat@npm:1.0.1" - checksum: 10/4d211042cc3d73a718c21ac6c4e7d7a0363e184be6a5ad25c8a1502e49df6d0a0253979e3d50dbdd3f60ef6c6c58d756b5d66ac1e05cda9cacd2e9fc59e3876a - languageName: node - linkType: hard - -"simple-get@npm:^4.0.0, simple-get@npm:^4.0.1": - version: 4.0.1 - resolution: "simple-get@npm:4.0.1" - dependencies: - decompress-response: "npm:^6.0.0" - once: "npm:^1.3.1" - simple-concat: "npm:^1.0.0" - checksum: 10/93f1b32319782f78f2f2234e9ce34891b7ab6b990d19d8afefaa44423f5235ce2676aae42d6743fecac6c8dfff4b808d4c24fe5265be813d04769917a9a44f36 - languageName: node - linkType: hard - "simple-git@npm:^3.16.1": version: 3.16.1 resolution: "simple-git@npm:3.16.1" @@ -18697,16 +18789,6 @@ __metadata: languageName: node linkType: hard -"streamx@npm:^2.15.0": - version: 2.15.1 - resolution: "streamx@npm:2.15.1" - dependencies: - fast-fifo: "npm:^1.1.0" - queue-tick: "npm:^1.0.1" - checksum: 10/5c5143d832b4d4c2cba09d3e77dcc099f62bfc44bffac38e7b196cdd7f17dcd46bc2012c614fad934c0d706712c2e9455e485435810504cf748906b2f1746837 - languageName: node - linkType: hard - "string-argv@npm:~0.3.2": version: 0.3.2 resolution: "string-argv@npm:0.3.2" @@ -18917,13 +18999,6 @@ __metadata: languageName: node linkType: hard -"strip-json-comments@npm:~2.0.1": - version: 2.0.1 - resolution: "strip-json-comments@npm:2.0.1" - checksum: 10/1074ccb63270d32ca28edfb0a281c96b94dc679077828135141f27d52a5a398ef5e78bcf22809d23cadc2b81dfbe345eb5fd8699b385c8b1128907dec4a7d1e1 - languageName: node - linkType: hard - "strip-outer@npm:^1.0.1": version: 1.0.1 resolution: "strip-outer@npm:1.0.1" @@ -19074,30 +19149,7 @@ __metadata: languageName: node linkType: hard -"tar-fs@npm:^2.0.0": - version: 2.1.1 - resolution: "tar-fs@npm:2.1.1" - dependencies: - chownr: "npm:^1.1.1" - mkdirp-classic: "npm:^0.5.2" - pump: "npm:^3.0.0" - tar-stream: "npm:^2.1.4" - checksum: 10/526deae025453e825f87650808969662fbb12eb0461d033e9b447de60ec951c6c4607d0afe7ce057defe9d4e45cf80399dd74bc15f9d9e0773d5e990a78ce4ac - languageName: node - linkType: hard - -"tar-fs@npm:^3.0.4": - version: 3.0.4 - resolution: "tar-fs@npm:3.0.4" - dependencies: - mkdirp-classic: "npm:^0.5.2" - pump: "npm:^3.0.0" - tar-stream: "npm:^3.1.5" - checksum: 10/070f35bdde283dbcb05cd22abd5fc1b6df2f190688b8a82d62eadb1fd873e4602586218e88e722b3f292441a651dfb27a9b8e7ef8db6ba5601f93a57a540856a - languageName: node - linkType: hard - -"tar-stream@npm:^2.1.4, tar-stream@npm:~2.2.0": +"tar-stream@npm:~2.2.0": version: 2.2.0 resolution: "tar-stream@npm:2.2.0" dependencies: @@ -19110,17 +19162,6 @@ __metadata: languageName: node linkType: hard -"tar-stream@npm:^3.1.5": - version: 3.1.6 - resolution: "tar-stream@npm:3.1.6" - dependencies: - b4a: "npm:^1.6.4" - fast-fifo: "npm:^1.2.0" - streamx: "npm:^2.15.0" - checksum: 10/2c32e0d57de778ae415357bfb126a512a384e9bfb8e234920455ad65282181a3765515bbd80392ab8e7e630158376ec7de46b18ab86a33d256a7dcc43b0648b7 - languageName: node - linkType: hard - "tar@npm:6.2.1, tar@npm:^6.1.11, tar@npm:^6.1.2": version: 6.2.1 resolution: "tar@npm:6.2.1" From 747b80f62299ea096c68b82110ed10d07c7a5205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Rod=C3=A9s-Guirao?= Date: Mon, 6 Jan 2025 19:10:31 +0100 Subject: [PATCH 15/29] new table for chart (and possibly other objects) revisions (#4387) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * init * init * 🤖 style: prettify code --- ...6177572560-HousekeepingSuggestedReviews.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 db/migration/1736177572560-HousekeepingSuggestedReviews.ts diff --git a/db/migration/1736177572560-HousekeepingSuggestedReviews.ts b/db/migration/1736177572560-HousekeepingSuggestedReviews.ts new file mode 100644 index 0000000000..9a1a07d308 --- /dev/null +++ b/db/migration/1736177572560-HousekeepingSuggestedReviews.ts @@ -0,0 +1,20 @@ +import { MigrationInterface, QueryRunner } from "typeorm" + +export class HousekeepingSuggestedReviews1736177572560 + implements MigrationInterface +{ + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`-- sql + CREATE TABLE housekeeping_suggested_reviews ( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT "Identifier of the review", + suggestedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT "Date where the review was suggested", + objectType VARCHAR(255) NOT NULL UNIQUE COMMENT "Type of the object to review (e.g. 'chart', 'dataset', etc.)", + objectId CHAR(36) NOT NULL COMMENT "ID of the object to review" + ) + `) + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP TABLE housekeeping_suggested_reviews`) + } +} From 0652855d6eb2fdf0243773d1d569fd1ab395ca56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Rod=C3=A9s-Guirao?= Date: Mon, 6 Jan 2025 20:46:49 +0100 Subject: [PATCH 16/29] Update db table types (#4388) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * change db table type * 🤖 style: prettify code --- ...8395813-UpdateHousekeepingSuggestedReviews.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 db/migration/1736188395813-UpdateHousekeepingSuggestedReviews.ts diff --git a/db/migration/1736188395813-UpdateHousekeepingSuggestedReviews.ts b/db/migration/1736188395813-UpdateHousekeepingSuggestedReviews.ts new file mode 100644 index 0000000000..6ce84a20a4 --- /dev/null +++ b/db/migration/1736188395813-UpdateHousekeepingSuggestedReviews.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm" + +export class HousekeepingSuggestedReviews1736188395813 + implements MigrationInterface +{ + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`-- sql + ALTER TABLE housekeeping_suggested_reviews + MODIFY COLUMN objectId INTEGER NOT NULL; + `) + } + + public async down(): Promise {} +} + +// ALTER TABLE employees From 997a3c463ce4eb75759fd94b9f9225a9605754b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Rod=C3=A9s-Guirao?= Date: Tue, 7 Jan 2025 01:23:31 +0100 Subject: [PATCH 17/29] edit migration further (#4389) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * migration * 🤖 style: prettify code * add annotation --- ...188395813-UpdateHousekeepingSuggestedReviews.ts | 3 +-- ...06740420-UpdateHousekeepingSuggestedReviews2.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 db/migration/1736206740420-UpdateHousekeepingSuggestedReviews2.ts diff --git a/db/migration/1736188395813-UpdateHousekeepingSuggestedReviews.ts b/db/migration/1736188395813-UpdateHousekeepingSuggestedReviews.ts index 6ce84a20a4..09bd3832f5 100644 --- a/db/migration/1736188395813-UpdateHousekeepingSuggestedReviews.ts +++ b/db/migration/1736188395813-UpdateHousekeepingSuggestedReviews.ts @@ -10,7 +10,6 @@ export class HousekeepingSuggestedReviews1736188395813 `) } + // eslint-disable-next-line @typescript-eslint/no-empty-function public async down(): Promise {} } - -// ALTER TABLE employees diff --git a/db/migration/1736206740420-UpdateHousekeepingSuggestedReviews2.ts b/db/migration/1736206740420-UpdateHousekeepingSuggestedReviews2.ts new file mode 100644 index 0000000000..19ed46a466 --- /dev/null +++ b/db/migration/1736206740420-UpdateHousekeepingSuggestedReviews2.ts @@ -0,0 +1,14 @@ +import { MigrationInterface, QueryRunner } from "typeorm" + +export class UpdateHousekeepingSuggestedReviews21736206740420 + implements MigrationInterface +{ + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`-- sql + ALTER TABLE housekeeping_suggested_reviews DROP INDEX objectType; + `) + } + + // eslint-disable-next-line @typescript-eslint/no-empty-function + public async down(): Promise {} +} From d29a33f11abe5f3a8e91349d076425a319d9ceea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Rod=C3=A9s-Guirao?= Date: Tue, 7 Jan 2025 02:46:39 +0100 Subject: [PATCH 18/29] housekeeper: this pr fixes all previous migrations (#4390) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix all migrations * 🤖 style: prettify code * create if not exists --- ...36177572560-HousekeepingSuggestedReviews.ts | 2 +- ...59039-RemoveHousekeepingSuggestedReviews.ts | 16 ++++++++++++++++ .../1736209905900-CreateHousekeeper.ts | 18 ++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 db/migration/1736209759039-RemoveHousekeepingSuggestedReviews.ts create mode 100644 db/migration/1736209905900-CreateHousekeeper.ts diff --git a/db/migration/1736177572560-HousekeepingSuggestedReviews.ts b/db/migration/1736177572560-HousekeepingSuggestedReviews.ts index 9a1a07d308..297a8bffd9 100644 --- a/db/migration/1736177572560-HousekeepingSuggestedReviews.ts +++ b/db/migration/1736177572560-HousekeepingSuggestedReviews.ts @@ -5,7 +5,7 @@ export class HousekeepingSuggestedReviews1736177572560 { public async up(queryRunner: QueryRunner): Promise { await queryRunner.query(`-- sql - CREATE TABLE housekeeping_suggested_reviews ( + CREATE TABLE IF NOT EXISTS housekeeping_suggested_reviews ( id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT "Identifier of the review", suggestedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT "Date where the review was suggested", objectType VARCHAR(255) NOT NULL UNIQUE COMMENT "Type of the object to review (e.g. 'chart', 'dataset', etc.)", diff --git a/db/migration/1736209759039-RemoveHousekeepingSuggestedReviews.ts b/db/migration/1736209759039-RemoveHousekeepingSuggestedReviews.ts new file mode 100644 index 0000000000..ad69c8ca05 --- /dev/null +++ b/db/migration/1736209759039-RemoveHousekeepingSuggestedReviews.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm" + +export class RemoveHousekeepingSuggestedReviews1736209759039 + implements MigrationInterface +{ + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `DROP TABLE IF EXISTS housekeeping_suggested_reviews` + ) + } + + // eslint-disable-next-line @typescript-eslint/no-empty-function + public async down(_queryRunner: QueryRunner): Promise { + return + } +} diff --git a/db/migration/1736209905900-CreateHousekeeper.ts b/db/migration/1736209905900-CreateHousekeeper.ts new file mode 100644 index 0000000000..20f35a2c6e --- /dev/null +++ b/db/migration/1736209905900-CreateHousekeeper.ts @@ -0,0 +1,18 @@ +import { MigrationInterface, QueryRunner } from "typeorm" + +export class CreateHousekeeper1736209905900 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`-- sql + CREATE TABLE housekeeper_reviews ( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT "Identifier of the review", + suggestedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT "Date where the review was suggested", + objectType VARCHAR(255) NOT NULL COMMENT "Type of the object to review (e.g. 'chart', 'dataset', etc.)", + objectId INTEGER NOT NULL COMMENT "ID of the object to review" + ) + `) + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP TABLE housekeeper_reviews`) + } +} From ebc85637f2e49c16ceebef4b772ce01bfd27896e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ra=C4=8D=C3=A1k?= Date: Mon, 23 Dec 2024 15:17:52 +0100 Subject: [PATCH 19/29] Run `npx react-codemod update-react-imports` Since React 17 we no longer need to import React for JSX transforms. Running this codemod: * Removes all unused React imports as a result of upgrading to the new JSX transform. * Changes all default React imports (i.e. import React from "react") to destructured named imports (ex. import { useState } from "react") which is the preferred style going into the future. These cannot be separated, even though we now only needed to remove the unused imports. --- adminShared/search.tsx | 2 +- adminSiteClient/Admin.tsx | 1 - adminSiteClient/AdminApp.tsx | 2 +- adminSiteClient/AdminAppContext.ts | 2 +- adminSiteClient/AdminLayout.tsx | 2 +- adminSiteClient/AdminSidebar.tsx | 2 +- adminSiteClient/BulkDownloadPage.tsx | 6 +++--- adminSiteClient/BulkGrapherConfigEditor.tsx | 4 ++-- adminSiteClient/ChartEditorView.tsx | 2 +- adminSiteClient/ChartIndexPage.tsx | 4 ++-- adminSiteClient/ChartList.tsx | 2 +- adminSiteClient/ChartRow.tsx | 2 +- adminSiteClient/ChartViewIndexPage.tsx | 3 ++- adminSiteClient/ColorSchemeDropdown.tsx | 4 ++-- adminSiteClient/Colorpicker.tsx | 8 ++++---- adminSiteClient/DatasetEditPage.tsx | 8 ++++---- adminSiteClient/DatasetList.tsx | 2 +- adminSiteClient/DatasetsIndexPage.tsx | 4 ++-- adminSiteClient/DeployStatusPage.tsx | 4 ++-- adminSiteClient/DimensionCard.tsx | 8 ++++---- adminSiteClient/EditTags.tsx | 6 +++--- adminSiteClient/EditableTags.tsx | 2 +- adminSiteClient/EditorBasicTab.tsx | 2 +- adminSiteClient/EditorColorScaleSection.tsx | 20 +++++++++---------- adminSiteClient/EditorCustomizeTab.tsx | 2 +- adminSiteClient/EditorDataTab.tsx | 2 +- adminSiteClient/EditorDebugTab.tsx | 10 +++++----- adminSiteClient/EditorExportTab.tsx | 4 ++-- adminSiteClient/EditorFAQ.tsx | 4 ++-- adminSiteClient/EditorHistoryTab.tsx | 6 +++--- adminSiteClient/EditorMapTab.tsx | 14 ++++++------- adminSiteClient/EditorMarimekkoTab.tsx | 4 ++-- adminSiteClient/EditorReferencesTab.tsx | 16 +++++++-------- adminSiteClient/EditorScatterTab.tsx | 4 ++-- adminSiteClient/EditorTextTab.tsx | 4 ++-- adminSiteClient/ExplorerTagsPage.tsx | 4 ++-- adminSiteClient/Forms.tsx | 2 +- adminSiteClient/GdocsAdd.tsx | 2 +- adminSiteClient/GdocsBreadcrumbsInput.tsx | 1 - adminSiteClient/GdocsDateline.tsx | 1 - adminSiteClient/GdocsDiff.tsx | 1 - adminSiteClient/GdocsDiffButton.tsx | 1 - adminSiteClient/GdocsEditLink.tsx | 2 +- adminSiteClient/GdocsErrorHelp.tsx | 1 - adminSiteClient/GdocsIndexPage.tsx | 2 +- adminSiteClient/GdocsMoreMenu.tsx | 1 - adminSiteClient/GdocsPreviewPage.tsx | 9 ++------- adminSiteClient/GdocsPublicationContext.tsx | 1 - adminSiteClient/GdocsSaveButtons.tsx | 1 - adminSiteClient/GdocsSettingsContentField.tsx | 2 +- adminSiteClient/GdocsSettingsForms.tsx | 1 - adminSiteClient/GdocsSlug.tsx | 2 +- adminSiteClient/GdocsStore.tsx | 3 ++- adminSiteClient/GrapherConfigGridEditor.tsx | 2 +- .../GrapherConfigGridEditorTypesAndUtils.tsx | 1 - adminSiteClient/IconBadge.tsx | 2 +- adminSiteClient/ImagesIndexPage.tsx | 5 +++-- adminSiteClient/Link.tsx | 2 +- adminSiteClient/NotFoundPage.tsx | 4 ++-- adminSiteClient/OriginList.tsx | 4 ++-- adminSiteClient/PostEditorPage.tsx | 6 +++--- adminSiteClient/PostsIndexPage.tsx | 6 +++--- adminSiteClient/RedirectsIndexPage.tsx | 6 +++--- adminSiteClient/SaveButtons.tsx | 12 +++++------ adminSiteClient/SiteRedirectsIndexPage.tsx | 2 +- adminSiteClient/SourceEditPage.tsx | 6 +++--- adminSiteClient/SourceList.tsx | 4 ++-- adminSiteClient/TagBadge.tsx | 2 +- adminSiteClient/TagBucketSortingIcon.tsx | 1 - adminSiteClient/TagEditPage.tsx | 6 +++--- adminSiteClient/TagGraphPage.tsx | 2 +- adminSiteClient/TagsIndexPage.tsx | 4 ++-- adminSiteClient/TestIndexPage.tsx | 4 ++-- adminSiteClient/UserEditPage.tsx | 4 ++-- adminSiteClient/UsersIndexPage.tsx | 2 +- adminSiteClient/VariableEditPage.tsx | 6 +++--- adminSiteClient/VariableList.tsx | 2 +- adminSiteClient/VariableSelector.tsx | 2 +- adminSiteClient/VariablesAnnotationPage.tsx | 4 ++-- adminSiteClient/VariablesIndexPage.tsx | 4 ++-- adminSiteClient/VisionDeficiencies.tsx | 4 ++-- adminSiteClient/gdocsNotifications.tsx | 2 +- adminSiteServer/IndexPage.tsx | 1 - adminSiteServer/LoginPage.tsx | 2 -- adminSiteServer/adminRouter.tsx | 2 +- adminSiteServer/appClass.tsx | 1 - adminSiteServer/testPageRouter.tsx | 1 - baker/GrapherBaker.tsx | 1 - baker/MultiDimBaker.tsx | 1 - baker/algolia/utils/pages.ts | 6 +++--- baker/countryProfiles.tsx | 1 - baker/formatWordpressPost.tsx | 1 - baker/siteRenderers.tsx | 1 - .../ExplorerCreatePage.jsdom.test.tsx | 5 +---- explorerAdminClient/ExplorerCreatePage.tsx | 12 +++++------ explorerAdminClient/ExplorersListPage.tsx | 8 ++++---- .../components/src/Button/Button.tsx | 1 - .../components/src/Checkbox.tsx | 2 +- .../src/CodeSnippet/CodeSnippet.stories.tsx | 2 +- .../src/CodeSnippet/CodeSnippet.tsx | 2 +- .../src/DataCitation/DataCitation.tsx | 1 - .../src/ExpandableToggle/ExpandableToggle.tsx | 3 ++- .../components/src/Halo/Halo.tsx | 2 +- .../src/IndicatorKeyData/IndicatorKeyData.tsx | 2 +- .../IndicatorProcessing.tsx | 1 - .../src/IndicatorSources/IndicatorSources.tsx | 2 +- .../src/LabeledSwitch/LabeledSwitch.tsx | 2 +- .../MarkdownTextWrap.stories.tsx | 3 ++- .../src/MarkdownTextWrap/MarkdownTextWrap.tsx | 3 ++- .../components/src/OverlayHeader.tsx | 2 +- .../components/src/RadioButton.tsx | 2 +- .../components/src/SimpleMarkdownText.tsx | 2 +- .../src/TextWrap/TextWrap.stories.tsx | 2 +- .../components/src/TextWrap/TextWrap.tsx | 2 +- .../components/src/TextWrap/TextWrapGroup.tsx | 2 +- .../src/closeButton/CloseButton.tsx | 2 +- .../explorer/src/Explorer.sample.tsx | 1 - .../src/ExplorerControls.jsdom.test.tsx | 5 +---- .../explorer/src/ExplorerControls.tsx | 6 +++--- .../grapher/src/axis/AxisViews.jsdom.test.tsx | 5 +---- .../grapher/src/axis/AxisViews.tsx | 2 +- .../barCharts/DiscreteBarChart.stories.tsx | 2 +- .../grapher/src/bodyDiv/BodyDiv.tsx | 2 +- .../captionedChart/CaptionedChart.stories.tsx | 2 +- .../src/captionedChart/CaptionedChart.tsx | 2 +- .../grapher/src/captionedChart/Logos.tsx | 2 +- .../grapher/src/chart/ChartManager.ts | 2 +- .../grapher/src/chart/ChartTypeSwitcher.tsx | 2 +- .../grapher/src/chart/ChartUtils.tsx | 2 +- .../grapher/src/controls/ActionButtons.tsx | 3 ++- .../grapher/src/controls/ChartIcons.tsx | 2 +- .../src/controls/CommandPalette.stories.tsx | 2 +- .../grapher/src/controls/CommandPalette.tsx | 2 +- .../grapher/src/controls/ContentSwitchers.tsx | 2 +- .../grapher/src/controls/Dropdown.tsx | 2 +- .../src/controls/EntitySelectionToggle.tsx | 2 +- .../src/controls/MapProjectionMenu.tsx | 2 +- .../grapher/src/controls/SettingsMenu.tsx | 2 +- .../grapher/src/controls/ShareMenu.tsx | 2 +- .../grapher/src/controls/SortIcon.tsx | 2 +- .../src/controls/VerticalScrollContainer.tsx | 4 +++- .../src/controls/controlsRow/ControlsRow.tsx | 4 ++-- .../controls/entityPicker/EntityPicker.tsx | 2 +- .../GlobalEntitySelector.jsdom.test.tsx | 6 +----- .../GlobalEntitySelector.stories.tsx | 2 +- .../GlobalEntitySelector.tsx | 2 +- .../src/controls/settings/AbsRelToggle.tsx | 2 +- .../src/controls/settings/AxisScaleToggle.tsx | 2 +- .../settings/FacetStrategySelector.tsx | 2 +- .../controls/settings/FacetYDomainToggle.tsx | 2 +- .../controls/settings/NoDataAreaToggle.tsx | 2 +- .../controls/settings/TableFilterToggle.tsx | 2 +- .../src/controls/settings/ZoomToggle.tsx | 2 +- .../grapher/src/core/Grapher.stories.tsx | 2 +- .../src/dataTable/DataTable.jsdom.test.tsx | 6 +----- .../src/dataTable/DataTable.stories.tsx | 2 +- .../grapher/src/dataTable/DataTable.tsx | 2 +- .../src/entitySelector/EntitySelector.tsx | 2 +- .../src/facetChart/FacetChart.stories.tsx | 2 +- .../grapher/src/footer/Footer.stories.tsx | 2 +- .../grapher/src/footer/Footer.tsx | 2 +- .../grapher/src/fullScreen/FullScreen.tsx | 2 +- .../grapher/src/header/Header.stories.tsx | 2 +- .../grapher/src/header/Header.tsx | 2 +- .../HorizontalColorLegends.tsx | 2 +- .../src/lineCharts/LineChart.stories.tsx | 2 +- .../src/lineLegend/LineLegend.stories.tsx | 2 +- .../grapher/src/lineLegend/LineLegend.tsx | 2 +- .../LoadingIndicator.stories.tsx | 2 +- .../src/loadingIndicator/LoadingIndicator.tsx | 2 +- .../src/mapCharts/MapChart.stories.tsx | 2 +- .../grapher/src/mapCharts/MapSparkline.tsx | 2 +- .../src/mapCharts/MapTooltip.jsdom.test.tsx | 5 +---- .../src/mapCharts/MapTooltip.stories.tsx | 2 +- .../grapher/src/modal/DownloadIcons.tsx | 2 -- .../src/modal/DownloadModal.stories.tsx | 2 +- .../grapher/src/modal/DownloadModal.tsx | 3 ++- .../grapher/src/modal/EmbedModal.tsx | 2 +- .../grapher/src/modal/EntitySelectorModal.tsx | 2 +- .../grapher/src/modal/Modal.tsx | 2 +- .../grapher/src/modal/ModalHeader.tsx | 1 - .../grapher/src/modal/SourcesDescriptions.tsx | 1 - .../grapher/src/modal/SourcesKeyDataTable.tsx | 6 +++--- .../src/modal/SourcesModal.stories.tsx | 2 +- .../grapher/src/modal/SourcesModal.tsx | 2 +- .../src/noDataModal/NoDataModal.stories.tsx | 2 +- .../grapher/src/noDataModal/NoDataModal.tsx | 2 +- .../src/scatterCharts/ComparisonLine.tsx | 2 +- .../scatterCharts/ConnectedScatterLegend.tsx | 2 +- .../src/scatterCharts/MultiColorPolyline.tsx | 2 +- .../src/scatterCharts/NoDataSection.tsx | 2 +- .../ScatterPlotChart.stories.tsx | 2 +- .../src/scatterCharts/ScatterPoints.tsx | 2 +- .../scatterCharts/ScatterPointsWithLabels.tsx | 2 +- .../src/scatterCharts/ScatterSizeLegend.tsx | 2 +- .../grapher/src/scatterCharts/Triangle.tsx | 2 +- .../grapher/src/sidePanel/SidePanel.tsx | 2 +- .../src/slideInDrawer/SlideInDrawer.tsx | 2 +- .../src/slopeCharts/SlopeChart.stories.tsx | 1 - .../StackedAreaChart.stories.tsx | 2 +- .../src/stackedCharts/StackedAreaChart.tsx | 2 +- .../stackedCharts/StackedBarChart.stories.tsx | 2 +- .../src/stackedCharts/StackedBarChart.tsx | 2 +- .../StackedDiscreteBarChart.stories.tsx | 2 +- .../grapher/src/tabs/ExpandableTabs.tsx | 2 +- .../@ourworldindata/grapher/src/tabs/Tabs.tsx | 3 ++- .../timeline/TimelineComponent.stories.tsx | 2 +- .../src/timeline/TimelineComponent.tsx | 2 +- .../grapher/src/tooltip/Tooltip.tsx | 2 +- .../grapher/src/tooltip/TooltipContents.tsx | 2 +- .../grapher/src/tooltip/TooltipProps.ts | 2 +- .../VerticalColorLegend.stories.tsx | 2 +- .../VerticalColorLegend.tsx | 2 +- packages/@ourworldindata/utils/src/Tippy.tsx | 2 +- packages/@ourworldindata/utils/src/Util.ts | 2 +- site/AboutThisData.tsx | 1 - site/AlertBanner.tsx | 2 -- site/BackToTopic.tsx | 2 +- site/BlogIndexPage.tsx | 1 - site/Breadcrumb/Breadcrumb.tsx | 6 +++--- site/Byline.tsx | 1 - site/ChartListItemVariant.tsx | 1 - site/CitationMeta.tsx | 6 +++--- site/CookieNotice.tsx | 2 +- site/CookiePreferencesManager.tsx | 2 +- site/CountriesIndexPage.tsx | 1 - site/CountryProfilePage.tsx | 1 - site/DataCatalog/DataCatalog.tsx | 3 ++- site/DataCatalog/DataCatalogPage.tsx | 1 - site/DataCatalog/DataCatalogSkeletons.tsx | 1 - site/DataInsightsIndexPage.tsx | 1 - site/DataInsightsIndexPageContent.tsx | 1 - site/DataInsightsNewsletterBanner.tsx | 1 - site/DataPageV2.tsx | 1 - site/DataPageV2Content.tsx | 4 ++-- site/DataToken.tsx | 1 - site/DonateForm.tsx | 2 +- site/DonatePage.tsx | 1 - site/ExplorerIndex.tsx | 4 ++-- site/ExplorerIndexPage.tsx | 1 - site/ExplorerPage.tsx | 1 - site/Feedback.stories.tsx | 1 - site/Feedback.tsx | 2 +- site/FeedbackPage.tsx | 4 ++-- site/Footnote.tsx | 1 - site/GrapherFigureView.tsx | 2 +- site/GrapherImage.tsx | 2 -- site/GrapherPage.jsdom.test.tsx | 5 +---- site/GrapherPage.tsx | 1 - site/GrapherWithFallback.tsx | 1 - site/Head.tsx | 1 - site/Html.tsx | 2 +- site/IframeDetector.tsx | 1 - site/InteractionNotice.tsx | 4 ---- site/KeyDataTable.tsx | 2 -- site/Lightbox.tsx | 2 +- site/LongFormPage.tsx | 6 +++--- site/MetadataSection.tsx | 1 - site/NewsletterSubscription.tsx | 3 ++- site/NoJSDetector.tsx | 18 ----------------- site/NotFoundPage.tsx | 1 - site/NotFoundPageForm.tsx | 1 - site/NotFoundPageIcon.tsx | 2 -- site/NotFoundPageMain.tsx | 1 - site/PageInfo.tsx | 2 -- site/PostCard/PostCard.tsx | 1 - site/RelatedArticles/RelatedArticles.tsx | 1 - site/SearchCountry.tsx | 2 +- site/SectionHeading.tsx | 1 - site/SiteAbout.tsx | 2 -- site/SiteFooter.tsx | 1 - site/SiteHeader.tsx | 1 - site/SiteLogos.tsx | 2 -- site/SiteMobileCategory.tsx | 2 +- site/SiteMobileMenu.tsx | 2 +- site/SiteNavigation.tsx | 6 +++--- site/SiteNavigationToggle.tsx | 2 +- site/SiteNavigationTopic.tsx | 1 - site/SiteNavigationTopics.tsx | 12 ++--------- site/SiteResources.tsx | 2 -- site/SiteSearchNavigation.tsx | 1 - site/SiteSubnavigation.tsx | 1 - site/SiteTools.tsx | 1 - site/TableOfContents.tsx | 2 +- site/Tablepress.tsx | 1 - site/ThankYouPage.tsx | 1 - site/TombstonePage.tsx | 1 - site/TopicTags.tsx | 2 -- site/bakeGlobalEntitySelector.tsx | 1 - site/blocks/AdditionalInformation.tsx | 2 +- site/blocks/AllChartsListItem.tsx | 2 +- site/blocks/CookiePreferences.tsx | 3 ++- site/blocks/ExpandableParagraph.stories.tsx | 2 +- site/blocks/ExpandableParagraph.tsx | 3 ++- site/blocks/GalleryArrow.tsx | 1 - site/blocks/Help.tsx | 1 - site/blocks/ProminentLink.tsx | 4 ++-- site/blocks/RelatedCharts.jsdom.test.tsx | 5 +---- site/blocks/RelatedCharts.tsx | 3 ++- site/blocks/StickyNav.tsx | 4 ++-- site/collections/DynamicCollection.tsx | 2 +- site/collections/DynamicCollectionPage.tsx | 1 - site/collections/StaticCollectionPage.tsx | 1 - site/covid/FullWidthRawHtml.tsx | 2 +- site/covid/LastUpdated.tsx | 2 +- site/detailsOnDemand.tsx | 1 - site/formatting.tsx | 1 - site/gdocs/DebugContext.tsx | 3 ++- site/gdocs/OwidGdoc.tsx | 3 ++- site/gdocs/OwidGdocPage.tsx | 1 - site/gdocs/components/AdditionalCharts.tsx | 1 - site/gdocs/components/AllCharts.tsx | 2 +- site/gdocs/components/ArticleBlock.tsx | 1 - site/gdocs/components/ArticleBlocks.tsx | 1 - site/gdocs/components/AtomArticleBlocks.tsx | 1 - site/gdocs/components/BlockErrorBoundary.tsx | 2 +- site/gdocs/components/Byline.tsx | 6 +++--- site/gdocs/components/Callout.tsx | 1 - site/gdocs/components/Chart.tsx | 2 +- site/gdocs/components/ChartStory.tsx | 2 +- site/gdocs/components/DataInsightDateline.tsx | 1 - .../components/DataInsightsNewsletter.tsx | 1 - site/gdocs/components/Donors.tsx | 1 - site/gdocs/components/ExplorerTiles.tsx | 2 +- site/gdocs/components/Footnotes.tsx | 1 - site/gdocs/components/HomepageIntro.tsx | 2 +- site/gdocs/components/HomepageSearch.tsx | 2 +- site/gdocs/components/Image.tsx | 2 +- site/gdocs/components/KeyIndicator.tsx | 1 - .../components/KeyIndicatorCollection.tsx | 3 ++- .../components/KeyInsights.jsdom.test.tsx | 5 +---- site/gdocs/components/KeyInsights.tsx | 3 ++- site/gdocs/components/LatestDataInsights.tsx | 1 - .../components/LatestDataInsightsBlock.tsx | 2 +- site/gdocs/components/LinkedAuthor.tsx | 1 - site/gdocs/components/List.tsx | 1 - site/gdocs/components/MissingData.tsx | 1 - site/gdocs/components/NumberedList.tsx | 1 - site/gdocs/components/OwidGdocHeader.tsx | 1 - site/gdocs/components/Paragraph.tsx | 1 - site/gdocs/components/Person.tsx | 1 - site/gdocs/components/PillRow.tsx | 2 +- site/gdocs/components/ProminentLink.tsx | 2 +- site/gdocs/components/PullQuote.tsx | 1 - site/gdocs/components/Recirc.tsx | 1 - site/gdocs/components/ResearchAndWriting.tsx | 2 +- site/gdocs/components/SDGGrid.tsx | 2 +- site/gdocs/components/Scroller.tsx | 2 +- site/gdocs/components/Socials.tsx | 1 - site/gdocs/components/Table.tsx | 2 +- site/gdocs/components/TableOfContents.tsx | 2 +- site/gdocs/components/TopicPageIntro.tsx | 2 +- site/gdocs/components/Video.tsx | 1 - site/gdocs/pages/AboutPage.tsx | 1 - site/gdocs/pages/Author.tsx | 2 +- site/gdocs/pages/DataInsight.tsx | 3 ++- site/gdocs/pages/Fragment.tsx | 2 +- site/gdocs/pages/GdocPost.tsx | 1 - site/gdocs/pages/Homepage.tsx | 2 +- site/gdocs/utils.tsx | 3 ++- site/multiDim/MultiDimDataPage.tsx | 1 - site/multiDim/MultiDimDataPageContent.tsx | 2 +- .../MultiDimDataPageSettingsPanel.tsx | 2 +- site/multiembedder/MultiEmbedder.tsx | 1 - site/multiembedder/MultiEmbedderTestPage.tsx | 1 - site/runDataTokens.tsx | 2 +- site/search/Autocomplete.tsx | 3 ++- site/search/ChartHit.tsx | 2 +- site/search/SearchPage.tsx | 1 - site/search/SearchPanel.tsx | 3 ++- site/typography.stories.tsx | 3 ++- site/viteUtils.tsx | 2 +- 372 files changed, 392 insertions(+), 558 deletions(-) diff --git a/adminShared/search.tsx b/adminShared/search.tsx index 1b03dd543a..6eba551ab9 100644 --- a/adminShared/search.tsx +++ b/adminShared/search.tsx @@ -1,5 +1,5 @@ import { drop, escapeRegExp, sortBy } from "@ourworldindata/utils" -import React from "react" +import * as React from "react" export interface SearchWord { regex: RegExp diff --git a/adminSiteClient/Admin.tsx b/adminSiteClient/Admin.tsx index 80ec3802c9..307513c79e 100644 --- a/adminSiteClient/Admin.tsx +++ b/adminSiteClient/Admin.tsx @@ -1,4 +1,3 @@ -import React from "react" import ReactDOM from "react-dom" import * as lodash from "lodash" import { observable, computed, action } from "mobx" diff --git a/adminSiteClient/AdminApp.tsx b/adminSiteClient/AdminApp.tsx index 04adf0d387..72560499ae 100644 --- a/adminSiteClient/AdminApp.tsx +++ b/adminSiteClient/AdminApp.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Admin } from "./Admin.js" import { ChartEditorPage } from "./ChartEditorPage.js" import { action } from "mobx" diff --git a/adminSiteClient/AdminAppContext.ts b/adminSiteClient/AdminAppContext.ts index 902d8cb85c..63ec79bb07 100644 --- a/adminSiteClient/AdminAppContext.ts +++ b/adminSiteClient/AdminAppContext.ts @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Admin } from "./Admin.js" export interface AdminAppContextType { diff --git a/adminSiteClient/AdminLayout.tsx b/adminSiteClient/AdminLayout.tsx index 6b6eaadde5..b7c02067a3 100644 --- a/adminSiteClient/AdminLayout.tsx +++ b/adminSiteClient/AdminLayout.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observable, action, computed } from "mobx" import { observer } from "mobx-react" diff --git a/adminSiteClient/AdminSidebar.tsx b/adminSiteClient/AdminSidebar.tsx index cb5e5eecf5..3b7ad4c2d0 100644 --- a/adminSiteClient/AdminSidebar.tsx +++ b/adminSiteClient/AdminSidebar.tsx @@ -1,5 +1,5 @@ import { Link } from "./Link.js" -import React from "react" +import * as React from "react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faChartBar, diff --git a/adminSiteClient/BulkDownloadPage.tsx b/adminSiteClient/BulkDownloadPage.tsx index 128837fc31..78e83e1bfc 100644 --- a/adminSiteClient/BulkDownloadPage.tsx +++ b/adminSiteClient/BulkDownloadPage.tsx @@ -1,10 +1,10 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { AdminLayout } from "./AdminLayout.js" import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" @observer -export class BulkDownloadPage extends React.Component { +export class BulkDownloadPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType @@ -20,7 +20,7 @@ export class BulkDownloadPage extends React.Component { } } -export class DownloadChartsSection extends React.Component { +export class DownloadChartsSection extends Component { render() { return (
diff --git a/adminSiteClient/BulkGrapherConfigEditor.tsx b/adminSiteClient/BulkGrapherConfigEditor.tsx index 378d00998c..ff5214a52c 100644 --- a/adminSiteClient/BulkGrapherConfigEditor.tsx +++ b/adminSiteClient/BulkGrapherConfigEditor.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { chartBulkUpdateAllowedColumnNamesAndTypes, WHITELISTED_SQL_COLUMN_NAMES, @@ -130,7 +130,7 @@ const config: GrapherConfigGridEditorConfig = { finalVariableLayerModificationFn: () => ({}), } -export class BulkGrapherConfigEditorPage extends React.Component { +export class BulkGrapherConfigEditorPage extends Component { render() { return ( diff --git a/adminSiteClient/ChartEditorView.tsx b/adminSiteClient/ChartEditorView.tsx index 2cd3005e10..3c6fb4312a 100644 --- a/adminSiteClient/ChartEditorView.tsx +++ b/adminSiteClient/ChartEditorView.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { observable, diff --git a/adminSiteClient/ChartIndexPage.tsx b/adminSiteClient/ChartIndexPage.tsx index eb2eb4722c..7018047982 100644 --- a/adminSiteClient/ChartIndexPage.tsx +++ b/adminSiteClient/ChartIndexPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, computed, action, runInAction } from "mobx" @@ -15,7 +15,7 @@ import { import { sortNumeric, SortOrder } from "@ourworldindata/utils" @observer -export class ChartIndexPage extends React.Component { +export class ChartIndexPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/ChartList.tsx b/adminSiteClient/ChartList.tsx index 8236bdbc74..6c51c0fc56 100644 --- a/adminSiteClient/ChartList.tsx +++ b/adminSiteClient/ChartList.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { runInAction, observable } from "mobx" import { bind } from "decko" diff --git a/adminSiteClient/ChartRow.tsx b/adminSiteClient/ChartRow.tsx index 18677f5563..f9564fd62d 100644 --- a/adminSiteClient/ChartRow.tsx +++ b/adminSiteClient/ChartRow.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { action, runInAction } from "mobx" import * as lodash from "lodash" diff --git a/adminSiteClient/ChartViewIndexPage.tsx b/adminSiteClient/ChartViewIndexPage.tsx index fca45f0728..4211ba1d15 100644 --- a/adminSiteClient/ChartViewIndexPage.tsx +++ b/adminSiteClient/ChartViewIndexPage.tsx @@ -1,4 +1,5 @@ -import React, { useContext, useEffect, useMemo, useState } from "react" +import { useContext, useEffect, useMemo, useState } from "react" +import * as React from "react" import { Button, Flex, Input, Space, Table } from "antd" import { AdminLayout } from "./AdminLayout.js" diff --git a/adminSiteClient/ColorSchemeDropdown.tsx b/adminSiteClient/ColorSchemeDropdown.tsx index b4f0b0df57..5b0ecf238e 100644 --- a/adminSiteClient/ColorSchemeDropdown.tsx +++ b/adminSiteClient/ColorSchemeDropdown.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { computed, action } from "mobx" import Select from "react-select" import { GrapherChartOrMapType } from "@ourworldindata/types" @@ -27,7 +27,7 @@ interface ColorSchemeDropdownProps { } @observer -export class ColorSchemeDropdown extends React.Component { +export class ColorSchemeDropdown extends Component { static defaultProps = { additionalOptions: [], gradientColorCount: 6, diff --git a/adminSiteClient/Colorpicker.tsx b/adminSiteClient/Colorpicker.tsx index c14536d145..0f4cc772c4 100644 --- a/adminSiteClient/Colorpicker.tsx +++ b/adminSiteClient/Colorpicker.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component, Fragment } from "react" import { action } from "mobx" import { observer } from "mobx-react" import { SketchPicker } from "react-color" @@ -16,7 +16,7 @@ interface ColorpickerProps { } @observer -export class Colorpicker extends React.Component { +export class Colorpicker extends Component { @action.bound onColor(color: string) { if (color === "") { this.props.onColor(undefined) @@ -39,7 +39,7 @@ export class Colorpicker extends React.Component { } return ( - + ({ @@ -49,7 +49,7 @@ export class Colorpicker extends React.Component { color={this.props.color} onChange={(color) => this.onColor(color.hex)} /> - + ) } } diff --git a/adminSiteClient/DatasetEditPage.tsx b/adminSiteClient/DatasetEditPage.tsx index 143f0261fe..e02d1f58cc 100644 --- a/adminSiteClient/DatasetEditPage.tsx +++ b/adminSiteClient/DatasetEditPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, computed, runInAction, action } from "mobx" import * as lodash from "lodash" @@ -81,7 +81,7 @@ class DatasetEditable { } @observer -class DatasetTagEditor extends React.Component<{ +class DatasetTagEditor extends Component<{ newDataset: DatasetEditable availableTags: { id: number; name: string; parentName: string }[] }> { @@ -106,7 +106,7 @@ class DatasetTagEditor extends React.Component<{ } @observer -class DatasetEditor extends React.Component<{ dataset: DatasetPageData }> { +class DatasetEditor extends Component<{ dataset: DatasetPageData }> { static contextType = AdminAppContext context!: AdminAppContextType @observable newDataset!: DatasetEditable @@ -449,7 +449,7 @@ class DatasetEditor extends React.Component<{ dataset: DatasetPageData }> { } @observer -export class DatasetEditPage extends React.Component<{ datasetId: number }> { +export class DatasetEditPage extends Component<{ datasetId: number }> { static contextType = AdminAppContext context!: AdminAppContextType @observable dataset?: DatasetPageData diff --git a/adminSiteClient/DatasetList.tsx b/adminSiteClient/DatasetList.tsx index f05b59040b..67c073d480 100644 --- a/adminSiteClient/DatasetList.tsx +++ b/adminSiteClient/DatasetList.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observable, action } from "mobx" import { observer } from "mobx-react" import * as lodash from "lodash" diff --git a/adminSiteClient/DatasetsIndexPage.tsx b/adminSiteClient/DatasetsIndexPage.tsx index dcc8fcad4f..f99feac167 100644 --- a/adminSiteClient/DatasetsIndexPage.tsx +++ b/adminSiteClient/DatasetsIndexPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, computed, action, runInAction } from "mobx" import * as lodash from "lodash" @@ -15,7 +15,7 @@ import { } from "../adminShared/search.js" @observer -export class DatasetsIndexPage extends React.Component { +export class DatasetsIndexPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/DeployStatusPage.tsx b/adminSiteClient/DeployStatusPage.tsx index 9bbb107011..d9541f2ca1 100644 --- a/adminSiteClient/DeployStatusPage.tsx +++ b/adminSiteClient/DeployStatusPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { action, observable, runInAction } from "mobx" @@ -16,7 +16,7 @@ const statusLabel: Record = { } @observer -export class DeployStatusPage extends React.Component { +export class DeployStatusPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/DimensionCard.tsx b/adminSiteClient/DimensionCard.tsx index 4053be981d..db3d094a02 100644 --- a/adminSiteClient/DimensionCard.tsx +++ b/adminSiteClient/DimensionCard.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component, Fragment } from "react" import { observable, computed, action } from "mobx" import { observer } from "mobx-react" import { ChartDimension } from "@ourworldindata/grapher" @@ -27,7 +27,7 @@ import { AbstractChartEditor } from "./AbstractChartEditor.js" @observer export class DimensionCard< Editor extends AbstractChartEditor, -> extends React.Component<{ +> extends Component<{ dimension: ChartDimension editor: Editor isDndEnabled?: boolean @@ -70,7 +70,7 @@ export class DimensionCard< private get tableDisplaySettings() { const { tableDisplay = {} } = this.props.dimension.display return ( - +
Table:
-
+ ) } diff --git a/adminSiteClient/EditTags.tsx b/adminSiteClient/EditTags.tsx index 11ebfd074d..e031090289 100644 --- a/adminSiteClient/EditTags.tsx +++ b/adminSiteClient/EditTags.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { createRef, Component } from "react" import { action } from "mobx" import { observer } from "mobx-react" import { DbChartTagJoin } from "@ourworldindata/utils" @@ -9,7 +9,7 @@ import { } from "react-tag-autocomplete" @observer -export class EditTags extends React.Component<{ +export class EditTags extends Component<{ tags: DbChartTagJoin[] suggestions: DbChartTagJoin[] onDelete: (index: number) => void @@ -17,7 +17,7 @@ export class EditTags extends React.Component<{ onSave: () => void }> { dismissable: boolean = true - reactTagsApi = React.createRef() + reactTagsApi = createRef() @action.bound onClickSomewhere() { if (this.dismissable) this.props.onSave() diff --git a/adminSiteClient/EditableTags.tsx b/adminSiteClient/EditableTags.tsx index 1d3fab38a3..a9194f3ac7 100644 --- a/adminSiteClient/EditableTags.tsx +++ b/adminSiteClient/EditableTags.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import * as lodash from "lodash" import { observable, action } from "mobx" import { observer } from "mobx-react" diff --git a/adminSiteClient/EditorBasicTab.tsx b/adminSiteClient/EditorBasicTab.tsx index f3ebebb0ee..9b89b12bbf 100644 --- a/adminSiteClient/EditorBasicTab.tsx +++ b/adminSiteClient/EditorBasicTab.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observable, action, diff --git a/adminSiteClient/EditorColorScaleSection.tsx b/adminSiteClient/EditorColorScaleSection.tsx index fe6753d127..bfd1511f16 100644 --- a/adminSiteClient/EditorColorScaleSection.tsx +++ b/adminSiteClient/EditorColorScaleSection.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component, Fragment } from "react" import { action, computed, runInAction } from "mobx" import { observer } from "mobx-react" import Select from "react-select" @@ -41,7 +41,7 @@ interface EditorColorScaleSectionFeatures { } @observer -export class EditorColorScaleSection extends React.Component<{ +export class EditorColorScaleSection extends Component<{ scale: ColorScale chartType: GrapherChartOrMapType features: EditorColorScaleSectionFeatures @@ -50,7 +50,7 @@ export class EditorColorScaleSection extends React.Component<{ }> { render() { return ( - + - + ) } } @observer -class ColorLegendSection extends React.Component<{ +class ColorLegendSection extends Component<{ scale: ColorScale features: EditorColorScaleSectionFeatures onChange?: () => void @@ -130,7 +130,7 @@ class ColorLegendSection extends React.Component<{ } @observer -class ColorsSection extends React.Component<{ +class ColorsSection extends Component<{ scale: ColorScale chartType: GrapherChartOrMapType showLineChartColors: boolean @@ -275,7 +275,7 @@ class ColorsSection extends React.Component<{ } @observer -class ColorSchemeEditor extends React.Component<{ +class ColorSchemeEditor extends Component<{ scale: ColorScale showLineChartColors: boolean onChange?: () => void @@ -319,7 +319,7 @@ class ColorSchemeEditor extends React.Component<{ } @observer -class BinLabelView extends React.Component<{ +class BinLabelView extends Component<{ scale: ColorScale bin: ColorScaleBin index: number @@ -385,7 +385,7 @@ function populateManualBinValuesIfAutomatic(scale: ColorScale) { } @observer -class NumericBinView extends React.Component<{ +class NumericBinView extends Component<{ scale: ColorScale bin: NumericBin index: number @@ -492,7 +492,7 @@ class NumericBinView extends React.Component<{ } @observer -class CategoricalBinView extends React.Component<{ +class CategoricalBinView extends Component<{ scale: ColorScale bin: CategoricalBin showLineChartColors: boolean diff --git a/adminSiteClient/EditorCustomizeTab.tsx b/adminSiteClient/EditorCustomizeTab.tsx index 7f92dd1fb0..9a72f56549 100644 --- a/adminSiteClient/EditorCustomizeTab.tsx +++ b/adminSiteClient/EditorCustomizeTab.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observable, computed, action } from "mobx" import { observer } from "mobx-react" import { diff --git a/adminSiteClient/EditorDataTab.tsx b/adminSiteClient/EditorDataTab.tsx index 84c15f868b..82ba1dc802 100644 --- a/adminSiteClient/EditorDataTab.tsx +++ b/adminSiteClient/EditorDataTab.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { differenceOfSets, moveArrayItemToIndex, diff --git a/adminSiteClient/EditorDebugTab.tsx b/adminSiteClient/EditorDebugTab.tsx index 566f5087de..ba5ffbc2dd 100644 --- a/adminSiteClient/EditorDebugTab.tsx +++ b/adminSiteClient/EditorDebugTab.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { Section, Toggle } from "./Forms.js" import { ChartEditor, isChartEditorInstance } from "./ChartEditor.js" @@ -26,7 +26,7 @@ import { stringify } from "safe-stable-stringify" @observer export class EditorDebugTab< Editor extends AbstractChartEditor, -> extends React.Component<{ +> extends Component<{ editor: Editor }> { render() { @@ -42,7 +42,7 @@ export class EditorDebugTab< } @observer -class EditorDebugTabForChart extends React.Component<{ +class EditorDebugTabForChart extends Component<{ editor: ChartEditor }> { @action.bound copyYamlToClipboard() { @@ -200,7 +200,7 @@ class EditorDebugTabForChart extends React.Component<{ } @observer -class EditorDebugTabForChartView extends React.Component<{ +class EditorDebugTabForChartView extends Component<{ editor: ChartViewEditor }> { @action.bound copyYamlToClipboard() { @@ -340,7 +340,7 @@ class EditorDebugTabForChartView extends React.Component<{ } @observer -class EditorDebugTabForIndicatorChart extends React.Component<{ +class EditorDebugTabForIndicatorChart extends Component<{ editor: IndicatorChartEditor }> { render() { diff --git a/adminSiteClient/EditorExportTab.tsx b/adminSiteClient/EditorExportTab.tsx index 84fa7bac40..ccbd59d7f3 100644 --- a/adminSiteClient/EditorExportTab.tsx +++ b/adminSiteClient/EditorExportTab.tsx @@ -1,6 +1,6 @@ import { IReactionDisposer, action, autorun, computed, observable } from "mobx" import { observer } from "mobx-react" -import React from "react" +import { Component } from "react" import { Section, Toggle } from "./Forms.js" import { Grapher } from "@ourworldindata/grapher" import { @@ -59,7 +59,7 @@ interface EditorExportTabProps { @observer export class EditorExportTab< Editor extends AbstractChartEditor, -> extends React.Component> { +> extends Component> { @observable private settings = DEFAULT_SETTINGS private originalSettings: Partial = DEFAULT_SETTINGS private originalGrapher: OriginalGrapher diff --git a/adminSiteClient/EditorFAQ.tsx b/adminSiteClient/EditorFAQ.tsx index 7b3b2e660c..7abee1f4d6 100644 --- a/adminSiteClient/EditorFAQ.tsx +++ b/adminSiteClient/EditorFAQ.tsx @@ -1,9 +1,9 @@ -import React from "react" +import { Component } from "react" import { Modal } from "./Forms.js" import { faLink, faUnlink } from "@fortawesome/free-solid-svg-icons" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" -export class EditorFAQ extends React.Component<{ onClose: () => void }> { +export class EditorFAQ extends Component<{ onClose: () => void }> { render() { return ( diff --git a/adminSiteClient/EditorHistoryTab.tsx b/adminSiteClient/EditorHistoryTab.tsx index 99c3cbf00c..8eed5f62d4 100644 --- a/adminSiteClient/EditorHistoryTab.tsx +++ b/adminSiteClient/EditorHistoryTab.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { ChartEditor, Log } from "./ChartEditor.js" import { Timeago } from "./Forms.js" @@ -51,7 +51,7 @@ function LogCompareModal({ } @observer -class LogRenderer extends React.Component<{ +class LogRenderer extends Component<{ log: Log previousLog: Log | undefined }> { @@ -102,7 +102,7 @@ class LogRenderer extends React.Component<{ } @observer -export class EditorHistoryTab extends React.Component<{ editor: ChartEditor }> { +export class EditorHistoryTab extends Component<{ editor: ChartEditor }> { @computed get logs() { return this.props.editor.logs || [] } diff --git a/adminSiteClient/EditorMapTab.tsx b/adminSiteClient/EditorMapTab.tsx index 51d5b2b689..a5a7a462bf 100644 --- a/adminSiteClient/EditorMapTab.tsx +++ b/adminSiteClient/EditorMapTab.tsx @@ -12,13 +12,13 @@ import { import { ColumnSlug, isEmpty, ToleranceStrategy } from "@ourworldindata/utils" import { action, computed } from "mobx" import { observer } from "mobx-react" -import React from "react" +import { Component, Fragment } from "react" import { EditorColorScaleSection } from "./EditorColorScaleSection.js" import { NumberField, Section, SelectField, Toggle } from "./Forms.js" import { AbstractChartEditor } from "./AbstractChartEditor.js" @observer -class VariableSection extends React.Component<{ +class VariableSection extends Component<{ mapConfig: MapConfig filledDimensions: ChartDimension[] parentConfig?: GrapherInterface @@ -77,7 +77,7 @@ class VariableSection extends React.Component<{ } @observer -class TimelineSection extends React.Component<{ mapConfig: MapConfig }> { +class TimelineSection extends Component<{ mapConfig: MapConfig }> { @action.bound onToggleHideTimeline(value: boolean) { this.props.mapConfig.hideTimeline = value || undefined } @@ -150,7 +150,7 @@ class TimelineSection extends React.Component<{ mapConfig: MapConfig }> { } @observer -class TooltipSection extends React.Component<{ mapConfig: MapConfig }> { +class TooltipSection extends Component<{ mapConfig: MapConfig }> { @action.bound onTooltipUseCustomLabels(tooltipUseCustomLabels: boolean) { this.props.mapConfig.tooltipUseCustomLabels = tooltipUseCustomLabels ? true @@ -176,7 +176,7 @@ class TooltipSection extends React.Component<{ mapConfig: MapConfig }> { @observer export class EditorMapTab< Editor extends AbstractChartEditor, -> extends React.Component<{ editor: Editor }> { +> extends Component<{ editor: Editor }> { @computed get grapher() { return this.props.editor.grapher } @@ -198,7 +198,7 @@ export class EditorMapTab< parentConfig={this.props.editor.activeParentConfig} /> {isReady && ( - + - + )}
) diff --git a/adminSiteClient/EditorMarimekkoTab.tsx b/adminSiteClient/EditorMarimekkoTab.tsx index bc816a149e..2e1ffd7c30 100644 --- a/adminSiteClient/EditorMarimekkoTab.tsx +++ b/adminSiteClient/EditorMarimekkoTab.tsx @@ -6,11 +6,11 @@ import { excludeUndefined } from "@ourworldindata/utils" import lodash from "lodash" import { action, computed, IReactionDisposer, observable, reaction } from "mobx" import { observer } from "mobx-react" -import React from "react" +import { Component } from "react" import { NumberField, Section, SelectField, Toggle } from "./Forms.js" @observer -export class EditorMarimekkoTab extends React.Component<{ grapher: Grapher }> { +export class EditorMarimekkoTab extends Component<{ grapher: Grapher }> { @observable xOverrideTimeInputField: number | undefined constructor(props: { grapher: Grapher }) { super(props) diff --git a/adminSiteClient/EditorReferencesTab.tsx b/adminSiteClient/EditorReferencesTab.tsx index 3fc2d0b6d2..5e91f17300 100644 --- a/adminSiteClient/EditorReferencesTab.tsx +++ b/adminSiteClient/EditorReferencesTab.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component, Fragment } from "react" import { observer } from "mobx-react" import { ChartEditor, @@ -28,7 +28,7 @@ const BASE_URL = BAKED_GRAPHER_URL.replace(/^https?:\/\//, "") @observer export class EditorReferencesTab< Editor extends AbstractChartEditor, -> extends React.Component<{ +> extends Component<{ editor: Editor }> { render() { @@ -163,7 +163,7 @@ export const ReferencesSection = (props: { } @observer -export class EditorReferencesTabForChart extends React.Component<{ +export class EditorReferencesTabForChart extends Component<{ editor: ChartEditor }> { @computed get isPersisted() { @@ -232,7 +232,7 @@ export class EditorReferencesTabForChart extends React.Component<{
Alternative URLs for this chart
{this.redirects.length ? ( - +

The following URLs redirect to this chart:

    {this.redirects.map((redirect) => ( @@ -254,7 +254,7 @@ export class EditorReferencesTabForChart extends React.Component<{ ))}

-
+ ) : null} {this.isPersisted && ( extends React.Component<{ +class AddRedirectForm extends Component<{ editor: Editor onSuccess: (redirect: ChartRedirect) => void }> { @@ -356,7 +354,7 @@ class AddRedirectForm< } @observer -export class EditorReferencesTabForIndicator extends React.Component<{ +export class EditorReferencesTabForIndicator extends Component<{ editor: IndicatorChartEditor }> { render() { diff --git a/adminSiteClient/EditorScatterTab.tsx b/adminSiteClient/EditorScatterTab.tsx index 9692b6cd6d..582f4489d1 100644 --- a/adminSiteClient/EditorScatterTab.tsx +++ b/adminSiteClient/EditorScatterTab.tsx @@ -9,11 +9,11 @@ import { Grapher } from "@ourworldindata/grapher" import { debounce, excludeUndefined } from "@ourworldindata/utils" import { action, computed, observable } from "mobx" import { observer } from "mobx-react" -import React from "react" +import { Component } from "react" import { NumberField, Section, SelectField, Toggle } from "./Forms.js" @observer -export class EditorScatterTab extends React.Component<{ grapher: Grapher }> { +export class EditorScatterTab extends Component<{ grapher: Grapher }> { @observable comparisonLine: ComparisonLineConfig = { yEquals: undefined } constructor(props: { grapher: Grapher }) { diff --git a/adminSiteClient/EditorTextTab.tsx b/adminSiteClient/EditorTextTab.tsx index da032de3bd..b259827bdd 100644 --- a/adminSiteClient/EditorTextTab.tsx +++ b/adminSiteClient/EditorTextTab.tsx @@ -5,7 +5,7 @@ import { getErrorMessageRelatedQuestionUrl } from "@ourworldindata/grapher" import { slugify } from "@ourworldindata/utils" import { action, computed } from "mobx" import { observer } from "mobx-react" -import React from "react" +import { Component } from "react" import { isChartEditorInstance } from "./ChartEditor.js" import { AutoTextField, @@ -23,7 +23,7 @@ import { ErrorMessages } from "./ChartEditorTypes.js" @observer export class EditorTextTab< Editor extends AbstractChartEditor, -> extends React.Component<{ editor: Editor; errorMessages: ErrorMessages }> { +> extends Component<{ editor: Editor; errorMessages: ErrorMessages }> { @action.bound onSlug(slug: string) { this.props.editor.grapher.slug = slugify(slug) } diff --git a/adminSiteClient/ExplorerTagsPage.tsx b/adminSiteClient/ExplorerTagsPage.tsx index ea25262789..6390bae3f8 100644 --- a/adminSiteClient/ExplorerTagsPage.tsx +++ b/adminSiteClient/ExplorerTagsPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { action, computed, observable, runInAction } from "mobx" @@ -19,7 +19,7 @@ type ExplorerWithTags = { } @observer -export class ExplorerTagsPage extends React.Component { +export class ExplorerTagsPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType @observable explorersWithTags: ExplorerWithTags[] = [] diff --git a/adminSiteClient/Forms.tsx b/adminSiteClient/Forms.tsx index 5db987cd77..5dcd325c58 100644 --- a/adminSiteClient/Forms.tsx +++ b/adminSiteClient/Forms.tsx @@ -4,7 +4,7 @@ * Reusable React components to keep admin UI succint and consistent */ -import React from "react" +import * as React from "react" import { bind } from "decko" import { action } from "mobx" import { observer } from "mobx-react" diff --git a/adminSiteClient/GdocsAdd.tsx b/adminSiteClient/GdocsAdd.tsx index 6a01770cef..503820b745 100644 --- a/adminSiteClient/GdocsAdd.tsx +++ b/adminSiteClient/GdocsAdd.tsx @@ -1,5 +1,5 @@ import { GDOCS_URL_PLACEHOLDER, gdocUrlRegex } from "@ourworldindata/utils" -import React from "react" +import * as React from "react" import { GDOCS_BASIC_ARTICLE_TEMPLATE_URL, GDOCS_CLIENT_EMAIL, diff --git a/adminSiteClient/GdocsBreadcrumbsInput.tsx b/adminSiteClient/GdocsBreadcrumbsInput.tsx index bed28d0255..094e7188cb 100644 --- a/adminSiteClient/GdocsBreadcrumbsInput.tsx +++ b/adminSiteClient/GdocsBreadcrumbsInput.tsx @@ -6,7 +6,6 @@ import { OwidGdocPostInterface, } from "@ourworldindata/utils" import { Button, Col, Input, Row } from "antd" -import React from "react" import { getPropertyMostCriticalError } from "./gdocsValidation.js" import { GdocsErrorHelp } from "./GdocsErrorHelp.js" diff --git a/adminSiteClient/GdocsDateline.tsx b/adminSiteClient/GdocsDateline.tsx index 3c38fb94b5..67bbb192a8 100644 --- a/adminSiteClient/GdocsDateline.tsx +++ b/adminSiteClient/GdocsDateline.tsx @@ -1,7 +1,6 @@ import { Col, DatePicker } from "antd" import { Dayjs } from "dayjs" import { dayjs, OwidGdocErrorMessage, OwidGdoc } from "@ourworldindata/utils" -import React from "react" import { PUBLISHED_AT_FORMAT } from "../settings/clientSettings" import { getPropertyMostCriticalError } from "./gdocsValidation.js" import { GdocsErrorHelp } from "./GdocsErrorHelp.js" diff --git a/adminSiteClient/GdocsDiff.tsx b/adminSiteClient/GdocsDiff.tsx index b056d34229..15c2048ac9 100644 --- a/adminSiteClient/GdocsDiff.tsx +++ b/adminSiteClient/GdocsDiff.tsx @@ -1,4 +1,3 @@ -import React from "react" import ReactDiffViewer, { DiffMethod } from "react-diff-viewer-continued" import { stringify } from "safe-stable-stringify" import { omit, OwidGdoc } from "@ourworldindata/utils" diff --git a/adminSiteClient/GdocsDiffButton.tsx b/adminSiteClient/GdocsDiffButton.tsx index 26c934a31b..5805e6b10e 100644 --- a/adminSiteClient/GdocsDiffButton.tsx +++ b/adminSiteClient/GdocsDiffButton.tsx @@ -1,5 +1,4 @@ import { Badge, Button } from "antd" -import React from "react" export const GdocsDiffButton = ({ hasChanges, diff --git a/adminSiteClient/GdocsEditLink.tsx b/adminSiteClient/GdocsEditLink.tsx index a1562625c4..37c3e4499c 100644 --- a/adminSiteClient/GdocsEditLink.tsx +++ b/adminSiteClient/GdocsEditLink.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { faEdit } from "@fortawesome/free-solid-svg-icons" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" diff --git a/adminSiteClient/GdocsErrorHelp.tsx b/adminSiteClient/GdocsErrorHelp.tsx index e9e3045cbc..1e6775046c 100644 --- a/adminSiteClient/GdocsErrorHelp.tsx +++ b/adminSiteClient/GdocsErrorHelp.tsx @@ -1,4 +1,3 @@ -import React from "react" import { Help } from "./Forms.js" import { OwidGdocErrorMessage } from "@ourworldindata/utils" diff --git a/adminSiteClient/GdocsIndexPage.tsx b/adminSiteClient/GdocsIndexPage.tsx index b6dfce756e..77046b3c58 100644 --- a/adminSiteClient/GdocsIndexPage.tsx +++ b/adminSiteClient/GdocsIndexPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import cx from "classnames" import { AdminLayout } from "./AdminLayout.js" import { Modal, SearchField } from "./Forms.js" diff --git a/adminSiteClient/GdocsMoreMenu.tsx b/adminSiteClient/GdocsMoreMenu.tsx index 2c203f8222..0cf48939a8 100644 --- a/adminSiteClient/GdocsMoreMenu.tsx +++ b/adminSiteClient/GdocsMoreMenu.tsx @@ -1,4 +1,3 @@ -import * as React from "react" import { useState } from "react" import { Dropdown, Button, Modal, Form, Checkbox, Input } from "antd" import { diff --git a/adminSiteClient/GdocsPreviewPage.tsx b/adminSiteClient/GdocsPreviewPage.tsx index 62f1fac5df..49844dd7ba 100644 --- a/adminSiteClient/GdocsPreviewPage.tsx +++ b/adminSiteClient/GdocsPreviewPage.tsx @@ -1,10 +1,5 @@ -import React, { - useCallback, - useContext, - useEffect, - useRef, - useState, -} from "react" +import { useCallback, useContext, useEffect, useRef, useState } from "react" +import * as React from "react" import { AdminLayout } from "./AdminLayout.js" import { GdocsMatchProps } from "./GdocsIndexPage.js" import { diff --git a/adminSiteClient/GdocsPublicationContext.tsx b/adminSiteClient/GdocsPublicationContext.tsx index b217e22307..d9af1afb95 100644 --- a/adminSiteClient/GdocsPublicationContext.tsx +++ b/adminSiteClient/GdocsPublicationContext.tsx @@ -3,7 +3,6 @@ import { OwidGdocPublicationContext, OwidGdocPostInterface, } from "@ourworldindata/utils" -import React from "react" import { GdocsErrorHelp } from "./GdocsErrorHelp.js" export const GdocsPublicationContext = ({ diff --git a/adminSiteClient/GdocsSaveButtons.tsx b/adminSiteClient/GdocsSaveButtons.tsx index 204307d63e..663845f1c5 100644 --- a/adminSiteClient/GdocsSaveButtons.tsx +++ b/adminSiteClient/GdocsSaveButtons.tsx @@ -1,5 +1,4 @@ import { Badge, Button, Modal, Space } from "antd" -import React from "react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faExclamationTriangle, diff --git a/adminSiteClient/GdocsSettingsContentField.tsx b/adminSiteClient/GdocsSettingsContentField.tsx index b9954d7a88..1352e78c63 100644 --- a/adminSiteClient/GdocsSettingsContentField.tsx +++ b/adminSiteClient/GdocsSettingsContentField.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Input, InputProps } from "antd" import { OwidGdocPostInterface, diff --git a/adminSiteClient/GdocsSettingsForms.tsx b/adminSiteClient/GdocsSettingsForms.tsx index abe21772f0..a191106806 100644 --- a/adminSiteClient/GdocsSettingsForms.tsx +++ b/adminSiteClient/GdocsSettingsForms.tsx @@ -1,4 +1,3 @@ -import React from "react" import { OwidGdocPostInterface, OwidGdocErrorMessage, diff --git a/adminSiteClient/GdocsSlug.tsx b/adminSiteClient/GdocsSlug.tsx index f5231be281..4e79f111f8 100644 --- a/adminSiteClient/GdocsSlug.tsx +++ b/adminSiteClient/GdocsSlug.tsx @@ -1,5 +1,5 @@ import { Col, Input, Row, Space, Switch } from "antd" -import React, { useEffect, useState } from "react" +import { useEffect, useState } from "react" import { slugify, OwidGdocErrorMessage, OwidGdoc } from "@ourworldindata/utils" import { Help } from "./Forms.js" import { getPropertyMostCriticalError } from "./gdocsValidation.js" diff --git a/adminSiteClient/GdocsStore.tsx b/adminSiteClient/GdocsStore.tsx index 1a7b11c387..996b1e6e7b 100644 --- a/adminSiteClient/GdocsStore.tsx +++ b/adminSiteClient/GdocsStore.tsx @@ -1,4 +1,5 @@ -import React, { useContext, createContext, useState } from "react" +import { useContext, createContext, useState } from "react" +import * as React from "react" import { action, observable } from "mobx" import { getOwidGdocFromJSON, diff --git a/adminSiteClient/GrapherConfigGridEditor.tsx b/adminSiteClient/GrapherConfigGridEditor.tsx index 4c7ae6f7cf..d4539d9b76 100644 --- a/adminSiteClient/GrapherConfigGridEditor.tsx +++ b/adminSiteClient/GrapherConfigGridEditor.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Bounds, stringifyUnknownError, diff --git a/adminSiteClient/GrapherConfigGridEditorTypesAndUtils.tsx b/adminSiteClient/GrapherConfigGridEditorTypesAndUtils.tsx index 7b64b39587..3de0bbc428 100644 --- a/adminSiteClient/GrapherConfigGridEditorTypesAndUtils.tsx +++ b/adminSiteClient/GrapherConfigGridEditorTypesAndUtils.tsx @@ -36,7 +36,6 @@ import { EditorOption, FieldDescription, } from "../adminShared/schemaProcessing.js" -import React from "react" import { IconDefinition } from "@fortawesome/fontawesome-common-types" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" diff --git a/adminSiteClient/IconBadge.tsx b/adminSiteClient/IconBadge.tsx index 1fac97ae4a..4c084474b1 100644 --- a/adminSiteClient/IconBadge.tsx +++ b/adminSiteClient/IconBadge.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faExclamationTriangle, diff --git a/adminSiteClient/ImagesIndexPage.tsx b/adminSiteClient/ImagesIndexPage.tsx index ecd8a452f9..1de6114e21 100644 --- a/adminSiteClient/ImagesIndexPage.tsx +++ b/adminSiteClient/ImagesIndexPage.tsx @@ -1,4 +1,5 @@ -import React, { +import { + createContext, useCallback, useContext, useEffect, @@ -503,7 +504,7 @@ function PutImageButton({ ) } -const NotificationContext = React.createContext(null) +const NotificationContext = createContext(null) export function ImageIndexPage() { const { admin } = useContext(AdminAppContext) diff --git a/adminSiteClient/Link.tsx b/adminSiteClient/Link.tsx index e6baf1260b..d9648e74d6 100644 --- a/adminSiteClient/Link.tsx +++ b/adminSiteClient/Link.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { NavLink } from "react-router-dom" import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" diff --git a/adminSiteClient/NotFoundPage.tsx b/adminSiteClient/NotFoundPage.tsx index 99ebc68f5c..eefc12af9a 100644 --- a/adminSiteClient/NotFoundPage.tsx +++ b/adminSiteClient/NotFoundPage.tsx @@ -1,9 +1,9 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { AdminLayout } from "./AdminLayout.js" @observer -export class NotFoundPage extends React.Component { +export class NotFoundPage extends Component { render() { return ( diff --git a/adminSiteClient/OriginList.tsx b/adminSiteClient/OriginList.tsx index 19e8ec28e4..ffb36c46f3 100644 --- a/adminSiteClient/OriginList.tsx +++ b/adminSiteClient/OriginList.tsx @@ -1,11 +1,11 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" import { OwidOrigin } from "@ourworldindata/utils" import { BindString, FieldsRow } from "./Forms.js" @observer -export class OriginList extends React.Component<{ +export class OriginList extends Component<{ origins: OwidOrigin[] }> { static contextType = AdminAppContext diff --git a/adminSiteClient/PostEditorPage.tsx b/adminSiteClient/PostEditorPage.tsx index b7e13e752d..c1c03f6091 100644 --- a/adminSiteClient/PostEditorPage.tsx +++ b/adminSiteClient/PostEditorPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, runInAction } from "mobx" @@ -15,7 +15,7 @@ interface Post { content: string } -class PostEditor extends React.Component<{ post: Post }> { +class PostEditor extends Component<{ post: Post }> { render() { const { post } = this.props return ( @@ -29,7 +29,7 @@ class PostEditor extends React.Component<{ post: Post }> { } @observer -export class PostEditorPage extends React.Component<{ postId?: number }> { +export class PostEditorPage extends Component<{ postId?: number }> { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/PostsIndexPage.tsx b/adminSiteClient/PostsIndexPage.tsx index 6393a19efb..e06771ceb6 100644 --- a/adminSiteClient/PostsIndexPage.tsx +++ b/adminSiteClient/PostsIndexPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, computed, action, runInAction } from "mobx" @@ -54,7 +54,7 @@ interface PostRowProps { } @observer -class PostRow extends React.Component { +class PostRow extends Component { static contextType = AdminAppContext context!: AdminAppContextType @@ -240,7 +240,7 @@ class PostRow extends React.Component { } @observer -export class PostsIndexPage extends React.Component { +export class PostsIndexPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/RedirectsIndexPage.tsx b/adminSiteClient/RedirectsIndexPage.tsx index 57b000ead8..0f5a0a2a7c 100644 --- a/adminSiteClient/RedirectsIndexPage.tsx +++ b/adminSiteClient/RedirectsIndexPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, action, runInAction } from "mobx" import { AdminLayout } from "./AdminLayout.js" @@ -14,7 +14,7 @@ interface RedirectListItem { } @observer -class RedirectRow extends React.Component<{ +class RedirectRow extends Component<{ redirect: RedirectListItem onDelete: (redirect: RedirectListItem) => void }> { @@ -46,7 +46,7 @@ class RedirectRow extends React.Component<{ } @observer -export class RedirectsIndexPage extends React.Component { +export class RedirectsIndexPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/SaveButtons.tsx b/adminSiteClient/SaveButtons.tsx index dbb9ed7171..ce63127a91 100644 --- a/adminSiteClient/SaveButtons.tsx +++ b/adminSiteClient/SaveButtons.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { ChartEditor, isChartEditorInstance } from "./ChartEditor.js" import { action, computed } from "mobx" import { observer } from "mobx-react" @@ -19,9 +19,7 @@ import { } from "./ChartViewEditor.js" @observer -export class SaveButtons< - Editor extends AbstractChartEditor, -> extends React.Component<{ +export class SaveButtons extends Component<{ editor: Editor errorMessages: ErrorMessages errorMessagesForDimensions: ErrorMessagesForDimensions @@ -50,7 +48,7 @@ export class SaveButtons< } @observer -class SaveButtonsForChart extends React.Component<{ +class SaveButtonsForChart extends Component<{ editor: ChartEditor errorMessages: ErrorMessages errorMessagesForDimensions: ErrorMessagesForDimensions @@ -140,7 +138,7 @@ class SaveButtonsForChart extends React.Component<{ } @observer -class SaveButtonsForIndicatorChart extends React.Component<{ +class SaveButtonsForIndicatorChart extends Component<{ editor: IndicatorChartEditor errorMessages: ErrorMessages errorMessagesForDimensions: ErrorMessagesForDimensions @@ -189,7 +187,7 @@ class SaveButtonsForIndicatorChart extends React.Component<{ } @observer -class SaveButtonsForChartView extends React.Component<{ +class SaveButtonsForChartView extends Component<{ editor: ChartViewEditor errorMessages: ErrorMessages errorMessagesForDimensions: ErrorMessagesForDimensions diff --git a/adminSiteClient/SiteRedirectsIndexPage.tsx b/adminSiteClient/SiteRedirectsIndexPage.tsx index 30fdc567fb..1fea807c0c 100644 --- a/adminSiteClient/SiteRedirectsIndexPage.tsx +++ b/adminSiteClient/SiteRedirectsIndexPage.tsx @@ -1,5 +1,5 @@ import cx from "classnames" -import React, { useContext, useEffect, useState } from "react" +import { useContext, useEffect, useState } from "react" import { useForm } from "react-hook-form" import { BAKED_BASE_URL } from "../settings/clientSettings.js" diff --git a/adminSiteClient/SourceEditPage.tsx b/adminSiteClient/SourceEditPage.tsx index 62b1424ee1..98fd43f282 100644 --- a/adminSiteClient/SourceEditPage.tsx +++ b/adminSiteClient/SourceEditPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, computed, runInAction } from "mobx" import { Prompt } from "react-router-dom" @@ -43,7 +43,7 @@ class SourceEditable { } @observer -class SourceEditor extends React.Component<{ source: SourcePageData }> { +class SourceEditor extends Component<{ source: SourcePageData }> { @observable newSource!: SourceEditable @observable isDeleted: boolean = false @@ -162,7 +162,7 @@ class SourceEditor extends React.Component<{ source: SourcePageData }> { } @observer -export class SourceEditPage extends React.Component<{ sourceId: number }> { +export class SourceEditPage extends Component<{ sourceId: number }> { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/SourceList.tsx b/adminSiteClient/SourceList.tsx index b304b23cfc..a5e9a23ef6 100644 --- a/adminSiteClient/SourceList.tsx +++ b/adminSiteClient/SourceList.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" import { OwidSource } from "@ourworldindata/utils" @@ -7,7 +7,7 @@ import { BindString } from "./Forms.js" const MAX_SOURCES = 10 @observer -export class SourceList extends React.Component<{ +export class SourceList extends Component<{ sources: OwidSource[] }> { static contextType = AdminAppContext diff --git a/adminSiteClient/TagBadge.tsx b/adminSiteClient/TagBadge.tsx index c55d7427f5..5b2842d2d3 100644 --- a/adminSiteClient/TagBadge.tsx +++ b/adminSiteClient/TagBadge.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { KeyChartLevel, DbChartTagJoin } from "@ourworldindata/utils" diff --git a/adminSiteClient/TagBucketSortingIcon.tsx b/adminSiteClient/TagBucketSortingIcon.tsx index cc62391ce2..d91302402c 100644 --- a/adminSiteClient/TagBucketSortingIcon.tsx +++ b/adminSiteClient/TagBucketSortingIcon.tsx @@ -1,4 +1,3 @@ -import React from "react" import { KeyChartLevel } from "@ourworldindata/utils" export const TagBucketSortingIcon = ({ level }: { level?: number }) => { diff --git a/adminSiteClient/TagEditPage.tsx b/adminSiteClient/TagEditPage.tsx index 374bab4a4d..cfb8faff08 100644 --- a/adminSiteClient/TagEditPage.tsx +++ b/adminSiteClient/TagEditPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, computed, runInAction } from "mobx" import { Prompt, Redirect } from "react-router-dom" @@ -33,7 +33,7 @@ class TagEditable { } @observer -class TagEditor extends React.Component<{ tag: TagPageData }> { +class TagEditor extends Component<{ tag: TagPageData }> { static contextType = AdminAppContext context!: AdminAppContextType @@ -177,7 +177,7 @@ class TagEditor extends React.Component<{ tag: TagPageData }> { } @observer -export class TagEditPage extends React.Component<{ tagId: number }> { +export class TagEditPage extends Component<{ tagId: number }> { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/TagGraphPage.tsx b/adminSiteClient/TagGraphPage.tsx index a1cef3caf5..de64571844 100644 --- a/adminSiteClient/TagGraphPage.tsx +++ b/adminSiteClient/TagGraphPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { observable, action, runInAction, toJS, computed } from "mobx" import * as lodash from "lodash" diff --git a/adminSiteClient/TagsIndexPage.tsx b/adminSiteClient/TagsIndexPage.tsx index 1c6412de2b..1dcd5078a7 100644 --- a/adminSiteClient/TagsIndexPage.tsx +++ b/adminSiteClient/TagsIndexPage.tsx @@ -1,5 +1,5 @@ import { observer } from "mobx-react" -import React from "react" +import { Component } from "react" import { AdminLayout } from "./AdminLayout.js" import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" import { observable, runInAction } from "mobx" @@ -9,7 +9,7 @@ import { Link } from "react-router-dom" import { Button, Modal } from "antd" @observer -export class TagsIndexPage extends React.Component { +export class TagsIndexPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/TestIndexPage.tsx b/adminSiteClient/TestIndexPage.tsx index 69753bd433..1810d3c8a6 100644 --- a/adminSiteClient/TestIndexPage.tsx +++ b/adminSiteClient/TestIndexPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { AdminLayout } from "./AdminLayout.js" @@ -6,7 +6,7 @@ import { Link } from "./Link.js" import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" @observer -export class TestIndexPage extends React.Component { +export class TestIndexPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/UserEditPage.tsx b/adminSiteClient/UserEditPage.tsx index dee6b69875..30f209d234 100644 --- a/adminSiteClient/UserEditPage.tsx +++ b/adminSiteClient/UserEditPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, runInAction } from "mobx" import { BindString, Toggle } from "./Forms.js" @@ -8,7 +8,7 @@ import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" import { UserIndexMeta } from "./UserMeta.js" @observer -export class UserEditPage extends React.Component<{ userId: number }> { +export class UserEditPage extends Component<{ userId: number }> { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/UsersIndexPage.tsx b/adminSiteClient/UsersIndexPage.tsx index 09291cf3cc..88a47492d2 100644 --- a/adminSiteClient/UsersIndexPage.tsx +++ b/adminSiteClient/UsersIndexPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { observable, action, runInAction } from "mobx" diff --git a/adminSiteClient/VariableEditPage.tsx b/adminSiteClient/VariableEditPage.tsx index 3632ce1b58..2fd99236e2 100644 --- a/adminSiteClient/VariableEditPage.tsx +++ b/adminSiteClient/VariableEditPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, @@ -125,7 +125,7 @@ class VariableEditable // XXX refactor with DatasetEditPage @observer -class VariableEditor extends React.Component<{ +class VariableEditor extends Component<{ variable: VariablePageData }> { @observable newVariable!: VariableEditable @@ -727,7 +727,7 @@ class VariableEditor extends React.Component<{ } @observer -export class VariableEditPage extends React.Component<{ variableId: number }> { +export class VariableEditPage extends Component<{ variableId: number }> { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/VariableList.tsx b/adminSiteClient/VariableList.tsx index 8ac334ee2c..994280f925 100644 --- a/adminSiteClient/VariableList.tsx +++ b/adminSiteClient/VariableList.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { Link } from "./Link.js" diff --git a/adminSiteClient/VariableSelector.tsx b/adminSiteClient/VariableSelector.tsx index 6d8b885824..5b35f0eb26 100644 --- a/adminSiteClient/VariableSelector.tsx +++ b/adminSiteClient/VariableSelector.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import * as lodash from "lodash" import { groupBy, diff --git a/adminSiteClient/VariablesAnnotationPage.tsx b/adminSiteClient/VariablesAnnotationPage.tsx index e7c8a5fc3a..fb28929173 100644 --- a/adminSiteClient/VariablesAnnotationPage.tsx +++ b/adminSiteClient/VariablesAnnotationPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { DimensionProperty } from "@ourworldindata/utils" import { AdminLayout } from "./AdminLayout.js" import { GrapherConfigGridEditor } from "./GrapherConfigGridEditor.js" @@ -148,7 +148,7 @@ const config: GrapherConfigGridEditorConfig = { }), } -export class VariablesAnnotationPage extends React.Component { +export class VariablesAnnotationPage extends Component { render() { return ( diff --git a/adminSiteClient/VariablesIndexPage.tsx b/adminSiteClient/VariablesIndexPage.tsx index 5009a42bf4..2d688d2aff 100644 --- a/adminSiteClient/VariablesIndexPage.tsx +++ b/adminSiteClient/VariablesIndexPage.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { observable, @@ -16,7 +16,7 @@ import { VariableList, VariableListItem } from "./VariableList.js" import { AdminAppContext, AdminAppContextType } from "./AdminAppContext.js" @observer -export class VariablesIndexPage extends React.Component { +export class VariablesIndexPage extends Component { static contextType = AdminAppContext context!: AdminAppContextType diff --git a/adminSiteClient/VisionDeficiencies.tsx b/adminSiteClient/VisionDeficiencies.tsx index d2b4fbea2f..5c236a6f37 100644 --- a/adminSiteClient/VisionDeficiencies.tsx +++ b/adminSiteClient/VisionDeficiencies.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import Select, { GroupBase, components, OptionProps } from "react-select" import classNames from "classnames" import { observer } from "mobx-react" @@ -119,7 +119,7 @@ const VisionDeficiencyOption = ( ) @observer -export class VisionDeficiencyDropdown extends React.Component { +export class VisionDeficiencyDropdown extends Component { noDeficiencyOption = { label: "No deficiencies", value: "none", diff --git a/adminSiteClient/gdocsNotifications.tsx b/adminSiteClient/gdocsNotifications.tsx index 0ce8b97c3e..6d415bfa37 100644 --- a/adminSiteClient/gdocsNotifications.tsx +++ b/adminSiteClient/gdocsNotifications.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { notification } from "antd" import { OwidGdocErrorMessageType } from "@ourworldindata/utils" import { match } from "ts-pattern" diff --git a/adminSiteServer/IndexPage.tsx b/adminSiteServer/IndexPage.tsx index 2cded50346..5a58509e04 100644 --- a/adminSiteServer/IndexPage.tsx +++ b/adminSiteServer/IndexPage.tsx @@ -1,4 +1,3 @@ -import React from "react" import { ENV, GITHUB_USERNAME, diff --git a/adminSiteServer/LoginPage.tsx b/adminSiteServer/LoginPage.tsx index d95292b740..def4d2d1a2 100644 --- a/adminSiteServer/LoginPage.tsx +++ b/adminSiteServer/LoginPage.tsx @@ -1,5 +1,3 @@ -import React from "react" - export const LoginPage = (props: { next?: string; errorMessage?: string }) => { const style = ` html, body { diff --git a/adminSiteServer/adminRouter.tsx b/adminSiteServer/adminRouter.tsx index 4ec2039fb6..f239b00ea5 100644 --- a/adminSiteServer/adminRouter.tsx +++ b/adminSiteServer/adminRouter.tsx @@ -2,7 +2,7 @@ import express, { Request, Response, Router } from "express" import rateLimit from "express-rate-limit" import filenamify from "filenamify" -import React from "react" +import * as React from "react" import { Writable } from "stream" import { expectInt, renderToHtmlPage } from "../serverUtils/serverUtil.js" import { logInWithCredentials, logOut } from "./authentication.js" diff --git a/adminSiteServer/appClass.tsx b/adminSiteServer/appClass.tsx index c2467c13c4..1ef3cc0546 100644 --- a/adminSiteServer/appClass.tsx +++ b/adminSiteServer/appClass.tsx @@ -1,4 +1,3 @@ -import React from "react" import { simpleGit } from "simple-git" import express, { NextFunction } from "express" // eslint-disable-next-line @typescript-eslint/no-require-imports diff --git a/adminSiteServer/testPageRouter.tsx b/adminSiteServer/testPageRouter.tsx index 2ac528a2fc..93199b4c70 100644 --- a/adminSiteServer/testPageRouter.tsx +++ b/adminSiteServer/testPageRouter.tsx @@ -1,7 +1,6 @@ // Testing pages for comparing local charts against live versions import { Router } from "express" -import React from "react" import { renderToHtmlPage, expectInt } from "../serverUtils/serverUtil.js" import { diff --git a/baker/GrapherBaker.tsx b/baker/GrapherBaker.tsx index 313b45c7ee..2f65b46899 100644 --- a/baker/GrapherBaker.tsx +++ b/baker/GrapherBaker.tsx @@ -1,4 +1,3 @@ -import React from "react" import { GrapherPage } from "../site/GrapherPage.js" import { DataPageV2 } from "../site/DataPageV2.js" import { renderToHtmlPage } from "../baker/siteRenderers.js" diff --git a/baker/MultiDimBaker.tsx b/baker/MultiDimBaker.tsx index 9ceb90e81a..db04ecdb3c 100644 --- a/baker/MultiDimBaker.tsx +++ b/baker/MultiDimBaker.tsx @@ -16,7 +16,6 @@ import { import * as db from "../db/db.js" import { renderToHtmlPage } from "./siteRenderers.js" import { MultiDimDataPage } from "../site/multiDim/MultiDimDataPage.js" -import React from "react" import { BAKED_BASE_URL, BAKED_GRAPHER_URL, diff --git a/baker/algolia/utils/pages.ts b/baker/algolia/utils/pages.ts index 1045100000..f9b16b1ce6 100644 --- a/baker/algolia/utils/pages.ts +++ b/baker/algolia/utils/pages.ts @@ -27,7 +27,7 @@ import { } from "../../../site/search/searchTypes.js" import { getAnalyticsPageviewsByUrlObj } from "../../../db/model/Pageview.js" import { ArticleBlocks } from "../../../site/gdocs/components/ArticleBlocks.js" -import React from "react" +import { createElement } from "react" import { getFullPost, getPostTags, @@ -224,10 +224,10 @@ function generateGdocRecords( if (!gdoc.content.body) continue // Only rendering the blocks - not the page nav, title, byline, etc const renderedPostContent = ReactDOMServer.renderToStaticMarkup( - React.createElement( + createElement( "div", null, - React.createElement(ArticleBlocks, { + createElement(ArticleBlocks, { blocks: gdoc.content.body, }) ) diff --git a/baker/countryProfiles.tsx b/baker/countryProfiles.tsx index 358b762606..946d9699fb 100644 --- a/baker/countryProfiles.tsx +++ b/baker/countryProfiles.tsx @@ -1,4 +1,3 @@ -import React from "react" import * as db from "../db/db.js" import { CountriesIndexPage } from "../site/CountriesIndexPage.js" import { diff --git a/baker/formatWordpressPost.tsx b/baker/formatWordpressPost.tsx index de045d7cf5..40b6621e39 100644 --- a/baker/formatWordpressPost.tsx +++ b/baker/formatWordpressPost.tsx @@ -1,6 +1,5 @@ import cheerio from "cheerio" import urlSlug from "url-slug" -import React from "react" import ReactDOMServer from "react-dom/server.js" import { HTTPS_ONLY } from "../settings/serverSettings.js" import { GrapherExports } from "../baker/GrapherBakingUtils.js" diff --git a/baker/siteRenderers.tsx b/baker/siteRenderers.tsx index de8bd8deaa..f2df79ef18 100644 --- a/baker/siteRenderers.tsx +++ b/baker/siteRenderers.tsx @@ -10,7 +10,6 @@ import { ExplorerIndexPage } from "../site/ExplorerIndexPage.js" import { ThankYouPage } from "../site/ThankYouPage.js" import TombstonePage from "../site/TombstonePage.js" import OwidGdocPage from "../site/gdocs/OwidGdocPage.js" -import React from "react" import ReactDOMServer from "react-dom/server.js" import * as lodash from "lodash" import { formatCountryProfile, isCanonicalInternalUrl } from "./formatting.js" diff --git a/explorerAdminClient/ExplorerCreatePage.jsdom.test.tsx b/explorerAdminClient/ExplorerCreatePage.jsdom.test.tsx index 686a9c91ba..21fdb3cbb5 100755 --- a/explorerAdminClient/ExplorerCreatePage.jsdom.test.tsx +++ b/explorerAdminClient/ExplorerCreatePage.jsdom.test.tsx @@ -1,7 +1,4 @@ -#! /usr/bin/env jest - -import React from "react" -import { ExplorerCreatePage } from "./ExplorerCreatePage.js" +#! /usr/bin/env jestimport { ExplorerCreatePage } from "./ExplorerCreatePage.js" import Enzyme from "enzyme" import Adapter from "@wojtekmaj/enzyme-adapter-react-17" diff --git a/explorerAdminClient/ExplorerCreatePage.tsx b/explorerAdminClient/ExplorerCreatePage.tsx index 96ff261a1a..73fb57da87 100644 --- a/explorerAdminClient/ExplorerCreatePage.tsx +++ b/explorerAdminClient/ExplorerCreatePage.tsx @@ -11,7 +11,7 @@ import Handsontable from "handsontable" import { registerAllModules } from "handsontable/registry" import { action, computed, observable } from "mobx" import { observer } from "mobx-react" -import React from "react" +import { Component, createRef } from "react" import { Prompt } from "react-router-dom" import { DefaultNewExplorerSlug, @@ -39,7 +39,7 @@ const RESERVED_NAMES = [DefaultNewExplorerSlug, "index", "new", "create"] // don registerAllModules() @observer -export class ExplorerCreatePage extends React.Component<{ +export class ExplorerCreatePage extends Component<{ slug: string gitCmsBranchName: string manager?: AdminManager @@ -325,12 +325,12 @@ export class ExplorerCreatePage extends React.Component<{ } } -class HotEditor extends React.Component<{ +class HotEditor extends Component<{ onChange: (code: string) => void program: ExplorerProgram programOnDisk: ExplorerProgram }> { - private hotTableComponent = React.createRef() + private hotTableComponent = createRef() @computed private get program() { return this.props.program @@ -467,7 +467,7 @@ class HotEditor extends React.Component<{ } } -class PictureInPicture extends React.Component<{ +class PictureInPicture extends Component<{ previewLink: string }> { render() { @@ -480,7 +480,7 @@ class PictureInPicture extends React.Component<{ } } -class TemplatesComponent extends React.Component<{ +class TemplatesComponent extends Component<{ isNewFile: boolean onChange: (code: string) => void }> { diff --git a/explorerAdminClient/ExplorersListPage.tsx b/explorerAdminClient/ExplorersListPage.tsx index 225995eb94..d4e1b079c6 100644 --- a/explorerAdminClient/ExplorersListPage.tsx +++ b/explorerAdminClient/ExplorersListPage.tsx @@ -14,7 +14,7 @@ import { runInAction, } from "mobx" import { observer } from "mobx-react" -import React from "react" +import { Component } from "react" import { DefaultNewExplorerSlug, ExplorersRouteResponse, @@ -35,7 +35,7 @@ import { BAKED_BASE_URL } from "../settings/clientSettings.js" import { AdminManager } from "./AdminManager.js" @observer -class ExplorerRow extends React.Component<{ +class ExplorerRow extends Component<{ explorer: ExplorerProgram indexPage: ExplorersIndexPage gitCmsBranchName: string @@ -148,7 +148,7 @@ class ExplorerRow extends React.Component<{ } @observer -class ExplorerList extends React.Component<{ +class ExplorerList extends Component<{ explorers: ExplorerProgram[] searchHighlight?: (text: string) => any indexPage: ExplorersIndexPage @@ -185,7 +185,7 @@ class ExplorerList extends React.Component<{ } @observer -export class ExplorersIndexPage extends React.Component<{ +export class ExplorersIndexPage extends Component<{ manager?: AdminManager }> { @observable explorers: ExplorerProgram[] = [] diff --git a/packages/@ourworldindata/components/src/Button/Button.tsx b/packages/@ourworldindata/components/src/Button/Button.tsx index ee31c82545..aaf4213483 100644 --- a/packages/@ourworldindata/components/src/Button/Button.tsx +++ b/packages/@ourworldindata/components/src/Button/Button.tsx @@ -1,4 +1,3 @@ -import React from "react" import cx from "classnames" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { IconDefinition, faArrowRight } from "@fortawesome/free-solid-svg-icons" diff --git a/packages/@ourworldindata/components/src/Checkbox.tsx b/packages/@ourworldindata/components/src/Checkbox.tsx index d3af557fde..787fd8b4a8 100644 --- a/packages/@ourworldindata/components/src/Checkbox.tsx +++ b/packages/@ourworldindata/components/src/Checkbox.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faCheck } from "@fortawesome/free-solid-svg-icons" diff --git a/packages/@ourworldindata/components/src/CodeSnippet/CodeSnippet.stories.tsx b/packages/@ourworldindata/components/src/CodeSnippet/CodeSnippet.stories.tsx index 68275f415b..79b74cb16b 100644 --- a/packages/@ourworldindata/components/src/CodeSnippet/CodeSnippet.stories.tsx +++ b/packages/@ourworldindata/components/src/CodeSnippet/CodeSnippet.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { CodeSnippet } from "./CodeSnippet.js" export default { diff --git a/packages/@ourworldindata/components/src/CodeSnippet/CodeSnippet.tsx b/packages/@ourworldindata/components/src/CodeSnippet/CodeSnippet.tsx index 50a97ff17e..bbd26e0c25 100644 --- a/packages/@ourworldindata/components/src/CodeSnippet/CodeSnippet.tsx +++ b/packages/@ourworldindata/components/src/CodeSnippet/CodeSnippet.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react" +import { useEffect, useState } from "react" import ReactDOM from "react-dom" import ReactDOMServer from "react-dom/server.js" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" diff --git a/packages/@ourworldindata/components/src/DataCitation/DataCitation.tsx b/packages/@ourworldindata/components/src/DataCitation/DataCitation.tsx index 055f7015ad..5931346197 100644 --- a/packages/@ourworldindata/components/src/DataCitation/DataCitation.tsx +++ b/packages/@ourworldindata/components/src/DataCitation/DataCitation.tsx @@ -1,4 +1,3 @@ -import React from "react" import { CodeSnippet } from "../CodeSnippet/CodeSnippet.js" export const DataCitation = (props: { diff --git a/packages/@ourworldindata/components/src/ExpandableToggle/ExpandableToggle.tsx b/packages/@ourworldindata/components/src/ExpandableToggle/ExpandableToggle.tsx index fde1c3bc1c..f6d63fabf5 100644 --- a/packages/@ourworldindata/components/src/ExpandableToggle/ExpandableToggle.tsx +++ b/packages/@ourworldindata/components/src/ExpandableToggle/ExpandableToggle.tsx @@ -1,6 +1,7 @@ import { faMinus, faPlus } from "@fortawesome/free-solid-svg-icons" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" -import React, { useState } from "react" +import { useState } from "react" +import * as React from "react" import cx from "classnames" export const ExpandableToggle = ({ diff --git a/packages/@ourworldindata/components/src/Halo/Halo.tsx b/packages/@ourworldindata/components/src/Halo/Halo.tsx index 6732a911d0..92a42cf73c 100644 --- a/packages/@ourworldindata/components/src/Halo/Halo.tsx +++ b/packages/@ourworldindata/components/src/Halo/Halo.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Color } from "@ourworldindata/types" const defaultHaloStyle: React.CSSProperties = { diff --git a/packages/@ourworldindata/components/src/IndicatorKeyData/IndicatorKeyData.tsx b/packages/@ourworldindata/components/src/IndicatorKeyData/IndicatorKeyData.tsx index a04d4d8604..9f308e195a 100644 --- a/packages/@ourworldindata/components/src/IndicatorKeyData/IndicatorKeyData.tsx +++ b/packages/@ourworldindata/components/src/IndicatorKeyData/IndicatorKeyData.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { OwidProcessingLevel, getPhraseForProcessingLevel, diff --git a/packages/@ourworldindata/components/src/IndicatorProcessing/IndicatorProcessing.tsx b/packages/@ourworldindata/components/src/IndicatorProcessing/IndicatorProcessing.tsx index 7ddf380185..e110148ced 100644 --- a/packages/@ourworldindata/components/src/IndicatorProcessing/IndicatorProcessing.tsx +++ b/packages/@ourworldindata/components/src/IndicatorProcessing/IndicatorProcessing.tsx @@ -1,4 +1,3 @@ -import React from "react" import { SimpleMarkdownText } from "../SimpleMarkdownText.js" import { faArrowDown } from "@fortawesome/free-solid-svg-icons" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" diff --git a/packages/@ourworldindata/components/src/IndicatorSources/IndicatorSources.tsx b/packages/@ourworldindata/components/src/IndicatorSources/IndicatorSources.tsx index c632cf301d..2df7948de9 100644 --- a/packages/@ourworldindata/components/src/IndicatorSources/IndicatorSources.tsx +++ b/packages/@ourworldindata/components/src/IndicatorSources/IndicatorSources.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import cx from "classnames" import { ExpandableToggle } from "../ExpandableToggle/ExpandableToggle.js" import { DisplaySource, uniqBy, formatSourceDate } from "@ourworldindata/utils" diff --git a/packages/@ourworldindata/components/src/LabeledSwitch/LabeledSwitch.tsx b/packages/@ourworldindata/components/src/LabeledSwitch/LabeledSwitch.tsx index 4a65531fe7..bad6ed0ef7 100644 --- a/packages/@ourworldindata/components/src/LabeledSwitch/LabeledSwitch.tsx +++ b/packages/@ourworldindata/components/src/LabeledSwitch/LabeledSwitch.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faInfoCircle } from "@fortawesome/free-solid-svg-icons" diff --git a/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.stories.tsx b/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.stories.tsx index 5f9755c56f..de160e284e 100644 --- a/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.stories.tsx +++ b/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.stories.tsx @@ -1,4 +1,5 @@ -import React, { createRef } from "react" +import { createRef } from "react" +import * as React from "react" import { action, computed, observable } from "mobx" import { observer } from "mobx-react" import { diff --git a/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.tsx b/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.tsx index 1baff419ea..494e67e4a0 100644 --- a/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.tsx +++ b/packages/@ourworldindata/components/src/MarkdownTextWrap/MarkdownTextWrap.tsx @@ -1,4 +1,5 @@ -import React, { CSSProperties } from "react" +import { CSSProperties } from "react" +import * as React from "react" import { computed } from "mobx" import { excludeUndefined, diff --git a/packages/@ourworldindata/components/src/OverlayHeader.tsx b/packages/@ourworldindata/components/src/OverlayHeader.tsx index 2a9ec83750..f81fc15c40 100644 --- a/packages/@ourworldindata/components/src/OverlayHeader.tsx +++ b/packages/@ourworldindata/components/src/OverlayHeader.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import cx from "classnames" import { CloseButton } from "./closeButton/CloseButton.js" diff --git a/packages/@ourworldindata/components/src/RadioButton.tsx b/packages/@ourworldindata/components/src/RadioButton.tsx index 638559ae47..94e1dc934a 100644 --- a/packages/@ourworldindata/components/src/RadioButton.tsx +++ b/packages/@ourworldindata/components/src/RadioButton.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" export class RadioButton extends React.Component<{ checked: boolean diff --git a/packages/@ourworldindata/components/src/SimpleMarkdownText.tsx b/packages/@ourworldindata/components/src/SimpleMarkdownText.tsx index b36a879b91..8c92eb0b78 100644 --- a/packages/@ourworldindata/components/src/SimpleMarkdownText.tsx +++ b/packages/@ourworldindata/components/src/SimpleMarkdownText.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { Remark, useRemarkSync, UseRemarkSyncOptions } from "react-remark" import { remarkPlainLinks } from "./markdown/remarkPlainLinks.js" diff --git a/packages/@ourworldindata/components/src/TextWrap/TextWrap.stories.tsx b/packages/@ourworldindata/components/src/TextWrap/TextWrap.stories.tsx index 369959ec64..33ec426984 100644 --- a/packages/@ourworldindata/components/src/TextWrap/TextWrap.stories.tsx +++ b/packages/@ourworldindata/components/src/TextWrap/TextWrap.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { TextWrap } from "./TextWrap" diff --git a/packages/@ourworldindata/components/src/TextWrap/TextWrap.tsx b/packages/@ourworldindata/components/src/TextWrap/TextWrap.tsx index 87ba9eddfe..7912d62acc 100644 --- a/packages/@ourworldindata/components/src/TextWrap/TextWrap.tsx +++ b/packages/@ourworldindata/components/src/TextWrap/TextWrap.tsx @@ -1,6 +1,6 @@ import { max, stripHTML, Bounds, FontFamily, last } from "@ourworldindata/utils" import { computed } from "mobx" -import React from "react" +import * as React from "react" import { Fragment, joinFragments, splitIntoFragments } from "./TextWrapUtils" declare type FontSize = number diff --git a/packages/@ourworldindata/components/src/TextWrap/TextWrapGroup.tsx b/packages/@ourworldindata/components/src/TextWrap/TextWrapGroup.tsx index 05a4f16eda..d540132ed7 100644 --- a/packages/@ourworldindata/components/src/TextWrap/TextWrapGroup.tsx +++ b/packages/@ourworldindata/components/src/TextWrap/TextWrapGroup.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { TextWrap } from "./TextWrap" import { splitIntoFragments } from "./TextWrapUtils" diff --git a/packages/@ourworldindata/components/src/closeButton/CloseButton.tsx b/packages/@ourworldindata/components/src/closeButton/CloseButton.tsx index d8be4ca885..45a1894697 100644 --- a/packages/@ourworldindata/components/src/closeButton/CloseButton.tsx +++ b/packages/@ourworldindata/components/src/closeButton/CloseButton.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import cx from "classnames" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faXmark } from "@fortawesome/free-solid-svg-icons" diff --git a/packages/@ourworldindata/explorer/src/Explorer.sample.tsx b/packages/@ourworldindata/explorer/src/Explorer.sample.tsx index 53cb8bff93..7c90092016 100644 --- a/packages/@ourworldindata/explorer/src/Explorer.sample.tsx +++ b/packages/@ourworldindata/explorer/src/Explorer.sample.tsx @@ -1,4 +1,3 @@ -import React from "react" import { DimensionProperty } from "@ourworldindata/utils" import { GRAPHER_TAB_OPTIONS } from "@ourworldindata/types" import { GrapherProgrammaticInterface } from "@ourworldindata/grapher" diff --git a/packages/@ourworldindata/explorer/src/ExplorerControls.jsdom.test.tsx b/packages/@ourworldindata/explorer/src/ExplorerControls.jsdom.test.tsx index 8be4b11d13..19bfa65ae2 100755 --- a/packages/@ourworldindata/explorer/src/ExplorerControls.jsdom.test.tsx +++ b/packages/@ourworldindata/explorer/src/ExplorerControls.jsdom.test.tsx @@ -1,7 +1,4 @@ -#! /usr/bin/env jest - -import React from "react" -import { ExplorerControlType } from "./ExplorerConstants.js" +#! /usr/bin/env jestimport { ExplorerControlType } from "./ExplorerConstants.js" import { ExplorerControlPanel } from "./ExplorerControls.js" import Enzyme from "enzyme" diff --git a/packages/@ourworldindata/explorer/src/ExplorerControls.tsx b/packages/@ourworldindata/explorer/src/ExplorerControls.tsx index f1d8b5016a..1e76b270cd 100644 --- a/packages/@ourworldindata/explorer/src/ExplorerControls.tsx +++ b/packages/@ourworldindata/explorer/src/ExplorerControls.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { observer } from "mobx-react" import { action, computed } from "mobx" import Select, { components, SingleValueProps } from "react-select" @@ -17,7 +17,7 @@ const SELECTED_OPTION_CLASS = "SelectedOption" const EXPLORER_DROPDOWN_CLASS = "ExplorerDropdown" const HIDDEN_CONTROL_HEADER_CLASS = "HiddenControlHeader" -export class ExplorerControlBar extends React.Component<{ +export class ExplorerControlBar extends Component<{ isMobile?: boolean showControls?: boolean closeControls?: () => void @@ -105,7 +105,7 @@ const ExplorerDropdown = (props: { } @observer -export class ExplorerControlPanel extends React.Component<{ +export class ExplorerControlPanel extends Component<{ choice: ExplorerChoice explorerSlug?: string onChange?: (value: string) => void diff --git a/packages/@ourworldindata/grapher/src/axis/AxisViews.jsdom.test.tsx b/packages/@ourworldindata/grapher/src/axis/AxisViews.jsdom.test.tsx index a6eda45a4b..bb6ac66a29 100755 --- a/packages/@ourworldindata/grapher/src/axis/AxisViews.jsdom.test.tsx +++ b/packages/@ourworldindata/grapher/src/axis/AxisViews.jsdom.test.tsx @@ -1,8 +1,5 @@ -#! /usr/bin/env jest - -import { AxisConfig } from "./AxisConfig" +#! /usr/bin/env jestimport { AxisConfig } from "./AxisConfig" import { DualAxisComponent, HorizontalAxisGridLines } from "./AxisViews" -import React from "react" import { ScaleType } from "@ourworldindata/types" import { DualAxis } from "./Axis" diff --git a/packages/@ourworldindata/grapher/src/axis/AxisViews.tsx b/packages/@ourworldindata/grapher/src/axis/AxisViews.tsx index bd4c533dc9..362cd2153c 100644 --- a/packages/@ourworldindata/grapher/src/axis/AxisViews.tsx +++ b/packages/@ourworldindata/grapher/src/axis/AxisViews.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { observer } from "mobx-react" import { diff --git a/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.stories.tsx b/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.stories.tsx index 577196e387..5ba2e1b35c 100644 --- a/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/barCharts/DiscreteBarChart.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { DiscreteBarChart } from "./DiscreteBarChart" import { SampleColumnSlugs, diff --git a/packages/@ourworldindata/grapher/src/bodyDiv/BodyDiv.tsx b/packages/@ourworldindata/grapher/src/bodyDiv/BodyDiv.tsx index f7445d9844..b2101e0afd 100644 --- a/packages/@ourworldindata/grapher/src/bodyDiv/BodyDiv.tsx +++ b/packages/@ourworldindata/grapher/src/bodyDiv/BodyDiv.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import ReactDOM from "react-dom" interface BodyDivProps { diff --git a/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.stories.tsx b/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.stories.tsx index 830ed48469..1cc2db9e3f 100644 --- a/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.stories.tsx @@ -6,7 +6,7 @@ import { SeriesStrategy, } from "@ourworldindata/types" import { DEFAULT_BOUNDS } from "@ourworldindata/utils" -import React from "react" +import * as React from "react" import { CaptionedChart, CaptionedChartManager, diff --git a/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.tsx b/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.tsx index babbce9753..b7fc5140dd 100644 --- a/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.tsx +++ b/packages/@ourworldindata/grapher/src/captionedChart/CaptionedChart.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { observer } from "mobx-react" import { diff --git a/packages/@ourworldindata/grapher/src/captionedChart/Logos.tsx b/packages/@ourworldindata/grapher/src/captionedChart/Logos.tsx index 2d5273fc4d..ff8c3acc64 100644 --- a/packages/@ourworldindata/grapher/src/captionedChart/Logos.tsx +++ b/packages/@ourworldindata/grapher/src/captionedChart/Logos.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { OWID_LOGO_SVG, diff --git a/packages/@ourworldindata/grapher/src/chart/ChartManager.ts b/packages/@ourworldindata/grapher/src/chart/ChartManager.ts index 630db5820e..3173fc20b6 100644 --- a/packages/@ourworldindata/grapher/src/chart/ChartManager.ts +++ b/packages/@ourworldindata/grapher/src/chart/ChartManager.ts @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { EntitySelectionMode, FacetStrategy, diff --git a/packages/@ourworldindata/grapher/src/chart/ChartTypeSwitcher.tsx b/packages/@ourworldindata/grapher/src/chart/ChartTypeSwitcher.tsx index 0e1886d7a8..7ba3da16b3 100644 --- a/packages/@ourworldindata/grapher/src/chart/ChartTypeSwitcher.tsx +++ b/packages/@ourworldindata/grapher/src/chart/ChartTypeSwitcher.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { ALL_GRAPHER_CHART_TYPES, GrapherChartType, diff --git a/packages/@ourworldindata/grapher/src/chart/ChartUtils.tsx b/packages/@ourworldindata/grapher/src/chart/ChartUtils.tsx index 08810daa58..36357a0c80 100644 --- a/packages/@ourworldindata/grapher/src/chart/ChartUtils.tsx +++ b/packages/@ourworldindata/grapher/src/chart/ChartUtils.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { areSetsEqual, Box, getCountryByName } from "@ourworldindata/utils" import { SeriesStrategy, diff --git a/packages/@ourworldindata/grapher/src/controls/ActionButtons.tsx b/packages/@ourworldindata/grapher/src/controls/ActionButtons.tsx index 4b81087e96..dadc693d30 100644 --- a/packages/@ourworldindata/grapher/src/controls/ActionButtons.tsx +++ b/packages/@ourworldindata/grapher/src/controls/ActionButtons.tsx @@ -1,4 +1,5 @@ -import React, { useState } from "react" +import { useState } from "react" +import * as React from "react" import { computed, action } from "mobx" import { observer } from "mobx-react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" diff --git a/packages/@ourworldindata/grapher/src/controls/ChartIcons.tsx b/packages/@ourworldindata/grapher/src/controls/ChartIcons.tsx index 6ca49c648f..aa653dd953 100644 --- a/packages/@ourworldindata/grapher/src/controls/ChartIcons.tsx +++ b/packages/@ourworldindata/grapher/src/controls/ChartIcons.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faChartBar, diff --git a/packages/@ourworldindata/grapher/src/controls/CommandPalette.stories.tsx b/packages/@ourworldindata/grapher/src/controls/CommandPalette.stories.tsx index 7a5dfbb695..59b4698b01 100644 --- a/packages/@ourworldindata/grapher/src/controls/CommandPalette.stories.tsx +++ b/packages/@ourworldindata/grapher/src/controls/CommandPalette.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { CommandPalette, Command } from "../controls/CommandPalette" export default { diff --git a/packages/@ourworldindata/grapher/src/controls/CommandPalette.tsx b/packages/@ourworldindata/grapher/src/controls/CommandPalette.tsx index f2c39b1218..8bf3363178 100644 --- a/packages/@ourworldindata/grapher/src/controls/CommandPalette.tsx +++ b/packages/@ourworldindata/grapher/src/controls/CommandPalette.tsx @@ -1,7 +1,7 @@ import { BodyDiv } from "../bodyDiv/BodyDiv" import { sortBy } from "@ourworldindata/utils" import { observer } from "mobx-react" -import React from "react" +import * as React from "react" declare type keyboardCombo = string diff --git a/packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx b/packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx index 848f434051..78ed5aa34a 100644 --- a/packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx +++ b/packages/@ourworldindata/grapher/src/controls/ContentSwitchers.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { action, computed } from "mobx" import { observer } from "mobx-react" import classnames from "classnames" diff --git a/packages/@ourworldindata/grapher/src/controls/Dropdown.tsx b/packages/@ourworldindata/grapher/src/controls/Dropdown.tsx index 445e1b237f..3ec4867cd5 100644 --- a/packages/@ourworldindata/grapher/src/controls/Dropdown.tsx +++ b/packages/@ourworldindata/grapher/src/controls/Dropdown.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import Select, { Props } from "react-select" import cx from "classnames" diff --git a/packages/@ourworldindata/grapher/src/controls/EntitySelectionToggle.tsx b/packages/@ourworldindata/grapher/src/controls/EntitySelectionToggle.tsx index efff60da4e..23d80f5d59 100644 --- a/packages/@ourworldindata/grapher/src/controls/EntitySelectionToggle.tsx +++ b/packages/@ourworldindata/grapher/src/controls/EntitySelectionToggle.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { observer } from "mobx-react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" diff --git a/packages/@ourworldindata/grapher/src/controls/MapProjectionMenu.tsx b/packages/@ourworldindata/grapher/src/controls/MapProjectionMenu.tsx index 5b7621e73d..eabe02d0d7 100644 --- a/packages/@ourworldindata/grapher/src/controls/MapProjectionMenu.tsx +++ b/packages/@ourworldindata/grapher/src/controls/MapProjectionMenu.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed, action } from "mobx" import { observer } from "mobx-react" import { MapConfig } from "../mapCharts/MapConfig" diff --git a/packages/@ourworldindata/grapher/src/controls/SettingsMenu.tsx b/packages/@ourworldindata/grapher/src/controls/SettingsMenu.tsx index 961863e4d6..b1d5dca342 100644 --- a/packages/@ourworldindata/grapher/src/controls/SettingsMenu.tsx +++ b/packages/@ourworldindata/grapher/src/controls/SettingsMenu.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed, action, observable } from "mobx" import { observer } from "mobx-react" import classnames from "classnames" diff --git a/packages/@ourworldindata/grapher/src/controls/ShareMenu.tsx b/packages/@ourworldindata/grapher/src/controls/ShareMenu.tsx index 46cf518d4a..c99e0a6e2e 100644 --- a/packages/@ourworldindata/grapher/src/controls/ShareMenu.tsx +++ b/packages/@ourworldindata/grapher/src/controls/ShareMenu.tsx @@ -1,5 +1,5 @@ import { observer } from "mobx-react" -import React from "react" +import * as React from "react" import { computed, action } from "mobx" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faXTwitter, faFacebook } from "@fortawesome/free-brands-svg-icons" diff --git a/packages/@ourworldindata/grapher/src/controls/SortIcon.tsx b/packages/@ourworldindata/grapher/src/controls/SortIcon.tsx index c17d1d2ae4..e08865f987 100644 --- a/packages/@ourworldindata/grapher/src/controls/SortIcon.tsx +++ b/packages/@ourworldindata/grapher/src/controls/SortIcon.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import classnames from "classnames" import { IconDefinition } from "@fortawesome/fontawesome-svg-core/index" import { diff --git a/packages/@ourworldindata/grapher/src/controls/VerticalScrollContainer.tsx b/packages/@ourworldindata/grapher/src/controls/VerticalScrollContainer.tsx index 4b3c05f390..d561aa86a3 100644 --- a/packages/@ourworldindata/grapher/src/controls/VerticalScrollContainer.tsx +++ b/packages/@ourworldindata/grapher/src/controls/VerticalScrollContainer.tsx @@ -1,5 +1,7 @@ /* eslint-disable react/prop-types */ -import React, { useEffect, useState } from "react" +import { useEffect, useState } from "react" + +import * as React from "react" import classnames from "classnames" type VerticalScrollContainerProps = React.DetailedHTMLProps< diff --git a/packages/@ourworldindata/grapher/src/controls/controlsRow/ControlsRow.tsx b/packages/@ourworldindata/grapher/src/controls/controlsRow/ControlsRow.tsx index 740acec567..f621c4a941 100644 --- a/packages/@ourworldindata/grapher/src/controls/controlsRow/ControlsRow.tsx +++ b/packages/@ourworldindata/grapher/src/controls/controlsRow/ControlsRow.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Component } from "react" import { computed } from "mobx" import { observer } from "mobx-react" @@ -29,7 +29,7 @@ export interface ControlsRowManager } @observer -export class ControlsRow extends React.Component<{ +export class ControlsRow extends Component<{ manager: ControlsRowManager maxWidth?: number settingsMenuTop?: number diff --git a/packages/@ourworldindata/grapher/src/controls/entityPicker/EntityPicker.tsx b/packages/@ourworldindata/grapher/src/controls/entityPicker/EntityPicker.tsx index 0f8a7fae88..f7c4dfc93e 100644 --- a/packages/@ourworldindata/grapher/src/controls/entityPicker/EntityPicker.tsx +++ b/packages/@ourworldindata/grapher/src/controls/entityPicker/EntityPicker.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { action, computed, observable, runInAction, reaction } from "mobx" import { observer } from "mobx-react" import { Flipper, Flipped } from "react-flip-toolkit" diff --git a/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.jsdom.test.tsx b/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.jsdom.test.tsx index 76c2e22b52..bdadf0d6e0 100644 --- a/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.jsdom.test.tsx +++ b/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.jsdom.test.tsx @@ -1,8 +1,4 @@ -#! /usr/bin/env jest - -import React from "react" - -import Enzyme from "enzyme" +#! /usr/bin/env jestimport Enzyme from "enzyme" import Adapter from "@wojtekmaj/enzyme-adapter-react-17" import { GlobalEntitySelector } from "./GlobalEntitySelector" import { SelectionArray } from "../../selection/SelectionArray" diff --git a/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.stories.tsx b/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.stories.tsx index b658ec4c11..face91d2ee 100644 --- a/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.stories.tsx +++ b/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { SelectionArray } from "../../selection/SelectionArray" import { GlobalEntitySelector } from "./GlobalEntitySelector" diff --git a/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.tsx b/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.tsx index 9075c55762..cf8a28c7b6 100644 --- a/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.tsx +++ b/packages/@ourworldindata/grapher/src/controls/globalEntitySelector/GlobalEntitySelector.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import ReactDOM from "react-dom" import { action, observable, IReactionDisposer, reaction, computed } from "mobx" import { observer } from "mobx-react" diff --git a/packages/@ourworldindata/grapher/src/controls/settings/AbsRelToggle.tsx b/packages/@ourworldindata/grapher/src/controls/settings/AbsRelToggle.tsx index d24ce59e35..55ad25476d 100644 --- a/packages/@ourworldindata/grapher/src/controls/settings/AbsRelToggle.tsx +++ b/packages/@ourworldindata/grapher/src/controls/settings/AbsRelToggle.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed, action } from "mobx" import { observer } from "mobx-react" import { diff --git a/packages/@ourworldindata/grapher/src/controls/settings/AxisScaleToggle.tsx b/packages/@ourworldindata/grapher/src/controls/settings/AxisScaleToggle.tsx index 0821960163..8afe6e2379 100644 --- a/packages/@ourworldindata/grapher/src/controls/settings/AxisScaleToggle.tsx +++ b/packages/@ourworldindata/grapher/src/controls/settings/AxisScaleToggle.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { action } from "mobx" import { observer } from "mobx-react" import { ScaleType } from "@ourworldindata/types" diff --git a/packages/@ourworldindata/grapher/src/controls/settings/FacetStrategySelector.tsx b/packages/@ourworldindata/grapher/src/controls/settings/FacetStrategySelector.tsx index a96e11782e..a6d9c97973 100644 --- a/packages/@ourworldindata/grapher/src/controls/settings/FacetStrategySelector.tsx +++ b/packages/@ourworldindata/grapher/src/controls/settings/FacetStrategySelector.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { observer } from "mobx-react" import { DEFAULT_GRAPHER_ENTITY_TYPE } from "../../core/GrapherConstants" diff --git a/packages/@ourworldindata/grapher/src/controls/settings/FacetYDomainToggle.tsx b/packages/@ourworldindata/grapher/src/controls/settings/FacetYDomainToggle.tsx index 359fb224b2..d8cc3ef872 100644 --- a/packages/@ourworldindata/grapher/src/controls/settings/FacetYDomainToggle.tsx +++ b/packages/@ourworldindata/grapher/src/controls/settings/FacetYDomainToggle.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed, action } from "mobx" import { observer } from "mobx-react" import { FacetAxisDomain, FacetStrategy } from "@ourworldindata/types" diff --git a/packages/@ourworldindata/grapher/src/controls/settings/NoDataAreaToggle.tsx b/packages/@ourworldindata/grapher/src/controls/settings/NoDataAreaToggle.tsx index 2c0af0baba..0b58e8e0ca 100644 --- a/packages/@ourworldindata/grapher/src/controls/settings/NoDataAreaToggle.tsx +++ b/packages/@ourworldindata/grapher/src/controls/settings/NoDataAreaToggle.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed, action } from "mobx" import { observer } from "mobx-react" import { LabeledSwitch } from "@ourworldindata/components" diff --git a/packages/@ourworldindata/grapher/src/controls/settings/TableFilterToggle.tsx b/packages/@ourworldindata/grapher/src/controls/settings/TableFilterToggle.tsx index d0aefe432f..c3c96c1136 100644 --- a/packages/@ourworldindata/grapher/src/controls/settings/TableFilterToggle.tsx +++ b/packages/@ourworldindata/grapher/src/controls/settings/TableFilterToggle.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { action, computed } from "mobx" import { observer } from "mobx-react" import { DEFAULT_GRAPHER_ENTITY_TYPE_PLURAL } from "../../core/GrapherConstants" diff --git a/packages/@ourworldindata/grapher/src/controls/settings/ZoomToggle.tsx b/packages/@ourworldindata/grapher/src/controls/settings/ZoomToggle.tsx index cbbaf5871b..0c0d40bdd6 100644 --- a/packages/@ourworldindata/grapher/src/controls/settings/ZoomToggle.tsx +++ b/packages/@ourworldindata/grapher/src/controls/settings/ZoomToggle.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { action } from "mobx" import { observer } from "mobx-react" import { LabeledSwitch } from "@ourworldindata/components" diff --git a/packages/@ourworldindata/grapher/src/core/Grapher.stories.tsx b/packages/@ourworldindata/grapher/src/core/Grapher.stories.tsx index e7b31d2b84..88836052b2 100644 --- a/packages/@ourworldindata/grapher/src/core/Grapher.stories.tsx +++ b/packages/@ourworldindata/grapher/src/core/Grapher.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Grapher, GrapherProgrammaticInterface } from "./Grapher" import { SampleColumnSlugs, diff --git a/packages/@ourworldindata/grapher/src/dataTable/DataTable.jsdom.test.tsx b/packages/@ourworldindata/grapher/src/dataTable/DataTable.jsdom.test.tsx index de5bcd27e3..322192eb7b 100755 --- a/packages/@ourworldindata/grapher/src/dataTable/DataTable.jsdom.test.tsx +++ b/packages/@ourworldindata/grapher/src/dataTable/DataTable.jsdom.test.tsx @@ -1,8 +1,4 @@ -#! /usr/bin/env jest - -import React from "react" - -import { DataTable } from "./DataTable" +#! /usr/bin/env jestimport { DataTable } from "./DataTable" import { GRAPHER_CHART_TYPES, GRAPHER_TAB_OPTIONS } from "@ourworldindata/types" import { childMortalityGrapher, diff --git a/packages/@ourworldindata/grapher/src/dataTable/DataTable.stories.tsx b/packages/@ourworldindata/grapher/src/dataTable/DataTable.stories.tsx index 495e3140c5..5ad59d8828 100644 --- a/packages/@ourworldindata/grapher/src/dataTable/DataTable.stories.tsx +++ b/packages/@ourworldindata/grapher/src/dataTable/DataTable.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { DataTable, DataTableManager } from "./DataTable" import { SynthesizeGDPTable } from "@ourworldindata/core-table" import { GRAPHER_CHART_TYPES, GRAPHER_TAB_OPTIONS } from "@ourworldindata/types" diff --git a/packages/@ourworldindata/grapher/src/dataTable/DataTable.tsx b/packages/@ourworldindata/grapher/src/dataTable/DataTable.tsx index 3e1af11460..f7113ced87 100644 --- a/packages/@ourworldindata/grapher/src/dataTable/DataTable.tsx +++ b/packages/@ourworldindata/grapher/src/dataTable/DataTable.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed, observable, action } from "mobx" import { observer } from "mobx-react" import classnames from "classnames" diff --git a/packages/@ourworldindata/grapher/src/entitySelector/EntitySelector.tsx b/packages/@ourworldindata/grapher/src/entitySelector/EntitySelector.tsx index 3d547020bb..6aa4875123 100644 --- a/packages/@ourworldindata/grapher/src/entitySelector/EntitySelector.tsx +++ b/packages/@ourworldindata/grapher/src/entitySelector/EntitySelector.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { computed, action, reaction } from "mobx" import cx from "classnames" diff --git a/packages/@ourworldindata/grapher/src/facetChart/FacetChart.stories.tsx b/packages/@ourworldindata/grapher/src/facetChart/FacetChart.stories.tsx index 1bc6a3243b..b5e883f499 100644 --- a/packages/@ourworldindata/grapher/src/facetChart/FacetChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/facetChart/FacetChart.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { FacetChart } from "./FacetChart" import { SampleColumnSlugs, diff --git a/packages/@ourworldindata/grapher/src/footer/Footer.stories.tsx b/packages/@ourworldindata/grapher/src/footer/Footer.stories.tsx index 2fc97a9d33..db0aefc565 100644 --- a/packages/@ourworldindata/grapher/src/footer/Footer.stories.tsx +++ b/packages/@ourworldindata/grapher/src/footer/Footer.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Footer } from "../footer/Footer" import { FooterManager } from "./FooterManager" diff --git a/packages/@ourworldindata/grapher/src/footer/Footer.tsx b/packages/@ourworldindata/grapher/src/footer/Footer.tsx index b1a9807e2e..d2132d46b0 100644 --- a/packages/@ourworldindata/grapher/src/footer/Footer.tsx +++ b/packages/@ourworldindata/grapher/src/footer/Footer.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observable, computed, action } from "mobx" import { observer } from "mobx-react" import parseUrl from "url-parse" diff --git a/packages/@ourworldindata/grapher/src/fullScreen/FullScreen.tsx b/packages/@ourworldindata/grapher/src/fullScreen/FullScreen.tsx index 341d94474d..8acd8a6507 100644 --- a/packages/@ourworldindata/grapher/src/fullScreen/FullScreen.tsx +++ b/packages/@ourworldindata/grapher/src/fullScreen/FullScreen.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { action } from "mobx" import { observer } from "mobx-react" import { BodyDiv } from "../bodyDiv/BodyDiv" diff --git a/packages/@ourworldindata/grapher/src/header/Header.stories.tsx b/packages/@ourworldindata/grapher/src/header/Header.stories.tsx index 12e0c9b4a9..c9594f5781 100644 --- a/packages/@ourworldindata/grapher/src/header/Header.stories.tsx +++ b/packages/@ourworldindata/grapher/src/header/Header.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Header } from "./Header" import { HeaderManager } from "./HeaderManager" diff --git a/packages/@ourworldindata/grapher/src/header/Header.tsx b/packages/@ourworldindata/grapher/src/header/Header.tsx index 286198bc7a..f961a6d1b0 100644 --- a/packages/@ourworldindata/grapher/src/header/Header.tsx +++ b/packages/@ourworldindata/grapher/src/header/Header.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { DEFAULT_BOUNDS, range, diff --git a/packages/@ourworldindata/grapher/src/horizontalColorLegend/HorizontalColorLegends.tsx b/packages/@ourworldindata/grapher/src/horizontalColorLegend/HorizontalColorLegends.tsx index 37ed032586..31ad4e8050 100644 --- a/packages/@ourworldindata/grapher/src/horizontalColorLegend/HorizontalColorLegends.tsx +++ b/packages/@ourworldindata/grapher/src/horizontalColorLegend/HorizontalColorLegends.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { action, computed } from "mobx" import { observer } from "mobx-react" import { diff --git a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.stories.tsx b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.stories.tsx index 9ad72efc4f..f46badff80 100644 --- a/packages/@ourworldindata/grapher/src/lineCharts/LineChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/lineCharts/LineChart.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { LineChart } from "../lineCharts/LineChart" import { OwidTableSlugs, ScaleType } from "@ourworldindata/types" import { diff --git a/packages/@ourworldindata/grapher/src/lineLegend/LineLegend.stories.tsx b/packages/@ourworldindata/grapher/src/lineLegend/LineLegend.stories.tsx index f0d8628269..3b947697b6 100644 --- a/packages/@ourworldindata/grapher/src/lineLegend/LineLegend.stories.tsx +++ b/packages/@ourworldindata/grapher/src/lineLegend/LineLegend.stories.tsx @@ -1,6 +1,6 @@ import { DualAxis } from "../axis/Axis" import { AxisConfig } from "../axis/AxisConfig" -import React from "react" +import * as React from "react" import { LineLegend, LineLegendManager } from "./LineLegend" export default { diff --git a/packages/@ourworldindata/grapher/src/lineLegend/LineLegend.tsx b/packages/@ourworldindata/grapher/src/lineLegend/LineLegend.tsx index f36393b9e9..ed14c1c17d 100644 --- a/packages/@ourworldindata/grapher/src/lineLegend/LineLegend.tsx +++ b/packages/@ourworldindata/grapher/src/lineLegend/LineLegend.tsx @@ -1,5 +1,5 @@ // This implements the line labels that appear to the right of the lines/polygons in LineCharts/StackedAreas. -import React from "react" +import * as React from "react" import { Bounds, noop, diff --git a/packages/@ourworldindata/grapher/src/loadingIndicator/LoadingIndicator.stories.tsx b/packages/@ourworldindata/grapher/src/loadingIndicator/LoadingIndicator.stories.tsx index 3ba8766b4b..7b81590e5f 100644 --- a/packages/@ourworldindata/grapher/src/loadingIndicator/LoadingIndicator.stories.tsx +++ b/packages/@ourworldindata/grapher/src/loadingIndicator/LoadingIndicator.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { LoadingIndicator } from "./LoadingIndicator" export default { diff --git a/packages/@ourworldindata/grapher/src/loadingIndicator/LoadingIndicator.tsx b/packages/@ourworldindata/grapher/src/loadingIndicator/LoadingIndicator.tsx index 527ae3274c..6fb69ff665 100644 --- a/packages/@ourworldindata/grapher/src/loadingIndicator/LoadingIndicator.tsx +++ b/packages/@ourworldindata/grapher/src/loadingIndicator/LoadingIndicator.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Bounds } from "@ourworldindata/utils" const DEFAULT_COLOR = "#333" diff --git a/packages/@ourworldindata/grapher/src/mapCharts/MapChart.stories.tsx b/packages/@ourworldindata/grapher/src/mapCharts/MapChart.stories.tsx index c5c24bc159..c91a3b06e3 100644 --- a/packages/@ourworldindata/grapher/src/mapCharts/MapChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/mapCharts/MapChart.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { MapChart } from "./MapChart" import { SynthesizeGDPTable } from "@ourworldindata/core-table" diff --git a/packages/@ourworldindata/grapher/src/mapCharts/MapSparkline.tsx b/packages/@ourworldindata/grapher/src/mapCharts/MapSparkline.tsx index 72977920cd..bab838ac45 100644 --- a/packages/@ourworldindata/grapher/src/mapCharts/MapSparkline.tsx +++ b/packages/@ourworldindata/grapher/src/mapCharts/MapSparkline.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { observer } from "mobx-react" import { diff --git a/packages/@ourworldindata/grapher/src/mapCharts/MapTooltip.jsdom.test.tsx b/packages/@ourworldindata/grapher/src/mapCharts/MapTooltip.jsdom.test.tsx index 2344e68090..9b4dcfc244 100755 --- a/packages/@ourworldindata/grapher/src/mapCharts/MapTooltip.jsdom.test.tsx +++ b/packages/@ourworldindata/grapher/src/mapCharts/MapTooltip.jsdom.test.tsx @@ -1,7 +1,4 @@ -#! /usr/bin/env jest - -import React from "react" -import { Grapher } from "../core/Grapher" +#! /usr/bin/env jestimport { Grapher } from "../core/Grapher" import { legacyMapGrapher } from "./MapChart.sample" import Enzyme from "enzyme" diff --git a/packages/@ourworldindata/grapher/src/mapCharts/MapTooltip.stories.tsx b/packages/@ourworldindata/grapher/src/mapCharts/MapTooltip.stories.tsx index d8307c808c..d0090c2174 100644 --- a/packages/@ourworldindata/grapher/src/mapCharts/MapTooltip.stories.tsx +++ b/packages/@ourworldindata/grapher/src/mapCharts/MapTooltip.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { MapTooltip } from "./MapTooltip" import { Grapher } from "../core/Grapher" import { legacyMapGrapher } from "./MapChart.sample" diff --git a/packages/@ourworldindata/grapher/src/modal/DownloadIcons.tsx b/packages/@ourworldindata/grapher/src/modal/DownloadIcons.tsx index 85ce38ac4f..44d456c02f 100644 --- a/packages/@ourworldindata/grapher/src/modal/DownloadIcons.tsx +++ b/packages/@ourworldindata/grapher/src/modal/DownloadIcons.tsx @@ -1,5 +1,3 @@ -import React from "react" - export const DownloadIconFullDataset = () => ( {
)} {rows.map(([first, second]) => ( - +
{
)} -
+ ))} ) diff --git a/packages/@ourworldindata/grapher/src/modal/SourcesModal.stories.tsx b/packages/@ourworldindata/grapher/src/modal/SourcesModal.stories.tsx index 237c93f04d..9df4c26fa3 100644 --- a/packages/@ourworldindata/grapher/src/modal/SourcesModal.stories.tsx +++ b/packages/@ourworldindata/grapher/src/modal/SourcesModal.stories.tsx @@ -1,5 +1,5 @@ import { SynthesizeGDPTable } from "@ourworldindata/core-table" -import React from "react" +import * as React from "react" import { SourcesModal } from "./SourcesModal" export default { diff --git a/packages/@ourworldindata/grapher/src/modal/SourcesModal.tsx b/packages/@ourworldindata/grapher/src/modal/SourcesModal.tsx index 049449ea53..d3f2d1aeda 100644 --- a/packages/@ourworldindata/grapher/src/modal/SourcesModal.tsx +++ b/packages/@ourworldindata/grapher/src/modal/SourcesModal.tsx @@ -25,7 +25,7 @@ import { CLOSE_BUTTON_WIDTH, CloseButton, } from "@ourworldindata/components" -import React from "react" +import * as React from "react" import cx from "classnames" import { action, computed } from "mobx" import { observer } from "mobx-react" diff --git a/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.stories.tsx b/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.stories.tsx index 2da5875525..d4ab0913db 100644 --- a/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.stories.tsx +++ b/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { NoDataModal } from "./NoDataModal" export default { diff --git a/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.tsx b/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.tsx index 2aa2811e0b..675d72a9db 100644 --- a/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.tsx +++ b/packages/@ourworldindata/grapher/src/noDataModal/NoDataModal.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { observer } from "mobx-react" import a from "indefinite" diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/ComparisonLine.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/ComparisonLine.tsx index d1e6156d99..456b09f106 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/ComparisonLine.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/ComparisonLine.tsx @@ -5,7 +5,7 @@ import { PointVector, makeIdForHumanConsumption, } from "@ourworldindata/utils" -import React from "react" +import * as React from "react" import { computed } from "mobx" import { observer } from "mobx-react" import { DualAxis } from "../axis/Axis" diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/ConnectedScatterLegend.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/ConnectedScatterLegend.tsx index 1705a965cc..fc3e9726e3 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/ConnectedScatterLegend.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/ConnectedScatterLegend.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { Triangle } from "./Triangle" import { TextWrap } from "@ourworldindata/components" diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/MultiColorPolyline.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/MultiColorPolyline.tsx index d44a1e3ec9..26757962cf 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/MultiColorPolyline.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/MultiColorPolyline.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { observer } from "mobx-react" diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/NoDataSection.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/NoDataSection.tsx index 9041e4ee8f..da0b23e7f6 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/NoDataSection.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/NoDataSection.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { Bounds, HorizontalAlign } from "@ourworldindata/utils" import { GRAPHER_FONT_SCALE_11, diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.stories.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.stories.tsx index 1d79d92b0d..ba0787d120 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPlotChart.stories.tsx @@ -5,7 +5,7 @@ import { } from "@ourworldindata/core-table" import { ScaleType } from "@ourworldindata/types" import { DEFAULT_BOUNDS } from "@ourworldindata/utils" -import React from "react" +import * as React from "react" import { ScatterPlotChart } from "./ScatterPlotChart" import { ScatterPlotManager } from "./ScatterPlotChartConstants" diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPoints.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPoints.tsx index e6a4921047..e580b4ffca 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPoints.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPoints.tsx @@ -5,7 +5,7 @@ import { makeIdForHumanConsumption, } from "@ourworldindata/utils" import { observer } from "mobx-react" -import React from "react" +import * as React from "react" import { MultiColorPolyline } from "./MultiColorPolyline" import { ScatterRenderSeries, diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPointsWithLabels.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPointsWithLabels.tsx index fd8d306752..92dc8bc639 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPointsWithLabels.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterPointsWithLabels.tsx @@ -17,7 +17,7 @@ import { } from "@ourworldindata/utils" import { computed, action, observable } from "mobx" import { observer } from "mobx-react" -import React from "react" +import * as React from "react" import { Halo } from "@ourworldindata/components" import { MultiColorPolyline } from "./MultiColorPolyline" import { diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterSizeLegend.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterSizeLegend.tsx index 8dded0dd24..ff7c4a887a 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/ScatterSizeLegend.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/ScatterSizeLegend.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed } from "mobx" import { scaleLinear, ScaleLinear } from "d3-scale" import { TextWrap, Halo } from "@ourworldindata/components" diff --git a/packages/@ourworldindata/grapher/src/scatterCharts/Triangle.tsx b/packages/@ourworldindata/grapher/src/scatterCharts/Triangle.tsx index 2f4065da9a..612b1ca35e 100644 --- a/packages/@ourworldindata/grapher/src/scatterCharts/Triangle.tsx +++ b/packages/@ourworldindata/grapher/src/scatterCharts/Triangle.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" type TriangleProps = Readonly<{ diff --git a/packages/@ourworldindata/grapher/src/sidePanel/SidePanel.tsx b/packages/@ourworldindata/grapher/src/sidePanel/SidePanel.tsx index 2aec229465..31ff205d88 100644 --- a/packages/@ourworldindata/grapher/src/sidePanel/SidePanel.tsx +++ b/packages/@ourworldindata/grapher/src/sidePanel/SidePanel.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { observer } from "mobx-react" import { computed } from "mobx" import { Bounds } from "@ourworldindata/utils" diff --git a/packages/@ourworldindata/grapher/src/slideInDrawer/SlideInDrawer.tsx b/packages/@ourworldindata/grapher/src/slideInDrawer/SlideInDrawer.tsx index c620a9b14b..5db0224244 100644 --- a/packages/@ourworldindata/grapher/src/slideInDrawer/SlideInDrawer.tsx +++ b/packages/@ourworldindata/grapher/src/slideInDrawer/SlideInDrawer.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import cx from "classnames" import { computed, action, observable } from "mobx" import { observer } from "mobx-react" diff --git a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.stories.tsx b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.stories.tsx index 2db3a06828..de0ac6a2e8 100644 --- a/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/slopeCharts/SlopeChart.stories.tsx @@ -1,4 +1,3 @@ -import React from "react" import { SlopeChart } from "./SlopeChart" import { SampleColumnSlugs, diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.stories.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.stories.tsx index 9b0be6ab0e..2a019f9b5e 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.stories.tsx @@ -4,7 +4,7 @@ import { SynthesizeFruitTable, SynthesizeGDPTable, } from "@ourworldindata/core-table" -import React from "react" +import * as React from "react" import { StackedAreaChart } from "./StackedAreaChart" export default { diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.tsx index a45e91b3c5..538f16d368 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/StackedAreaChart.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { extend, reverse, diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.stories.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.stories.tsx index f00cedebd1..68bd5f9a2d 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { StackedBarChart } from "./StackedBarChart" import { SampleColumnSlugs, diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.tsx index 6dcbab4f96..c950aa58ac 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/StackedBarChart.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { computed, action, observable } from "mobx" import { observer } from "mobx-react" import { diff --git a/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.stories.tsx b/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.stories.tsx index e04db971e5..041115562c 100644 --- a/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.stories.tsx +++ b/packages/@ourworldindata/grapher/src/stackedCharts/StackedDiscreteBarChart.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { StackedDiscreteBarChart } from "./StackedDiscreteBarChart" import { SynthesizeFruitTable } from "@ourworldindata/core-table" diff --git a/packages/@ourworldindata/grapher/src/tabs/ExpandableTabs.tsx b/packages/@ourworldindata/grapher/src/tabs/ExpandableTabs.tsx index bd7a4a795d..c60655b5f0 100644 --- a/packages/@ourworldindata/grapher/src/tabs/ExpandableTabs.tsx +++ b/packages/@ourworldindata/grapher/src/tabs/ExpandableTabs.tsx @@ -1,4 +1,4 @@ -import React, { useState } from "react" +import { useState } from "react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faPlus, faMinus } from "@fortawesome/free-solid-svg-icons" import cx from "classnames" diff --git a/packages/@ourworldindata/grapher/src/tabs/Tabs.tsx b/packages/@ourworldindata/grapher/src/tabs/Tabs.tsx index b2b5f3165b..71b5baf00f 100644 --- a/packages/@ourworldindata/grapher/src/tabs/Tabs.tsx +++ b/packages/@ourworldindata/grapher/src/tabs/Tabs.tsx @@ -1,4 +1,5 @@ -import React, { useRef } from "react" +import { useRef } from "react" +import * as React from "react" import cx from "classnames" export interface TabLabel { diff --git a/packages/@ourworldindata/grapher/src/timeline/TimelineComponent.stories.tsx b/packages/@ourworldindata/grapher/src/timeline/TimelineComponent.stories.tsx index f765deff3e..e46d670425 100644 --- a/packages/@ourworldindata/grapher/src/timeline/TimelineComponent.stories.tsx +++ b/packages/@ourworldindata/grapher/src/timeline/TimelineComponent.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { TimelineComponent } from "./TimelineComponent" import { action, computed, observable } from "mobx" import { range } from "@ourworldindata/utils" diff --git a/packages/@ourworldindata/grapher/src/timeline/TimelineComponent.tsx b/packages/@ourworldindata/grapher/src/timeline/TimelineComponent.tsx index f78014f1a0..5d290561d5 100644 --- a/packages/@ourworldindata/grapher/src/timeline/TimelineComponent.tsx +++ b/packages/@ourworldindata/grapher/src/timeline/TimelineComponent.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { select } from "d3-selection" import cx from "classnames" import { diff --git a/packages/@ourworldindata/grapher/src/tooltip/Tooltip.tsx b/packages/@ourworldindata/grapher/src/tooltip/Tooltip.tsx index 01d1101282..ea928fa6a5 100644 --- a/packages/@ourworldindata/grapher/src/tooltip/Tooltip.tsx +++ b/packages/@ourworldindata/grapher/src/tooltip/Tooltip.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import classnames from "classnames" import { observable, computed, action } from "mobx" import { observer } from "mobx-react" diff --git a/packages/@ourworldindata/grapher/src/tooltip/TooltipContents.tsx b/packages/@ourworldindata/grapher/src/tooltip/TooltipContents.tsx index a3a8b7f0f1..18fad5e9d4 100644 --- a/packages/@ourworldindata/grapher/src/tooltip/TooltipContents.tsx +++ b/packages/@ourworldindata/grapher/src/tooltip/TooltipContents.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import classnames from "classnames" import { CoreColumn } from "@ourworldindata/core-table" import { NO_DATA_LABEL } from "../color/ColorScale.js" diff --git a/packages/@ourworldindata/grapher/src/tooltip/TooltipProps.ts b/packages/@ourworldindata/grapher/src/tooltip/TooltipProps.ts index 9fae113da6..925f2b224a 100644 --- a/packages/@ourworldindata/grapher/src/tooltip/TooltipProps.ts +++ b/packages/@ourworldindata/grapher/src/tooltip/TooltipProps.ts @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { CoreColumn } from "@ourworldindata/core-table" import { GrapherTooltipAnchor, diff --git a/packages/@ourworldindata/grapher/src/verticalColorLegend/VerticalColorLegend.stories.tsx b/packages/@ourworldindata/grapher/src/verticalColorLegend/VerticalColorLegend.stories.tsx index 42d9e94b5c..c96b017216 100644 --- a/packages/@ourworldindata/grapher/src/verticalColorLegend/VerticalColorLegend.stories.tsx +++ b/packages/@ourworldindata/grapher/src/verticalColorLegend/VerticalColorLegend.stories.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { VerticalColorLegend, VerticalColorLegendManager, diff --git a/packages/@ourworldindata/grapher/src/verticalColorLegend/VerticalColorLegend.tsx b/packages/@ourworldindata/grapher/src/verticalColorLegend/VerticalColorLegend.tsx index ea659e517e..00ce48d6aa 100644 --- a/packages/@ourworldindata/grapher/src/verticalColorLegend/VerticalColorLegend.tsx +++ b/packages/@ourworldindata/grapher/src/verticalColorLegend/VerticalColorLegend.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { sum, max, makeIdForHumanConsumption } from "@ourworldindata/utils" import { TextWrap } from "@ourworldindata/components" import { computed } from "mobx" diff --git a/packages/@ourworldindata/utils/src/Tippy.tsx b/packages/@ourworldindata/utils/src/Tippy.tsx index 37f24c7f56..41fb833da2 100644 --- a/packages/@ourworldindata/utils/src/Tippy.tsx +++ b/packages/@ourworldindata/utils/src/Tippy.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { default as OriginalTippy, TippyProps } from "@tippyjs/react" interface CustomTippyProps extends TippyProps { diff --git a/packages/@ourworldindata/utils/src/Util.ts b/packages/@ourworldindata/utils/src/Util.ts index 9908fd2875..0cc04c6a6f 100644 --- a/packages/@ourworldindata/utils/src/Util.ts +++ b/packages/@ourworldindata/utils/src/Util.ts @@ -179,7 +179,7 @@ import { GRAPHER_CHART_TYPES, } from "@ourworldindata/types" import { PointVector } from "./PointVector.js" -import React from "react" +import * as React from "react" import { match, P } from "ts-pattern" export type NoUndefinedValues = { diff --git a/site/AboutThisData.tsx b/site/AboutThisData.tsx index 67b533b8f2..2cea09941a 100644 --- a/site/AboutThisData.tsx +++ b/site/AboutThisData.tsx @@ -1,4 +1,3 @@ -import * as React from "react" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" import { faArrowDown } from "@fortawesome/free-solid-svg-icons" import dayjs from "dayjs" diff --git a/site/AlertBanner.tsx b/site/AlertBanner.tsx index 5da3b51599..a43c7d3540 100644 --- a/site/AlertBanner.tsx +++ b/site/AlertBanner.tsx @@ -1,5 +1,3 @@ -import React from "react" - export const AlertBanner = () => { // 2023-03-23: This banner is now disabled, since we no longer want to highlight // the COVID-19 data this way. If we don't reuse this banner later for something diff --git a/site/BackToTopic.tsx b/site/BackToTopic.tsx index e522a17e27..7480a5393f 100644 --- a/site/BackToTopic.tsx +++ b/site/BackToTopic.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import { SubNavId } from "@ourworldindata/types" import { getSubnavItem, subnavs } from "./SiteSubnavigation.js" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" diff --git a/site/BlogIndexPage.tsx b/site/BlogIndexPage.tsx index 72ec99d9d8..29d224d91d 100644 --- a/site/BlogIndexPage.tsx +++ b/site/BlogIndexPage.tsx @@ -1,4 +1,3 @@ -import React from "react" import { Head } from "./Head.js" import { SiteHeader } from "./SiteHeader.js" import { SiteFooter } from "./SiteFooter.js" diff --git a/site/Breadcrumb/Breadcrumb.tsx b/site/Breadcrumb/Breadcrumb.tsx index 07791a4830..01b84afbb5 100644 --- a/site/Breadcrumb/Breadcrumb.tsx +++ b/site/Breadcrumb/Breadcrumb.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Fragment } from "react" import { BreadcrumbItem } from "@ourworldindata/utils" import { SubNavId } from "@ourworldindata/types" import { getSubnavItem, SubnavItem, subnavs } from "../SiteSubnavigation.js" @@ -80,10 +80,10 @@ export const Breadcrumbs = ({ ) return ( - + {breadcrumb} {!isLast && } - + ) })} diff --git a/site/Byline.tsx b/site/Byline.tsx index 063b07f64b..0042eaff21 100644 --- a/site/Byline.tsx +++ b/site/Byline.tsx @@ -1,4 +1,3 @@ -import React from "react" import { formatAuthors } from "./clientFormatting.js" export const Byline = ({ diff --git a/site/ChartListItemVariant.tsx b/site/ChartListItemVariant.tsx index 7579f02107..d78fe12a6d 100644 --- a/site/ChartListItemVariant.tsx +++ b/site/ChartListItemVariant.tsx @@ -1,4 +1,3 @@ -import React from "react" import { BasicChartInformation } from "@ourworldindata/utils" export const ChartListItemVariant = ({ diff --git a/site/CitationMeta.tsx b/site/CitationMeta.tsx index 584428d5fd..c312f4db6e 100644 --- a/site/CitationMeta.tsx +++ b/site/CitationMeta.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { Fragment } from "react" import { dayjs } from "@ourworldindata/utils" export const CitationMeta = (props: { @@ -15,7 +15,7 @@ export const CitationMeta = (props: { authors = authors.concat(["Max Roser"]) return ( - + @@ -32,6 +32,6 @@ export const CitationMeta = (props: { {authors.map((author) => ( ))} - + ) } diff --git a/site/CookieNotice.tsx b/site/CookieNotice.tsx index 226548dba6..9cc5c838f1 100644 --- a/site/CookieNotice.tsx +++ b/site/CookieNotice.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react" +import { useEffect, useState } from "react" import classnames from "classnames" import { FontAwesomeIcon } from "@fortawesome/react-fontawesome/index.js" import { faCheck } from "@fortawesome/free-solid-svg-icons" diff --git a/site/CookiePreferencesManager.tsx b/site/CookiePreferencesManager.tsx index 44f9552f33..605629a0b6 100644 --- a/site/CookiePreferencesManager.tsx +++ b/site/CookiePreferencesManager.tsx @@ -1,5 +1,5 @@ import ReactDOM from "react-dom" -import React, { useEffect, useMemo, useReducer } from "react" +import { useEffect, useMemo, useReducer } from "react" import Cookies from "js-cookie" import { CookiePreferences } from "../site/blocks/CookiePreferences.js" import { CookieNotice } from "../site/CookieNotice.js" diff --git a/site/CountriesIndexPage.tsx b/site/CountriesIndexPage.tsx index 80f8295868..b454f9057e 100644 --- a/site/CountriesIndexPage.tsx +++ b/site/CountriesIndexPage.tsx @@ -1,4 +1,3 @@ -import React from "react" import { Head } from "./Head.js" import { SiteHeader } from "./SiteHeader.js" import { SiteFooter } from "./SiteFooter.js" diff --git a/site/CountryProfilePage.tsx b/site/CountryProfilePage.tsx index 9cf15071f0..78995a1f59 100644 --- a/site/CountryProfilePage.tsx +++ b/site/CountryProfilePage.tsx @@ -1,4 +1,3 @@ -import React from "react" import { Head } from "./Head.js" import { SiteHeader } from "./SiteHeader.js" import { SiteFooter } from "./SiteFooter.js" diff --git a/site/DataCatalog/DataCatalog.tsx b/site/DataCatalog/DataCatalog.tsx index e0188c964e..411a99738e 100644 --- a/site/DataCatalog/DataCatalog.tsx +++ b/site/DataCatalog/DataCatalog.tsx @@ -1,4 +1,5 @@ -import React, { useEffect, useMemo, useReducer, useRef, useState } from "react" +import { useEffect, useMemo, useReducer, useRef, useState } from "react" +import * as React from "react" import ReactDOM from "react-dom" import cx from "classnames" import { diff --git a/site/DataCatalog/DataCatalogPage.tsx b/site/DataCatalog/DataCatalogPage.tsx index 0ff28a1a7c..20a4b53cc5 100644 --- a/site/DataCatalog/DataCatalogPage.tsx +++ b/site/DataCatalog/DataCatalogPage.tsx @@ -1,4 +1,3 @@ -import React from "react" import { Head } from "../Head.js" import { SiteHeader } from "../SiteHeader.js" import { SiteFooter } from "../SiteFooter.js" diff --git a/site/DataCatalog/DataCatalogSkeletons.tsx b/site/DataCatalog/DataCatalogSkeletons.tsx index 731ab1853e..8d116eb830 100644 --- a/site/DataCatalog/DataCatalogSkeletons.tsx +++ b/site/DataCatalog/DataCatalogSkeletons.tsx @@ -1,4 +1,3 @@ -import React from "react" import cx from "classnames" // 💀 Beware! Spooky skeletons for the data catalog 💀 diff --git a/site/DataInsightsIndexPage.tsx b/site/DataInsightsIndexPage.tsx index 1c77a98247..de12b2f3bb 100644 --- a/site/DataInsightsIndexPage.tsx +++ b/site/DataInsightsIndexPage.tsx @@ -1,4 +1,3 @@ -import React from "react" import { Head } from "./Head.js" import { SiteHeader } from "./SiteHeader.js" import { SiteFooter } from "./SiteFooter.js" diff --git a/site/DataInsightsIndexPageContent.tsx b/site/DataInsightsIndexPageContent.tsx index ba39a1c16a..622d85b04b 100644 --- a/site/DataInsightsIndexPageContent.tsx +++ b/site/DataInsightsIndexPageContent.tsx @@ -1,4 +1,3 @@ -import React from "react" import cx from "classnames" import ReactDOM from "react-dom" import { diff --git a/site/DataInsightsNewsletterBanner.tsx b/site/DataInsightsNewsletterBanner.tsx index aebce5284e..9bdea248a0 100644 --- a/site/DataInsightsNewsletterBanner.tsx +++ b/site/DataInsightsNewsletterBanner.tsx @@ -1,4 +1,3 @@ -import * as React from "react" import { useState, useEffect } from "react" import Cookies from "js-cookie" import cx from "classnames" diff --git a/site/DataPageV2.tsx b/site/DataPageV2.tsx index e3c4814ca7..84af379842 100644 --- a/site/DataPageV2.tsx +++ b/site/DataPageV2.tsx @@ -17,7 +17,6 @@ import { Url, } from "@ourworldindata/utils" import { MarkdownTextWrap } from "@ourworldindata/components" -import React from "react" import urljoin from "url-join" import { ADMIN_BASE_URL, diff --git a/site/DataPageV2Content.tsx b/site/DataPageV2Content.tsx index 8cb1c99693..5b46203187 100644 --- a/site/DataPageV2Content.tsx +++ b/site/DataPageV2Content.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useMemo } from "react" +import { useState, useEffect, useMemo } from "react" import { Grapher, GrapherProgrammaticInterface } from "@ourworldindata/grapher" import { REUSE_THIS_WORK_SECTION_ID, @@ -73,7 +73,7 @@ export const DataPageV2Content = ({ grapherConfig: GrapherInterface imageMetadata: Record }) => { - const [grapher, setGrapher] = React.useState(undefined) + const [grapher, setGrapher] = useState(undefined) const titleFragments = joinTitleFragments( datapageData.attributionShort, diff --git a/site/DataToken.tsx b/site/DataToken.tsx index b1fb784c06..0bf738031b 100644 --- a/site/DataToken.tsx +++ b/site/DataToken.tsx @@ -1,4 +1,3 @@ -import React from "react" import { dictionary } from "./runDataTokens.js" export const DataToken_name = "DataToken" diff --git a/site/DonateForm.tsx b/site/DonateForm.tsx index d6e910660f..a914fee14e 100644 --- a/site/DonateForm.tsx +++ b/site/DonateForm.tsx @@ -1,4 +1,4 @@ -import React from "react" +import * as React from "react" import ReactDOM from "react-dom" import cx from "classnames" import { observable, action, computed } from "mobx" diff --git a/site/DonatePage.tsx b/site/DonatePage.tsx index b9fdb0d6ab..972387bff1 100644 --- a/site/DonatePage.tsx +++ b/site/DonatePage.tsx @@ -1,4 +1,3 @@ -import React from "react" import { Head } from "./Head.js" import { SiteHeader } from "./SiteHeader.js" import { SiteFooter } from "./SiteFooter.js" diff --git a/site/ExplorerIndex.tsx b/site/ExplorerIndex.tsx index f71adbad07..4e21042c8b 100644 --- a/site/ExplorerIndex.tsx +++ b/site/ExplorerIndex.tsx @@ -1,4 +1,4 @@ -import React from "react" +import { useState } from "react" import ReactDOM from "react-dom" import { MinimalExplorerInfo } from "@ourworldindata/types" import { EXPLORER_DYNAMIC_THUMBNAIL_URL } from "../settings/clientSettings.js" @@ -11,7 +11,7 @@ function ExplorerIndexPageCard(props: { explorer: MinimalExplorerInfo }) { const { baseUrl, explorer } = props - const [hasError, setHasError] = React.useState(false) + const [hasError, setHasError] = useState(false) return (
  • { +export class FeedbackPage extends Component<{ baseUrl: string }> { render() { const { baseUrl } = this.props return ( diff --git a/site/Footnote.tsx b/site/Footnote.tsx index 43a87f6a75..cd933ca400 100644 --- a/site/Footnote.tsx +++ b/site/Footnote.tsx @@ -1,5 +1,4 @@ import { isNil, parseIntOrUndefined, Tippy } from "@ourworldindata/utils" -import React from "react" import ReactDOM from "react-dom" export const Footnote = ({ diff --git a/site/GrapherFigureView.tsx b/site/GrapherFigureView.tsx index 46b567e4b1..8f1d472f56 100644 --- a/site/GrapherFigureView.tsx +++ b/site/GrapherFigureView.tsx @@ -1,4 +1,4 @@ -import React, { useRef } from "react" +import { useRef } from "react" import { Grapher, GrapherProgrammaticInterface } from "@ourworldindata/grapher" import { diff --git a/site/GrapherImage.tsx b/site/GrapherImage.tsx index 8d14c518b5..95e0d34fde 100644 --- a/site/GrapherImage.tsx +++ b/site/GrapherImage.tsx @@ -1,5 +1,3 @@ -import React from "react" - import { DEFAULT_GRAPHER_HEIGHT, DEFAULT_GRAPHER_WIDTH, diff --git a/site/GrapherPage.jsdom.test.tsx b/site/GrapherPage.jsdom.test.tsx index 4f2a9b3f3b..f6c16d91c1 100755 --- a/site/GrapherPage.jsdom.test.tsx +++ b/site/GrapherPage.jsdom.test.tsx @@ -1,12 +1,9 @@ -#! /usr/bin/env jest - -import { GrapherInterface } from "@ourworldindata/types" +#! /usr/bin/env jestimport { GrapherInterface } from "@ourworldindata/types" import { DimensionProperty, KeyChartLevel, RelatedChart, } from "@ourworldindata/utils" -import React from "react" import { ChartListItemVariant } from "./ChartListItemVariant.js" import { GrapherPage } from "./GrapherPage.js" import { SiteFooter } from "./SiteFooter.js" diff --git a/site/GrapherPage.tsx b/site/GrapherPage.tsx index 22e1dceb5a..c5c3929fc2 100644 --- a/site/GrapherPage.tsx +++ b/site/GrapherPage.tsx @@ -14,7 +14,6 @@ import { Url, } from "@ourworldindata/utils" import { MarkdownTextWrap } from "@ourworldindata/components" -import React from "react" import urljoin from "url-join" import { ADMIN_BASE_URL, diff --git a/site/GrapherWithFallback.tsx b/site/GrapherWithFallback.tsx index 3849df575f..fc0bc1d9c9 100644 --- a/site/GrapherWithFallback.tsx +++ b/site/GrapherWithFallback.tsx @@ -1,5 +1,4 @@ import { Grapher } from "@ourworldindata/grapher" -import React from "react" import { GrapherFigureView } from "./GrapherFigureView.js" import cx from "classnames" import { GRAPHER_PREVIEW_CLASS } from "./SiteConstants.js" diff --git a/site/Head.tsx b/site/Head.tsx index 575c57774b..29b9683892 100644 --- a/site/Head.tsx +++ b/site/Head.tsx @@ -1,4 +1,3 @@ -import React from "react" import { viteAssetsForSite } from "./viteUtils.js" import { GOOGLE_TAG_MANAGER_ID } from "../settings/clientSettings.js" import { NoJSDetector } from "./NoJSDetector.js" diff --git a/site/Html.tsx b/site/Html.tsx index a3373f270a..2a31bb0fba 100644 --- a/site/Html.tsx +++ b/site/Html.tsx @@ -1,5 +1,5 @@ import cx from "classnames" -import React, { HtmlHTMLAttributes } from "react" +import { HtmlHTMLAttributes } from "react" /** * Renders a element with the class "js-disabled" to indicate that JavaScript is disabled. diff --git a/site/IframeDetector.tsx b/site/IframeDetector.tsx index c7706fb28e..9f695d94e3 100644 --- a/site/IframeDetector.tsx +++ b/site/IframeDetector.tsx @@ -1,5 +1,4 @@ import { GRAPHER_IS_IN_IFRAME_CLASS } from "@ourworldindata/grapher" -import React from "react" export const IFrameDetector = () => (