FEATURE: Add lazy loading to user bookmarks list (#9317)

This is so users with huge amount of bookmarks do not have to wait a long time to see results.

* Add a bookmark list and list serializer to server-side to be able to handle paging and load more URL
* Use load-more component to load more bookmark items, 20 at a time in user activity
* Change the way current user is loaded for bookmark ember models because it was breaking/losing resolvedTimezone when loading more items
This commit is contained in:
Martin Brennan
2020-04-01 14:09:07 +10:00
committed by GitHub
parent b8d2261db9
commit c07dd0d22a
10 changed files with 155 additions and 61 deletions

View File

@ -4198,7 +4198,7 @@ describe UsersController do
sign_in(user)
get "/u/#{user.username}/bookmarks.json"
expect(response.status).to eq(200)
expect(JSON.parse(response.body)['bookmarks'].map { |b| b['id'] }).to match_array([bookmark1.id, bookmark2.id])
expect(JSON.parse(response.body)['user_bookmark_list']['bookmarks'].map { |b| b['id'] }).to match_array([bookmark1.id, bookmark2.id])
end
it "does not show another user's bookmarks" do