Skip to content

Commit

Permalink
🔨 rename DataInsight -> DataInsightMinimalInformation
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Feb 13, 2025
1 parent 76bf05c commit d53204f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion adminShared/AdminTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface ApiChartViewOverview {
title: string
}

export interface DataInsight {
export interface DataInsightMinimalInformation {
gdocId: string
title: string
published: boolean
Expand Down
4 changes: 2 additions & 2 deletions adminSiteClient/AbstractChartEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Admin } from "./Admin.js"
import { defaultGrapherConfig, Grapher } from "@ourworldindata/grapher"
import { ChartViewMinimalInformation } from "./ChartEditor.js"
import { IndicatorChartInfo } from "./IndicatorChartEditor.js"
import { DataInsight } from "../adminShared/AdminTypes.js"
import { DataInsightMinimalInformation } from "../adminShared/AdminTypes.js"

export type EditorTab =
| "basic"
Expand Down Expand Up @@ -42,7 +42,7 @@ export interface References {
explorers?: string[]
chartViews?: ChartViewMinimalInformation[]
childCharts?: IndicatorChartInfo[]
dataInsights?: DataInsight[]
dataInsights?: DataInsightMinimalInformation[]
}

export abstract class AbstractChartEditor<
Expand Down
8 changes: 4 additions & 4 deletions adminSiteClient/EditorReferencesTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
} from "./ChartViewEditor.js"
import { ReuploadImageForDataInsightModal } from "./ReuploadImageForDataInsightModal.js"
import { ImageUploadResponse } from "./imagesHelpers.js"
import { DataInsight } from "../adminShared/AdminTypes.js"
import { DataInsightMinimalInformation } from "../adminShared/AdminTypes.js"
import { notification } from "antd"

const BASE_URL = BAKED_GRAPHER_URL.replace(/^https?:\/\//, "")
Expand Down Expand Up @@ -483,11 +483,11 @@ const NotificationContext = createContext(null)

const ReferencesDataInsights = (props: {
references: Pick<References, "dataInsights">
canReuploadImage?: (dataInsight: DataInsight) => boolean
makeImageUrl?: (dataInsight: DataInsight) => string
canReuploadImage?: (dataInsight: DataInsightMinimalInformation) => boolean
makeImageUrl?: (dataInsight: DataInsightMinimalInformation) => string
}) => {
const [dataInsightForUpload, setDataInsightForUpload] =
useState<DataInsight>()
useState<DataInsightMinimalInformation>()

const [notificationApi, notificationContextHolder] =
notification.useNotification()
Expand Down
4 changes: 2 additions & 2 deletions adminSiteServer/apiRoutes/chartViews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
import { omit, pick } from "lodash"
import {
ApiChartViewOverview,
DataInsight,
DataInsightMinimalInformation,
} from "../../adminShared/AdminTypes.js"
import { expectInt } from "../../serverUtils/serverUtil.js"
import {
Expand Down Expand Up @@ -357,7 +357,7 @@ export async function getChartViewReferences(
async function getDataInsightsForChartView(
knex: Knex<any, any[]>,
chartViewId: number
): Promise<DataInsight[]> {
): Promise<DataInsightMinimalInformation[]> {
const rows = await db.knexRaw<
Pick<DbRawPostGdoc, "id" | "published"> &
Pick<OwidGdocDataInsightContent, "title"> & {
Expand Down
4 changes: 2 additions & 2 deletions adminSiteServer/apiRoutes/charts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import { getPublishedLinksTo } from "../../db/model/Link.js"

import { Request } from "../authentication.js"
import e from "express"
import { DataInsight } from "../../adminShared/AdminTypes.js"
import { DataInsightMinimalInformation } from "../../adminShared/AdminTypes.js"

export const getReferencesByChartId = async (
chartId: number,
Expand Down Expand Up @@ -92,7 +92,7 @@ export const getReferencesByChartId = async (
WHERE cv.parentChartId = ?`,
[chartId]
)
const dataInsightsPromise = db.knexRaw<DataInsight>(
const dataInsightsPromise = db.knexRaw<DataInsightMinimalInformation>(
knex,
`-- sql
SELECT
Expand Down

0 comments on commit d53204f

Please sign in to comment.