Add pagination for items in My Lists

Bug #1160596 reported by Kyle Tomita
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Wishlist
Unassigned

Bug Description

The need for paging of the items in My Lists arose because of performance and visual reasons. On our system, patron's were getting Internal Server Errors because their list items were taking too long to load. The large size of the list was also making the page very long.

Adding pages with 10 items each would solve both these issues.

Evergreen: master

Ben Shum (bshum)
Changed in evergreen:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Kyle Tomita (tomitakyle) wrote :
tags: added: pullrequest
Revision history for this message
Pasi Kallinen (paxed) wrote :

My signoff:
http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/paxed/lp1160596-signoff

Perhaps the 10 items per page isn't quite enough - I'd probably go for 20.
And an improvement could be to have that configurable instead of hardcoded value.

tags: added: signedoff
Revision history for this message
Jason Stephenson (jstephenson) wrote :

Would it be a big deal for you to add the configuration as a user preference, Kyle? If so, I could take a stab at it, either in your branch or another.

Revision history for this message
Kyle Tomita (tomitakyle) wrote :

Hi Jason, is the configuration you are referring to the number of items per page?

Revision history for this message
Jason Stephenson (jstephenson) wrote : Re: [Bug 1160596] Re: Add pagination for items in My Lists

Quoting Kyle Tomita <email address hidden>:

> Hi Jason, is the configuration you are referring to the number of items
> per page?

Yes

Revision history for this message
Kyle Tomita (tomitakyle) wrote :

Jason,
Were you thinking of adding it as an option in Account Preferences or selectable on the My Lists page? Or even an org.setting?

Revision history for this message
Kyle Tomita (tomitakyle) wrote :

Upon further review, I feel a new tab under the Account Preferences would be best. (My List Options)
This could also hold an option for the number of lists displayed per page.

How does that idea sound?

Revision history for this message
Jason Stephenson (jstephenson) wrote :

Quoting Kyle Tomita <email address hidden>:

> Upon further review, I feel a new tab under the Account Preferences
> would be best. (My List Options)
> This could also hold an option for the number of lists displayed per page.
>
> How does that idea sound?

That works for me.

Revision history for this message
Kyle Tomita (tomitakyle) wrote :

The solution with a user setting to set the number of list items per page is pushed as a single commit to branch, http://git.evergreen-ils.org/?p=working/Evergreen.git;a=log;h=refs/heads/user/catalystit/lp1160596

Thanks for the suggestions everyone. This took longer than expected, but at least I learned a lot about Evergreen user settings. Hope it works to your liking.

Kyle Tomita (tomitakyle)
Changed in evergreen:
assignee: Kyle Tomita (tomitakyle) → nobody
Revision history for this message
Pasi Kallinen (paxed) wrote :

There's one untranslatable string, the list item help img title attr, and the db seed inserts don't have the oils_i18n_gettext() marker (which is bug 1160347)

Revision history for this message
Mike Rylander (mrylander) wrote :
Kyle Tomita (tomitakyle)
Changed in evergreen:
assignee: nobody → Kyle Tomita (tomitakyle)
status: Confirmed → In Progress
Revision history for this message
Kyle Tomita (tomitakyle) wrote :

Pasi Kallinen, I will work on getting those two items fixed.

Mike Rylander, Do you have some pointers for me on how to remove that hard-coded source? The idea of that part is to calculate the number of ebooks in a patron's list. Is there a way to determine if an item is an ebook?

Revision history for this message
Mike Rylander (mrylander) wrote :

Kyle,

You could check the source for the "trancendant" flag, or check for located URIs, or look at the MARC and make a heuristic determination of e-book-ness, or use a search constrained to the container and filter for bibs with no visible copies that still show up in a public search (which would cover the first two) ... or some combination of those. But not every site (in fact, none, out of the box) will use the same source as your site for all of their e-books.

Revision history for this message
Kyle Tomita (tomitakyle) wrote :

I updated the code to reflect the i18n and hard-coded bre.source fixes.

For the bre.source, I went ahead and check the source for the "transcendant" flag.

Changed in evergreen:
assignee: Kyle Tomita (tomitakyle) → nobody
Revision history for this message
Mike Rylander (mrylander) wrote :

Thanks, Kyle.

Reviewing the code directly is becoming difficult because of the master merges and commits spread out over a wide-ish swath of time. When you have a chance, please push a rebased branch with all of your code at the top of the history -- not one commit, necessarily, but all together and applying atop whatever is in the branch now. The easiest way to do this is to create a new branch off origin/master and then cherry-pick all of your commits into that, so they sit at the front. You can force-push this sort rebased branch to the existing one.

Going forward, unless the code you're touching also changes in master there's generally no need to try to keep your branch up-to-date with master. That said, if a branch does sit for a while without being incorporated into master, an occasional rebase wouldn't hurt. Like above, it's fine to force-push rebases of user (as opposed to collab) branches for the purpose of eliminating bit rot because the assumption is that active coding is done and you're not killing important history.

tags: removed: signedoff
Revision history for this message
Kyle Tomita (tomitakyle) wrote :

I pulled all changes into the top commit and updated the commit message.

I am still a newbie to the community, so that info helps me. Thanks Mike.

Kyle Tomita (tomitakyle)
Changed in evergreen:
status: In Progress → Confirmed
Ben Shum (bshum)
Changed in evergreen:
milestone: 2.4.0-rc → 2.5.0-alpha
Dan Wells (dbw2)
Changed in evergreen:
milestone: 2.5.0-m1 → 2.5.0-m2
Dan Wells (dbw2)
Changed in evergreen:
milestone: 2.5.0-m2 → 2.5.0-alpha1
Kathy Lussier (klussier)
tags: added: bookbag
Remington Steed (rjs7)
Changed in evergreen:
milestone: 2.5.0-alpha1 → 2.5.0-alpha2
Dan Wells (dbw2)
Changed in evergreen:
milestone: 2.5.0-alpha2 → 2.5.0-beta1
Dan Wells (dbw2)
tags: added: 2.5-beta-blocker
Remington Steed (rjs7)
tags: removed: my
Dan Wells (dbw2)
Changed in evergreen:
assignee: nobody → Dan Wells (dbw2)
Revision history for this message
Dan Wells (dbw2) wrote :

Kyle, thank you for your work on this! I have reviewed and pushed your code with a few trivial changes:

1) Removed an unneeded comment - this was copied and pasted from elsewhere in the file, but it didn't apply anymore
2) Moved some variables from CamelCase to under_score - there are a few files in Evergreen which use camel-case for variable names, but the files touched do not, so I felt it better to be consistent here
3) Added 'my list' paginator selection to stylesheet - it was hardcoded to 'red'

Even though the original branch is now in master, I am concerned by the complex counting queries, particularly the fact that replicating so much logic might lead to small inconsistencies or maintainability issues down the road. Perhaps we should just leverage the actual bookbag query to get the count instead? Here is a branch which does just that:

working/user/dbwells/lp1160596_my_list_paging_tweaks

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/dbwells/lp1160596_my_list_paging_tweaks

Again, the original branch is in, so this branch just needs review of the changes in the tip commit.

Changed in evergreen:
assignee: Dan Wells (dbw2) → nobody
Revision history for this message
Mike Rylander (mrylander) wrote :

Dan, thanks for the cleanup. Merged to master.

Changed in evergreen:
status: Confirmed → Fix Committed
Dan Wells (dbw2)
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.