Update seed default values (#2681)
* Update seed default values * Update seed default values * Update seed default values * remove allowImpersonation in workspaceMembers * remove USD from currencyCode defaultValue * fix tests
This commit is contained in:
@ -24,6 +24,7 @@ const activityMetadata = {
|
||||
description: 'Activity title',
|
||||
icon: 'IconNotes',
|
||||
isNullable: true,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
@ -37,6 +38,7 @@ const activityMetadata = {
|
||||
description: 'Activity body',
|
||||
icon: 'IconList',
|
||||
isNullable: true,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
@ -50,6 +52,7 @@ const activityMetadata = {
|
||||
description: 'Activity type',
|
||||
icon: 'IconCheckbox',
|
||||
isNullable: false,
|
||||
defaultValue: { value: 'Note' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
@ -148,7 +151,6 @@ const activityMetadata = {
|
||||
icon: undefined,
|
||||
isNullable: false,
|
||||
isSystem: true,
|
||||
defaultValue: undefined,
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
|
||||
@ -23,6 +23,7 @@ const apiKeyMetadata = {
|
||||
description: 'ApiKey name',
|
||||
icon: 'IconLink',
|
||||
isNullable: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
|
||||
@ -25,6 +25,18 @@ const commentMetadata = {
|
||||
isNullable: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
type: FieldMetadataType.UUID,
|
||||
name: 'authorId',
|
||||
label: 'Author',
|
||||
targetColumnMap: {},
|
||||
description: 'Comment author',
|
||||
icon: 'IconCircleUser',
|
||||
isNullable: true,
|
||||
isSystem: true,
|
||||
},
|
||||
// Relations
|
||||
{
|
||||
isCustom: false,
|
||||
@ -37,18 +49,6 @@ const commentMetadata = {
|
||||
icon: 'IconCircleUser',
|
||||
isNullable: true,
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
type: FieldMetadataType.RELATION,
|
||||
name: 'authorId',
|
||||
label: 'Author',
|
||||
targetColumnMap: {},
|
||||
description: 'Comment author',
|
||||
icon: 'IconCircleUser',
|
||||
isNullable: true,
|
||||
isSystem: true,
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
|
||||
@ -38,6 +38,7 @@ const companyMetadata = {
|
||||
'The company website URL. We use this url to fetch the company icon',
|
||||
icon: 'IconLink',
|
||||
isNullable: true,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
@ -51,6 +52,7 @@ const companyMetadata = {
|
||||
description: 'The company address',
|
||||
icon: 'IconMap',
|
||||
isNullable: true,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
|
||||
@ -47,9 +47,10 @@ const opportunityMetadata = {
|
||||
targetColumnMap: {
|
||||
value: 'probability',
|
||||
},
|
||||
description: 'Opportunity amount',
|
||||
description: 'Opportunity probability',
|
||||
icon: 'IconProgressCheck',
|
||||
isNullable: true,
|
||||
defaultValue: { value: '0' },
|
||||
},
|
||||
// Relations
|
||||
{
|
||||
|
||||
@ -78,6 +78,7 @@ const personMetadata = {
|
||||
description: 'Contact’s job title',
|
||||
icon: 'IconBriefcase',
|
||||
isNullable: true,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
@ -91,6 +92,7 @@ const personMetadata = {
|
||||
description: 'Contact’s phone number',
|
||||
icon: 'IconPhone',
|
||||
isNullable: true,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
@ -104,6 +106,7 @@ const personMetadata = {
|
||||
description: 'Contact’s city',
|
||||
icon: 'IconMap',
|
||||
isNullable: true,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
@ -118,6 +121,7 @@ const personMetadata = {
|
||||
icon: 'IconFileUpload',
|
||||
isNullable: true,
|
||||
isSystem: true,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
// Relations
|
||||
{
|
||||
|
||||
@ -14,7 +14,7 @@ const viewFieldMetadata = {
|
||||
{
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
type: FieldMetadataType.TEXT,
|
||||
type: FieldMetadataType.UUID,
|
||||
name: 'fieldMetadataId',
|
||||
label: 'Field Metadata Id',
|
||||
targetColumnMap: {
|
||||
@ -23,7 +23,6 @@ const viewFieldMetadata = {
|
||||
description: 'View Field target field',
|
||||
icon: 'IconTag',
|
||||
isNullable: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
|
||||
@ -14,7 +14,7 @@ const viewFilterMetadata = {
|
||||
{
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
type: FieldMetadataType.TEXT,
|
||||
type: FieldMetadataType.UUID,
|
||||
name: 'fieldMetadataId',
|
||||
label: 'Field Metadata Id',
|
||||
targetColumnMap: {
|
||||
@ -23,7 +23,6 @@ const viewFilterMetadata = {
|
||||
description: 'View Filter target field',
|
||||
icon: null,
|
||||
isNullable: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
|
||||
@ -14,7 +14,7 @@ const viewSortMetadata = {
|
||||
{
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
type: FieldMetadataType.TEXT,
|
||||
type: FieldMetadataType.UUID,
|
||||
name: 'fieldMetadataId',
|
||||
label: 'Field Metadata Id',
|
||||
targetColumnMap: {
|
||||
@ -23,7 +23,6 @@ const viewSortMetadata = {
|
||||
description: 'View Sort target field',
|
||||
icon: null,
|
||||
isNullable: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
|
||||
@ -24,7 +24,7 @@ const viewMetadata = {
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
type: FieldMetadataType.TEXT,
|
||||
type: FieldMetadataType.UUID,
|
||||
name: 'objectMetadataId',
|
||||
label: 'Object Metadata Id',
|
||||
targetColumnMap: {
|
||||
@ -33,7 +33,6 @@ const viewMetadata = {
|
||||
description: 'View target object',
|
||||
icon: null,
|
||||
isNullable: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
type: FieldMetadataType.TEXT,
|
||||
|
||||
@ -38,6 +38,7 @@ const workspaceMemberMetadata = {
|
||||
description: 'Preferred color scheme',
|
||||
icon: 'IconColorSwatch',
|
||||
isNullable: false,
|
||||
defaultValue: { value: 'Light' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
@ -51,7 +52,7 @@ const workspaceMemberMetadata = {
|
||||
description: 'Preferred language',
|
||||
icon: 'IconLanguage',
|
||||
isNullable: false,
|
||||
defaultValue: { value: 'fr' },
|
||||
defaultValue: { value: 'en' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
@ -66,6 +67,7 @@ const workspaceMemberMetadata = {
|
||||
icon: 'IconFileUpload',
|
||||
isNullable: true,
|
||||
isSystem: false,
|
||||
defaultValue: { value: '' },
|
||||
},
|
||||
{
|
||||
isCustom: false,
|
||||
|
||||
@ -81,23 +81,21 @@ export class WorkspaceManagerService {
|
||||
workspaceId: string,
|
||||
): Promise<ObjectMetadataEntity[]> {
|
||||
const createdObjectMetadata = await this.objectMetadataService.createMany(
|
||||
Object.values(standardObjectsMetadata).map(
|
||||
(objectMetadata: ObjectMetadataEntity) => ({
|
||||
...objectMetadata,
|
||||
dataSourceId,
|
||||
workspaceId,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
fields: [...basicFieldsMetadata, ...objectMetadata.fields].map(
|
||||
(field) => ({
|
||||
...field,
|
||||
workspaceId,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
}),
|
||||
),
|
||||
}),
|
||||
),
|
||||
Object.values(standardObjectsMetadata).map((objectMetadata: any) => ({
|
||||
...objectMetadata,
|
||||
dataSourceId,
|
||||
workspaceId,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
fields: [...basicFieldsMetadata, ...objectMetadata.fields].map(
|
||||
(field) => ({
|
||||
...field,
|
||||
workspaceId,
|
||||
isCustom: false,
|
||||
isActive: true,
|
||||
}),
|
||||
),
|
||||
})),
|
||||
);
|
||||
|
||||
await this.relationMetadataService.createMany(
|
||||
|
||||
@ -3,6 +3,7 @@ import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { DataSourceService } from 'src/metadata/data-source/data-source.service';
|
||||
import { ObjectMetadataService } from 'src/metadata/object-metadata/object-metadata.service';
|
||||
import { WorkspaceSchemaStorageService } from 'src/workspace/workspace-schema-storage/workspace-schema-storage.service';
|
||||
import { ScalarsExplorerService } from 'src/workspace/services/scalars-explorer.service';
|
||||
|
||||
import { WorkspaceFactory } from './workspace.factory';
|
||||
|
||||
@ -24,6 +25,10 @@ describe('WorkspaceFactory', () => {
|
||||
provide: ObjectMetadataService,
|
||||
useValue: {},
|
||||
},
|
||||
{
|
||||
provide: ScalarsExplorerService,
|
||||
useValue: {},
|
||||
},
|
||||
{
|
||||
provide: WorkspaceGraphQLSchemaFactory,
|
||||
useValue: {},
|
||||
|
||||
Reference in New Issue
Block a user