-
Notifications
You must be signed in to change notification settings - Fork 2
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 Custom Fields Feature for Project Issues and Implement Associated CRUD Operations #21
Conversation
This adds the ability to track additional custom fields for project issues. These custom fields can be of various types (text, number, date, boolean), and are identified by a custom field id. Along with this, CRUD operations for these custom fields have also been implemented, including newly defined GraphQL mutations for creating and deleting project custom fields. To store these custom field values at the database level, additional columns have been added to the 'issues' table in a new migration file, and these values can be updated using the existing 'updateIssue' mutation under resolvers.
PR Analysis
PR Feedback💡 General suggestions: The PR is well-structured and the changes are logically grouped. The use of Sequelize for database operations and GraphQL for API operations is consistent with best practices. However, there are several TODO comments indicating areas that need improvement or further investigation. It would be beneficial to address these before merging the PR. 🤖 Code feedback:
✨ Usage tips:
|
This commit revolves around updating the naming conventions for custom field values. The term 'customFieldValues' has been replaced with 'customFields' across various files. This has also impacted the logic managing these fields, with adapted models, migrations, and resolvers to instantly reflect the changes. The 'customFieldValues' method within the Issue resolver has been completely removed as it is no longer necessary, given the new naming convention.
/describe |
PR Description updated to latest commit (8e87461) |
Type
enhancement, bug_fix
Description
PR changes walkthrough
8 files
20231228152900-add-custom-fields.js
backend/src/db/migrations/20231228152900-add-custom-fields.js
Add a new migration to create the 'project_custom_fields'
table with fields for id, projectId, fieldName, fieldType,
createdAt, and updatedAt.
20231228153315-add-issue-custom-field-values.js
backend/src/db/migrations/20231228153315-add-issue-custom-field-values.js
Add a new migration to add a 'custom_fields' JSONB column to
the 'issues' table.
index.js
backend/src/db/models/index.js
Import and initialize the 'ProjectCustomFields' model.
issue.js
backend/src/db/models/issue.js
Add 'customFields' JSONB field to the 'Issue' model.
project-custom-fields.js
backend/src/db/models/project-custom-fields.js
Define the 'ProjectCustomField' model with fields for id,
projectId, fieldName, fieldType, createdAt, and updatedAt.
index.js
backend/src/resolvers/Issue/index.js
Implement custom field value handling in the 'updateIssue'
mutation and add a 'CustomFieldValue' type resolver.
index.js
backend/src/resolvers/Project/index.js
Add mutations for creating and deleting project custom
fields and a resolver to fetch custom fields for a project.
type-defs.js
backend/src/type-defs.js
Add GraphQL type definitions for custom fields and custom
field values, and update the 'Issue' type to include
'customFields'.
1 files
index.js
backend/src/index.js
Add a check to return early from the context function if no
token is present.