Split components into object-metadata and object-record (#2425)
* Split components into object-metadata and object-record * Fix seed
This commit is contained in:
@ -291,7 +291,7 @@ export const seedFieldMetadata = async (
|
||||
isActive: true,
|
||||
type: 'TEXT',
|
||||
name: 'fieldMetadataId',
|
||||
label: 'Field Id',
|
||||
label: 'Field Metadata Id',
|
||||
targetColumnMap: {
|
||||
value: 'fieldMetadataId',
|
||||
},
|
||||
|
||||
@ -20,6 +20,7 @@ export const seedObjectMetadata = async (
|
||||
'icon',
|
||||
'dataSourceId',
|
||||
'workspaceId',
|
||||
'isActive',
|
||||
])
|
||||
.orIgnore()
|
||||
.values([
|
||||
@ -35,6 +36,7 @@ export const seedObjectMetadata = async (
|
||||
icon: 'IconBuildingSkyscraper',
|
||||
dataSourceId: 'b37b2163-7f63-47a9-b1b3-6c7290ca9fb1',
|
||||
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isActive: true,
|
||||
},
|
||||
// Views
|
||||
{
|
||||
@ -48,6 +50,7 @@ export const seedObjectMetadata = async (
|
||||
icon: 'IconLayoutCollage',
|
||||
dataSourceId: 'b37b2163-7f63-47a9-b1b3-6c7290ca9fb1',
|
||||
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isActive: true,
|
||||
},
|
||||
// ViewFields
|
||||
{
|
||||
@ -61,6 +64,7 @@ export const seedObjectMetadata = async (
|
||||
icon: 'IconColumns3',
|
||||
dataSourceId: 'b37b2163-7f63-47a9-b1b3-6c7290ca9fb1',
|
||||
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isActive: true,
|
||||
},
|
||||
// ViewFilters
|
||||
{
|
||||
@ -74,6 +78,7 @@ export const seedObjectMetadata = async (
|
||||
icon: 'IconFilterBolt',
|
||||
dataSourceId: 'b37b2163-7f63-47a9-b1b3-6c7290ca9fb1',
|
||||
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isActive: true,
|
||||
},
|
||||
// ViewSorts
|
||||
{
|
||||
@ -87,6 +92,7 @@ export const seedObjectMetadata = async (
|
||||
icon: 'IconArrowsSort',
|
||||
dataSourceId: 'b37b2163-7f63-47a9-b1b3-6c7290ca9fb1',
|
||||
workspaceId: 'twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419',
|
||||
isActive: true,
|
||||
},
|
||||
])
|
||||
.execute();
|
||||
|
||||
@ -10,7 +10,7 @@ const viewFieldsMetadata = {
|
||||
{
|
||||
type: 'TEXT',
|
||||
name: 'fieldMetadataId',
|
||||
label: 'Field Id',
|
||||
label: 'Field Metadata Id',
|
||||
targetColumnMap: {
|
||||
value: 'fieldMetadataId',
|
||||
},
|
||||
|
||||
@ -7,7 +7,7 @@ import {
|
||||
} from 'src/tenant/utils/deduce-relation-direction.util';
|
||||
|
||||
describe('deduceRelationDirection', () => {
|
||||
it('should return FROM when the current object ID matches fromObjectMetadataId', () => {
|
||||
it('should return FROM when the current object Metadata ID matches fromObjectMetadataId', () => {
|
||||
const currentObjectId = 'from_object_id';
|
||||
const relationMetadata = {
|
||||
id: 'relation_id',
|
||||
@ -26,7 +26,7 @@ describe('deduceRelationDirection', () => {
|
||||
expect(result).toBe(RelationDirection.FROM);
|
||||
});
|
||||
|
||||
it('should return TO when the current object ID matches toObjectMetadataId', () => {
|
||||
it('should return TO when the current object Metadata ID matches toObjectMetadataId', () => {
|
||||
// Arrange
|
||||
const currentObjectId = 'to_object_id';
|
||||
const relationMetadata = {
|
||||
@ -46,7 +46,7 @@ describe('deduceRelationDirection', () => {
|
||||
expect(result).toBe(RelationDirection.TO);
|
||||
});
|
||||
|
||||
it('should throw an error when the current object ID does not match any object metadata ID', () => {
|
||||
it('should throw an error when the current object Metadata ID does not match any object metadata ID', () => {
|
||||
const currentObjectId = 'unrelated_object_id';
|
||||
const relationMetadata = {
|
||||
id: 'relation_id',
|
||||
|
||||
Reference in New Issue
Block a user