Fix Activities and Tasks modules (#2561)

* Fix activities

* Fix Timeline

* Refactor useCreateOne and useUpdateOne records

* Fix seeds
This commit is contained in:
Charles Bochet
2023-11-17 16:24:58 +01:00
committed by GitHub
parent a6d8cdb116
commit baf1260443
23 changed files with 259 additions and 222 deletions

View File

@ -18,12 +18,10 @@ const activityTargetMetadata = {
type: FieldMetadataType.RELATION,
name: 'activity',
label: 'Activity',
targetColumnMap: {
value: 'activityId',
},
targetColumnMap: {},
description: 'ActivityTarget activity',
icon: 'IconCheckbox',
isNullable: false,
isNullable: true,
},
{
isCustom: false,
@ -51,6 +49,45 @@ const activityTargetMetadata = {
icon: 'IconBuildingSkyscraper',
isNullable: true,
},
{
isCustom: false,
isActive: true,
type: FieldMetadataType.UUID,
name: 'activityId',
label: 'Activity id (foreign key)',
targetColumnMap: {},
description: 'ActivityTarget activity id foreign key',
icon: undefined,
isNullable: false,
isSystem: true,
defaultValue: undefined,
},
{
isCustom: false,
isActive: true,
type: FieldMetadataType.UUID,
name: 'personId',
label: 'Person id (foreign key)',
targetColumnMap: {},
description: 'ActivityTarget person id foreign key',
icon: undefined,
isNullable: true,
isSystem: true,
defaultValue: undefined,
},
{
isCustom: false,
isActive: true,
type: FieldMetadataType.UUID,
name: 'companyId',
label: 'Company id (foreign key)',
targetColumnMap: {},
description: 'ActivityTarget company id foreign key',
icon: undefined,
isNullable: true,
isSystem: true,
defaultValue: undefined,
},
],
};

View File

@ -1,3 +1,4 @@
import { SeedWorkspaceId } from 'src/database/seeds/metadata';
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
const activityMetadata = {
@ -129,28 +130,52 @@ const activityMetadata = {
type: FieldMetadataType.RELATION,
name: 'author',
label: 'Author',
targetColumnMap: {
value: 'authorId',
},
targetColumnMap: {},
description:
'Activity author. This is the person who created the activity',
icon: 'IconUserCircle',
isNullable: false,
},
{
isCustom: false,
workspaceId: SeedWorkspaceId,
isActive: true,
type: FieldMetadataType.UUID,
name: 'authorId',
label: 'Author id (foreign key)',
targetColumnMap: {},
description: 'Activity author id foreign key',
icon: undefined,
isNullable: false,
isSystem: true,
defaultValue: undefined,
},
{
isCustom: false,
isActive: true,
type: FieldMetadataType.RELATION,
name: 'assignee',
label: 'Assignee',
targetColumnMap: {
value: 'assigneeId',
},
targetColumnMap: {},
description:
'Acitivity assignee. This is the workspace member assigned to the activity ',
icon: 'IconUserCircle',
isNullable: true,
},
{
isCustom: false,
workspaceId: SeedWorkspaceId,
isActive: true,
type: FieldMetadataType.UUID,
name: 'assigneeId',
label: 'Assignee id (foreign key)',
targetColumnMap: {},
description: 'Acitivity assignee id foreign key',
icon: undefined,
isNullable: true,
isSystem: true,
defaultValue: undefined,
},
],
};