-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 field forms #7595
Fix field forms #7595
Conversation
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.
PR Summary
This PR addresses issues with relation field forms, focusing on improving the handling of initial values and field name updates based on relation types.
- Implemented
useRelationSettingsFormInitialValues
hook inSettingsDataModelFieldRelationSettingsFormCard.tsx
to manage initial values for relation fields - Simplified
SettingsDataModelFieldIconLabelForm.tsx
by removing manual state management for labels and icons - Updated
SettingsObjectNewFieldConfigure.tsx
to use watched form values directly inSettingsDataModelFieldSettingsFormCard
- Adjusted border color in
IconButton.tsx
for visual consistency - Removed automatic field name updates based on relation type changes in
SettingsDataModelFieldRelationForm.tsx
, which may affect desired behavior
5 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile
value={value} | ||
onChange={(newValue) => { | ||
setLabelEditedManually(true); | ||
onChange(newValue); | ||
}} | ||
onChange={onChange} | ||
fullWidth |
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.
logic: The automatic update of the field name based on relation type changes has been removed. Consider implementing a way to update the field name while still allowing manual edits
fieldMetadataItem={{ | ||
icon: formConfig.watch('icon'), | ||
label: formConfig.watch('label') || 'New Field', | ||
type: fieldType as FieldMetadataType, | ||
}} |
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.
style: Consider using a separate variable for the fieldMetadataItem object to improve readability
@ehconitin Could you create an issue with the relevant changes left to do ? |
Thanks @ehconitin for your contribution! |
follow up issue #7683 |
@lucasbordeau
forms are broken!
revert - #7363
used useRelationSettingsFormInitialValues hook from that commit.
TODO - figure out a way to change the relation name label from singular to plural and vice versa, until it is edited.
related issue - #7355