-
Notifications
You must be signed in to change notification settings - Fork 33
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
[WC-2405]: Add barcode format controls to prevent incorrect scanning #980
Open
HedwigAR
wants to merge
15
commits into
main
Choose a base branch
from
fix/WC-2405-phone-web-barcode-scanner-code-39-value
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[WC-2405]: Add barcode format controls to prevent incorrect scanning #980
HedwigAR
wants to merge
15
commits into
main
from
fix/WC-2405-phone-web-barcode-scanner-code-39-value
+205
−291
Conversation
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
iobuhov
requested changes
Apr 8, 2024
packages/pluggableWidgets/barcode-scanner-web/src/BarcodeScanner.editorConfig.ts
Outdated
Show resolved
Hide resolved
packages/pluggableWidgets/barcode-scanner-web/src/hooks/useReader.ts
Outdated
Show resolved
Hide resolved
Great PR and description BTW 👍 |
HedwigAR
force-pushed
the
fix/WC-2405-phone-web-barcode-scanner-code-39-value
branch
from
April 8, 2024 14:03
d14c907
to
7c0feeb
Compare
iobuhov
reviewed
Apr 8, 2024
packages/pluggableWidgets/barcode-scanner-web/src/BarcodeScanner.editorConfig.ts
Outdated
Show resolved
Hide resolved
iobuhov
reviewed
Apr 8, 2024
packages/pluggableWidgets/barcode-scanner-web/src/hooks/useReader.ts
Outdated
Show resolved
Hide resolved
iobuhov
requested changes
Apr 9, 2024
iobuhov
previously approved these changes
Apr 9, 2024
HedwigAR
force-pushed
the
fix/WC-2405-phone-web-barcode-scanner-code-39-value
branch
from
May 15, 2024 09:24
20c1947
to
857df22
Compare
gjulivan
reviewed
May 28, 2024
packages/pluggableWidgets/barcode-scanner-web/src/hooks/useReader.ts
Outdated
Show resolved
Hide resolved
gjulivan
reviewed
May 28, 2024
packages/pluggableWidgets/barcode-scanner-web/src/hooks/useReader.ts
Outdated
Show resolved
Hide resolved
iobuhov
reviewed
May 31, 2024
const scanWithCropOnce = (reader: BrowserMultiFormatReader): Promise<Result> => { | ||
const cropWidth = videoRef.current!.videoWidth * scale; | ||
const element = document.getElementById("canvas-middle-middle")!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should use refs? It's more react way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I fixed it and used a ref instead, let me know if I did that right
iobuhov
reviewed
May 31, 2024
packages/pluggableWidgets/barcode-scanner-web/src/hooks/useReader.ts
Outdated
Show resolved
Hide resolved
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull request type
Bug fix (non-breaking change which fixes an issue)
Description
We found a case where a Code-39 code was recognized as a RSS-14 code instead. Since we support both of them and they do look very similar, we've added an option to be able to specify what formats should be recognized.
Now the user can select if they want to be able to recognize all formats (this is the option that's enabled by default). If the user does not want this, they'll be able to specify only the codes they're expecting.
This PR also includes a fix for scanning with the mask enabled, where it wasn't scanning the full resolution.
What should be covered while testing?
Testing should check whether it's still possible to recognize all barcode types when
useAllFormats
is set to Yes. Test should also check whether selecting specific formats is effective, and if this does exclude other codes from being recognized (aka, when only code-39 is selected it should no longer trigger on QR codes)