Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐝 (staging) sophia #3639

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
616ed35
Merge pull request #4342 from owid/persist-alt-text
ikesau Dec 20, 2024
83f62ea
Add Bluesky to donation sharing options (#4347)
rakyi Dec 20, 2024
d425fa0
🐛 (facet) show swatch colour on hovering (#4348)
sophiamersmann Dec 20, 2024
6079a94
🐛 (scatter) left-align no data section (#4349)
sophiamersmann Dec 20, 2024
d1bd40b
Merge pull request #4353 from owid/add-antibiotics-topic-list
spoonerf Dec 23, 2024
58e75de
Merge pull request #4354 from owid/spoonerf-patch-1
spoonerf Dec 23, 2024
a6c11e1
🐛 (explorer) dismiss focus state after unselecting an entity (#4365)
sophiamersmann Jan 2, 2025
7bee7db
🐛 clear focus when clearing query params (#4366)
sophiamersmann Jan 2, 2025
efc276c
🧪 fix flaky test (#4367)
sophiamersmann Jan 2, 2025
6b4305d
🐛 (facet) make legend clickable for line and slope charts only (#4370)
sophiamersmann Jan 2, 2025
58b0348
✨ (discrete bar) hide horizontal axis (#4371)
sophiamersmann Jan 3, 2025
5afe857
✨ (discrete bar) thin zero line (#4372)
sophiamersmann Jan 3, 2025
59228f1
✨ (discrete bar) add more whitespace between bars (#4373)
sophiamersmann Jan 6, 2025
1118d02
Merge pull request #4356 from owid/enhance-archive-dataset-ui
lucasrodes Jan 6, 2025
747b80f
new table for chart (and possibly other objects) revisions (#4387)
lucasrodes Jan 6, 2025
0652855
Update db table types (#4388)
lucasrodes Jan 6, 2025
997a3c4
edit migration further (#4389)
lucasrodes Jan 7, 2025
d29a33f
housekeeper: this pr fixes all previous migrations (#4390)
lucasrodes Jan 7, 2025
ebc8563
Run `npx react-codemod update-react-imports`
rakyi Dec 23, 2024
5586025
Update to ESlint 9 and flat config
rakyi Dec 26, 2024
e4e53d2
Add eslint-plugin-react-refresh
rakyi Jan 3, 2025
5917ff0
Rename adminSiteServer files from .tsx to .ts
rakyi Jan 3, 2025
62ccc94
Fix missing link to grapher in image caption (#4381)
rakyi Jan 7, 2025
b2adf18
Revert temporary giving season changes (#4385)
rakyi Jan 7, 2025
3194a92
Remove Tablepress (#4386)
rakyi Jan 7, 2025
5d4c780
style: remove unused eslint annotation
marcelgerber Jan 7, 2025
1f24997
chore(deps): dedupe dependencies (#4391)
marcelgerber Jan 7, 2025
516d18a
chore: use latest `whatwg-url` release
marcelgerber Dec 22, 2024
7563bb7
Merge pull request #4359 from owid/row-key-images-table
danyx23 Jan 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 0 additions & 12 deletions .eslintignore

This file was deleted.

74 changes: 0 additions & 74 deletions .eslintrc.cjs

This file was deleted.

4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
},
{
"name": "Launch admin server",
"program": "${workspaceFolder}/adminSiteServer/app.tsx",
"program": "${workspaceFolder}/adminSiteServer/app.ts",
"request": "launch",
"type": "node",
"runtimeExecutable": "yarn",
Expand All @@ -113,7 +113,7 @@
},
{
"name": "Launch admin server (via fnm)",
"program": "${workspaceFolder}/adminSiteServer/app.tsx",
"program": "${workspaceFolder}/adminSiteServer/app.ts",
"request": "launch",
"type": "node",
"runtimeExecutable": "fnm",
Expand Down
5 changes: 4 additions & 1 deletion adminShared/patchHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ export function setValueRecursive(
let newObject: any = {}
if (json !== undefined && checkIsPlainObjectWithGuard(json))
newObject = { ...json }
const currentValue = newObject.hasOwnProperty(currentPart)
const currentValue = Object.prototype.hasOwnProperty.call(
newObject,
currentPart
)
? newObject[currentPart]
: undefined
const updatedValue = setValueRecursive(
Expand Down
18 changes: 9 additions & 9 deletions adminShared/schemaProcessing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ function extractSchemaRecursive(
// then do not emit anything directly and recurse over the
// described properties
if (
schema.hasOwnProperty("type") &&
Object.prototype.hasOwnProperty.call(schema, "type") &&
schema.type === "object" &&
schema.hasOwnProperty("properties") &&
Object.prototype.hasOwnProperty.call(schema, "properties") &&
checkIsPlainObjectWithGuard(schema.properties)
) {
// Color scales are complex objects that are treated as opaque objects with a special
Expand Down Expand Up @@ -166,15 +166,15 @@ function extractSchemaRecursive(
// paternProperties is ".*" and the type of those
// is string (interpreted as a color)
// We yield something like this as a single entry
schema.hasOwnProperty("type") &&
Object.prototype.hasOwnProperty.call(schema, "type") &&
schema.type === "object" &&
schema.hasOwnProperty("patternProperties") &&
Object.prototype.hasOwnProperty.call(schema, "patternProperties") &&
Object.values(
schema.patternProperties as Record<string, any>
).every(
(item: any) =>
checkIsPlainObjectWithGuard(item) &&
item.hasOwnProperty("type") &&
Object.prototype.hasOwnProperty.call(item, "type") &&
isPlainTypeString((item as any).type)
)
) {
Expand Down Expand Up @@ -234,7 +234,7 @@ function extractSchemaRecursive(
// a primitive type. If so we collect all the types
// and yield a single FieldDefinition with the merged
// type
schema.hasOwnProperty("oneOf") &&
Object.prototype.hasOwnProperty.call(schema, "oneOf") &&
isArray(schema.oneOf) &&
schema.oneOf.map((item) => item.type).every(isPlainTypeStringOrNull)
) {
Expand Down Expand Up @@ -264,13 +264,13 @@ function recursiveDereference(
schema !== undefined &&
checkIsPlainObjectWithGuard(schema)
) {
if (schema.hasOwnProperty("$ref")) {
if (Object.prototype.hasOwnProperty.call(schema, "$ref")) {
const ref = schema["$ref"] as string
const localPrefix = "#/$defs/"
if (!ref.startsWith(localPrefix))
throw "Only local refs are supported at the moment!"
const refName = ref.substring(localPrefix.length)
if (!defs.hasOwnProperty(refName)) {
if (!Object.prototype.hasOwnProperty.call(defs, refName)) {
console.error("Reference not found", refName)
return schema
} else return defs[refName] // Note: we are not using recursive dereferencing, i.e. if there are refs in the $defs section we don't resolve them here
Expand All @@ -281,7 +281,7 @@ function recursiveDereference(
}

function dereference(schema: Record<string, unknown>): any {
if (!schema.hasOwnProperty("$defs")) return
if (!Object.prototype.hasOwnProperty.call(schema, "$defs")) return
const defs = schema["$defs"] as Record<string, unknown>

const dereferenced = recursiveDereference(schema, defs)
Expand Down
2 changes: 1 addition & 1 deletion adminShared/search.tsx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions adminSiteClient/.eslintrc.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions adminSiteClient/Admin.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from "react"
import ReactDOM from "react-dom"
import * as lodash from "lodash"
import { observable, computed, action } from "mobx"
Expand Down Expand Up @@ -163,7 +162,6 @@ export class Admin {
}

@action.bound private removeRequest(request: Promise<Response>): void {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.currentRequests = this.currentRequests.filter(
(req) => req !== request
)
Expand Down
4 changes: 2 additions & 2 deletions adminSiteClient/AdminApp.tsx
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -40,7 +40,7 @@ import { AdminLayout } from "./AdminLayout.js"
import { BulkGrapherConfigEditorPage } from "./BulkGrapherConfigEditor.js"
import { GdocsIndexPage, GdocsMatchProps } from "./GdocsIndexPage.js"
import { GdocsPreviewPage } from "./GdocsPreviewPage.js"
import { GdocsStoreProvider } from "./GdocsStore.js"
import { GdocsStoreProvider } from "./GdocsStoreProvider.js"
import { IndicatorChartEditorPage } from "./IndicatorChartEditorPage.js"
import { ChartViewEditorPage } from "./ChartViewEditorPage.js"
import { ChartViewIndexPage } from "./ChartViewIndexPage.js"
Expand Down
2 changes: 1 addition & 1 deletion adminSiteClient/AdminAppContext.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react"
import * as React from "react"
import { Admin } from "./Admin.js"

export interface AdminAppContextType {
Expand Down
2 changes: 1 addition & 1 deletion adminSiteClient/AdminLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react"
import * as React from "react"
import { observable, action, computed } from "mobx"
import { observer } from "mobx-react"

Expand Down
2 changes: 1 addition & 1 deletion adminSiteClient/AdminSidebar.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 3 additions & 3 deletions adminSiteClient/BulkDownloadPage.tsx
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -20,7 +20,7 @@ export class BulkDownloadPage extends React.Component {
}
}

export class DownloadChartsSection extends React.Component {
export class DownloadChartsSection extends Component {
render() {
return (
<section>
Expand Down
4 changes: 2 additions & 2 deletions adminSiteClient/BulkGrapherConfigEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react"
import { Component } from "react"
import {
chartBulkUpdateAllowedColumnNamesAndTypes,
WHITELISTED_SQL_COLUMN_NAMES,
Expand Down Expand Up @@ -130,7 +130,7 @@ const config: GrapherConfigGridEditorConfig = {
finalVariableLayerModificationFn: () => ({}),
}

export class BulkGrapherConfigEditorPage extends React.Component {
export class BulkGrapherConfigEditorPage extends Component {
render() {
return (
<AdminLayout title="Bulk chart editor">
Expand Down
2 changes: 1 addition & 1 deletion adminSiteClient/ChartEditorView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react"
import * as React from "react"
import { observer } from "mobx-react"
import {
observable,
Expand Down
4 changes: 2 additions & 2 deletions adminSiteClient/ChartIndexPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react"
import { Component } from "react"
import { observer } from "mobx-react"
import { observable, computed, action, runInAction } from "mobx"

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion adminSiteClient/ChartList.tsx
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 3 additions & 1 deletion adminSiteClient/ChartRow.tsx
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -127,6 +127,8 @@ export class ChartRow extends React.Component<{
}
}

// The rule doesn't support class components in the same file.
// eslint-disable-next-line react-refresh/only-export-components
function InheritanceStatus({ chart }: { chart: ChartListItem }) {
// if no information is available, return an empty cell
if (
Expand Down
3 changes: 2 additions & 1 deletion adminSiteClient/ChartViewIndexPage.tsx
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions adminSiteClient/ColorSchemeDropdown.tsx
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -27,7 +27,7 @@ interface ColorSchemeDropdownProps {
}

@observer
export class ColorSchemeDropdown extends React.Component<ColorSchemeDropdownProps> {
export class ColorSchemeDropdown extends Component<ColorSchemeDropdownProps> {
static defaultProps = {
additionalOptions: [],
gradientColorCount: 6,
Expand Down
8 changes: 4 additions & 4 deletions adminSiteClient/Colorpicker.tsx
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -16,7 +16,7 @@ interface ColorpickerProps {
}

@observer
export class Colorpicker extends React.Component<ColorpickerProps> {
export class Colorpicker extends Component<ColorpickerProps> {
@action.bound onColor(color: string) {
if (color === "") {
this.props.onColor(undefined)
Expand All @@ -39,7 +39,7 @@ export class Colorpicker extends React.Component<ColorpickerProps> {
}

return (
<React.Fragment>
<Fragment>
<SketchPicker
disableAlpha
presetColors={availableColors.map((color) => ({
Expand All @@ -49,7 +49,7 @@ export class Colorpicker extends React.Component<ColorpickerProps> {
color={this.props.color}
onChange={(color) => this.onColor(color.hex)}
/>
</React.Fragment>
</Fragment>
)
}
}
Loading
Loading