-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(form): fix issue with hiding a field group that only have fi…
…eldsets (#4477) * chore(test-studio): add repro schema for field groups with only fieldsets inside * refactor(form): tidy up field group logic and fix issue causing field group to be hidden if all fields are inside fieldsets Fixes #4432 * fixup! refactor(form): tidy up field group logic and fix issue causing field group to be hidden if all fields are inside fieldsets * fixup! fixup! refactor(form): tidy up field group logic and fix issue causing field group to be hidden if all fields are inside fieldsets --------- Co-authored-by: Robin Pyon <[email protected]>
- Loading branch information
Showing
9 changed files
with
255 additions
and
123 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,54 @@ | ||
import {CogIcon} from '@sanity/icons' | ||
|
||
export default { | ||
name: 'fieldGroupsWithFieldsets', | ||
title: 'Field groups with all fields inside fieldsets', | ||
type: 'document', | ||
groups: [ | ||
{ | ||
name: 'group1', | ||
title: 'Group 1', | ||
icon: CogIcon, | ||
}, | ||
{ | ||
name: 'group2', | ||
title: 'Group 2', | ||
}, | ||
], | ||
fieldsets: [ | ||
{name: 'fieldset1', title: 'Fieldset 1', options: {collapsed: true}}, | ||
{name: 'fieldset2', title: 'Fieldset 2', options: {collapsed: true}}, | ||
], | ||
fields: [ | ||
{ | ||
name: 'group1fieldset1', | ||
type: 'string', | ||
group: 'group1', | ||
fieldset: 'fieldset1', | ||
}, | ||
{ | ||
name: 'noGroupFieldset1', | ||
type: 'string', | ||
validation: (r) => r.required(), | ||
fieldset: 'fieldset1', | ||
}, | ||
{ | ||
name: 'group1fieldset2', | ||
type: 'string', | ||
group: 'group1', | ||
fieldset: 'fieldset2', | ||
}, | ||
{ | ||
name: 'group2fieldset1', | ||
type: 'string', | ||
group: 'group2', | ||
fieldset: 'fieldset1', | ||
}, | ||
{ | ||
name: 'group2fieldset2', | ||
type: 'string', | ||
group: 'group2', | ||
fieldset: 'fieldset2', | ||
}, | ||
], | ||
} |
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
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
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
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
Oops, something went wrong.
cf4fc5c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
performance-studio – ./
performance-studio-git-next.sanity.build
performance-studio.sanity.build
cf4fc5c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
test-studio – ./
test-studio-git-next.sanity.build
test-studio.sanity.build