avo icon indicating copy to clipboard operation
avo copied to clipboard

fix: don't hydrate resource with last record on index

Open Paul-Bob opened this issue 11 months ago • 2 comments

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

image

After

image

Paul-Bob avatar Mar 01 '24 12:03 Paul-Bob

Code Climate has analyzed commit 77dece17 and detected 0 issues on this pull request.

View more on Code Climate.

codeclimate[bot] avatar Mar 01 '24 12:03 codeclimate[bot]

Please let's wait a little bit with the @header_fields implementation. I wanna have a closer look on this.

adrianthedev avatar Mar 02 '24 07:03 adrianthedev

This PR has been marked as stale because there was no activity for the past 15 days.

github-actions[bot] avatar Mar 23 '24 01:03 github-actions[bot]

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.

  1. 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
  2. Header will no longer miss columns, even if only 1 row have a value for a column, that column will be rendered
  3. 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

Paul-Bob avatar Apr 09 '24 09:04 Paul-Bob

This PR has been merged into main. The functionality will be available in the next release.

Please check the release guide for more information.

github-actions[bot] avatar Apr 18 '24 09:04 github-actions[bot]

I feel like this PR might be the reason for the issue I'm seeing: https://github.com/avo-hq/avo/issues/2732

xeron avatar May 01 '24 17:05 xeron