diff --git a/cookbook/templates/shopping_list.html b/cookbook/templates/shopping_list.html index 22d24875c..9a3e05fbf 100644 --- a/cookbook/templates/shopping_list.html +++ b/cookbook/templates/shopping_list.html @@ -19,23 +19,10 @@ -{% endblock %} {% block content %} - - - - {% endblock %} {% block content %} -
- -

{% trans 'Shopping List' %}

-
-
- {% trans 'Edit' %} -

{% trans 'Shopping List' %}

diff --git a/cookbook/tests/factories/__init__.py b/cookbook/tests/factories/__init__.py index a71fd5427..f9adcdb2f 100644 --- a/cookbook/tests/factories/__init__.py +++ b/cookbook/tests/factories/__init__.py @@ -71,16 +71,16 @@ class FoodFactory(factory.django.DjangoModelFactory): """Food factory.""" name = factory.LazyAttribute(lambda x: faker.sentence(nb_words=3)) description = factory.LazyAttribute(lambda x: faker.sentence(nb_words=10)) - # supermarket_category = factory.Maybe( - # factory.LazyAttribute(lambda x: x.has_category), - # yes_declaration=factory.SubFactory(SupermarketCategoryFactory, space=factory.SelfAttribute('..space')), - # no_declaration=None - # ) - # recipe = factory.Maybe( - # factory.LazyAttribute(lambda x: x.has_recipe), - # yes_declaration=factory.SubFactory('cookbook.tests.factories.RecipeFactory', space=factory.SelfAttribute('..space')), - # no_declaration=None - # ) + supermarket_category = factory.Maybe( + factory.LazyAttribute(lambda x: x.has_category), + yes_declaration=factory.SubFactory(SupermarketCategoryFactory, space=factory.SelfAttribute('..space')), + no_declaration=None + ) + recipe = factory.Maybe( + factory.LazyAttribute(lambda x: x.has_recipe), + yes_declaration=factory.SubFactory('cookbook.tests.factories.RecipeFactory', space=factory.SelfAttribute('..space')), + no_declaration=None + ) space = factory.SubFactory(SpaceFactory) class Params: @@ -178,21 +178,21 @@ class ShoppingListRecipeFactory(factory.django.DjangoModelFactory): class ShoppingListEntryFactory(factory.django.DjangoModelFactory): """ShoppingListEntry factory.""" - # list_recipe = factory.Maybe( - # factory.LazyAttribute(lambda x: x.has_mealplan), - # yes_declaration=factory.SubFactory(ShoppingListRecipeFactory, space=factory.SelfAttribute('..space')), - # no_declaration=None - # ) + list_recipe = factory.Maybe( + factory.LazyAttribute(lambda x: x.has_mealplan), + yes_declaration=factory.SubFactory(ShoppingListRecipeFactory, space=factory.SelfAttribute('..space')), + no_declaration=None + ) food = factory.SubFactory(FoodFactory, space=factory.SelfAttribute('..space')) # unit = factory.SubFactory(UnitFactory, space=factory.SelfAttribute('..space')) # # ingredient = factory.SubFactory(IngredientFactory) - # amount = factory.LazyAttribute(lambda x: Decimal(faker.random_int(min=1, max=10))/100) - # order = 0 - # checked = False - # created_by = factory.SubFactory(UserFactory, space=factory.SelfAttribute('..space')) - # created_at = factory.LazyAttribute(lambda x: faker.past_date()) - # completed_at = None - # delay_until = None + amount = factory.LazyAttribute(lambda x: Decimal(faker.random_int(min=1, max=10))/100) + order = 0 + checked = False + created_by = factory.SubFactory(UserFactory, space=factory.SelfAttribute('..space')) + created_at = factory.LazyAttribute(lambda x: faker.past_date()) + completed_at = None + delay_until = None space = factory.SubFactory('cookbook.tests.factories.SpaceFactory') class Params: diff --git a/vue/src/utils/openapi/api.ts b/vue/src/utils/openapi/api.ts index 424b4d9a0..5961702df 100644 --- a/vue/src/utils/openapi/api.ts +++ b/vue/src/utils/openapi/api.ts @@ -1081,10 +1081,10 @@ export interface MealPlan { created_by?: string; /** * - * @type {Array} + * @type {Array} * @memberof MealPlan */ - shared?: Array; + shared?: Array | null; /** * * @type {string} @@ -1269,6 +1269,25 @@ export interface MealPlanRecipeKeywords { */ label?: string; } +/** + * + * @export + * @interface MealPlanShared + */ +export interface MealPlanShared { + /** + * + * @type {number} + * @memberof MealPlanShared + */ + id?: number; + /** + * + * @type {string} + * @memberof MealPlanShared + */ + username?: string; +} /** * * @export @@ -1465,10 +1484,10 @@ export interface RecipeBook { icon?: string | null; /** * - * @type {Array} + * @type {Array} * @memberof RecipeBook */ - shared: Array; + shared: Array; /** * * @type {string} @@ -1513,25 +1532,6 @@ export interface RecipeBookEntry { */ recipe_content?: string; } -/** - * - * @export - * @interface RecipeBookShared - */ -export interface RecipeBookShared { - /** - * - * @type {number} - * @memberof RecipeBookShared - */ - id?: number; - /** - * - * @type {string} - * @memberof RecipeBookShared - */ - username?: string; -} /** * * @export @@ -2029,10 +2029,10 @@ export interface ShoppingList { entries: Array | null; /** * - * @type {Array} + * @type {Array} * @memberof ShoppingList */ - shared: Array; + shared: Array; /** * * @type {boolean} @@ -2960,10 +2960,10 @@ export interface UserPreference { show_recent?: boolean; /** * - * @type {Array} + * @type {Array} * @memberof UserPreference */ - plan_share?: Array; + plan_share?: Array | null; /** * * @type {number}