Parts combobox sorting - Angular Holdings Editor / volcopy editor

Bug #2037674 reported by Josh Stompro
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
Undecided
Unassigned

Bug Description

EG 3.11.1

I'm seeing some strange sorting in the Part combobox in the Angular holdings editor.

I've attached a screenshot, but here is the list.

 2016-10-17 ( OCT 17 )
 2016-11-07 ( NOV 07 )
 2016-12-19 ( DEC 19 )
 2017-05-08 ( May 8 )
 2016-10-31 ( OCT 31 )
 2019-01-14 ( Jan 14 )
 2019-02-25 ( Feb 25 )
 2019-01-28 ( Jan 28 )

This appears to match what an unordered db query returns
select label from biblio.monograph_part where record=188963 and not deleted;

So I think it just isn't being sorted.

It appears as if the commit for bug 1888723 was trying to add sorting for the parts data in volcopy.service.ts, fetchBibParts().

https://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/src/eg2/src/app/staff/cat/volcopy/volcopy.service.ts;h=9752bbd6f9eded766448b95ee2bd7a5a3a21da7d;hb=HEAD#l424

Maybe something just isn't quite right in that code.

Maybe the pcrud.search call can just set the order instead of sorting in javascript?

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :
Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Working branch at user/stompro/lp2037674_angular_holdings_part_sort

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/stompro/lp2037674_angular_holdings_part_sort

I'm unsure what the last part of the .subscribe( function is doing. But it worked fine to tell the pcrud.search to sort the results.

I added a descending sort to the call. When the parts sorting for the holdings editor for the AngularJS client was discussed, the reverse sort was agreed upon also. Bug 1760893 for the discussion then. Which is great because that is what we wanted.

Here is an example of how to reverse the parts sorting for the Angular Monograph Parts interface and for Angular holds placement also in case that is useful to anyone.
https://gitlab.com/LARL/evergreen-larl/-/commit/d71d672f85adae566e00380f3c094cf88899a4ee

Josh

tags: added: cat-holdingseditor cat-parts pullrequest
tags: removed: pullrequest
Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

I stepped through the code again in developer tools... and I think that the sort can just be removed.
The ngForOf that populates the combobox entries seem to be running before the sort happens, or at the same time.

Looking now I can see that the sort actually does start to change the last 20 or so entries in my test bib by the time the combobox entries are created.

I'm testing with a magazine bib that is loading 288 parts to give it a good workout.

So the .subscribe in fetchBibParts executes the first function to push the parts into bibParts, after that completes, it seems like the ngFor starts populating the combobox, and then the .subscribe 3rd function gets called and starts the sort....

I removed the pullrequest until I have a chance to update the branch.
Josh

Changed in evergreen:
status: New → Confirmed
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.