How to use the @sanity/desk-tool/structure-builder.documentTypeListItems function in @sanity/desk-tool

To help you get started, we’ve selected a few @sanity/desk-tool examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sanity-io / sanity / packages / preview-gatsby-blog-studio / src / deskStructure.js View on Github external
.title('Authors')
            .child(documentId =>
              S.document()
                .documentId(documentId)
                .schemaType('author')
                .views([S.view.form(), S.view.component(Preview)])
            )
        ),
      S.listItem()
        .title('Categories')
        .schemaType('category')
        .child(S.documentTypeList('category').title('Categories')),
      // This returns an array of all the document types
      // defined in schema.js. We filter out those that we have
      // defined the structure above
      ...S.documentTypeListItems().filter(hiddenDocTypes)
    ])
github sanity-io / sanity-template-gatsby-portfolio / template / studio / deskStructure.js View on Github external
S.listItem()
        .title('Projects')
        .schemaType('project')
        .child(S.documentTypeList('project').title('Projects')),
      S.listItem()
        .title('People')
        .schemaType('person')
        .child(S.documentTypeList('person').title('People')),
      S.listItem()
        .title('Categories')
        .schemaType('category')
        .child(S.documentTypeList('category').title('Categories')),
      // This returns an array of all the document types
      // defined in schema.js. We filter out those that we have
      // defined the structure above
      ...S.documentTypeListItems().filter(hiddenDocTypes)
    ])
github queerjs / website / studio / deskStructure.js View on Github external
.schemaType('siteSettings')
            .documentId('siteSettings')
        ),
      S.listItem()
        .title('Attendees')
        .schemaType('attendee')
        .child(S.documentTypeList('attendee').title('Attendees')),
      S.listItem()
        .title('Speakers')
        .icon(MdPerson)
        .schemaType('speaker')
        .child(S.documentTypeList('speaker').title('Speakers')),
      // This returns an array of all the document types
      // defined in schema.js. We filter out those that we have
      // defined the structure above
      ...S.documentTypeListItems().filter(hiddenDocTypes)
    ])
github sanity-io / sanity-template-sapper-blog / template / studio / deskStructure.js View on Github external
.title('Blog posts')
        .schemaType('post')
        .child(S.documentTypeList('post').title('Blog posts')),
      S.listItem()
        .title('Authors')
        .icon(MdPerson)
        .schemaType('author')
        .child(S.documentTypeList('author').title('Authors')),
      S.listItem()
        .title('Categories')
        .schemaType('category')
        .child(S.documentTypeList('category').title('Categories')),
      // This returns an array of all the document types
      // defined in schema.js. We filter out those that we have
      // defined the structure above
      ...S.documentTypeListItems().filter(hiddenDocTypes)
    ])
github sanity-io / sanity / packages / test-studio / src / deskStructure.js View on Github external
id: 'books-by-author',
        title: 'Books by author',
        schemaType: 'book',
        child: () =>
          S.documentTypeList('author').child(authorId =>
            S.documentTypeList('book')
              .title('Books by author')
              .filter('_type == $type && author._ref == $authorId')
              .params({type: 'book', authorId})
              .initialValueTemplates([S.initialValueTemplateItem('book-by-author', {authorId})])
          )
      }),

      S.divider(),

      ...S.documentTypeListItems(),

      S.listItem()
        .title('Custom books list')
        .child(
          S.documentList()
            .title('Unspecified books list')
            .menuItems(S.documentTypeList('book').getMenuItems())
            .filter('_type == $type')
            .params({type: 'book'})
        ),

      S.documentTypeListItem('sanity.imageAsset')
        .title('Images')
        .icon(MdImage)
    ])
github sanity-io / sanity / packages / preview-nextjs-landing-pages-studio / plugins / dashboard-widget-structure-menu / src / lib / structure.js View on Github external
export function getDefaultStructure() {
  const items = StructureBuilder.documentTypeListItems()
  return StructureBuilder.list()
    .id('__root__')
    .title('Content')
    .showIcons(items.some(item => item.getSchemaType().icon))
    .items(items)
}
github sanity-io / sanity / packages / preview-nextjs-landing-pages-studio / src / deskStructure.js View on Github external
.schemaType('ad')
        .child(S.documentTypeList('ad').title('Ads')),
      S.listItem()
        .title('People')
        .schemaType('person')
        .child(
          S.documentTypeList('person')
            .title('People')
            .child(documentId =>
              S.document()
                .documentId(documentId)
                .schemaType('person')
                .views([S.view.form(), S.view.component(Preview)])
            )
        ),
      ...S.documentTypeListItems().filter(hiddenDocTypes)
    ])
github ehowey / gatsby-theme-catalyst / starters / gatsby-starter-catalyst-writer / sanity-studio / structure / deskStructure.js View on Github external
.child(
                  S.editor()
                    .schemaType("bioPage")
                    .documentId("bioPage")
                ),
              S.listItem()
                .title("Contact Page")
                .icon(MdInsertDriveFile)
                .child(
                  S.editor()
                    .schemaType("contactPage")
                    .documentId("contactPage")
                ),
            ])
        ),
      ...S.documentTypeListItems().filter(hiddenDocTypes),
    ])
github sanity-io / sanity / packages / preview-gatsby-blog-studio / plugins / dashboard-widget-structure-menu / src / lib / structure.js View on Github external
export function getDefaultStructure () {
  const items = StructureBuilder.documentTypeListItems()
  return StructureBuilder.list()
    .id('__root__')
    .title('Content')
    .showIcons(items.some(item => item.getSchemaType().icon))
    .items(items)
}