Part-DB-server/src/Controller
swdee c29605ef23
Label Scanner Enhancements: LCSC barcode, create part, augmented scanning (#1194)
* added handling of LCSC barcode decoding and part loading on Label Scanner

* when a part is scanned and not found, the scanner did not redraw so scanning subsequent parts was not possible without reloading the browser page.  fixed the barcode scanner initialization and shutdown so it redraws properly after part not found

* added redirection to part page on successful scan of lcsc, digikey, and mouser barcodes.   added create part button if part does not exist in database

* added augmented mode to label scanner to use vendor labels for part lookup to see part storage location quickly

* shrink camera height on mobile so augmented information can been viewed onscreen

* handle momentarily bad reads from qrcode library

* removed augmented checkbox and combined functionality into info mode checkbox.  changed barcode scanner to use XHR callback for barcode decoding to avoid problems with form submission and camera caused by page reloaded when part not found.

* fix scanning of part-db barcodes to redirect to storage location or part lots.   made scan result messages conditional for parts or other non-part barcodes

* fix static analysis errors

* added unit tests for meeting code coverage report

* fix @MayNiklas reported bug:  when manually submitting the form (from a barcode scan or manual input) redirect to Create New part screen for the decoded information instead of showing 'Format Unknown' popup error message

* fix @d-buchmann bug:  clear 'scan-augmented-result' field upon rescan of new barcode

* fix @d-buchmann bug: after scanning in Info mode, if Info mode is turned off when scanning a part that did not exist, it now redirects user to create part page

* fix @d-buchmann bug: make barcode decode table 100% width of page

* fix bug with manual form submission where a part does not exist but decodes properly which causes the camera to not redraw on page reload due to unclean shutdown. this is an existing bug in the scanner interface.

steps to produce the issue:
- have camera active
- put in code in Input
- info mode ticked
- click submit button

on page reload the camera does not reactivate

* fixed translation messages

* Use symfony native functions to generate the routes for part creation

* Use native request functions for request param parsing

* Refactored LCSCBarcocdeScanResult to be an value object like the other Barcode results

* Added test for LCSCBarcodeScanResult

* Fixed exception when submitting form for info mode

* Made BarcodeSourceType a backed enum, so that it can be used in Request::getEnum()

* Moved database queries from BarcodeRedirector to PartRepository

* Fixed modeEnum parsing

* Fixed test errors

* Refactored BarcodeRedirector logic to be more universal

* Fixed BarcodeScanResultHandler test

* Refactored BarcodeScanResultHandler to be able to resolve arbitary entities from scans

* Moved barcode to info provider logic from Controller to BarcodeScanResultHandler service

* Improved augmentented info styling and allow to use it with normal form submit too

* Correctly handle nullable infoURL in ScanController

* Replaced the custom controller for fragment replacements with symfony streams

This does not require a complete new endpoint

* Removed data-lookup-url attribute from scan read box

* Removed unused translations

* Added basic info block when an storage location was found for an barcode

* Fixed phpstan issues

* Fixed tests

* Fixed part image for mobile view

* Added more tests for BarcodeScanResultHandler service

* Fixed tests

---------

Co-authored-by: Jan Böhmer <mail@jan-boehmer.de>
2026-02-22 21:26:44 +01:00
..
AdminPages Fixed error with mass creation, when elements on different level had the same name 2025-12-07 21:40:57 +01:00
ErrorHandling Show the error page in a pop up in prod environment too 2024-03-10 00:12:54 +01:00
.gitignore Initial commit 2019-02-23 16:49:38 +01:00
AttachmentFileController.php Readded option to show all elements in a table 2025-09-07 20:04:48 +02:00
BulkInfoProviderImportController.php Added tests for new DTO objects 2025-09-21 23:07:45 +02:00
GroupController.php Use the route attribute from the correct namespace 2024-03-03 20:37:33 +01:00
HomepageController.php Merged functionality from UpdateAvailableManager and UpdateChecker 2026-02-02 18:44:44 +01:00
InfoProviderController.php Added an web page to quickly add a new part from a web URL 2026-02-01 18:18:58 +01:00
KiCadApiController.php Applied rector suggestions 2024-06-22 00:31:43 +02:00
LabelController.php Fixed tests 2025-09-07 00:26:24 +02:00
LogController.php Allow to configure default table page length via Settings UI 2024-08-21 22:15:26 +02:00
OAuthClientController.php Applied rector suggestions 2024-06-22 00:31:43 +02:00
PartController.php Ran rector 2026-02-14 23:33:40 +01:00
PartImportExportController.php Fixed exception when trying to export an empty entity list 2025-02-01 20:57:27 +01:00
PartListsController.php Added ID to search options. Fixed seach option by using equal to instead of like for the ID. 2026-01-09 11:37:30 +01:00
ProjectController.php Added generic CSV type option, to highlight the universal nature of the importer 2025-09-06 23:20:07 +02:00
RedirectController.php Moved default language, default timezone and base currency settings to new settings system 2024-08-03 23:14:29 +02:00
ScanController.php Label Scanner Enhancements: LCSC barcode, create part, augmented scanning (#1194) 2026-02-22 21:26:44 +01:00
SecurityController.php Ran rector to convert some our twig extensions to use #[AsTwigXX] attributes 2026-02-14 23:53:31 +01:00
SelectAPIController.php Added way to batch edit the location of parts with a single stock 2025-03-29 16:21:10 +01:00
SettingsController.php Implemented the ability to set user-defined synonyms/labels for internal element types 2025-11-12 21:35:02 +01:00
StatisticsController.php Use the route attribute from the correct namespace 2024-03-03 20:37:33 +01:00
ToolsController.php Merged functionality from UpdateAvailableManager and UpdateChecker 2026-02-02 18:44:44 +01:00
TreeController.php Use the route attribute from the correct namespace 2024-03-03 20:37:33 +01:00
TypeaheadController.php Added feature for part IPN suggest with category prefixes (#1054) 2025-11-03 00:31:47 +01:00
UpdateManagerController.php Put update manager under /system route instead of admin 2026-02-02 21:29:07 +01:00
UserController.php Use the route attribute from the correct namespace 2024-03-03 20:37:33 +01:00
UserSettingsController.php Ran rector to convert some our twig extensions to use #[AsTwigXX] attributes 2026-02-14 23:53:31 +01:00
WebauthnKeyRegistrationController.php Use the route attribute from the correct namespace 2024-03-03 20:37:33 +01:00