Morph-settings-relation-and-morph-merge (#15062)

🎯 Merge Settings Relation and Morph Relation Forms

In the settings, we unify morph and relation into a single form. 

The form now automatically creates 
- a `RELATION` field when 1 destination object is selected 
- or a `MORPH_RELATION` field when 2+ objects are selected. 

Better UI labels (showing object name for single selection, "X Objects"
for multiple), proper field editing controls on destination objects, and
capitalized field labels.

We still make sure the isMorphRelationEnabled feature flag prevents
current users from accessing this feature

Fixes https://github.com/twentyhq/core-team-issues/issues/1589
This commit is contained in:
Guillim
2025-10-16 09:56:24 +02:00
committed by GitHub
parent d3f3f991a5
commit 20fdb66bd3
16 changed files with 241 additions and 520 deletions
@@ -165,8 +165,8 @@ export const SettingsMorphRelationMultiSelect = ({
{isDisabled ? (
<MultiSelectControl
selectedOptions={selectedOptions}
fixedIcon={IconBox}
fixedText="Object"
fixedIcon={selectedOptions.length < 2 ? undefined : IconBox}
fixedText={selectedOptions.length < 2 ? undefined : 'Object'}
isDisabled={isDisabled}
selectSizeVariant={selectSizeVariant}
hasRightElement={hasRightElement}
@@ -180,8 +180,8 @@ export const SettingsMorphRelationMultiSelect = ({
clickableComponent={
<MultiSelectControl
selectedOptions={selectedOptions}
fixedIcon={IconBox}
fixedText="Object"
fixedIcon={selectedOptions.length < 2 ? undefined : IconBox}
fixedText={selectedOptions.length < 2 ? undefined : 'Object'}
isDisabled={isDisabled}
selectSizeVariant={selectSizeVariant}
hasRightElement={hasRightElement}