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] Add asignee and relation on task #8284

Conversation

Hitarthsheth07
Copy link
Contributor

@Hitarthsheth07 Hitarthsheth07 commented Nov 2, 2024

FIX #8248

There was a minor logical error in the boxedRelationFieldMetadataItems. (see files changed)

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

This PR modifies the FieldsCard component to fix the display and editing of the Assignee field on Task show pages by correcting the relation field filtering logic.

  • Fixed logical operator in boxedRelationFieldMetadataItems filter from && to || in /packages/twenty-front/src/modules/object-record/record-show/components/FieldsCard.tsx
  • Removed unnecessary condition check for noteTargets when object is not a Note
  • Removed unnecessary condition check for taskTargets when object is not a Task
  • Contains a commented out debug console.log statement that should be removed

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

Comment on lines 82 to 85
objectNameSingular !== CoreObjectNameSingular.Note &&
fieldMetadataItem.name !== 'noteTargets' &&
fieldMetadataItem.name !== 'noteTargets' ||
objectNameSingular !== CoreObjectNameSingular.Task &&
fieldMetadataItem.name !== 'taskTargets',
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: This condition has a logical error. Using || instead of && here will cause incorrect filtering of relation fields. The current logic will show all fields when either condition is false.

@@ -55,6 +55,8 @@ export const FieldsCard = ({
fieldMetadataItemA.name.localeCompare(fieldMetadataItemB.name),
);

// console.log(JSON.st(availableFieldMetadataItems))
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Remove commented out console.log statement

@FelixMalfait
Copy link
Member

Oh I'm sorry I didn't see @charlesBochet had raised an issue, I had already fixed it right before you raised the PR here: #8280

Glad we came to the same conclusion :). Thanks a lot for the effort

@Hitarthsheth07
Copy link
Contributor Author

Oh I'm sorry I didn't see @charlesBochet had raised an issue, I had already fixed it right before you raised the PR here: #8280

Glad we came to the same conclusion :). Thanks a lot for the effort

No problem @FelixMalfait. Also, if you've got some time two more of my PR's are awaiting review. 🙃

@Hitarthsheth07 Hitarthsheth07 deleted the add-relational-fields-on-tasks branch November 6, 2024 20:30
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.

On Tasks Show Page, I should be able to edit the Assignee of a Task
2 participants