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