Use new type position for standard objects and newly created objects (#4349)
Co-authored-by: Thomas Trompette <thomast@twenty.com>
This commit is contained in:
@ -29,6 +29,7 @@ export const useMapFieldMetadataToGraphQLQuery = () => {
|
||||
'BOOLEAN',
|
||||
'RATING',
|
||||
'SELECT',
|
||||
'POSITION',
|
||||
] as FieldType[]
|
||||
).includes(fieldType);
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ export const mapFieldMetadataToGraphqlQuery = (
|
||||
FieldMetadataType.EMAIL,
|
||||
FieldMetadataType.NUMBER,
|
||||
FieldMetadataType.BOOLEAN,
|
||||
FieldMetadataType.POSITION,
|
||||
].includes(fieldType);
|
||||
|
||||
if (fieldIsSimpleValue) {
|
||||
|
||||
@ -36,6 +36,7 @@ const getSchemaComponentsProperties = (
|
||||
case FieldMetadataType.NUMERIC:
|
||||
case FieldMetadataType.PROBABILITY:
|
||||
case FieldMetadataType.RATING:
|
||||
case FieldMetadataType.POSITION:
|
||||
itemProperty.type = 'number';
|
||||
break;
|
||||
case FieldMetadataType.BOOLEAN:
|
||||
|
||||
@ -291,7 +291,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
|
||||
defaultValue: { type: 'now' },
|
||||
},
|
||||
{
|
||||
type: FieldMetadataType.NUMBER,
|
||||
type: FieldMetadataType.POSITION,
|
||||
name: 'position',
|
||||
label: 'Position',
|
||||
targetColumnMap: {
|
||||
|
||||
@ -24,7 +24,8 @@ export type BasicFieldMetadataType =
|
||||
| FieldMetadataType.PROBABILITY
|
||||
| FieldMetadataType.BOOLEAN
|
||||
| FieldMetadataType.POSITION
|
||||
| FieldMetadataType.DATE_TIME;
|
||||
| FieldMetadataType.DATE_TIME
|
||||
| FieldMetadataType.POSITION;
|
||||
|
||||
@Injectable()
|
||||
export class BasicColumnActionFactory extends ColumnActionAbstractFactory<BasicFieldMetadataType> {
|
||||
|
||||
@ -12,6 +12,7 @@ const checkPosition = (value: any): PositionType => {
|
||||
if (isValidNumberPosition(value) || isValidStringPosition(value)) {
|
||||
return value;
|
||||
}
|
||||
|
||||
throw new Error('Invalid position found');
|
||||
};
|
||||
|
||||
|
||||
@ -99,9 +99,9 @@ export class CompanyObjectMetadata extends BaseObjectMetadata {
|
||||
idealCustomerProfile: boolean;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.NUMBER,
|
||||
type: FieldMetadataType.POSITION,
|
||||
label: 'Position',
|
||||
description: 'Position',
|
||||
description: 'Company record position',
|
||||
icon: 'IconHierarchy2',
|
||||
})
|
||||
@IsSystem()
|
||||
|
||||
@ -82,9 +82,9 @@ export class OpportunityObjectMetadata extends BaseObjectMetadata {
|
||||
stage: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.NUMBER,
|
||||
type: FieldMetadataType.POSITION,
|
||||
label: 'Position',
|
||||
description: 'Position',
|
||||
description: 'Opportunity record position',
|
||||
icon: 'IconHierarchy2',
|
||||
})
|
||||
@IsSystem()
|
||||
|
||||
@ -97,9 +97,9 @@ export class PersonObjectMetadata extends BaseObjectMetadata {
|
||||
avatarUrl: string;
|
||||
|
||||
@FieldMetadata({
|
||||
type: FieldMetadataType.NUMBER,
|
||||
type: FieldMetadataType.POSITION,
|
||||
label: 'Position',
|
||||
description: 'Record Position',
|
||||
description: 'Person record Position',
|
||||
icon: 'IconHierarchy2',
|
||||
})
|
||||
@IsSystem()
|
||||
|
||||
Reference in New Issue
Block a user