Skip to content

Commit

Permalink
🔨 remove validation for internal DI props
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Feb 5, 2025
1 parent ec11ed2 commit 54b0129
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions adminSiteClient/gdocsValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,45 +186,6 @@ function validateApprovedBy(
}
}

function validateGrapherUrl(
gdoc: OwidGdocDataInsightInterface,
errors: OwidGdocErrorMessage[]
) {
if (!gdoc.content["narrative-chart"] && !gdoc.content["grapher-url"]) {
errors.push({
property: "grapher-url",
type: OwidGdocErrorMessageType.Warning,
message: `Missing "grapher-url". This isn't required, but if you're referencing a grapher, it's a good idea to add it so that we can link it to this data insight in the future. Include country selections, if applicable.`,
})
}
}

function validateNarrativeChart(
gdoc: OwidGdocDataInsightInterface,
errors: OwidGdocErrorMessage[]
) {
if (!gdoc.content["narrative-chart"] && !gdoc.content["grapher-url"]) {
errors.push({
property: "narrative-chart",
type: OwidGdocErrorMessageType.Warning,
message: `Missing "narrative-chart". This isn't required, but if you're referencing a narrative chart, it's a good idea to add it so that we can link it to this data insight.`,
})
}
}

function validateFigmaUrl(
gdoc: OwidGdocDataInsightInterface,
errors: OwidGdocErrorMessage[]
) {
if (!gdoc.content["figma-url"]) {
errors.push({
property: "figma-url",
type: OwidGdocErrorMessageType.Warning,
message: `Missing "figma-url". This isn't required, but if you edited the chart in Figma, it's a good idea to share the URL so that we can link it to this data insight.`,
})
}
}

function validateDataInsightImage(
gdoc: OwidGdocDataInsightInterface,
errors: OwidGdocErrorMessage[]
Expand Down Expand Up @@ -322,9 +283,6 @@ export const getErrors = (gdoc: OwidGdoc): OwidGdocErrorMessage[] => {
validateAtomFields(gdoc, errors)
} else if (checkIsDataInsight(gdoc)) {
validateApprovedBy(gdoc, errors)
validateNarrativeChart(gdoc, errors)
validateGrapherUrl(gdoc, errors)
validateFigmaUrl(gdoc, errors)
validateDataInsightImage(gdoc, errors)
} else if (checkIsAuthor(gdoc)) {
validateSocials(gdoc, errors)
Expand Down

0 comments on commit 54b0129

Please sign in to comment.