avo
avo copied to clipboard
fix: don't hydrate resource with last record on index
Description
Checklist:
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
Screenshots & recording
Before
After
Code Climate has analyzed commit 77dece17 and detected 0 issues on this pull request.
View more on Code Climate.
Please let's wait a little bit with the @header_fields
implementation. I wanna have a closer look on this.
This PR has been marked as stale because there was no activity for the past 15 days.
Please let's wait a little bit with the
@header_fields
implementation. I wanna have a closer look on this.
This PR is ready to review. The main point of @header_fields
implementation is to "prepare" each table row before rendering the header.
If we know what columns are present on each row we can then compute the header by making an union.
This solves many issues.
- Resource will no longer need to be wrongly hydrated with the last table record:
1.1. This lead to several problems like an action link generated for that resource will wrongly target the last table record. Also all blocks executed on the index have the last table record hydrated, for example the
self.index_controls
https://github.com/avo-hq/avo/issues/2653#issuecomment-2044518084 - Header will no longer miss columns, even if only 1 row have a value for a column, that column will be rendered
- Row values will respect the column, I.E. if a row have a certain field hidden but the column exists now an empty dash will be rendered instead printing the next field value on the wrong column
This PR has been merged into main
. The functionality will be available in the next release.
Please check the release guide for more information.
I feel like this PR might be the reason for the issue I'm seeing: https://github.com/avo-hq/avo/issues/2732