Adds pagination for custom props & fixes an issue with errant (none) return values - #1382
Merged
ukutaht merged 5 commits intoOct 14, 2021
Merged
Conversation
Contributor
|
This is great, thanks @Vigasaurus ! |
ukutaht
requested changes
Oct 13, 2021
Contributor
There was a problem hiding this comment.
Looks god to me.
Historically I haven't been testing things thoroughly but I think we're at a point where the project is getting pretty big and complex and I want to rein things in a bit.
This can be tested in the breakdown_test.exs file because there you can specify a low value for limit so you don't have to create 100 DB entries just for testing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Fixes #1353 by adding a "Load More" button to the bottom of the custom props list
Potentially fixes #550 (but that may have already been fixed with the old way of limiting to 100)
Also fixes an issue where the (none) value for custom props was being returned at all times, meaning that if you requested 100 items, it would return those 100 items + the none entry if there were the full 100 items to be returned, meaning that in a paginated setup, the none entry would be in the first page & not in its correct sorted order. Fixes this by 1. not applying the limit nor the offset to the none entry query (since it's extra filtered and would always be returning one row) and 2. removing the none entry from the zipped results if it was the 101st (or rather, the entry with an
index == limit) entry in the array (this implies that it was added where it was not yet necessary, and it should instead be returned on the next (or further) page.Tests
Changelog
Documentation