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 isLabelSyncedWithName toggle at object creation #8646

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

ijreilly
Copy link
Collaborator

  • remove useless disableNameEdit prop (always has same value as disabled prop)

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 streamlines form disabling logic and fixes the isLabelSyncedWithName toggle behavior during object creation in the settings data model forms.

  • Simplified form disabling by replacing redundant disabled and disableNameEdit props with single disableEdition prop in /packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectAboutForm.tsx
  • Fixed initialization of isLabelSyncedWithName toggle to properly default to true when creating new objects
  • Updated API name input fields to respect combined disableEdition prop and isLabelSyncedWithName state

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

Comment on lines 305 to +306
checked={value ?? true}
disabled={!objectMetadataItem?.isCustom}
disabled={
Copy link
Contributor

Choose a reason for hiding this comment

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

style: value ?? true is redundant since defaultValue is already set with the same fallback on line 298

Copy link
Member

@Weiko Weiko left a comment

Choose a reason for hiding this comment

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

LGTM

@Weiko Weiko merged commit cf73e32 into main Nov 21, 2024
19 checks passed
@Weiko Weiko deleted the fix-form-object-creation branch November 21, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants