feat: NoValue is bot properly created the backend (#9110)
`No Value` view groups wasn't properly created when we select a group by field metadata, this PR fix the issue. Also a script is added to backfill the current view groups. --------- Co-authored-by: Marie <51697796+ijreilly@users.noreply.github.com>
This commit is contained in:
@ -73,6 +73,20 @@ export const useHandleRecordGroupField = ({
|
||||
}) satisfies ViewGroup,
|
||||
);
|
||||
|
||||
if (
|
||||
!existingGroupKeys.has(`${fieldMetadataItem.id}:`) &&
|
||||
fieldMetadataItem.isNullable === true
|
||||
) {
|
||||
viewGroupsToCreate.push({
|
||||
__typename: 'ViewGroup',
|
||||
id: v4(),
|
||||
fieldValue: '',
|
||||
isVisible: true,
|
||||
position: fieldMetadataItem.options.length,
|
||||
fieldMetadataId: fieldMetadataItem.id,
|
||||
} satisfies ViewGroup);
|
||||
}
|
||||
|
||||
const viewGroupsToDelete = view.viewGroups.filter(
|
||||
(group) => group.fieldMetadataId !== fieldMetadataItem.id,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user