Skip to content

fix: reset paging if table filters or sorts #794

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

Merged
merged 2 commits into from
Apr 24, 2021
Merged

Conversation

aaron-steinfeld
Copy link
Contributor

Description

Tables should switch page to page one if the user searches, applies a sort or filters. Currently, any offset is preserved meaning a search when on page two will show you page two of search results etc. The cause of this is three parts -

  1. the paginator, which actually pushes changes to the data, only pushed if the change was caused by the component itself, not if the inputs to the paginator changed.
  2. The table only pushed changes to the paginator when the url/route changed
  3. Because changes emitting from the paginator never made it back to the paginator's inputs, change detection in the reset case wasn't firing (because the reset page was equivalent to the last page input)

Testing

Visual/E2E

@aaron-steinfeld aaron-steinfeld requested a review from a team as a code owner April 24, 2021 01:32
@codecov
Copy link

codecov bot commented Apr 24, 2021

Codecov Report

Merging #794 (53a1e67) into main (ecc797f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #794   +/-   ##
=======================================
  Coverage   85.42%   85.42%           
=======================================
  Files         792      792           
  Lines       16169    16176    +7     
  Branches     2062     2063    +1     
=======================================
+ Hits        13812    13819    +7     
  Misses       2326     2326           
  Partials       31       31           
Impacted Files Coverage Δ
...ts/components/src/paginator/paginator.component.ts 95.38% <100.00%> (+0.30%) ⬆️
projects/components/src/table/table.component.ts 91.17% <100.00%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ecc797f...53a1e67. Read the comment docs.

@github-actions

This comment has been minimized.

Copy link
Contributor

@jake-bassett jake-bassett left a comment

Choose a reason for hiding this comment

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

Could have sworn we fixed this once before.

@aaron-steinfeld
Copy link
Contributor Author

Could have sworn we fixed this once before.

Probably!

@github-actions

This comment has been minimized.

@aaron-steinfeld aaron-steinfeld merged commit 7d25280 into main Apr 24, 2021
@aaron-steinfeld aaron-steinfeld deleted the reset-paging branch April 24, 2021 02:35
@github-actions
Copy link

Unit Test Results

    4 files  ±0  250 suites  ±0   13m 50s ⏱️ -17s
897 tests ±0  897 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
903 runs  ±0  903 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 7d25280. ± Comparison against base commit ecc797f.

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