Skip to content

Commit

Permalink
Merge pull request #1154 from owid/move-suggested-chart-revision-types
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber authored Feb 14, 2022
2 parents 0ce5926 + 19761bb commit 67011d7
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 19 deletions.
8 changes: 1 addition & 7 deletions adminSiteClient/SuggestedChartRevision.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { GrapherInterface } from "../grapher/core/GrapherInterface"

export enum SuggestedChartRevisionStatus {
pending = "pending",
approved = "approved",
rejected = "rejected",
flagged = "flagged",
}
import { SuggestedChartRevisionStatus } from "../clientUtils/owidTypes"

export interface SuggestedChartRevisionSerialized {
id: number
Expand Down
10 changes: 5 additions & 5 deletions adminSiteClient/SuggestedChartRevisionApproverPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import Select from "react-select"
import classNames from "classnames"
import { Bounds } from "../clientUtils/Bounds"
import { getStylesForTargetHeight } from "../clientUtils/react-select"
import { SortOrder } from "../clientUtils/owidTypes"
import {
SortOrder,
SuggestedChartRevisionStatus,
} from "../clientUtils/owidTypes"
import { Grapher } from "../grapher/core/Grapher"
import { TextAreaField, NumberField, RadioGroup, Toggle } from "./Forms"
import { PostReference } from "./ChartEditor"
Expand All @@ -32,10 +35,7 @@ import {
VisionDeficiencyDropdown,
VisionDeficiencyEntity,
} from "./VisionDeficiencies"
import {
SuggestedChartRevisionSerialized,
SuggestedChartRevisionStatus,
} from "./SuggestedChartRevision"
import { SuggestedChartRevisionSerialized } from "./SuggestedChartRevision"

@observer
export class SuggestedChartRevisionApproverPage extends React.Component<{
Expand Down
2 changes: 1 addition & 1 deletion adminSiteClient/SuggestedChartRevisionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { AdminAppContext, AdminAppContextType } from "./AdminAppContext"
import { BAKED_GRAPHER_URL } from "../settings/clientSettings"
import { ChartListItem } from "./ChartList"
import { Link } from "./Link"
import { SuggestedChartRevisionStatus } from "./SuggestedChartRevision"
import { SuggestedChartRevisionStatus } from "../clientUtils/owidTypes"

export interface SuggestedChartRevisionListItem {
id: number
Expand Down
2 changes: 1 addition & 1 deletion adminSiteServer/apiRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
GrapherInterface,
grapherKeysToSerialize,
} from "../grapher/core/GrapherInterface"
import { SuggestedChartRevisionStatus } from "../adminSiteClient/SuggestedChartRevision"
import { SuggestedChartRevisionStatus } from "../clientUtils/owidTypes"
import {
VariableAnnotationsResponse,
VariableAnnotationPatch,
Expand Down
3 changes: 2 additions & 1 deletion baker/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
{ "path": "../db" },
{ "path": "../settings" },
{ "path": "../clientUtils" },
{ "path": "../serverUtils" }
{ "path": "../serverUtils" },
{ "path": "../gitCms" }
]
}
7 changes: 7 additions & 0 deletions clientUtils/owidTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,13 @@ export interface FullPost {
glossary: boolean
}

export enum SuggestedChartRevisionStatus {
pending = "pending",
approved = "approved",
rejected = "rejected",
flagged = "flagged",
}

// Exception format that can be easily given as an API error
export class JsonError extends Error {
status: number
Expand Down
2 changes: 1 addition & 1 deletion db/model/SuggestedChartRevision.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Entity, PrimaryGeneratedColumn, Column, BaseEntity } from "typeorm"

import { SuggestedChartRevisionStatus } from "../../adminSiteClient/SuggestedChartRevision"
import { SuggestedChartRevisionStatus } from "../../clientUtils/owidTypes"

@Entity("suggested_chart_revisions")
export class SuggestedChartRevision extends BaseEntity {
Expand Down
4 changes: 2 additions & 2 deletions db/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"references": [
{ "path": "../clientUtils" },
{ "path": "../adminSiteClient" },
{ "path": "../settings" }
{ "path": "../settings" },
{ "path": "../grapher" }
]
}
3 changes: 2 additions & 1 deletion devTools/project-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ graph TD;
baker --> clientUtils;
baker --> db;
baker --> explorerAdminServer;
baker --> gitCms;
baker --> serverUtils;
baker --> settings;
baker --> site;
coreTable --> clientUtils;
db --> adminSiteClient;
db --> clientUtils;
db --> grapher;
db --> settings;
explorer --> clientUtils;
Expand Down

0 comments on commit 67011d7

Please sign in to comment.