]> 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)
committerJason Stephenson <jason@sigio.com>
Thu, 9 Aug 2018 13:18:24 +0000 (09:18 -0400)
commitacce04a9d8826491611d0d3a6686a944e5fb781a
tree787ca99891568c617cb9bfa49384ad3a8722a04b
parente2c10c4895f44ded8312b025c7f25e1ad46ad2d6
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>
Signed-off-by: Jason Stephenson <jason@sigio.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