Use LinksMetadata right type for Links fields (#6380)

This commit is contained in:
Marie 2024-07-24 10:48:15 +02:00 committed by GitHub
parent 6785a2b92c
commit 001e698bbe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 24 additions and 12 deletions

View File

@ -1,4 +1,4 @@
import { ObjectType, Field, registerEnumType } from '@nestjs/graphql';
import { Field, ObjectType, registerEnumType } from '@nestjs/graphql';
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
import { TimelineCalendarEventParticipant } from 'src/engine/core-modules/calendar/dtos/timeline-calendar-event-participant.dto';
@ -10,7 +10,7 @@ registerEnumType(CalendarChannelVisibility, {
});
@ObjectType('LinkMetadata')
export class LinkMetadata {
class LinkMetadata {
@Field()
label: string;
@ -18,6 +18,18 @@ export class LinkMetadata {
url: string;
}
@ObjectType('LinksMetadata')
export class LinksMetadata {
@Field()
primaryLinkLabel: string;
@Field()
primaryLinkUrl: string;
@Field(() => [LinkMetadata], { nullable: true })
secondaryLinks: object | null;
}
@ObjectType('TimelineCalendarEvent')
export class TimelineCalendarEvent {
@Field(() => UUIDScalarType)
@ -47,8 +59,8 @@ export class TimelineCalendarEvent {
@Field()
conferenceSolution: string;
@Field(() => LinkMetadata)
conferenceLink: LinkMetadata;
@Field(() => LinksMetadata)
conferenceLink: LinksMetadata;
@Field(() => [TimelineCalendarEventParticipant])
participants: TimelineCalendarEventParticipant[];

View File

@ -1,6 +1,6 @@
import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface';
import { LinkMetadata } from 'src/engine/metadata-modules/field-metadata/composite-types/link.composite-type';
import { LinksMetadata } from 'src/engine/metadata-modules/field-metadata/composite-types/links.composite-type';
import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
import {
RelationMetadataType,
@ -143,7 +143,7 @@ export class CalendarEventWorkspaceEntity extends BaseWorkspaceEntity {
icon: 'IconLink',
})
@WorkspaceIsNullable()
conferenceLink: LinkMetadata;
conferenceLink: LinksMetadata;
@WorkspaceField({
standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.recurringEventExternalId,

View File

@ -3,7 +3,7 @@ import { Address } from 'nodemailer/lib/mailer';
import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface';
import { CurrencyMetadata } from 'src/engine/metadata-modules/field-metadata/composite-types/currency.composite-type';
import { LinkMetadata } from 'src/engine/metadata-modules/field-metadata/composite-types/link.composite-type';
import { LinksMetadata } from 'src/engine/metadata-modules/field-metadata/composite-types/links.composite-type';
import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
import {
RelationMetadataType,
@ -74,7 +74,7 @@ export class CompanyWorkspaceEntity extends BaseWorkspaceEntity {
icon: 'IconBrandLinkedin',
})
@WorkspaceIsNullable()
linkedinLink: LinkMetadata | null;
linkedinLink: LinksMetadata | null;
@WorkspaceField({
standardId: COMPANY_STANDARD_FIELD_IDS.xLink,
@ -84,7 +84,7 @@ export class CompanyWorkspaceEntity extends BaseWorkspaceEntity {
icon: 'IconBrandX',
})
@WorkspaceIsNullable()
xLink: LinkMetadata | null;
xLink: LinksMetadata | null;
@WorkspaceField({
standardId: COMPANY_STANDARD_FIELD_IDS.annualRecurringRevenue,

View File

@ -1,7 +1,7 @@
import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface';
import { FullNameMetadata } from 'src/engine/metadata-modules/field-metadata/composite-types/full-name.composite-type';
import { LinkMetadata } from 'src/engine/metadata-modules/field-metadata/composite-types/link.composite-type';
import { LinksMetadata } from 'src/engine/metadata-modules/field-metadata/composite-types/links.composite-type';
import { FieldMetadataType } from 'src/engine/metadata-modules/field-metadata/field-metadata.entity';
import {
RelationMetadataType,
@ -62,7 +62,7 @@ export class PersonWorkspaceEntity extends BaseWorkspaceEntity {
icon: 'IconBrandLinkedin',
})
@WorkspaceIsNullable()
linkedinLink: LinkMetadata | null;
linkedinLink: LinksMetadata | null;
@WorkspaceField({
standardId: PERSON_STANDARD_FIELD_IDS.xLink,
@ -72,7 +72,7 @@ export class PersonWorkspaceEntity extends BaseWorkspaceEntity {
icon: 'IconBrandX',
})
@WorkspaceIsNullable()
xLink: LinkMetadata | null;
xLink: LinksMetadata | null;
@WorkspaceField({
standardId: PERSON_STANDARD_FIELD_IDS.jobTitle,