-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat(qr-scanner): implement scanner feature in dashboard and compare view #64
feat(qr-scanner): implement scanner feature in dashboard and compare view #64
Conversation
…rstand control flow
src/assets/ScannerLogo.svg
Outdated
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.
I have edited this file and now it will be centered and fill the entire parent component.
The respective lengths in the logo are also symmetric now :)
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.
This component is a replacement for the ManualAasAddInput and ManualAasViewerInput by giving it the callback and defining it outside
This has the additional benefit of beeing able to reuse the callback in the scanner component as well.
src/lib/util/LocalizedError.ts
Outdated
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.
This Error is used, if the error should be printed to the user (by Snackbar for example).
Any ideas on this? Is this the correct way to handle this case or should it be a more generic 'just add a localizedErrorDescriptor variable to the object'
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.
@@ -50,6 +54,33 @@ export function CompareView() { | |||
const handleDeleteAas = (aasId: string) => { | |||
deleteAas(aasId); | |||
}; | |||
|
|||
const handleAddAas = async (aasId: string) => { |
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.
This logic was previously in ManualAasAddInput.tsx.
This should be more readable
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.
This component will handle all the logic of switching the views and call the onScan callback on a valid QR code.
Description
new component:
Clicking on the QR scanner logo will open the camera.
It will continuously scan for a qr code and execute the onScan callback if a valid one was found:
Fixes # (MNES-1175)
Type of change
Please delete options that are not relevant.
Checklist: