CAT-152 Update Items Interface
authorKyle Huckins <khuckins@catalyte.io>
Wed, 25 Oct 2017 23:43:08 +0000 (23:43 +0000)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
commitc111f843939add8426867848f54623c1e403322e
tree991b8675ae372e9d80c38006239bce6973ab1b0f
parent15ba54b8a1e6f95ba44443d974c6496c98aed75e
CAT-152 Update Items Interface

Rebase and squash of Catalyte AngularJS Update Items port.  See commits
below.  Original code:

kcls/dev/catalyst-khuckins/CAT-151-Update-Items-Webby-Port

Basic frontend for update items interface.

Access via one of the following paths:
1. Direct:
      [Hostname]/eg/staff/acq/update_items/[Record ID]
2. Through Catalog:
      On a record, Other Actions->Update Items

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
new file:   Open-ILS/src/templates/staff/acq/update_items/index.tt2
new file:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2
new file:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-167 Update Items App.js Map

Comment through and add TODOs in app.js to map out what we
can utilize and what we should strip out.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-153 Retrieve Record for Item Update Interface

Set record ID to dataKey from $routeParams.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-154 Lineitems Dropdown for Update Items

- Move record_id into service object.
- Add new directive egProductOrderDropdown to handle the dropdown.
- Add new function in itemSvc to fetch lineitems based on bib record.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-155 Display Lineitem Details

- Add service function to convert lineitem to object
- Add service function to fetch needed copy information
- Slight refactor to CAT-154 code to accomodate objectification
- Create egProductOrderVolumes directive to handle display of Org and Volume
information
- Create egProductOrderCopy directive to handle display of Copy information

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-163 Display Line Item Notes

- Add notes to lineitem object
- Display Lineitem notes for selected PO  under Line Item Notes section
of update items interface.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-158 Update Items Save Functionality

- Items that have had their Call Number or Barcode edited
update upon pressing the "Save Changes" or "Save & Exit"
buttons.
- "Save Changes" will reload the page upon saving.
- "Save & Exit" closes the page upon saving.
- If a volume's call number has changed, a call will be made
to find_or_create_volume, creating a new volume only if an
applicable one doesn't already exist.
- Addition to retrieve_lineitem API: Optional flag
flesh_li_details_copy to retrieve the acp object tied to a
lineitem.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-161 Update Items Add Notes Functionality

- Allow adding notes to lineitem directly from the Update Items
Interface.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-168 service.saveChanges Refactor

- Refactor service.saveChanges to handle saving changes to items
in different Orgs.

 Changes to be committed:
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-159 Print Labels Functionality

- Ticking the print labels checkbox will open the Print
Item Labels interface for every item in the currently
selected lineitem upon saving changes. Any changes made
in the update items interface will be represented in the
Print Item Labels interface.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/acq/update_items/index.tt2
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-160 Print Worksheet Functionality

- Ticking the Print Worksheet box will open the Worksheet for the selected
lineitem, ready for the user to print.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-166 Edit Items Section

- Edit Items Section now covers the saving of Circ Modifier,
Circulate?, Location/Collection, and Price. Upon saving changes,
those fields will be accounted for when updating each copy.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-166 Edit Items Template Selector

- Template Selector now applies changes to the circ modifier,
circulate?, location/collection, and price fields based on the
values in the selected template.
- Template Selection will be cleared upon changing Lineitem
selection.
- Whitespace cleanup for previous commit

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-165 Edit Item Attributes

- Edit Item Attributes button now leads to the copy editor for
each copy in the currently selected lineitem in a new tab.
- A prompt will appear on the Update Items interface after
activating the Edit Item Attributes button warning that without
a refresh, there could be inconsistancy between changes made in the
Copy Editor and changes made in the Edit Items portion of the Update
Items interface.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
        modified:   Open-ILS/src/templates/staff/acq/update_items/index.tt2
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-156 Call Number Batch Apply

- The Apply button adjacent to the Call Number Batch Apply
field will now Apply the contents of that field to each volume
Call Number field.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-167 App.js cleanup & Polishing

- Remove unnecessary code from App.js
- Set controller for several Update Items directives to UpdateCtrl
- Disable input fields and buttons when no line item selected
- Add notices when no line items available, no lineitem selected, and
no notes to display
- Reduce amount of network calls made when fetching lineitems

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/acq/update_items/index.tt2
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-169 Update Items Hotkeys

- Angular-Hotkeys implementation for required hotkeys.
- Minor refactors to better accomodate hotkey code.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/acq/update_items/index.tt2
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js
modified:   Open-ILS/web/js/ui/default/staff/cat/catalog/app.js

CAT-152 Template Readability Adjustments

- Break overly long lines into multiple lines.
- Remove unnecessary strings defined in index

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/acq/update_items/index.tt2
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2

CAT-167 Only display on-order and received lis

- Remove extraneous console.log
- Ensure only lineitems that are on-order or received are
displayed

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-156 Autogenerate Barcodes & Checkdigit

- Implimentation of autogenerate barcodes with checkdidgets generation working
- Apply CSS changes and open ngToasts when Use Checkdigit
is checked and an invalid barcode is found.
- Consolidate egProductOrderCopies and egProductOrderVolumes
into t_update_items.tt2.

Signed-off-by: Alex Cautley <acautley@catalyte.io>
Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
modified:   Open-ILS/src/templates/staff/acq/update_items/index.tt2
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-167 Checkdigit Patch

- Allow Barcodes that are only numbers to be recognized as
valid by the checkdigit validation function.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-167 Color-blind Friendliness for Barcode Field

- Apply additional stylings and add glyphicon to Barcode field
when Use Checkdigit is enabled based on valid or invalid barcode.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-167 Initial Progress Dialog

- Add an instance of egProgressDialog while fetching lineitems

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-167 Save & Print Optimizations

- Move print option service logic into separate function.
- Adapt egItems print_spine_labels as separate function within egUpdateItems.
- Open Print Label and Worksheet windows after save, but before refresh, to better
handle large lineitems(1000+).
- Allow both Worksheet and Spine Label print windows to open without signifigant lag
time between each other.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

CAT-167 Handle Fetch error with large lineitems

- Apply error message when lineitem is unable to display due
to fetch error in edge cases where there is a lineitem with 1k+
entries occasionally stopping org information from being fetched
for other lineitems.
- Small rearrangement of code in UpdateCtrl to make things more
readable.
- Addition of Glyphicon warning sign when displaying error messages.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/templates/staff/acq/update_items/index.tt2
modified:   Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js

lp1744762 Lineitems by Bib filter multiple states

- Allow lineitem_state to take an array of strings, rather than
just a single string.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm

CAT-176 Refactor Update Items Fetch

- Utilize lineitem_state to properly fetch lineitems with the fixed code
from lp1744762

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/web/js/ui/default/staff/acq/update_items/app.js
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm
Open-ILS/src/templates/staff/acq/update_items/index.tt2 [new file with mode: 0644]
Open-ILS/src/templates/staff/acq/update_items/t_update_items.tt2 [new file with mode: 0644]
Open-ILS/src/templates/staff/cat/catalog/t_catalog.tt2
Open-ILS/web/js/ui/default/staff/acq/update_items/app.js [new file with mode: 0644]
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js