diff --git a/carbon-projects/lib/categories.ts b/carbon-projects/lib/categories.ts new file mode 100644 index 0000000000..5de58c04d3 --- /dev/null +++ b/carbon-projects/lib/categories.ts @@ -0,0 +1,11 @@ +export const categories = [ + { title: "Energy Efficiency", value: "Energy Efficiency" }, + { title: "Forestry", value: "Forestry" }, + { title: "Industrial Processing", value: "Industrial Processing" }, + { title: "Renewable Energy", value: "Renewable Energy" }, + { title: "Blue Carbon", value: "Blue Carbon" }, + { title: "Agriculture", value: "Agriculture" }, + { title: "Construction", value: "Construction" }, + { title: "Biochar", value: "Biochar" }, + { title: "Other", value: "Other" }, +]; diff --git a/carbon-projects/schemas/methodology.ts b/carbon-projects/schemas/methodology.ts index 4c2f639e43..8783dcea3b 100644 --- a/carbon-projects/schemas/methodology.ts +++ b/carbon-projects/schemas/methodology.ts @@ -1,16 +1,5 @@ import { defineField, defineType } from "sanity"; - -const categories = [ - { title: "Energy Efficiency", value: "Energy Efficiency" }, - { title: "Forestry", value: "Forestry" }, - { title: "Industrial Processing", value: "Industrial Processing" }, - { title: "Renewable Energy", value: "Renewable Energy" }, - { title: "Blue Carbon", value: "Blue Carbon" }, - { title: "Agriculture", value: "Agriculture" }, - { title: "Construction", value: "Construction" }, - { title: "Biochar", value: "Biochar" }, - { title: "Other", value: "Other" }, -]; +import { categories } from "../lib/categories"; export default defineType({ name: "methodology", diff --git a/carbon-projects/schemas/projectContent.ts b/carbon-projects/schemas/projectContent.ts index 1443993f6c..fc860a9d33 100644 --- a/carbon-projects/schemas/projectContent.ts +++ b/carbon-projects/schemas/projectContent.ts @@ -1,4 +1,5 @@ import { defineField, defineType } from "sanity"; +import { categories } from "../lib/categories"; import { sdgs } from "../lib/sdgs"; export default defineType({ @@ -30,6 +31,22 @@ export default defineType({ group: "info", validation: (r) => r.required(), }), + defineField({ + name: "nameOverride", + description: + "Manually modified name to override the official registry name for the project (used to handle formatting issues)", + group: "info", + type: "string", + }), + defineField({ + name: "categoryOverride", + description: + "For this project, override the methodology's normal category with a different one from our predefined ontology of categories", + type: "string", + options: { + list: categories, + }, + }), defineField({ name: "shortDescription", description: