From fd0e25f25a8c041863f8b48ac1c5eca4001d7716 Mon Sep 17 00:00:00 2001 From: Florent Lagrede Date: Mon, 26 Jun 2023 16:58:52 +0200 Subject: [PATCH] feat: add projectRating and creditCertification (#43) --- deskStructure.js | 10 ++++++++++ .../documents/shared/creditCertification.js | 18 ++++++++++++++++++ schemas/documents/shared/projectRating.js | 18 ++++++++++++++++++ schemas/schema.js | 4 ++++ 4 files changed, 50 insertions(+) create mode 100644 schemas/documents/shared/creditCertification.js create mode 100644 schemas/documents/shared/projectRating.js diff --git a/deskStructure.js b/deskStructure.js index 361429b..29ed483 100644 --- a/deskStructure.js +++ b/deskStructure.js @@ -241,6 +241,12 @@ export default S => 'Credit Generation Method', ), ), + S.listItem() + .title('Credit Certification') + .schemaType('creditCertification') + .child( + S.documentTypeList('creditCertification').title('Credit Certification'), + ), S.listItem() .title('Ecological Credit Card') .schemaType('ecologicalCreditCard') @@ -261,6 +267,10 @@ export default S => .title('Project Ecosystem') .schemaType('projectEcosystem') .child(S.documentTypeList('projectEcosystem').title('Project Ecosystem')), + S.listItem() + .title('Project Rating') + .schemaType('projectRating') + .child(S.documentTypeList('projectRating').title('Project Rating')), S.listItem() .title('Project') .schemaType('project') diff --git a/schemas/documents/shared/creditCertification.js b/schemas/documents/shared/creditCertification.js new file mode 100644 index 0000000..4ae8f76 --- /dev/null +++ b/schemas/documents/shared/creditCertification.js @@ -0,0 +1,18 @@ +export default { + title: 'Credit Certification', + name: 'creditCertification', + type: 'document', + fields: [ + { + title: 'Name', + name: 'name', + type: 'string', + validation: Rule => Rule.required(), + }, + { + title: 'Icon', + name: 'icon', + type: 'image', + }, + ], +}; diff --git a/schemas/documents/shared/projectRating.js b/schemas/documents/shared/projectRating.js new file mode 100644 index 0000000..0e4b5c6 --- /dev/null +++ b/schemas/documents/shared/projectRating.js @@ -0,0 +1,18 @@ +export default { + title: 'Project Rating', + name: 'projectRating', + type: 'document', + fields: [ + { + title: 'Name', + name: 'name', + type: 'string', + validation: Rule => Rule.required(), + }, + { + title: 'Icon', + name: 'icon', + type: 'image', + }, + ], +}; diff --git a/schemas/schema.js b/schemas/schema.js index 400d30a..11630df 100644 --- a/schemas/schema.js +++ b/schemas/schema.js @@ -36,6 +36,8 @@ import ecologicalCreditCard from './documents/shared/ecologicalCreditCard'; import offsetMethod from './documents/shared/offsetMethod'; import projectActivity from './documents/shared/projectActivity'; import projectEcosystem from './documents/shared/projectEcosystem'; +import creditCertification from './documents/shared/creditCertification'; +import projectRating from './documents/shared/projectRating'; import project from './documents/shared/project'; import featuredProjectCard from './documents/shared/featuredProjectCard'; import partner from './documents/shared/partner'; @@ -235,6 +237,7 @@ export default [ createCreditClassPage, createMethodologyPage, createMethodologyStepCardSection, + creditCertification, creditClass, creditInfos, creditType, @@ -322,6 +325,7 @@ export default [ projectDetails, projectDetailsCard, projectPage, + projectRating, projectsPage, quoteSection, quoteText,