Modify New BarcodeItem to use Modal instead of standard form #627
Labels
enhancement
Help Wanted
Groomed + open to all!
Loyola
Issues tagged for contributors from Loyola University
Summary
This issue is an enhancement of an existing feature. The enhancement will occur primarily in the
admin
namespace, but there is potential for an optimizing refactor to occur elsewhere.Occasionally, users need to create
BarcodeItems
while they are filling out aLineItem
row. This typically occurs when the user scans a barcode that does not yet exist in the system. In the main user namespace, this event will prompt them with a JS modal that lets them fill out the information and commit it, with minimal interruption to the workflow.The
admin
namespace also has the ability to create a newBarcodeItem
, but it uses the old static form to do it. We'd like to use the same modal form for this as well. (ie. from theAdmin::BarcodeItemsController#index
view, addingBarcodeItems
via the modal instead of going to a separate page.BONUS This feature involves a few different files that work together in several locations. The
_barcode_modal.html.erb
partial is located under/app/views/donations
but that's not the correct location for that to live. It should be moved to the/app/views/barcode_items
. There's also a whole bunch of JS logic that is ostensibly active on every page (/app/assets/javascripts/barcode_items.js.erb
), but really only needs to be wired up if the modal is included. When reviewing how this feature works, if you are able to optimize this aspect of it (since you'll already be touching some of these files), that would be awesome!Current Behavior
Creating a new
BarcodeItem
requires an admin user to use theAdmin::BarcodeItemsController#new
view.Desired Change
We have an existing modal created for BarcodeItems. It's invoked in
/app/assets/javascripts/barcode_items.js.erb
right now (~line 94:$("#newBarcode").modal();
)When a user clicks on "New BarcodeItem", use that modal instead of the #new form. It's OK to leave the #new form as a fall-through, though.
After the modal is resolved, reflect that addition in the page (either with a page refresh or by inserting it into the resultset via JS).
Criteria for Completion
Bonus items from above are not required for acceptance, but please note whether you did them or not, so they can be moved to a separate issue if necessary.
The text was updated successfully, but these errors were encountered: