From 0389fcf00de5b232d377fc54e93b280f7348f22c Mon Sep 17 00:00:00 2001 From: Guillim Date: Thu, 13 Nov 2025 12:03:25 +0100 Subject: [PATCH] removing feature flag IS_MORPH_RELATION_ENABLED (#15783) releasing the morph feature for all workspaces --- .../src/generated-metadata/graphql.ts | 1 - .../twenty-front/src/generated/graphql.ts | 1 - .../SettingsDataModelFieldRelationForm.tsx | 59 ++++--------------- .../constants/public-feature-flag.const.ts | 9 --- .../enums/feature-flag-key.enum.ts | 1 - .../services/field-metadata.service.ts | 18 ------ ...t-field-metadata-type-validator.service.ts | 17 ------ .../workspace-entity-manager.spec.ts | 1 - .../core/utils/seed-feature-flags.util.ts | 5 -- 9 files changed, 13 insertions(+), 99 deletions(-) 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 ? ( - - ) : ( -