Skip to content

Commit

Permalink
Add full sector list, update accreditation and file category options
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAurelius committed Jan 15, 2025
1 parent 4dd1648 commit 3beb794
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 7 deletions.
9 changes: 9 additions & 0 deletions carbon-projects/lib/fileCategories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const fileCategories = [
{ title: "Methodology", value: "Methodology" },
{
title: "Project Description Document (PDD)",
value: "Project Description Document (PDD)",
},
{ title: "Verifications", value: "Verifications" },
{ title: "Supporting Documentation", value: "Supporting Documentation" },
];
64 changes: 63 additions & 1 deletion carbon-projects/lib/sectors.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,65 @@
export const sectors = [
{ title: "Waste handling and disposal", value: "waste-h-d" },
{
title: "Afforestation and reforestation",
value: "afforestation-and-reforestation",
},
{
title: "Energy industries (renewable/non-renewable sources)",
value: "energy-industries-renewable-non-renewable-sources",
},
{ title: "Energy demand", value: "energy-demand" },
{
title: "Agriculture; forestry and fishing",
value: "agriculture-forestry-and-fishing",
},
{
title: "Waste handling and disposal",
value: "waste-handling-and-disposal",
},
{
title: "Livestock, enteric fermentation, and manure management",
value: "livestock-enteric-fermentation-and-manure-management",
},
{ title: "Technical Removal", value: "technical-removal" },
{ title: "Afforestation", value: "afforestation" },
{ title: "Transport", value: "transport" },
{
title: "Landfill Gas Capture/Combustion",
value: "landfill-gas-capture-combustion",
},
{ title: "Forestry", value: "forestry" },
{ title: "Energy Distribution", value: "energy-distribution" },
{
title:
"Water supply; sewerage, waste management and remediation activities",
value: "water-supply-sewerage-waste-management-and-remediation-activities",
},
{
title: "Electricity; gas, steam and air conditioning supply",
value: "electricity-gas-steam-and-air-conditioning-supply",
},
{ title: "Manufacturing", value: "manufacturing" },
{ title: "Transportation and storage", value: "transportation-and-storage" },
{
title: "Fugitive emissions from fuel (solid, oil and gas)",
value: "fugitive-emissions-from-fuel-solid-oil-and-gas",
},
{ title: "Manufacturing industries", value: "manufacturing-industries" },
{ title: "Chemical industries", value: "chemical-industries" },
{ title: "Energy distribution", value: "energy-distribution" },
{
title:
"Fugitive emissions from production and consumption of halocarbons and sulphur hexafluoride",
value:
"fugitive-emissions-from-production-and-consumption-of-halocarbons-and-sulphur-hexafluoride",
},
{ title: "Metal production", value: "metal-production" },
{ title: "Agriculture", value: "agriculture" },
{ title: "Mining/mineral production", value: "mining-mineral-production" },
{ title: "Construction", value: "construction" },
{ title: "Mining and quarrying", value: "mining-and-quarrying" },
{
title: "Metal production (metallurgy)",
value: "metal-production-metallurgy",
},
];
36 changes: 36 additions & 0 deletions carbon-projects/schemas/accreditation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { defineType } from "sanity";

export default defineType({
name: "accreditation",
title: "Accreditation",
description: "Information about an accreditation that applies to assessors",
type: "document",
preview: {
select: {
name: "name",
},
prepare(selection) {
return {
title: selection.name || "",
};
},
},
fields: [
{
type: "string",
title: "Name",
name: "name",
validation: (r) => r.required(),
},
{
type: "string",
title: "Link",
name: "link",
},
{
type: "image",
title: "Logo",
name: "logo",
},
],
});
8 changes: 4 additions & 4 deletions carbon-projects/schemas/assessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export default defineType({
name: "assessor",
title: "Assessor",
description: "Information about an organization that assesses projects",
description:
"A profile containing information about an entity including name, avatar, and link",
type: "document",
preview: {
select: {
Expand Down Expand Up @@ -39,8 +37,10 @@ export default defineType({
title: "Accreditations",
name: "accreditations",
of: [
{ type: "string", name: "name" },
{ type: "string", name: "link" },
{
type: "reference",
to: [{ type: "accreditation" }],
},
],
},
],
Expand Down
2 changes: 0 additions & 2 deletions carbon-projects/schemas/developer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export default defineType({
name: "developer",
title: "Developer",
description: "Information about an organization that develops projects",
description:
"A profile containing information about an entity including name, avatar, and link",
type: "document",
preview: {
select: {
Expand Down
2 changes: 2 additions & 0 deletions carbon-projects/schemas/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import accreditation from "./accreditation";
import assessor from "./assessor";
import country from "./country";
import developer from "./developer";
Expand All @@ -18,6 +19,7 @@ export const schemaTypes = [
captionImage,
country,
indexContent,
accreditation,
assessor,
developer,
standard,
Expand Down
4 changes: 4 additions & 0 deletions carbon-projects/schemas/objects/hostedFile.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineType } from "sanity";
import { fileCategories } from "../../lib/fileCategories";

export default defineType({
name: "hostedFile",
Expand Down Expand Up @@ -28,6 +29,9 @@ export default defineType({
type: "string",
title: "File category",
name: "category",
options: {
list: fileCategories,
},
},
{
type: "number",
Expand Down

0 comments on commit 3beb794

Please sign in to comment.