Loan workflow (#238): camera scanner unblocked + copy-code identifies book, copy/subtitle in details & receipt#248
Merged
Conversation
…ner works The Permissions-Policy header denied camera for the whole document (camera=()), so the in-browser barcode scanner (zxing-wasm getUserMedia) was blocked outright — "camera is not allowed in this document". Allow it on same-origin (camera=(self)); geolocation and microphone stay denied.
…oan details/receipt (#238) Improvements to the physical-copy loan workflow reported in discussion #238: - Create-loan form: entering or scanning a copy inventory code now resolves the book automatically (via /admin/copies/by-code) and fills the book field, so the operator never has to separately search the title — and can no longer pick the wrong book for a scanned copy. A status line confirms the identified copy (and warns if it is not currently available). - Book search suggestions on the create-loan form now show the subtitle. - Loan details page shows the physical copy inventory code and the subtitle. - Loan receipt PDF adds the subtitle and the copy inventory code (conditional: only when present, so pre-copy-tracking loans render unchanged). byCode and LoanRepository::getById now also return the subtitle. New strings translated across it/en/de/fr (the noun "copy/subtitle", not the verb). Covered by tests/nikola-loan-workflow.spec.js (all four behaviours, as the operator sees them).
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (12)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or 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
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.
Addresses the loan-workflow issues Nikola raised in discussion #238.
Camera scanner (urgent)
The
Permissions-Policyresponse header denied the camera for the whole document (camera=()), so the in-browser copy-code scanner (zxing-wasmgetUserMedia) was blocked outright. Now allowed on same-origin (camera=(self)); geolocation and microphone stay denied.Loan workflow
/admin/copies/by-code) and fills the book field. The operator no longer has to also search the title, and can't accidentally pick a book that doesn't match the scanned copy. A status line confirms the identified copy (and warns if it isn't available now).byCodeandLoanRepository::getByIdalso return the subtitle. New strings translated across it/en/de/fr (the noun "copy/subtitle", not the verb).Tests
tests/nikola-loan-workflow.spec.jscovers all four behaviours end-to-end as the operator sees them (copy-code auto-fill, subtitle in search, details, receipt PDF). Both tests pass locally.