-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added some barcode scanning fixes which only presented in MS Edge, se…
…nding the wrong part type to the backend.
- Loading branch information
1 parent
dcc7261
commit e4bf046
Showing
9 changed files
with
140 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
Binner/Binner.Web/ClientApp/src/pages/tools/BarcodeScanner.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
code { | ||
background: #f4f4f4; | ||
border: 1px solid #ddd; | ||
border-left: 3px solid #f36d33; | ||
color: #666; | ||
page-break-inside: avoid; | ||
font-family: monospace; | ||
font-size: 15px; | ||
line-height: 1.6; | ||
margin-bottom: 1.6em; | ||
max-width: 100%; | ||
padding: 1em 1.5em; | ||
display: block; | ||
word-wrap: break-word !important; | ||
white-space: pre-line !important; | ||
} | ||
|
||
pre { | ||
white-space: pre !important; | ||
} |
35 changes: 35 additions & 0 deletions
35
Binner/Binner.Web/ClientApp/src/pages/tools/BarcodeScanner.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React, { useState, useEffect, useMemo } from "react"; | ||
import { Link } from "react-router-dom"; | ||
import _ from "underscore"; | ||
import { Label, Button, Image, Form, Table, Segment, Dimmer, Checkbox, Loader, Popup } from "semantic-ui-react"; | ||
import { toast } from "react-toastify"; | ||
import { BarcodeScannerInput } from "../../components/BarcodeScannerInput"; | ||
import "./BarcodeScanner.css"; | ||
|
||
export function BarcodeScanner(props) { | ||
const [loading, setLoading] = useState(false); | ||
const [error, setError] = useState(null); | ||
const [message, setMessage] = useState(null); | ||
const [isKeyboardListening, setIsKeyboardListening] = useState(true); | ||
const [barcodeValue, setBarcodeValue] = useState('Waiting for input...'); | ||
|
||
// debounced handler for processing barcode scanner input | ||
const handleBarcodeInput = (e, input) => { | ||
// ignore single keypresses | ||
setBarcodeValue(JSON.stringify(input, null, 2)); | ||
toast.info(`Barcode type ${input.type} received`); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<BarcodeScannerInput onReceived={handleBarcodeInput} listening={isKeyboardListening} minInputLength={4} /> | ||
<h1>Barcode Scanner</h1> | ||
<p>Test your barcode scanner to see what values it outputs.</p> | ||
<Form> | ||
<div> | ||
<code><pre>{barcodeValue}</pre></code> | ||
</div> | ||
</Form> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters