@ -7,6 +7,7 @@ import { TableCell } from '@/ui/layout/table/components/TableCell';
|
||||
import { TableRow } from '@/ui/layout/table/components/TableRow';
|
||||
import { Field } from '~/generated-metadata/graphql';
|
||||
|
||||
import { dataTypes } from '../../constants/dataTypes';
|
||||
import { MetadataFieldDataType } from '../../types/ObjectFieldDataType';
|
||||
|
||||
import { SettingsObjectFieldDataType } from './SettingsObjectFieldDataType';
|
||||
@ -30,6 +31,9 @@ const StyledIconTableCell = styled(TableCell)`
|
||||
padding-right: ${({ theme }) => theme.spacing(1)};
|
||||
`;
|
||||
|
||||
// TODO: remove "relation" type for now, add it back when the backend is ready.
|
||||
const { RELATION: _, ...dataTypesWithoutRelation } = dataTypes;
|
||||
|
||||
export const SettingsObjectFieldItemTableRow = ({
|
||||
ActionIcon,
|
||||
fieldItem,
|
||||
@ -38,15 +42,12 @@ export const SettingsObjectFieldItemTableRow = ({
|
||||
const { Icon } = useLazyLoadIcon(fieldItem.icon ?? '');
|
||||
|
||||
// TODO: parse with zod and merge types with FieldType (create a subset of FieldType for example)
|
||||
const fieldDataTypeIsSupported = [
|
||||
'TEXT',
|
||||
'NUMBER',
|
||||
'BOOLEAN',
|
||||
'URL',
|
||||
].includes(fieldItem.type);
|
||||
const fieldDataTypeIsSupported = Object.keys(
|
||||
dataTypesWithoutRelation,
|
||||
).includes(fieldItem.type);
|
||||
|
||||
if (!fieldDataTypeIsSupported) {
|
||||
return <></>;
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user