Angular Staff Catalog Preferences Should Include Checkboxes, Sort Order

Bug #1943744 reported by Elizabeth Thomsen
152
This bug affects 32 people
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
Wishlist
Unassigned

Bug Description

The Catalog Preferences currently allow you to save a default search library, preferred library, search pane, number of results displayed, and whether or not the checkbox to exclude electronic resources should be on the search form, but it would be much more useful if it also allowed the user to also store the sort order and the settings for each checkbox.

(Tested on Evergreen 3.7.1)

Revision history for this message
Elizabeth Thomsen (et-8) wrote :
Changed in evergreen:
status: New → Confirmed
Revision history for this message
Jennifer Weston (jweston) wrote :

+1 to Catalog Preferences also allowing the user to store the sort order and the settings for each checkbox.

Making note of ongoing discussion about behavior of "Exclude Electronic Resources" (https://bugs.launchpad.net/evergreen/+bug/1908727) as it could be relevant to any changes to the Catalog Preferences

Revision history for this message
Elizabeth Thomsen (et-8) wrote :

Still a much-desired feature for catalogers (and others) -- the ability to configure these search defaults would eliminate a lot of repeatedly choose the same options

Confirmed, on head (https://bugsquash.mobiusconsortium.org/eg/staff)

Revision history for this message
Millissa (millissam) wrote :

This would make my staff extremely happy!

Changed in evergreen:
importance: Undecided → Wishlist
Revision history for this message
Christina Hammermeister (christinaregina) wrote :

I would personally be very happy with this.

tags: added: ux-preferences
Steven Mayo (stmayo)
Changed in evergreen:
assignee: nobody → Steven Mayo (stmayo)
Revision history for this message
Steven Mayo (stmayo) wrote (last edit ):

Branch: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/smayo/LP1943744-Staff_Catalog_Preferences_Include_Checkboxes_And_Sort_Order

Added 3 new workstation settings for default values for Sort Order, Limit to Available, and Group Formats/Editions. Didn't include Results from All Libraries, because... wouldn't you just set your search org higher? Am I missing something about how stuff works?
Will add a new setting for that too if people want it.

There are new rows on the Search Preferences page to modify each of these.

Pulled the Sort Results dropdown into its own component, sort-order-select, so that it will stay the same despite being in more than one place now. That component is used in the search form and the search preferences.

Added a check to the Catalog Service that applies your defaults if you haven't clicked it yourself. It took longer than I expected to wrangle the checkboxes into not always using the default without ignoring it entirely. Had to force the URL to always include the checkboxes to do that.

Spent longer than I expected on this, but it's been a busy month, and making a new component took some learning about Angular. My brain has embiggened.

Steps to Test:
[1] Go to Cataloging -> Search the Catalog
[2] Observe that Sort Results is 'Sort by Relevance' and the 'Limit to Available' and 'Group Formats/Editions' checkboxes are unchecked.
[3] Go to Search Preferences
[4] Observe the new Default Sort Order, Default Limit to Available, and Default Group Formats/Editions rows
[5] Set a new Default Sort Order and check one or both of the default checkboxes. You should receive a success toast.
[6] Reset the search to the default state - go back to the home page and go back to search again OR manually remove all the parameters from your URL
[6.1] If you search immediately from the preferences page instead, it should search using the values in your search bar instead of the defaults
[7] Observe that Sort Results, Limit to Available, and Group Formats/Editions are as you set the preferences
[8] Click on a search result and then click on the 'Back to Results' button
[9] Ensure the search bar is as you left it
[10] Modify the dropdown and checkboxes and search again
[11] Click on a search result and then click on the 'Back to Results' button
[12] Ensure the search bar is as you left it
[13] Go to Search Preferences again
[14] Ensure the search bar is as you left it

Changed in evergreen:
assignee: Steven Mayo (stmayo) → nobody
tags: added: pullrequest
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks for this branch, Steven! I applaud refactoring the sort-order-select into its own component, that's nice! And it has a test too, woohoo!

I did notice a few cleanup items:

* The test fails when I run `npm run test`: I think that adding `imports: [FormsModule]` to the TestBed.configureTestingModule call should get it rolling again.
* Could you run `ng lint` on this branch, please? There's also an `ng lint --fix` version that will do some cleanup for you.
* As a reader, I found the if statements without curly braces confusing, especially the ones you added in the catalog.service.ts -- there is an if, then two statements, then a blank line. The second statement is always executed regardless of the conditional, so it hurt my head that it was visually grouped together with it. I suspect `ng lint` might also complain about this.
* There are a few comments that might not be necessary:
  * the one near the end of src/app/staff/catalog/prefs.component.ts
  * the "big mad" one in app/staff/catalog/search-form.component.ts, although I appreciate the sentiment!
* Traditionally, the upgrade script should not have an actual upgrade number in it (yours has 1404) until it is committed, just 'XXXX' or something of the like.

Revision history for this message
Steven Mayo (stmayo) wrote (last edit ):

Thanks for the suggestions, Jane!
'ng lint' said the if statements needed curly braces like you thought, as well as a few other things I wouldn't have thought of like indentation and the name of an event emitter. It's almost as if linting is a great tool that I should have remembered to use in the first place.
I've done everything ng lint told me to and removed the comments.

Also, oops, I forgot to remove the number from the line I copied for the upgrade script. It's XXXX again.

Importing FormsModule got 'npm run test' rolling again for me. Thanks for the tip!

Here's the branch with another commit for all the cleanup: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/smayo/LP1943744-Staff_Catalog_Preferences_Include_Checkboxes_And_Sort_Order

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.