Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify New BarcodeItem to use Modal instead of standard form #627

Closed
2 tasks
armahillo opened this issue Nov 12, 2018 · 1 comment
Closed
2 tasks

Modify New BarcodeItem to use Modal instead of standard form #627

armahillo opened this issue Nov 12, 2018 · 1 comment
Labels
enhancement Help Wanted Groomed + open to all! Loyola Issues tagged for contributors from Loyola University

Comments

@armahillo
Copy link
Collaborator

armahillo commented Nov 12, 2018

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 a LineItem 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 new BarcodeItem, 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 the Admin::BarcodeItemsController#index view, adding BarcodeItems 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 the Admin::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

  • Include a spec that verifies the behavior
  • Test it manually to verify it behaves like it should (modal pops up when you click the button, filling it out saves correctly)

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.

@armahillo armahillo added enhancement Help Wanted Groomed + open to all! labels Nov 12, 2018
@armahillo armahillo added this to the 2018Q4 Release milestone Nov 12, 2018
@armahillo armahillo removed this from the 2018Q4 - Onboarding Focus milestone Jan 6, 2019
@armahillo armahillo added the Loyola Issues tagged for contributors from Loyola University label Jan 6, 2019
@armahillo
Copy link
Collaborator Author

This has been migrated to Loyola repo, and will be re-opened here if they do not complete it

Ref: loyno-mathcs#3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Help Wanted Groomed + open to all! Loyola Issues tagged for contributors from Loyola University
Projects
None yet
Development

No branches or pull requests

1 participant