LP#1773417 Improve empty volume handling
authorDan Wells <dbw2@calvin.edu>
Wed, 30 May 2018 16:43:08 +0000 (12:43 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Wed, 18 Jul 2018 14:10:31 +0000 (10:10 -0400)
commit8082b4f01d8fc02f676be37e50be7ef2e449ab41
tree27af964c1c8230c0829873eee3b0f9427019c626
parentbf38ba00afb1b9cbe2e3c566ae5ba16c6a9069c2
LP#1773417 Improve empty volume handling

The crux of this patch is to rethink how we handle the volume-only
editing interface.  Previously, we were attempting to distinguish
between when the volume was the only thing *showing* and when it
was actually the only thing *existing*.

We have now removed that distinction, so the volume-only interface
only cares about the volume regardless of the possible presence of
a copy.  This simplifies the interface logic, and reduces or
eliminates the chance of the hidden copy editor interfering with
the volume adding/editing functions.

Other smaller changes here include:
- Teach the edit function to pick up copy-less "empty" call numbers
- Reduce and clarify the arguments to spawnHoldingsAdd
  We had three arguments, but two were simply inversions of one another
  in every case.  Reduce to two arguments and give them more meaningful
  labels
- Fix typo ("emtpy") preventing proper button disabling for blank call
  numbers
- Move call number emptiness check from updateLabel() function to value
  watch instead.  This ensure that any updates to that value (even those
  not using the update function) will flip the flag appropriately.  This
  fixes a timing bug which prevented call numbers from being saved
  without further edits in some cases.

Ultimately, as J. Boyer suggests, we would be better off not generating
the copy editor at all (rather than just hiding it), but we're a few
steps off from that yet.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js