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

fest(server): Entity field custom attribute #6065

Conversation

yuval-hazaz
Copy link
Member

@yuval-hazaz yuval-hazaz commented May 20, 2023

Part of: #5989

PR Details

The third PR for the epic - add the server-side functionality for EntityField.CustomAttrbute

πŸ€– Generated by Copilot at efba08e

Summary

πŸ†•πŸ—ƒοΈπŸ§ͺ

This pull request adds a new field customAttributes to the entity field model, database, and GraphQL schema. This field can be used to store any custom attributes for the entity field, such as validation rules, UI hints, or other metadata. The pull request also updates the relevant tests and migrations to include the new field.

To store some extra metadata
We added customAttributes
To the entity field model and schema
And to the GraphQL resolver
And to the tests that check the data

Walkthrough

  • Add a new column customAttributes to the EntityField table in the database to store custom attributes for entity fields (link)
  • Add a corresponding field customAttributes to the EntityField model in the Prisma schema with a type of String and optional (link)
  • Add a GraphQL input field customAttributes to the EntityFieldCreateInput, EntityFieldUpdateInput, EntityFieldWhereInput, and EntityFieldOrderByInput classes in the entity module with a type of String and optional and nullable (link, link, link, link)
  • Add a TypeORM column and a GraphQL field customAttributes to the EntityField class in the models module with a type of string and String respectively and nullable and optional (link)
  • Add a mock value for customAttributes to the EXAMPLE_ENTITY_FIELD constant in the entity resolver and service test files and the resource service test file (link, link, link)
  • Add a mock value for customAttributes to the EXAMPLE_ENTITY_FIELD_DATA and related constants in the entity service test file (link, link, link, link)
  • Add a selection for customAttributes to the GraphQL queries and mutations for entity fields in the entity resolver test file (link, link, link, link, link, link, link, link, link, link, link)
  • Add a variable and an argument for customAttributes to the GraphQL mutation for creating an entity field in the entity resolver test file (link, link)
  • Add an assertion for customAttributes to the expected object for the createEntityField mutation in the entity resolver test file (link)

PR Checklist

  • Tests for the changes have been added
  • npm test doesn't throw any error

IMPORTANT: Please review the CONTRIBUTING.md file for detailed contributing guidelines.

@yuval-hazaz yuval-hazaz changed the base branch from master to feat/entity-custom-attribute-ui May 20, 2023 07:36
@nx-cloud
Copy link

nx-cloud bot commented May 20, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit efba08e. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

πŸ“‚ See all runs for this branch


βœ… Successfully ran 8 targets

Sent with πŸ’Œ from NxCloud.

@yuval-hazaz yuval-hazaz changed the title Feat/entity field custom attribute fest(server): Entity field custom attribute May 20, 2023
@EugeneTseitlin EugeneTseitlin linked an issue May 20, 2023 that may be closed by this pull request
Base automatically changed from feat/entity-custom-attribute-ui to feat/entity-custom-attributes-umbrella May 20, 2023 19:47
@yuval-hazaz yuval-hazaz merged commit e597c79 into feat/entity-custom-attributes-umbrella May 20, 2023
11 checks passed
@yuval-hazaz yuval-hazaz deleted the feat/entity-field-custom-attribute branch May 20, 2023 19:47
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.

As User - I want to set custom attributes on the entity level
2 participants