-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test-studio] Add a fieldsets test type
- Loading branch information
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
export default { | ||
name: 'fieldsetsTest', | ||
type: 'document', | ||
title: 'Fieldsets test', | ||
preview: { | ||
select: { | ||
title: 'myObject.first' | ||
} | ||
}, | ||
fieldsets: [{name: 'recursive', title: 'Recursive', options: {collapsable: true}}], | ||
fields: [ | ||
{ | ||
name: 'myObject', | ||
type: 'myObject', | ||
title: 'MyObject', | ||
description: 'The first field here should be the title' | ||
}, | ||
{ | ||
name: 'Person', | ||
type: 'object', | ||
fieldsets: [{name: 'social', title: 'Social media handles'}], | ||
fields: [ | ||
{ | ||
name: 'name', | ||
title: 'Name', | ||
type: 'string' | ||
}, | ||
{ | ||
name: 'twitter', | ||
title: 'Twitter', | ||
type: 'string', | ||
fieldset: 'social' | ||
}, | ||
{ | ||
name: 'instagram', | ||
title: 'Instagram', | ||
type: 'string', | ||
fieldset: 'social' | ||
}, | ||
{ | ||
name: 'facebook', | ||
title: 'Facebook', | ||
type: 'string', | ||
fieldset: 'social' | ||
} | ||
] | ||
}, | ||
{ | ||
name: 'fieldWithObjectType', | ||
title: 'Field of object type', | ||
type: 'object', | ||
description: 'This is a field of (anonymous, inline) object type. Values here should never get a `_type` property', | ||
fields: [ | ||
{name: 'field1', type: 'string', description: 'This is a string field'}, | ||
{ | ||
name: 'field2', | ||
type: 'myObject', | ||
title: 'A field of myObject', | ||
description: 'This is another field of "myObject"' | ||
}, | ||
] | ||
}, | ||
{ | ||
name: 'recursive', | ||
title: 'This field is of type objectsTest', | ||
type: 'objectsTest', | ||
fieldset: 'recursive' | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters