Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't use previous view group state when creating a new view #8370

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

magrinj
Copy link
Member

@magrinj magrinj commented Nov 6, 2024

When creating a new view we don't want to use view-groups from previous view.

@magrinj magrinj requested a review from charlesBochet November 6, 2024 15:08
@magrinj magrinj marked this pull request as ready for review November 6, 2024 15:08
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR modifies the Kanban view creation logic to ensure new views always start with fresh view groups based on current field options, rather than inheriting groups from the source view.

  • Modified packages/twenty-front/src/modules/views/hooks/useCreateViewFromCurrentView.ts to remove view group copying from source view
  • Added logic to create view groups based on kanban field metadata options
  • Added empty group handling with position at end of view groups array
  • Ensures consistent view group creation for all new Kanban views

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +134 to +141
viewGroupsToCreate.push({
__typename: 'ViewGroup',
id: v4(),
fieldValue: '',
position: viewGroupsToCreate.length,
isVisible: true,
fieldMetadataId: kanbanFieldMetadataId,
} satisfies ViewGroup);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Empty fieldValue group should have a more descriptive name like 'No Value' or 'Unassigned' for better UX

@charlesBochet charlesBochet merged commit ffd790c into main Nov 6, 2024
19 checks passed
@charlesBochet charlesBochet deleted the fix/create-new-view branch November 6, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants