From b2aa882abb15f61de9f75a4aa0d9cd91f3b26099 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Mon, 23 Dec 2024 18:01:29 +0100 Subject: [PATCH] Restored staged changes of 27f9d70b566f894f60ef654a8af88fed23bb4801 --- README.md | 2 +- changelog/77_UNRELEASED_xxxx-xx-xx.md | 60 +++++++++++++++++++++++ public/viewjs/components/productpicker.js | 6 +-- 3 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 changelog/77_UNRELEASED_xxxx-xx-xx.md diff --git a/README.md b/README.md index b139c7c9..f3d98a6f 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ Example: Button "**P** Add as new product" can be "pressed" by using the `P` key Products can be directly added to the database via looking them up against external services by a barcode. -This is currently only possible through the REST API. +This can be done in-place using the product picker workflow "External barcode lookup (via plugin)" (the workflow dialog is displayed when entering something unknown in any product input field). There is no plugin included for any service, see the reference implementation in `data/plugins/DemoBarcodeLookupPlugin.php`. diff --git a/changelog/77_UNRELEASED_xxxx-xx-xx.md b/changelog/77_UNRELEASED_xxxx-xx-xx.md new file mode 100644 index 00000000..7396b76d --- /dev/null +++ b/changelog/77_UNRELEASED_xxxx-xx-xx.md @@ -0,0 +1,60 @@ +> ⚠️ xxxBREAKING CHANGESxxx + +> ❗ xxxImportant upgrade informationXXX + +> 💡 xxxMinor upgrade informationXXX + +### New feature: xxxx + +- xxx + +### Stock + +- Added a new product picker workflow "External barcode lookup (via plugin)" + - This executes the configured barcode lookup plugin with the given barcode + - If the lookup was successful, the product edit page of the created product is displayed, where the product setup can be completed (if required) + - After that, the transaction is continued with that product + +### Shopping list + +- xxx + +### Recipes + +- xxx + +### Meal plan + +- xxx + +### Chores + +- xxx + +### Calendar + +- xxx + +### Tasks + +- xxx + +### Batteries + +- xxx + +### Equipment + +- xxx + +### Userfields + +- xxx + +### General + +- xxx + +### API + +- xxx diff --git a/public/viewjs/components/productpicker.js b/public/viewjs/components/productpicker.js index c723cef8..94cac3aa 100644 --- a/public/viewjs/components/productpicker.js +++ b/public/viewjs/components/productpicker.js @@ -250,8 +250,8 @@ $('#product_id_text_input').on('blur', function(e) Grocy.Components.ProductPicker.PopupOpen = false; window.location.href = U('/product/new?flow=InplaceNewProductWithBarcode&barcode=' + encodeURIComponent(input) + '&returnto=' + encodeURIComponent(Grocy.CurrentUrlRelative + "?flow=InplaceAddBarcodeToExistingProduct&barcode=" + input + "&" + embedded) + "&" + embedded); } - } - /*barcodepluginlookup: { + }, + barcodepluginlookup: { label: 'E ' + __t('External barcode lookup (via plugin)'), className: 'btn-dark add-new-product-plugin-dialog-button responsive-button ' + addProductWorkflowsAdditionalCssClasses, callback: function() @@ -276,7 +276,7 @@ $('#product_id_text_input').on('blur', function(e) } ); } - }*/ + } }; if (!Grocy.FeatureFlags.GROCY_FEATURE_FLAG_DISABLE_BROWSER_BARCODE_CAMERA_SCANNING)