-
Notifications
You must be signed in to change notification settings - Fork 105
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
(design) Scan Barcode Component #1529
Comments
jniles
added a commit
to jniles/bhima
that referenced
this issue
Mar 28, 2018
This commit implements a barcode component to make working with barcodes a bit easier. It replaces the cash barcode modal's custom logic with generic logic to be tested. Key features: 1. If the input loses focus, the user is notified and a button appears to re-establish focus on the hidden input. 2. Simple API - only a single callback is provided for the success case. 3. Record agnostic. Closes Third-Culture-Software#1529.
jniles
added a commit
to jniles/bhima
that referenced
this issue
Mar 28, 2018
This commit implements a barcode component to make working with barcodes a bit easier. It replaces the cash barcode modal's custom logic with generic logic to be tested. Key features: 1. If the input loses focus, the user is notified and a button appears to re-establish focus on the hidden input. 2. Simple API - only a single callback is provided for the success case. 3. Record agnostic. Closes Third-Culture-Software#1529.
jniles
added a commit
to jniles/bhima
that referenced
this issue
Mar 29, 2018
This commit implements a barcode component to make working with barcodes a bit easier. It replaces the cash barcode modal's custom logic with generic logic to be tested. Key features: 1. If the input loses focus, the user is notified and a button appears to re-establish focus on the hidden input. 2. Simple API - only a single callback is provided for the success case. 3. Record agnostic. Closes Third-Culture-Software#1529.
Closed in #2630 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Our current barcode scanning sits in a couple of controllers .. yet this is an ideal place for component. Furthermore, the current design is limited because you cannot re-focus the hidden input once it has be blurred.
Design Proposal
I propose we design component
bhScanBarcode
with the following signature:The
bhScanBarcode
component itself would have the logic for re-focusing the input if it got blurred. In pseudocode, this would look like:When a barcode was successfully scanned, it would need to look up the correct value for the barcode using the
/barcode
route, and then call theon-scan-callback()
with theentity
as a parameter. The parent controller would then be responsible for doing any other processing.In this way, the barcode component would be testable and much easier to work with.
The text was updated successfully, but these errors were encountered: