Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] isLabelSyncedWithName should be nullable #9028

Merged
merged 4 commits into from
Dec 12, 2024

Conversation

ijreilly
Copy link
Collaborator

@ijreilly ijreilly commented Dec 11, 2024

isLabelSyncedWithName should be nullable for fieldMetadata, as it is for objectMetadata.

  • Adding missing validation on label and name sync in fieldMetadataService for creation and update
  • adding metadata tests

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Makes the isLabelSyncedWithName field nullable in both server-side DTOs and generated GraphQL types to fix inconsistencies in field optionality.

  • Modified @Field decorator in /packages/twenty-server/src/engine/metadata-modules/field-metadata/dtos/field-metadata.dto.ts to include { nullable: true }
  • Updated generated types in /packages/twenty-front/src/generated-metadata/graphql.ts to reflect nullable boolean field
  • Change aligns with existing @IsOptional() decorator and TypeScript optional modifier

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@@ -147,7 +147,7 @@ export class FieldMetadataDTO<

@IsBoolean()
@IsOptional()
@Field()
@Field({ nullable: true })
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is nullable in the input but non-null in db, as it is for objectMetadata. I really need to double check but I think we want to allow null values in the input that we backfill in the service

@ijreilly ijreilly requested a review from Weiko December 12, 2024 16:37
Copy link
Member

@Weiko Weiko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

const response = await makeMetadataAPIRequest(graphqlOperation);

// Assert
console.log(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are those logs intended?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oopsie !

@ijreilly ijreilly merged commit d56c815 into main Dec 12, 2024
19 checks passed
@ijreilly ijreilly deleted the fix-label-sync-with-name-field branch December 12, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants