Hide inactive objects and fields (#10104)

This PR modifies the data model visualizer to only show objects and
fields which are active.

- Added `isActive` check in the filter within the useEffect of the
`packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverviewEffect.tsx`
to filter out objects that are inactive
- Also added `isActive` check to the `StyledInnerCard` in the file
`packages/twenty-front/src/modules/settings/data-model/graph-overview/components/SettingsDataModelOverviewObject.tsx`
within the filter to filter out fields that have been marked inactive

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
A. Kiplimo
2025-02-10 17:45:09 +03:00
committed by GitHub
parent 62e44de831
commit 2a0f937899

View File

@ -111,7 +111,9 @@ export const SettingsDataModelOverviewObject = ({
objectNameSingular: objectMetadataItem.nameSingular,
});
const fields = objectMetadataItem.fields.filter((x) => !x.isSystem);
const fields = objectMetadataItem.fields.filter(
(x) => !x.isSystem && x.isActive,
);
const countNonRelation = fields.filter(
(x) => x.type !== FieldMetadataType.RELATION,
@ -162,7 +164,7 @@ export const SettingsDataModelOverviewObject = ({
fields
.filter((x) => x.type !== FieldMetadataType.RELATION)
.map((field) => (
<StyledCardRow>
<StyledCardRow key={field.id}>
<ObjectFieldRowWithoutRelation field={field} />
</StyledCardRow>
))}