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 broken chips on timelin eActivity on show pages #9057

Merged
merged 3 commits into from
Dec 13, 2024

Conversation

charlesBochet
Copy link
Member

@charlesBochet charlesBochet commented Dec 13, 2024

We were using RecordIndexContext in FieldDisplays components which is wrong as the FieldDisplays could be used in locations not providing this context (not being indexes pages).

Instead, we are passing it within FieldContext which the context that will always be there for FieldDisplays and we need indexes to fill this FieldContext with their RecordIndexContext value when needed

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 replaces basePathToShowPage with labelIdentifierLink in FieldContext to fix broken chips in timeline activities on show pages, improving navigation and linking behavior across components.

  • Modifies packages/twenty-front/src/modules/object-record/record-field/contexts/FieldContext.ts to use labelIdentifierLink instead of basePathToShowPage
  • Updates ChipFieldDisplay component to use labelIdentifierLink for proper chip navigation
  • Simplifies RecordIndexRecordChip by removing useRecordIndexContextOrThrow and using direct to prop
  • Adds labelIdentifierLink to useChipFieldDisplay hook for consistent link handling
  • Removes redundant path generation in RecordTableCellFieldContextWrapper in favor of indexIdentifierUrl

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

const { columnDefinition } = useContext(RecordTableCellContext);

const { recordId, pathToShowPage } = useRecordTableRowContextOrThrow();
const { recordId } = useRecordTableRowContextOrThrow();
Copy link
Contributor

Choose a reason for hiding this comment

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

style: pathToShowPage is destructured but never used

@charlesBochet charlesBochet merged commit 57869d3 into main Dec 13, 2024
18 of 19 checks passed
@charlesBochet charlesBochet deleted the fix-broken-timeline-chips-on-show branch December 13, 2024 14:34
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