From 20380faeb30b68838e974bd483011e83e2cea3e1 Mon Sep 17 00:00:00 2001 From: Marc Ole Bulling Date: Sat, 30 Jan 2021 12:39:10 +0100 Subject: [PATCH 01/11] Fix for #1271 (#1286) --- public/viewjs/shoppinglist.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/viewjs/shoppinglist.js b/public/viewjs/shoppinglist.js index e0a2c17b..42039971 100644 --- a/public/viewjs/shoppinglist.js +++ b/public/viewjs/shoppinglist.js @@ -449,6 +449,7 @@ $(document).on("click", "#print-shopping-list-button", function(e) callback: function() { bootbox.hideAll(); + $('.modal-backdrop').remove(); $(".print-timestamp").text(moment().format("l LT")); From bfb5525ec1a2287ddb0e409d345ec7871b28ff7f Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 30 Jan 2021 12:41:09 +0100 Subject: [PATCH 02/11] Added changelog for #1286 --- changelog/62_UNRELEASED_xxxx-xx-xx.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog/62_UNRELEASED_xxxx-xx-xx.md b/changelog/62_UNRELEASED_xxxx-xx-xx.md index 73266155..5faed9b0 100644 --- a/changelog/62_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/62_UNRELEASED_xxxx-xx-xx.md @@ -1,3 +1,4 @@ - Fixed that tracking chores with "Done by" a different user was not possible - Fixed that editing stock entries was not possible +- Fixed that shopping list prints had a grey background (thanks @Forceu) - Some night mode style improvements (thanks @BlizzWave) From c889416c0a1ae8f898bdfcd839b5ea8557f88417 Mon Sep 17 00:00:00 2001 From: Marc Ole Bulling Date: Sat, 30 Jan 2021 12:47:12 +0100 Subject: [PATCH 03/11] Fix for #1289 and #1261 (#1297) --- public/viewjs/shoppinglistitemform.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/public/viewjs/shoppinglistitemform.js b/public/viewjs/shoppinglistitemform.js index fc8dacac..b373cbc4 100644 --- a/public/viewjs/shoppinglistitemform.js +++ b/public/viewjs/shoppinglistitemform.js @@ -244,17 +244,14 @@ if (GetUriParam("embedded") !== undefined) } var eitherRequiredFields = $("#product_id,#product_id_text_input,#note"); -eitherRequiredFields.on("input", function() +eitherRequiredFields.prop('required',""); +eitherRequiredFields.on('input', function () { - eitherRequiredFields.attr("required", ""); - if (!$(this).val().isEmpty()) - { - eitherRequiredFields.not(this).removeAttr("required"); - } - + eitherRequiredFields.not(this).prop('required', !$(this).val().length); Grocy.FrontendHelpers.ValidateForm('shoppinglist-form'); }); + if (GetUriParam("product-name") != null) { Grocy.Components.ProductPicker.GetPicker().trigger('change'); From 42689ecefe94889b0dad6ff15e3b710622040cfe Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 30 Jan 2021 12:49:17 +0100 Subject: [PATCH 04/11] Added changelog for #1297 --- changelog/62_UNRELEASED_xxxx-xx-xx.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog/62_UNRELEASED_xxxx-xx-xx.md b/changelog/62_UNRELEASED_xxxx-xx-xx.md index 5faed9b0..bb6f1a60 100644 --- a/changelog/62_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/62_UNRELEASED_xxxx-xx-xx.md @@ -1,4 +1,5 @@ - Fixed that tracking chores with "Done by" a different user was not possible - Fixed that editing stock entries was not possible - Fixed that shopping list prints had a grey background (thanks @Forceu) +- Improved/fixed the form validation on the shopping list item page (thanks @Forceu) - Some night mode style improvements (thanks @BlizzWave) From 760914bf82d905cb588cecad8ed259cc3ff1f7b4 Mon Sep 17 00:00:00 2001 From: Marius Boro Date: Sat, 30 Jan 2021 12:49:51 +0100 Subject: [PATCH 05/11] Update grocy_night_mode.css (#1269) Night mode updates for Grocy 3 --- public/css/grocy_night_mode.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/public/css/grocy_night_mode.css b/public/css/grocy_night_mode.css index 18f76e4f..fcc31f52 100644 --- a/public/css/grocy_night_mode.css +++ b/public/css/grocy_night_mode.css @@ -241,3 +241,16 @@ .night-mode .dropdown-menu { background-color: #333131; } + +.night-mode .table-secondary td, +.night-mode .table-secondary th { + background-color: #4c4e50; +} + +.night-mode .secondary-message { + border-top-color: #4c4e50; +} + +.night-mode .normal-message { + border-top-color: #07373f; +} From a1adc80c29963515af1c53eea9d545be40404f15 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 30 Jan 2021 13:06:44 +0100 Subject: [PATCH 06/11] Fixed consuming Scan Mode timing (fixes #1292) --- changelog/62_UNRELEASED_xxxx-xx-xx.md | 1 + public/viewjs/consume.js | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/changelog/62_UNRELEASED_xxxx-xx-xx.md b/changelog/62_UNRELEASED_xxxx-xx-xx.md index bb6f1a60..9e8b1c0e 100644 --- a/changelog/62_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/62_UNRELEASED_xxxx-xx-xx.md @@ -2,4 +2,5 @@ - Fixed that editing stock entries was not possible - Fixed that shopping list prints had a grey background (thanks @Forceu) - Improved/fixed the form validation on the shopping list item page (thanks @Forceu) +- Fixed that consuming with Scan Mode was not possible - Some night mode style improvements (thanks @BlizzWave) diff --git a/public/viewjs/consume.js b/public/viewjs/consume.js index 5a3ea2f4..25196b51 100644 --- a/public/viewjs/consume.js +++ b/public/viewjs/consume.js @@ -265,6 +265,11 @@ $("#location_id").on('change', function(e) console.error(xhr); } ); + + if (document.getElementById("product_id").getAttribute("barcode") == "null") + { + ScanModeSubmit(); + } }, function(xhr) { @@ -369,10 +374,9 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e) $(".input-group-productamountpicker").trigger("change"); Grocy.FrontendHelpers.ValidateForm('consume-form'); RefreshLocaleNumberInput(); + ScanModeSubmit(false); } } - - ScanModeSubmit(false); }, function(xhr) { @@ -380,10 +384,6 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e) } ); } - else - { - ScanModeSubmit(); - } }, function(xhr) { @@ -612,6 +612,11 @@ var current_productDetails; function RefreshForm() { var productDetails = current_productDetails; + if (!productDetails) + { + return; + } + if (productDetails.product.enable_tare_weight_handling == 1) { $("#consume-exact-amount-group").removeClass("d-none"); @@ -650,12 +655,10 @@ function ScanModeSubmit(singleUnit = true) if (singleUnit) { $("#display_amount").val(1); + $(".input-group-productamountpicker").trigger("change"); } - RefreshLocaleNumberInput(); - $(".input-group-productamountpicker").trigger("change"); Grocy.FrontendHelpers.ValidateForm("consume-form"); - if (document.getElementById("consume-form").checkValidity() === true) { $('#save-consume-button').click(); From a455a012045e4f505859f2a05651d72741bcde02 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 30 Jan 2021 13:11:40 +0100 Subject: [PATCH 07/11] Fixed print layout display handling (fixes #1272) --- public/viewjs/shoppinglist.js | 1 + views/shoppinglist.blade.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/viewjs/shoppinglist.js b/public/viewjs/shoppinglist.js index 42039971..cbc2d9c2 100644 --- a/public/viewjs/shoppinglist.js +++ b/public/viewjs/shoppinglist.js @@ -471,6 +471,7 @@ $(document).on("click", "#print-shopping-list-button", function(e) shoppingListPrintShadowTable.draw(); } + $(".print-layout-container").addClass("d-none"); $("." + $("input[name='print-layout-type']:checked").val()).removeClass("d-none"); window.print(); diff --git a/views/shoppinglist.blade.php b/views/shoppinglist.blade.php index d6fe522c..22d1123c 100644 --- a/views/shoppinglist.blade.php +++ b/views/shoppinglist.blade.php @@ -339,7 +339,7 @@ -