From 2bb792af99dcd6fb7afa176bb990e63bc5249969 Mon Sep 17 00:00:00 2001 From: Kurt Riddlesperger Date: Tue, 28 Apr 2020 01:11:05 -0500 Subject: [PATCH] remove product barcode tags --- public/viewjs/productform.js | 72 ------------------------------------ views/productform.blade.php | 9 ----- 2 files changed, 81 deletions(-) diff --git a/public/viewjs/productform.js b/public/viewjs/productform.js index f5c55ab5..93f7b8e2 100644 --- a/public/viewjs/productform.js +++ b/public/viewjs/productform.js @@ -166,33 +166,6 @@ } }); -$('#barcode-taginput').tagsManager({ - 'hiddenTagListName': 'barcode', - 'tagsContainer': '#barcode-taginput-container', - 'tagClass': 'badge badge-secondary', - 'delimiters': [13, 44] -}); - -if (Grocy.EditMode === 'edit') -{ - Grocy.Api.Get('objects/products/' + Grocy.EditObjectId, - function (product) - { - if (product.barcode !== null && product.barcode.length > 0) - { - product.barcode.split(',').forEach(function(item) - { - $('#barcode-taginput').tagsManager('pushTag', item); - }); - } - }, - function(xhr) - { - console.error(xhr); - } - ); -} - var prefillName = GetUriParam('prefillname'); if (prefillName !== undefined) { @@ -200,18 +173,6 @@ if (prefillName !== undefined) $('#name').focus(); } -var prefillBarcode = GetUriParam('prefillbarcode'); -if (prefillBarcode !== undefined) -{ - $('#barcode-taginput').tagsManager('pushTag', prefillBarcode); - $('#name').focus(); -} - -$("#barcode-taginput").on("blur", function(e) -{ - $("#barcode-taginput").tagsManager("pushTag", $("#barcode-taginput").val()); -}); - $('.input-group-qu').on('change', function(e) { var quIdPurchase = $("#qu_id_purchase").val(); @@ -435,29 +396,6 @@ $(document).on('click', '.qu-conversion-delete-button', function(e) console.error(xhr); } ); - - var newBarcode = ''; - productBarcode.split(',').forEach(function(item) - { - if(barcode != item) - { - newBarcode += ',' + item; - } - }); - - var jsonDataProduct = {}; - jsonDataProduct.barcode = newBarcode; - - Grocy.Api.Put('objects/products/' + productId, jsonDataProduct, - function(result) - { - }, - function(xhr) - { - Grocy.FrontendHelpers.EndUiBusy("product-form"); - Grocy.FrontendHelpers.ShowGenericError('Error while saving, probably this item already exists', xhr.response) - } - ); } } }); @@ -562,13 +500,3 @@ $('#qu_id_purchase').blur(function(e) Grocy.FrontendHelpers.ValidateForm('product-form'); } }); - -$(document).on("Grocy.BarcodeScanned", function(e, barcode, target) -{ - if (target != "#barcode-taginput") - { - return; - } - - $("#barcode-taginput").tagsManager("pushTag", barcode); -}); diff --git a/views/productform.blade.php b/views/productform.blade.php index d4791bf5..5851f704 100644 --- a/views/productform.blade.php +++ b/views/productform.blade.php @@ -56,7 +56,6 @@ @endphp @include('components.productpicker', array( 'products' => $products, - 'nextInputSelector' => '#barcode-taginput', 'prefillById' => $prefillById, 'disallowAllProductWorkflows' => true, 'isRequired' => false, @@ -70,14 +69,6 @@ -
- -
- -
-
-
- @if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)