]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1715697 Refactor empty volume adding
authorDan Wells <dbw2@calvin.edu>
Wed, 23 May 2018 18:39:49 +0000 (14:39 -0400)
committerDan Wells <dbw2@calvin.edu>
Wed, 18 Jul 2018 13:40:39 +0000 (09:40 -0400)
commit0ec789d66d5aa7a4d92c6e517d72c4a96688bfc1
tree765af066fe56f743c256ae925bb9f0b567b1c381
parent8ee176d110c4dae5481ab9970900a7a5667ae611
LP#1715697 Refactor empty volume adding

The new ability to add empty volumes was causing the existing
ability to add new volume/copy combos to not work as expected.
More specifically, added volume/copy combos would not generate
in the selected org_unit, but always in the ws_ou.

To correct this, this change refactors/reverts significant portions of
920f585052ef809ea6ca1e447d416ada871b467c.  Reasons include:

- Existing code distinguishs 'adds' from 'edits' via two wrappers,
spawnHoldingsAdd and spawnHoldingsEdit.  With this commit, empty volume
adding now extends the 'add' function rather than the 'edit' one, as
this seems more intuitive.

- The previous change had extended both the catalog app and another
similar directive which is only used in a merging context.  Since the
merge context had no ability to add anything, and the new code was not
wired up to the interface, this has simply been removed (for now).

- The volcopy app is set up around the concept of passed in
'prototype' vol/copy objects of varying degrees of completeness.  It
then loops over these to generate the interface.  The previous code
extended this setup with a loop over a potential 'owners' array to
generate empty volumes, but this unrelated loop within a loop seemed
counterintuitive (and was the source of the original bug).  This change
has been removed, and empty volume creation now hews more closely to
the original model.

While this commit appears large, when viewed in the context of the
pre-920f58505 code, it is quite limited in scope.

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/services/holdings.js
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js