fix #5660 - updated One to many [1:N] icon across app - created many to one icon [N:1] , and added it in app   --------- Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import {
|
||||
IconComponent,
|
||||
IconLayersLinked,
|
||||
IconRelationManyToOne,
|
||||
IconRelationOneToMany,
|
||||
IconRelationOneToOne,
|
||||
} from 'twenty-ui';
|
||||
|
||||
@ -21,7 +22,7 @@ export const RELATION_TYPES: Record<
|
||||
> = {
|
||||
[RelationMetadataType.OneToMany]: {
|
||||
label: 'Has many',
|
||||
Icon: IconLayersLinked,
|
||||
Icon: IconRelationOneToMany,
|
||||
imageSrc: OneToManySvg,
|
||||
},
|
||||
[RelationMetadataType.OneToOne]: {
|
||||
@ -31,7 +32,7 @@ export const RELATION_TYPES: Record<
|
||||
},
|
||||
MANY_TO_ONE: {
|
||||
label: 'Belongs to one',
|
||||
Icon: IconLayersLinked,
|
||||
Icon: IconRelationManyToOne,
|
||||
imageSrc: OneToManySvg,
|
||||
isImageFlipped: true,
|
||||
},
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { ReactNode, useMemo } from 'react';
|
||||
import { useTheme } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { ReactNode, useMemo } from 'react';
|
||||
import { Nullable, useIcons } from 'twenty-ui';
|
||||
|
||||
import { useGetRelationMetadata } from '@/object-metadata/hooks/useGetRelationMetadata';
|
||||
@ -13,6 +13,7 @@ import { TableRow } from '@/ui/layout/table/components/TableRow';
|
||||
|
||||
import { RELATION_TYPES } from '../../constants/RelationTypes';
|
||||
|
||||
import { RelationMetadataType } from '~/generated-metadata/graphql';
|
||||
import { SettingsObjectFieldDataType } from './SettingsObjectFieldDataType';
|
||||
|
||||
type SettingsObjectFieldItemTableRowProps = {
|
||||
@ -89,7 +90,12 @@ export const SettingsObjectFieldItemTableRow = ({
|
||||
<TableCell>
|
||||
<SettingsObjectFieldDataType
|
||||
Icon={RelationIcon}
|
||||
label={relationObjectMetadataItem?.labelPlural}
|
||||
label={
|
||||
relationType === RelationMetadataType.ManyToOne ||
|
||||
relationType === RelationMetadataType.OneToOne
|
||||
? relationObjectMetadataItem?.labelSingular
|
||||
: relationObjectMetadataItem?.labelPlural
|
||||
}
|
||||
to={
|
||||
relationObjectMetadataItem?.namePlural &&
|
||||
!relationObjectMetadataItem.isSystem
|
||||
|
||||
Reference in New Issue
Block a user