Skip to content

Commit

Permalink
fix various issues after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
danyx23 committed Jan 10, 2025
1 parent 404eef5 commit faf3b7c
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 35 deletions.
6 changes: 3 additions & 3 deletions adminSiteClient/EditorBasicTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import {

@observer
class DimensionSlotView<
Editor extends AbstractChartEditor
Editor extends AbstractChartEditor,
> extends React.Component<{
slot: DimensionSlot
editor: Editor
Expand Down Expand Up @@ -334,7 +334,7 @@ class DimensionSlotView<

@observer
class VariablesSection<
Editor extends AbstractChartEditor
Editor extends AbstractChartEditor,
> extends React.Component<{
editor: Editor
database: EditorDatabase
Expand Down Expand Up @@ -369,7 +369,7 @@ class VariablesSection<

@observer
export class EditorBasicTab<
Editor extends AbstractChartEditor
Editor extends AbstractChartEditor,
> extends React.Component<{
editor: Editor
database: EditorDatabase
Expand Down
2 changes: 1 addition & 1 deletion adminSiteClient/EditorTextTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { isChartViewEditorInstance } from "./ChartViewEditor.js"

@observer
export class EditorTextTab<
Editor extends AbstractChartEditor
Editor extends AbstractChartEditor,
> extends Component<{ editor: Editor; errorMessages: ErrorMessages }> {
@action.bound onSlug(slug: string) {
this.props.editor.grapherState.slug = slugify(slug)
Expand Down
4 changes: 2 additions & 2 deletions adminSiteClient/GrapherConfigGridEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ export class GrapherConfigGridEditor extends React.Component<GrapherConfigGridEd
)
}
}
if (this.selectedRow) this.updatePreviewToRow()
if (this.selectedRow) void this.updatePreviewToRow()
await this.sendPatches(action.patches)
}

Expand Down Expand Up @@ -848,7 +848,7 @@ export class GrapherConfigGridEditor extends React.Component<GrapherConfigGridEd
if (row1 !== this.selectedRow) {
this.hasUncommitedRichEditorChanges = false
this.selectedRow = row1
this.updatePreviewToRow()
void this.updatePreviewToRow()
}
this.selectionEndRow = row2
if (column1 !== this.selectedColumn) {
Expand Down
2 changes: 0 additions & 2 deletions adminSiteServer/testPageRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ import { ExplorerChartCreationMode } from "@ourworldindata/explorer"
import { getPlainRouteWithROTransaction } from "./plainRouterHelpers.js"
import {
ColorSchemes,
FetchingGrapher,
GrapherProgrammaticInterface,
} from "@ourworldindata/grapher"
import { GrapherFigureView } from "../site/GrapherFigureView.js"

const IS_LIVE = ADMIN_BASE_URL === "https://owid.cloud"
const DEFAULT_COMPARISON_URL = "https://ourworldindata.org"
Expand Down
5 changes: 2 additions & 3 deletions baker/GrapherImageBaker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ export async function bakeGrapherToSvgAndPng(
export async function getGraphersAndRedirectsBySlug(
knex: db.KnexReadonlyTransaction
) {
const { graphersBySlug, graphersById } = await getPublishedGraphersBySlug(
knex
)
const { graphersBySlug, graphersById } =
await getPublishedGraphersBySlug(knex)

const redirectQuery = await db.knexRaw<
Pick<DbPlainChartSlugRedirect, "slug" | "chart_id">
Expand Down
2 changes: 1 addition & 1 deletion packages/@ourworldindata/explorer/src/Explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ export class Explorer
@action.bound updateGrapherFromExplorer() {
switch (this.explorerProgram.chartCreationMode) {
case ExplorerChartCreationMode.FromGrapherId:
this.updateGrapherFromExplorerUsingGrapherId()
void this.updateGrapherFromExplorerUsingGrapherId()
break
case ExplorerChartCreationMode.FromVariableIds:
void this.updateGrapherFromExplorerUsingVariableIds()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import {
import React from "react"
import { Grapher, GrapherState } from "./Grapher.js"
import { loadVariableDataAndMetadata } from "./loadVariable.js"
import {
legacyToOwidTableAndDimensions,
legacyToOwidTableAndDimensionsWithMandatorySlug,
} from "./LegacyToOwidTable.js"
import { legacyToOwidTableAndDimensionsWithMandatorySlug } from "./LegacyToOwidTable.js"
import { OwidTable } from "@ourworldindata/core-table"
import { isEqual } from "@ourworldindata/utils"

Expand Down
12 changes: 4 additions & 8 deletions packages/@ourworldindata/grapher/src/core/Grapher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,7 @@ import {
DefaultChartClass,
} from "../chart/ChartTypeMap"
import { Entity, SelectionArray } from "../selection/SelectionArray"
import {
legacyToOwidTableAndDimensions,
legacyToOwidTableAndDimensionsWithMandatorySlug,
} from "./LegacyToOwidTable"
import { ScatterPlotManager } from "../scatterCharts/ScatterPlotChartConstants"
import { legacyToOwidTableAndDimensionsWithMandatorySlug } from "./LegacyToOwidTable"
import {
autoDetectSeriesStrategy,
autoDetectYColumnSlugs,
Expand Down Expand Up @@ -1085,7 +1081,7 @@ export class GrapherState {
get typeExceptWhenLineChartAndSingleTimeThenWillBeBarChart(): GrapherChartType {
return this.isLineChartThatTurnedIntoDiscreteBarActive
? GRAPHER_CHART_TYPES.DiscreteBar
: this.activeChartType ?? GRAPHER_CHART_TYPES.LineChart
: (this.activeChartType ?? GRAPHER_CHART_TYPES.LineChart)
}

@computed get isLineChart(): boolean {
Expand Down Expand Up @@ -1394,8 +1390,8 @@ export class GrapherState {
return !isStatic
? "underline"
: shouldIncludeDetailsInStaticExport
? "superscript"
: "none"
? "superscript"
: "none"
}

// required derived properties
Expand Down
10 changes: 5 additions & 5 deletions packages/@ourworldindata/grapher/src/core/LegacyToOwidTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ export const legacyToOwidTableAndDimensions = (
const entityName =
joinedVariablesTable.entityIdToNameMap.get(entityId)
return entityName && selectedEntityColors
? selectedEntityColors[entityName] ??
ErrorValueTypes.UndefinedButShouldBeString
? (selectedEntityColors[entityName] ??
ErrorValueTypes.UndefinedButShouldBeString)
: ErrorValueTypes.UndefinedButShouldBeString
}

Expand Down Expand Up @@ -456,7 +456,7 @@ const fullJoinTables = (
// not exist in the first table
const firstTableDuplicateForIndices: [
OwidTable | undefined,
string[] | undefined
string[] | undefined,
] = [tables[0], sharedColumnNames]
const defsToAddPerTable = [firstTableDuplicateForIndices]
.concat(zip(tables, columnsToAddPerTable))
Expand Down Expand Up @@ -646,8 +646,8 @@ const columnDefFromOwidVariable = (
const type = isContinent
? ColumnTypeNames.Continent
: variable.type
? variableTypeToColumnType(variable.type)
: ColumnTypeNames.NumberOrString
? variableTypeToColumnType(variable.type)
: ColumnTypeNames.NumberOrString

// Sorted values for ordinal columns
const sort =
Expand Down
7 changes: 1 addition & 6 deletions site/DataPageV2Content.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { useMemo, useEffect } from "react"
import { useMemo } from "react"
import {
FetchingGrapher,
fetchInputTableForConfig,
Grapher,
GrapherProgrammaticInterface,
GrapherState,
MapChart,
} from "@ourworldindata/grapher"
import {
REUSE_THIS_WORK_SECTION_ID,
Expand Down Expand Up @@ -34,7 +30,6 @@ import MetadataSection from "./MetadataSection.js"
import TopicTags from "./TopicTags.js"
import { AttachmentsContext } from "./gdocs/AttachmentsContext.js"
import { DocumentContext } from "./gdocs/DocumentContext.js"
import { reaction } from "mobx"
import { GrapherWithFallback } from "./GrapherWithFallback.js"

declare global {
Expand Down

0 comments on commit faf3b7c

Please sign in to comment.