How to use the @sanity/desk-tool/structure-builder.documentList 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 / test-studio / src / deskStructure.js View on Github external
.child(() =>
          delay(
            S.documentList({
              id: 'title-list',
              title: 'Titles!',
              options: {
                filter: 'defined(title)'
              }
            })
          )
        ),
github sanity-io / sanity / packages / test-studio / src / deskStructure.js View on Github external
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)
    ])