Changelog and small fixes for #545

This commit is contained in:
Bernd Bestel 2020-02-09 21:50:56 +01:00
parent 7638254f14
commit 49edd011b4
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 55 additions and 69 deletions

View File

@ -16,6 +16,7 @@
- Fixed that when reloading the "new recipe"-page (or when it gets auto-reloaded due to "Auto reload on external changes" is enabled), for each reload a new recipe was created - Fixed that when reloading the "new recipe"-page (or when it gets auto-reloaded due to "Auto reload on external changes" is enabled), for each reload a new recipe was created
- Fixed that the recipe "fullscreen card" was not correctly displayed - Fixed that the recipe "fullscreen card" was not correctly displayed
- Fixed that nested recipes showed all ingredients of the nested recipes twice - Fixed that nested recipes showed all ingredients of the nested recipes twice
- Fixed that when displaying or consuming a recipe from the meal plan the serving amount was maybe wrong (was the one from the recipe instead the one from the meal plan entry) (thanks @kriddles)
### Meal plan improvements ### Meal plan improvements
- Improved that all add-dialogs can be submitted by using `ENTER` and that the next input is automatically selected after selecting a recipe/product - Improved that all add-dialogs can be submitted by using `ENTER` and that the next input is automatically selected after selecting a recipe/product

View File

@ -582,21 +582,10 @@ $(document).on('click', '.recipe-order-missing-button', function(e)
{ {
Grocy.FrontendHelpers.BeginUiBusy(); Grocy.FrontendHelpers.BeginUiBusy();
//set the recipes desired_servings so that the views resolve correctly // Set the recipes desired_servings so that the "recipes resolved"-views resolve correctly based on the meal plan entry servings
//based on the meal plan servings Grocy.Api.Put('objects/recipes/' + objectId, { "desired_servings" : servings},
var data = { };
data.desired_servings = servings;
Grocy.Api.Put('objects/recipes/' + objectId, data,
function(result) function(result)
{ {
},
function(xhr)
{
console.error(xhr);
}
);
Grocy.Api.Post('recipes/' + objectId + '/add-not-fulfilled-products-to-shoppinglist', { }, Grocy.Api.Post('recipes/' + objectId + '/add-not-fulfilled-products-to-shoppinglist', { },
function(result) function(result)
{ {
@ -616,6 +605,12 @@ $(document).on('click', '.recipe-order-missing-button', function(e)
console.error(xhr); console.error(xhr);
} }
); );
},
function(xhr)
{
console.error(xhr);
}
);
} }
} }
}); });
@ -690,22 +685,11 @@ $(document).on('click', '.recipe-consume-button', function(e)
{ {
Grocy.FrontendHelpers.BeginUiBusy(); Grocy.FrontendHelpers.BeginUiBusy();
//set the recipes desired_servings so that the views resolve correctly // Set the recipes desired_servings so that the "recipes resolved"-views resolve correctly based on the meal plan entry servings
//based on the meal plan servings Grocy.Api.Put('objects/recipes/' + objectId, { "desired_servings": servings },
var data = { };
data.desired_servings = servings;
Grocy.Api.Put('objects/recipes/' + objectId, data,
function(result) function(result)
{ {
}, Grocy.Api.Post('recipes/' + objectId + '/consume', {},
function(xhr)
{
console.error(xhr);
}
);
Grocy.Api.Post('recipes/' + objectId + '/consume', { },
function(result) function(result)
{ {
Grocy.FrontendHelpers.EndUiBusy(); Grocy.FrontendHelpers.EndUiBusy();
@ -718,6 +702,12 @@ $(document).on('click', '.recipe-consume-button', function(e)
console.error(xhr); console.error(xhr);
} }
); );
},
function(xhr)
{
console.error(xhr);
}
);
} }
} }
}); });
@ -732,21 +722,10 @@ $(document).on("click", ".recipe-popup-button", function(e)
var objectId = $(e.currentTarget).attr('data-recipe-id'); var objectId = $(e.currentTarget).attr('data-recipe-id');
var servings = $(e.currentTarget).attr('data-mealplan-servings'); var servings = $(e.currentTarget).attr('data-mealplan-servings');
//set the recipes desired_servings so that the views resolve correctly // Set the recipes desired_servings so that the "recipes resolved"-views resolve correctly based on the meal plan entry servings
//based on the meal plan servings Grocy.Api.Put('objects/recipes/' + objectId, { "desired_servings": servings },
var data = { };
data.desired_servings = servings;
Grocy.Api.Put('objects/recipes/' + objectId, data,
function(result) function(result)
{ {
},
function(xhr)
{
console.error(xhr);
}
);
bootbox.dialog({ bootbox.dialog({
message: '<iframe height="650px" class="embed-responsive" src="' + U("/recipes?embedded&recipe=") + objectId + '#fullscreen"></iframe>', message: '<iframe height="650px" class="embed-responsive" src="' + U("/recipes?embedded&recipe=") + objectId + '#fullscreen"></iframe>',
size: 'extra-large', size: 'extra-large',
@ -756,13 +735,19 @@ $(document).on("click", ".recipe-popup-button", function(e)
cancel: { cancel: {
label: __t('Close'), label: __t('Close'),
className: 'btn-secondary responsive-button', className: 'btn-secondary responsive-button',
callback: function() callback: function ()
{ {
bootbox.hideAll(); bootbox.hideAll();
} }
} }
} }
}); });
},
function(xhr)
{
console.error(xhr);
}
);
}); });
$(window).on("resize", function() $(window).on("resize", function()