Skip to content

Commit

Permalink
feat: basket page resources (#24)
Browse files Browse the repository at this point in the history
* feat: add BasketDetails page document

* doc: update readme about documents actions

* doc: add details regarding experimental actions
  • Loading branch information
flagrede authored Jan 25, 2023
1 parent f764d5b commit 1ee0a1f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This is the [Sanity](https://sanity.io/) Studio for editing content on Regen Reg

1. Run `yarn start` to start the studio locally.
2. When adding new documents or objects to the schema, make sure to import them from `schemas/schemas.js`. In case of documents, you'll also need to make sure to add them to the appropriate list in `deskStructure` so it gets displayed on the Studio, whether it's as part under "Registry", "Website" or "Shared".
3. You might also need to change `__experimental_actions` field. When creating a new document you will need the `create` action to add a new entry in the local studio. This action should be commented back after to prevent having more than one entry for a document. Note that this is relevant only for documents that represent website/app pages. For other types of documents (eg SDG, impact...), we do no use experimental_actions at all because we do want to create multiple such documents, contrary to a website/app page that should be unique.

**NOTE**: if changes have been made in the CMS since the last deploy, you should run `yarn import-production` to import the latest data before making changes locally

Expand Down
16 changes: 14 additions & 2 deletions deskStructure.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ export default () => {
.title('Credit Classes')
.schemaType('creditClass')
.child(S.documentTypeList('creditClass').title('Credit Classes')),
S.listItem()
.title('Basket Details Page')
.schemaType('basketDetailsPage')
.child(S.document().schemaType('basketDetailsPage')),
]),
),

Expand Down Expand Up @@ -216,11 +220,19 @@ export default () => {
S.listItem()
.title('Resources for Getting Started Sections')
.schemaType('gettingStartedResourcesSection')
.child(S.documentTypeList('gettingStartedResourcesSection').title('Resources for Getting Started Sections')),
.child(
S.documentTypeList('gettingStartedResourcesSection').title(
'Resources for Getting Started Sections',
),
),
S.listItem()
.title('Resource for Getting Started Cards')
.schemaType('gettingStartedResourcesCard')
.child(S.documentTypeList('gettingStartedResourcesCard').title('Resource for Getting Started Cards')),
.child(
S.documentTypeList('gettingStartedResourcesCard').title(
'Resource for Getting Started Cards',
),
),
]),
),
]);
Expand Down
16 changes: 16 additions & 0 deletions schemas/documents/registry/basketDetailsPage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default {
name: 'basketDetailsPage',
type: 'document',
title: 'Basket Details Page',
__experimental_actions: ['update', /* 'create', 'delete', */ 'publish'],
fields: [
{
name: 'gettingStartedResourcesCard',
type: 'reference',
to: [{ type: 'gettingStartedResourcesCard' }],
title: 'Resources for Getting Started Card',
description: 'This content will appear at the bottom of the Basket Details page',
validation: Rule => Rule.required(),
},
],
};
2 changes: 2 additions & 0 deletions schemas/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import mainnetPage from './documents/www/mainnetPage';
import projectsPage from './documents/registry/projectsPage';
import projectPage from './documents/registry/projectPage';
import bridgePage from './documents/registry/bridgePage';
import basketDetailsPage from './documents/registry/basketDetailsPage';

import resource from './documents/shared/resource';
import faq from './documents/shared/faq';
Expand Down Expand Up @@ -172,6 +173,7 @@ export default createSchema({
// to the ones provided by any plugins that are installed
types: schemaTypes.concat([
basicStepCardSection,
basketDetailsPage,
blogPost,
blogSection,
bodyGreenTextWithPopover,
Expand Down

0 comments on commit 1ee0a1f

Please sign in to comment.