Add fullName field metadata type (#2563)
* Add fullName field metadata type * update seeds
This commit is contained in:
File diff suppressed because one or more lines are too long
@ -14,26 +14,14 @@ const personMetadata = {
|
||||
{
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
type: FieldMetadataType.TEXT,
|
||||
name: 'firstName',
|
||||
label: 'First name',
|
||||
type: FieldMetadataType.FULL_NAME,
|
||||
name: 'name',
|
||||
label: 'Name',
|
||||
targetColumnMap: {
|
||||
value: 'firstName',
|
||||
firstName: 'nameFirstName',
|
||||
lastName: 'nameLastName',
|
||||
},
|
||||
description: 'Contact’s first name',
|
||||
icon: 'IconUser',
|
||||
isNullable: false,
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
type: FieldMetadataType.TEXT,
|
||||
name: 'lastName',
|
||||
label: 'Last name',
|
||||
targetColumnMap: {
|
||||
value: 'lastName',
|
||||
},
|
||||
description: 'Contact’s last name',
|
||||
description: 'Contact’s name',
|
||||
icon: 'IconUser',
|
||||
isNullable: false,
|
||||
},
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
import { ObjectMetadataInterface } from 'src/workspace/workspace-schema-builder/interfaces/object-metadata.interface';
|
||||
import { FieldMetadataInterface } from 'src/workspace/workspace-schema-builder/interfaces/field-metadata.interface';
|
||||
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
|
||||
export const fullNameObjectDefinition = {
|
||||
id: FieldMetadataType.FULL_NAME.toString(),
|
||||
nameSingular: 'fullName',
|
||||
namePlural: 'fullName',
|
||||
labelSingular: 'FullName',
|
||||
labelPlural: 'FullName',
|
||||
targetTableName: '',
|
||||
fields: [
|
||||
{
|
||||
id: 'firstName',
|
||||
type: FieldMetadataType.TEXT,
|
||||
objectMetadataId: FieldMetadataType.FULL_NAME.toString(),
|
||||
name: 'firstName',
|
||||
label: 'First Name',
|
||||
targetColumnMap: { value: 'firstName' },
|
||||
isNullable: true,
|
||||
} satisfies FieldMetadataInterface,
|
||||
{
|
||||
id: 'lastName',
|
||||
type: FieldMetadataType.TEXT,
|
||||
objectMetadataId: FieldMetadataType.FULL_NAME.toString(),
|
||||
name: 'lastName',
|
||||
label: 'Last Name',
|
||||
targetColumnMap: { value: 'lastName' },
|
||||
isNullable: true,
|
||||
} satisfies FieldMetadataInterface,
|
||||
],
|
||||
fromRelations: [],
|
||||
toRelations: [],
|
||||
} satisfies ObjectMetadataInterface;
|
||||
@ -2,6 +2,7 @@ import { Injectable, Logger } from '@nestjs/common';
|
||||
|
||||
import { FieldMetadataEntity } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import { customTableDefaultColumns } from 'src/workspace/workspace-migration-runner/utils/custom-table-default-column.util';
|
||||
import { fullNameObjectDefinition } from 'src/workspace/workspace-schema-builder/object-definitions/full-name.object-definition';
|
||||
|
||||
import { TypeDefinitionsStorage } from './storages/type-definitions.storage';
|
||||
import {
|
||||
@ -63,6 +64,7 @@ export class TypeDefinitionsGenerator {
|
||||
const staticObjectMetadataCollection = [
|
||||
currencyObjectDefinition,
|
||||
linkObjectDefinition,
|
||||
fullNameObjectDefinition,
|
||||
];
|
||||
|
||||
this.logger.log(
|
||||
|
||||
Reference in New Issue
Block a user