Fixed the "Shopping list to stock workflow" with disabled FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING (fixes #537)

This commit is contained in:
Bernd Bestel 2020-02-02 13:01:31 +01:00
parent 5effa0c103
commit 890663bf63
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
13 changed files with 23 additions and 18 deletions

View File

@ -4,6 +4,7 @@
### Shopping list improvements/fixes
- Added an option to hide the month-calendar (in the shopping list settings / top right corner settings menu) (defaults to disabled, so please enable this option if you still want to have the month-calendar on the shopping list)
- Optimized the new compact view (there was a little too much white space at the sides of the page)
- Fixed that the "Shopping list to stock workflow" did not work when `FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING` was set to `false`
### Recipe improvements/fixes
- Optimized the ordering of the inputs on the recipe ingredient edit page (moved "Only check if a single unit is in stock" before the amount)

View File

@ -178,6 +178,11 @@ if (Grocy.Components.ProductPicker !== undefined)
$("#tare-weight-handling-info").addClass("d-none");
}
if (!Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)
{
Grocy.Components.DateTimePicker.SetValue(moment().format('YYYY-MM-DD'));
}
if (productDetails.product.default_best_before_days.toString() !== '0')
{
if (productDetails.product.default_best_before_days == -1)
@ -192,12 +197,6 @@ if (Grocy.Components.ProductPicker !== undefined)
Grocy.Components.DateTimePicker.SetValue(moment().add(productDetails.product.default_best_before_days, 'days').format('YYYY-MM-DD'));
}
$('#amount').focus();
Grocy.FrontendHelpers.ValidateForm('purchase-form');
if (GetUriParam("flow") === "shoppinglistitemtostock" && BoolVal(Grocy.UserSettings.shopping_list_to_stock_workflow_auto_submit_when_prefilled) && document.getElementById("purchase-form").checkValidity() === true)
{
$("#save-purchase-button").click();
}
}
else
{
@ -207,11 +206,16 @@ if (Grocy.Components.ProductPicker !== undefined)
}
else
{
Grocy.Components.DateTimePicker.SetValue(moment().format('YYYY-MM-DD'));
$('#amount').focus();
}
}
Grocy.FrontendHelpers.ValidateForm('purchase-form');
if (GetUriParam("flow") === "shoppinglistitemtostock" && BoolVal(Grocy.UserSettings.shopping_list_to_stock_workflow_auto_submit_when_prefilled) && document.getElementById("purchase-form").checkValidity() === true)
{
$("#save-purchase-button").click();
}
if (BoolVal(Grocy.UserSettings.scan_mode_purchase_enabled))
{
$("#amount").val(1);

View File

@ -95,7 +95,7 @@ $(document).on('click', '.shoppinglist-delete-button', function(e)
var shoppingListItemId = $(e.currentTarget).attr('data-shoppinglist-id');
Grocy.FrontendHelpers.BeginUiBusy();
Grocy.Api.Delete('objects/shopping_list/' + shoppingListItemId, {},
Grocy.Api.Delete('objects/shopping_list/' + shoppingListItemId, { },
function(result)
{
animateCSS("#shoppinglistitem-" + shoppingListItemId + "-row", "fadeOut", function()

View File

@ -5,7 +5,7 @@
@section('viewJsName', 'barcodescannertesting')
@push('pageScripts')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
@endpush
@section('content')

View File

@ -5,7 +5,7 @@
@section('viewJsName', 'batteriesoverview')
@push('pageStyles')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
@endpush
@section('content')

View File

@ -5,7 +5,7 @@
@section('viewJsName', 'choresoverview')
@push('pageStyles')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
@endpush
@section('content')

View File

@ -5,7 +5,7 @@
@section('viewJsName', 'manageapikeys')
@push('pageStyles')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
@endpush
@section('content')

View File

@ -5,7 +5,7 @@
@section('viewJsName', 'quantityunitpluraltesting')
@push('pageStyles')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
@endpush
@section('content')

View File

@ -11,7 +11,7 @@
@endpush
@push('pageStyles')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
@endpush

View File

@ -4,7 +4,7 @@
@section('viewJsName', 'stockentries')
@push('pageStyles')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
@endpush
@push('pageScripts')

View File

@ -5,7 +5,7 @@
@section('viewJsName', 'stockoverview')
@push('pageStyles')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
@endpush
@push('pageScripts')

View File

@ -10,7 +10,7 @@
@endpush
@push('pageStyles')
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/animate.css/animate.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
<link href="{{ $U('/node_modules/datatables.net-rowgroup-bs4/css/rowGroup.bootstrap4.min.css?v=', true) }}{{ $version }}" rel="stylesheet">
@endpush