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

Add createdBy field on custom object creation #6529

Merged
merged 2 commits into from
Aug 4, 2024
Merged

Conversation

charlesBochet
Copy link
Member

@charlesBochet charlesBochet commented Aug 4, 2024

In this PR, I'm:

  • adding createdBy field (type ACTOR) on custom objects when created
  • moving name and position default column to the set of columns automatically creation on object creation
  • fixing a bug on mutations (update / create), if the targetted object has a 'data' custom field, it was conflicting with the payload ==> I feel we need to refactor this part of the code but we can keep this for a bit later as we plan to move out of pg_graphql
image

@charlesBochet
Copy link
Member Author

@Weiko @magrinj FYI

Copy link

@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

This PR adds a createdBy field to custom objects and addresses a bug related to custom fields named 'data' in mutations.

  • packages/twenty-server/src/engine/api/graphql/workspace-query-builder/factories/create-many-query.factory.ts: Fixed bug with args.data handling to avoid conflicts with 'data' custom fields.
  • packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.service.ts: Added createdBy field and moved name and position fields to default columns.
  • packages/twenty-server/src/engine/workspace-manager/workspace-migration-runner/utils/custom-table-default-column.util.ts: Added new default columns including createdBySource and createdByWorkspaceMemberId.
  • packages/twenty-server/src/engine/workspace-manager/workspace-migration-runner/workspace-migration-runner.service.ts: Updated createTable method to dynamically generate default columns based on table name.
  • packages/twenty-server/src/engine/api/graphql/workspace-query-builder/factories/update-one-query.factory.ts: Fixed bug with args.data handling in update mutations.

8 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@charlesBochet charlesBochet merged commit e787215 into main Aug 4, 2024
7 of 11 checks passed
@charlesBochet charlesBochet deleted the created-by-custom branch August 4, 2024 11:12
@@ -265,6 +265,20 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
workspaceId: objectMetadataInput.workspaceId,
defaultValue: 'now',
},
{
Copy link
Member

Choose a reason for hiding this comment

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

Oops yes nice catch! 😄

{
name: 'createdBySource',
type: 'enum',
enumName: `${tableName}_createdBySource_enum`,
Copy link
Member

Choose a reason for hiding this comment

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

I'm always confused with that, are we really using camelcase for enum names? @charlesBochet (including the tableName that will be in camelCase as well)

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, everything is camelCase and values should be UPPER_CASE

charlesBochet added a commit that referenced this pull request Aug 4, 2024
…ed (#6531)

In this PR:
- take feedbacks from: #6530 /
#6529 /
#6526 /
#6512
- refactor onboarding uservars to be absent when the user is fully
onboarded: isStepComplete ==> isStepIncomplete
- introduce a new workspace.activationStatus: CREATION_ONGOING

I'm retesting the whole flow:
- with/without BILLING
- sign in with/without SSO
- sign up with/without SSO
- another workspaceMembers join the team
- subscriptionCanceled
- access to billingPortal
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