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 "Relations" not displayed on kanban views #9301

Merged
merged 4 commits into from
Jan 1, 2025

Conversation

guillim
Copy link
Contributor

@guillim guillim commented Dec 31, 2024

fix #7358

Problem was only for some specific relations : target tasks.
(Not related to 1o1 VS 1toMany VS MAnyto1)

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

Fixed a bug where Tasks and Notes 'Morph many' relations were not displaying in kanban views by correcting the metadata item filtering logic in the activity target hook.

  • Modified packages/twenty-front/src/modules/activities/hooks/useActivityTargetObjectRecords.ts to properly include Note and Task relations by removing incorrect negation in the includes() check
  • Ensures proper display of relation fields for both Tasks and Notes in kanban view contexts

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

@FelixMalfait
Copy link
Member

Made some feedbacks via Discord — I think this will require a different fix

@guillim guillim marked this pull request as draft December 31, 2024 16:58
@guillim guillim marked this pull request as ready for review December 31, 2024 18:03
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

(updates since last review)

This PR extends the fix for Tasks and Notes relations display in kanban views by implementing dynamic GraphQL field generation for record board queries.

  • Added useObjectMetadataItem hook in useRecordBoardRecordGqlFields.ts to fetch metadata for note/task targets
  • Implemented generateDepthOneRecordGqlFields for both noteTargets and taskTargets to replace hardcoded fields
  • Ensures complete relation data is fetched for kanban board display through dynamic field generation

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

useObjectMetadataItem({
objectNameSingular: CoreObjectNameSingular.TaskTarget,
});

const recordGqlFields: Record<string, any> = {
Copy link
Contributor

Choose a reason for hiding this comment

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

style: consider adding type safety by replacing Record<string, any> with a more specific type for GQL fields

Copy link
Member

@FelixMalfait FelixMalfait left a comment

Choose a reason for hiding this comment

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

Great!

@FelixMalfait FelixMalfait merged commit 7d74422 into main Jan 1, 2025
22 checks passed
@FelixMalfait FelixMalfait deleted the fix-task-notes-morph-relation branch January 1, 2025 08:17
Copy link

github-actions bot commented Jan 1, 2025

Fails
🚫

node failed.

Log

�[31mError: �[39m SyntaxError: Unexpected token C in JSON at position 0
    at JSON.parse (<anonymous>)
�[90m    at parseJSONFromBytes (node:internal/deps/undici/undici:5584:19)�[39m
�[90m    at successSteps (node:internal/deps/undici/undici:5555:27)�[39m
�[90m    at fullyReadBody (node:internal/deps/undici/undici:1665:9)�[39m
�[90m    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)�[39m
�[90m    at async specConsumeBody (node:internal/deps/undici/undici:5564:7)�[39m
danger-results://tmp/danger-results-0cc20d2a.json

Generated by 🚫 dangerJS against c3964dd

Weiko pushed a commit that referenced this pull request Jan 3, 2025
fix #7358

Problem was only for some specific relations : target tasks.
(Not related to 1o1 VS 1toMany VS MAnyto1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tasks & Notes Morph many "Relations" not displayed on kanban views
2 participants