diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts index bb73f8d621..4a8b6ae5f7 100644 --- a/packages/twenty-front/src/generated-metadata/graphql.ts +++ b/packages/twenty-front/src/generated-metadata/graphql.ts @@ -1274,7 +1274,6 @@ export enum FeatureFlagKey { IS_IMAP_SMTP_CALDAV_ENABLED = 'IS_IMAP_SMTP_CALDAV_ENABLED', IS_JSON_FILTER_ENABLED = 'IS_JSON_FILTER_ENABLED', IS_MESSAGE_FOLDER_CONTROL_ENABLED = 'IS_MESSAGE_FOLDER_CONTROL_ENABLED', - IS_MORPH_RELATION_ENABLED = 'IS_MORPH_RELATION_ENABLED', IS_PAGE_LAYOUT_ENABLED = 'IS_PAGE_LAYOUT_ENABLED', IS_POSTGRESQL_INTEGRATION_ENABLED = 'IS_POSTGRESQL_INTEGRATION_ENABLED', IS_PUBLIC_DOMAIN_ENABLED = 'IS_PUBLIC_DOMAIN_ENABLED', diff --git a/packages/twenty-front/src/generated/graphql.ts b/packages/twenty-front/src/generated/graphql.ts index 4a42dd275a..50a2ad8126 100644 --- a/packages/twenty-front/src/generated/graphql.ts +++ b/packages/twenty-front/src/generated/graphql.ts @@ -1215,7 +1215,6 @@ export enum FeatureFlagKey { IS_IMAP_SMTP_CALDAV_ENABLED = 'IS_IMAP_SMTP_CALDAV_ENABLED', IS_JSON_FILTER_ENABLED = 'IS_JSON_FILTER_ENABLED', IS_MESSAGE_FOLDER_CONTROL_ENABLED = 'IS_MESSAGE_FOLDER_CONTROL_ENABLED', - IS_MORPH_RELATION_ENABLED = 'IS_MORPH_RELATION_ENABLED', IS_PAGE_LAYOUT_ENABLED = 'IS_PAGE_LAYOUT_ENABLED', IS_POSTGRESQL_INTEGRATION_ENABLED = 'IS_POSTGRESQL_INTEGRATION_ENABLED', IS_PUBLIC_DOMAIN_ENABLED = 'IS_PUBLIC_DOMAIN_ENABLED', diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/morph-relation/components/SettingsDataModelFieldRelationForm.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/morph-relation/components/SettingsDataModelFieldRelationForm.tsx index 021f1c4517..d8b65ad66e 100644 --- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/morph-relation/components/SettingsDataModelFieldRelationForm.tsx +++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/morph-relation/components/SettingsDataModelFieldRelationForm.tsx @@ -11,18 +11,14 @@ import { useRelationSettingsFormInitialTargetObjectMetadatas } from '@/settings/ import { useFieldMetadataItemById } from '@/object-metadata/hooks/useFieldMetadataItemById'; -import { useFilteredObjectMetadataItems } from '@/object-metadata/hooks/useFilteredObjectMetadataItems'; -import { isObjectMetadataAvailableForRelation } from '@/object-metadata/utils/isObjectMetadataAvailableForRelation'; import { IconPicker } from '@/ui/input/components/IconPicker'; import { Select } from '@/ui/input/components/Select'; import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput'; import { useIsMobile } from '@/ui/utilities/responsive/hooks/useIsMobile'; -import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled'; import styled from '@emotion/styled'; import { useLingui } from '@lingui/react/macro'; import { isDefined } from 'twenty-shared/utils'; -import { useIcons } from 'twenty-ui/display'; -import { FeatureFlagKey, RelationType } from '~/generated-metadata/graphql'; +import { RelationType } from '~/generated-metadata/graphql'; const StyledSelectsContainer = styled.div<{ isMobile: boolean }>` display: grid; @@ -77,7 +73,7 @@ export const SettingsDataModelFieldRelationForm = ({ const { t } = useLingui(); const { control } = useFormContext(); - const { getIcon } = useIcons(); + const { fieldMetadataItem: existingFieldMetadataItem } = useFieldMetadataItemById(existingFieldMetadataId); @@ -108,12 +104,6 @@ export const SettingsDataModelFieldRelationForm = ({ ); const isMobile = useIsMobile(); - const isMorphRelationEnabled = useIsFeatureEnabled( - FeatureFlagKey.IS_MORPH_RELATION_ENABLED, - ); - - const { activeObjectMetadataItems } = useFilteredObjectMetadataItems(); - return ( @@ -138,40 +128,17 @@ export const SettingsDataModelFieldRelationForm = ({ name="morphRelationObjectMetadataIds" control={control} defaultValue={initialMorphRelationsObjectMetadataIds} - render={({ field: { onChange, value } }) => - isMorphRelationEnabled ? ( - - ) : ( -