Skip to content

Commit

Permalink
dev(test-studio): update comments debug schema
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanwikner committed Sep 29, 2023
1 parent f1cb46f commit dcafba6
Showing 1 changed file with 74 additions and 9 deletions.
83 changes: 74 additions & 9 deletions dev/test-studio/schema/debug/comments.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {defineType} from 'sanity'

const DESCRIPTION = 'Comments added to this field should be hidden when the toggle above is checked'

export const commentsDebug = defineType({
name: 'commentsDebug',
type: 'document',
Expand All @@ -11,36 +13,99 @@ export const commentsDebug = defineType({
title: 'String title',
},
{
name: 'hideImageField',
name: 'hideFields',
type: 'boolean',
title: 'Hide image field',
title: 'Hide fields',
},
{
type: 'object',
name: 'object',
title: 'Object title',
fields: [
{
type: 'string',
name: 'string',
title: 'String title',
hidden: ({document}) => Boolean(document?.hideFields),
description: DESCRIPTION,
},
{
type: 'number',
name: 'number',
title: 'Number title',
},
],
},
{
name: 'image',
type: 'image',
title: 'Image title',
hidden: ({document}) => Boolean(document?.hideImageField),
hidden: ({document}) => Boolean(document?.hideFields),
description: DESCRIPTION,
},
{
type: 'array',
name: 'arrayOfObjects',
title: 'Array of objects title',
title: 'Array 1',
of: [
{
name: 'firstObject',
name: 'arrayObject',
type: 'object',
title: 'First object title',
title: 'Array object 1',
fields: [
{
name: 'string',
type: 'string',
title: 'String title',
title: 'String 1',
},
{
name: 'image',
type: 'image',
title: 'Image title',
hidden: ({document}) => Boolean(document?.hideImageField),
title: 'Image 1',
hidden: ({document}) => {
return Boolean(document?.hideFields)
},
description: DESCRIPTION,
},
{
name: 'nestedArray',
type: 'array',
title: 'Array 2',
of: [
{
name: 'nestedArrayObject1',
type: 'object',
title: 'Nested array object 1',
fields: [
{
name: 'string',
type: 'string',
title: 'String 2.1',
},
{
name: 'image',
type: 'image',
title: 'Image 2.1',
hidden: ({document}) => {
return Boolean(document?.hideFields)
},
description: DESCRIPTION,
},
],
},
{
type: 'object',
name: 'nestedArrayObject2',
title: 'Nested array object 2',
fields: [
{
name: 'string',
type: 'string',
title: 'String 2.2',
},
],
},
],
},
],
},
Expand Down

0 comments on commit dcafba6

Please sign in to comment.