]> 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:55:22 +0000 (09:55 -0400)
commita0b46ea95c3dbee3d3e58a0ad668a18ec179397e
tree8f8c9f28a237d062c50dc868ed0d58a2b8516113
parentc7558a962f5698f7f4ec955cb89cdb7580d9ec65
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