How to use the @sanity/desk-tool/structure-builder.documentTypeList 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-template-gatsby-blog / template / studio / deskStructure.js View on Github external
.icon(MdSettings)
        .child(
          S.editor()
            .id('siteSettings')
            .schemaType('siteSettings')
            .documentId('siteSettings')
        ),
      S.listItem()
        .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
child: () =>
          S.documentTypeList('author')
            .title('Developers')
            .filter('_type == $type && role == $role')
            .params({type: 'author', role: 'developer'})
            .initialValueTemplates(S.initialValueTemplateItem('author-developer'))
      }),
github sanity-io / example-company-website-gatsby-sanity-combo / studio / deskStructure.js View on Github external
.icon(FaFile),
              S.listItem()
                .title('Contact')
                .child(
                  S.editor()
                    .id('contactPage')
                    .schemaType('page')
                    .documentId('contact')
                )
                .icon(FaFile)
            ])
        ),
      S.listItem()
        .title('People')
        .schemaType('person')
        .child(S.documentTypeList('person').title('People')),
      S.listItem()
        .title('Categories')
        .schemaType('category')
        .child(S.documentTypeList('category').title('Categories')),
      ...S.documentTypeListItems().filter(listItem => !hiddenTypes.includes(listItem.getId()))
    ])
github sanity-io / sanity / packages / preview-nextjs-landing-pages-studio / src / deskStructure.js View on Github external
.icon(MdSettings)
        .child(
          S.editor()
            .id('config')
            .schemaType('site-config')
            .documentId('global-config')
        ),
      S.listItem()
        .title('Pages')
        .icon(MdDashboard)
        .schemaType('page')
        .child(S.documentTypeList('page').title('Pages')),
      S.listItem()
        .title('Routes')
        .schemaType('route')
        .child(S.documentTypeList('route').title('Routes')),
      S.listItem()
        .title('Ads')
        .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)])
            )