mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-23 20:13:21 +03:00
Use LinksMetadata right type for Links fields (#6380)
This commit is contained in:
parent
6785a2b92c
commit
001e698bbe
@ -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[];
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user