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

[mobile] Scanning API fixes #194

Open
agritheory opened this issue Oct 7, 2024 · 6 comments · Fixed by agritheory/stonecrop#179
Open

[mobile] Scanning API fixes #194

agritheory opened this issue Oct 7, 2024 · 6 comments · Fixed by agritheory/stonecrop#179
Assignees

Comments

@agritheory
Copy link
Owner

agritheory commented Oct 7, 2024

  • In a Stock Entry or Repack context when an item is scanned, the add_or_increment function does not call the appropriate details API to get the rest of the information.
    image
  • the route and filter` functions need to call the API to refresh the list.
@agritheory agritheory changed the title [mobile] Scanning fixes [mobile] Scanning API fixes Oct 10, 2024
@Alchez
Copy link
Collaborator

Alchez commented Oct 14, 2024

@agritheory I think I'll need more context on both these points.

In a Stock Entry or Repack context when an item is scanned, the add_or_increment function does not call the appropriate details API to get the rest of the information.

Do you have an example component I can check for the setup?

the route and filter` functions need to call the API to refresh the list.

Should it always go to the same route, or be configurable to go to other routes per scan-type?

@agritheory
Copy link
Owner Author

agritheory commented Nov 4, 2024

Regression on however this is exposed:
image

Do you have an example component I can check for the setup?

https://github.com/agritheory/beam/blob/version-15/beam/beam/scan/__init__.py#L162

Should it always go to the same route, or be configurable to go to other routes per scan-type?

If the scan action from the listview is "route", it should change the route, otherwise I think we should implement the reactive list filter here as well. UI work: agritheory/stonecrop#179

@Alchez Alchez linked a pull request Nov 5, 2024 that will close this issue
@Alchez
Copy link
Collaborator

Alchez commented Nov 5, 2024

@agritheory

Regression on however this is exposed

So the onScan.js instance is mounted on the window object, which means that simulating on any non-window object will throw that error. I'm not sure what the right solution here is: should the implementation file decide where to mount the instance instead?

The following should work for you currently:

window.scanner.simulate(window, '<barcode_string>')

If the scan action from the listview is "route", it should change the route, otherwise I think we should implement the reactive list filter here as well. UI work: agritheory/stonecrop#179

Should the route maps be defined in hooks as well? Since the actual list of routes is defined there? We should probably have a 404 catch-all page as well in case a route somehow doesn't exist.

@agritheory
Copy link
Owner Author

window.scanner.simulate(window, '<barcode_string>')

Ah, I am used to using document here but this makes sense.

Should the route maps be defined in hooks as well? Since the actual list of routes is defined there?

I don't think we need to do that. This is function of the scanning matrix unless I'm misunderstanding your question.

We should probably have a 404 catch-all page as well in case a route somehow doesn't exist.

Good idea, let's do it. I'll put in a ticket.

@agritheory
Copy link
Owner Author

This issue isn't close to solved. Scanning does correctly interact with any ListView component at this time.

@agritheory agritheory reopened this Nov 7, 2024
@Alchez
Copy link
Collaborator

Alchez commented Nov 8, 2024

Oh my bad, I think I accidentally made it to be auto-closed after the PR was merged. I just wanted to connect this issue with the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants