mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2025-12-29 21:20:05 -05:00
Compare commits
4 Commits
dependabot
...
2.3.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84fd3055ea | ||
|
|
d22b5a4a39 | ||
|
|
602f0a8bf0 | ||
|
|
856f417d1b |
2
.github/workflows/build-docker.yml
vendored
2
.github/workflows/build-docker.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
suffix: ""
|
||||
continue-on-error: false
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Get version number
|
||||
id: get_version
|
||||
|
||||
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
python-version: ["3.12"]
|
||||
node-version: ["22"]
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v5
|
||||
- uses: awalsh128/cache-apt-pkgs-action@v1.6.0
|
||||
with:
|
||||
packages: libsasl2-dev python3-dev libxml2-dev libxmlsec1-dev libxslt-dev libxmlsec1-openssl libxslt-dev libldap2-dev libssl-dev gcc musl-dev postgresql-dev zlib-dev jpeg-dev libwebp-dev openssl-dev libffi-dev cargo openldap-dev python3-dev xmlsec-dev xmlsec build-base g++ curl
|
||||
|
||||
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
# We must fetch at least the immediate parents so that if this is
|
||||
# a pull request then we can checkout the head.
|
||||
|
||||
2
.github/workflows/docs.yml
vendored
2
.github/workflows/docs.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
if: github.repository_owner == 'TandoorRecipes' && ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: 3.x
|
||||
|
||||
@@ -56,7 +56,7 @@ class FoodPropertyHelper:
|
||||
if p.property_type == pt and p.property_amount is not None:
|
||||
has_property_value = True
|
||||
for c in conversions:
|
||||
if c.unit == i.food.properties_food_unit and i.food.properties_food_amount != 0:
|
||||
if c.unit == i.food.properties_food_unit:
|
||||
found_property = True
|
||||
computed_properties[pt.id]['total_value'] += (c.amount / i.food.properties_food_amount) * p.property_amount
|
||||
computed_properties[pt.id]['food_values'] = self.add_or_create(
|
||||
|
||||
@@ -324,9 +324,9 @@ class RecipeSearch():
|
||||
self._queryset = self._queryset.annotate(recent=Coalesce(Max(Case(When(pk__in=num_recent_recipes.values('recipe'), then='viewlog__pk'))), Value(0)))
|
||||
|
||||
def _favorite_recipes(self):
|
||||
if self._sort_includes('favorite') or self._timescooked is not None or self._timescooked_gte is not None or self._timescooked_lte is not None:
|
||||
if self._sort_includes('favorite') or self._timescooked or self._timescooked_gte or self._timescooked_lte:
|
||||
less_than = self._timescooked_lte and not self._sort_includes('-favorite')
|
||||
if less_than:
|
||||
if less_than or self._timescooked == 0:
|
||||
default = 1000
|
||||
else:
|
||||
default = 0
|
||||
@@ -338,11 +338,11 @@ class RecipeSearch():
|
||||
)
|
||||
self._queryset = self._queryset.annotate(favorite=Coalesce(Subquery(favorite_recipes), default))
|
||||
|
||||
if self._timescooked is not None:
|
||||
if self._timescooked:
|
||||
self._queryset = self._queryset.filter(favorite=self._timescooked)
|
||||
elif self._timescooked_lte is not None:
|
||||
elif self._timescooked_lte:
|
||||
self._queryset = self._queryset.filter(favorite__lte=int(self._timescooked_lte)).exclude(favorite=0)
|
||||
elif self._timescooked_gte is not None:
|
||||
elif self._timescooked_gte:
|
||||
self._queryset = self._queryset.filter(favorite__gte=int(self._timescooked_gte))
|
||||
|
||||
def keyword_filters(self, **kwargs):
|
||||
|
||||
@@ -75,8 +75,7 @@ class RecipeShoppingEditor():
|
||||
|
||||
@staticmethod
|
||||
def get_shopping_list_recipe(id, user, space):
|
||||
# TODO this sucks since it wont find SLR's that no longer have any entries
|
||||
return ShoppingListRecipe.objects.filter(id=id, space=space).filter(
|
||||
return ShoppingListRecipe.objects.filter(id=id).filter(entries__space=space).filter(
|
||||
Q(entries__created_by=user)
|
||||
| Q(entries__created_by__in=list(user.get_shopping_share()))
|
||||
).prefetch_related('entries').first()
|
||||
@@ -137,8 +136,7 @@ class RecipeShoppingEditor():
|
||||
self.servings = servings
|
||||
|
||||
self._delete_ingredients(ingredients=ingredients)
|
||||
# need to check if there is a SLR because its possible it cant be found if all entries are deleted
|
||||
if self._shopping_list_recipe and self.servings != self._shopping_list_recipe.servings:
|
||||
if self.servings != self._shopping_list_recipe.servings:
|
||||
self.edit_servings()
|
||||
self._add_ingredients(ingredients=ingredients)
|
||||
return True
|
||||
|
||||
@@ -96,20 +96,14 @@ class Mealie1(Integration):
|
||||
self.import_log.msg += f"Ignoring {r['name']} because a recipe with this name already exists.\n"
|
||||
self.import_log.save()
|
||||
else:
|
||||
servings = 1
|
||||
try:
|
||||
servings = r['recipe_servings'] if r['recipe_servings'] and r['recipe_servings'] != 0 else 1
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
recipe = Recipe.objects.create(
|
||||
waiting_time=parse_time(r['perform_time']),
|
||||
working_time=parse_time(r['prep_time']),
|
||||
description=r['description'][:512],
|
||||
name=r['name'],
|
||||
source_url=r['org_url'],
|
||||
servings=servings,
|
||||
servings_text=r['recipe_yield'].strip()[:32] if r['recipe_yield'] else "",
|
||||
servings=r['recipe_servings'] if r['recipe_servings'] and r['recipe_servings'] != 0 else 1,
|
||||
servings_text=r['recipe_yield'].strip() if r['recipe_yield'] else "",
|
||||
internal=True,
|
||||
created_at=r['created_at'],
|
||||
space=self.request.space,
|
||||
@@ -137,7 +131,7 @@ class Mealie1(Integration):
|
||||
step_id_dict = {}
|
||||
for s in mealie_database['recipe_instructions']:
|
||||
if s['recipe_id'] in recipes_dict:
|
||||
step = Step.objects.create(instruction=(s['text'] if s['text'] else "") + (f" \n {s['summary']}" if 'summary' in s and s['summary'] else ""),
|
||||
step = Step.objects.create(instruction=(s['text'] if s['text'] else "") + (f" \n {s['summary']}" if s['summary'] else ""),
|
||||
order=s['position'],
|
||||
name=s['title'],
|
||||
space=self.request.space)
|
||||
@@ -159,7 +153,7 @@ class Mealie1(Integration):
|
||||
for n in mealie_database['notes']:
|
||||
if n['recipe_id'] in recipes_dict:
|
||||
step = Step.objects.create(instruction=n['text'],
|
||||
name=n['title'][:128] if n['title'] else "",
|
||||
name=n['title'],
|
||||
order=100,
|
||||
space=self.request.space)
|
||||
steps_relation.append(Recipe.steps.through(recipe_id=recipes_dict[n['recipe_id']], step_id=step.pk))
|
||||
@@ -249,7 +243,7 @@ class Mealie1(Integration):
|
||||
for r in mealie_database['recipe_nutrition']:
|
||||
if r['recipe_id'] in recipes_dict:
|
||||
for key in property_types_dict:
|
||||
if key in r and r[key]:
|
||||
if r[key]:
|
||||
properties_relation.append(
|
||||
Property(property_type_id=property_types_dict[key].pk,
|
||||
property_amount=Decimal(str(r[key])) / (
|
||||
|
||||
@@ -63,15 +63,7 @@ class MealMaster(Integration):
|
||||
current_recipe = ''
|
||||
|
||||
for fl in file.readlines():
|
||||
line = ""
|
||||
try:
|
||||
line = fl.decode("UTF-8")
|
||||
except UnicodeDecodeError:
|
||||
try:
|
||||
line = fl.decode("windows-1250")
|
||||
except Exception as e:
|
||||
line = "ERROR DECODING LINE"
|
||||
|
||||
line = fl.decode("windows-1250")
|
||||
if (line.startswith('MMMMM') or line.startswith('-----')) and 'meal-master' in line.lower():
|
||||
if current_recipe != '':
|
||||
recipe_list.append(current_recipe)
|
||||
|
||||
@@ -8,7 +8,7 @@ msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2024-08-01 15:04+0200\n"
|
||||
"PO-Revision-Date: 2025-11-22 20:03+0000\n"
|
||||
"PO-Revision-Date: 2025-11-18 07:01+0000\n"
|
||||
"Last-Translator: SerhiiOS <serhios@users.noreply.translate.tandoor.dev>\n"
|
||||
"Language-Team: Ukrainian <http://translate.tandoor.dev/projects/tandoor/"
|
||||
"recipes-backend/uk/>\n"
|
||||
@@ -1085,7 +1085,7 @@ msgstr "Ви використовуєте безкоштовну версію Ta
|
||||
|
||||
#: .\cookbook\templates\base.html:407
|
||||
msgid "Upgrade Now"
|
||||
msgstr "Оновити Зараз"
|
||||
msgstr "Оновити зараз"
|
||||
|
||||
#: .\cookbook\templates\batch\edit.html:6
|
||||
msgid "Batch edit Category"
|
||||
@@ -1447,7 +1447,7 @@ msgstr "Таблиця"
|
||||
#: .\cookbook\templates\markdown_info.html:155
|
||||
#: .\cookbook\templates\markdown_info.html:172
|
||||
msgid "Header"
|
||||
msgstr "Шапка"
|
||||
msgstr "Заголовок"
|
||||
|
||||
#: .\cookbook\templates\markdown_info.html:157
|
||||
#: .\cookbook\templates\markdown_info.html:178
|
||||
@@ -2639,7 +2639,7 @@ msgstr "Конфігурація коннектора для бекенду"
|
||||
|
||||
#: .\cookbook\views\lists.py:91
|
||||
msgid "Invite Links"
|
||||
msgstr "Посилання для запрошеннь"
|
||||
msgstr "Посилання для запрошення"
|
||||
|
||||
#: .\cookbook\views\lists.py:154
|
||||
msgid "Supermarkets"
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
# Generated by Django 5.2.7 on 2025-11-30 10:19
|
||||
|
||||
import cookbook.models
|
||||
import django.db.models.deletion
|
||||
import django_prometheus.models
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cookbook', '0231_alter_aiprovider_options_alter_automation_options_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ShoppingList',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(blank=True, default='', max_length=32)),
|
||||
('description', models.TextField(blank=True)),
|
||||
('color', models.CharField(blank=True, max_length=7, null=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('space', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cookbook.space')),
|
||||
],
|
||||
bases=(django_prometheus.models.ExportModelOperationsMixin('shopping_list'), models.Model, cookbook.models.PermissionModelMixin),
|
||||
),
|
||||
]
|
||||
@@ -1157,7 +1157,7 @@ class Comment(ExportModelOperationsMixin('comment'), models.Model, PermissionMod
|
||||
|
||||
def __str__(self):
|
||||
return self.text
|
||||
|
||||
|
||||
class Meta:
|
||||
ordering = ('pk',)
|
||||
|
||||
@@ -1304,18 +1304,6 @@ class ShoppingListRecipe(ExportModelOperationsMixin('shopping_list_recipe'), mod
|
||||
ordering = ('pk',)
|
||||
|
||||
|
||||
class ShoppingList(ExportModelOperationsMixin('shopping_list'), models.Model, PermissionModelMixin):
|
||||
name = models.CharField(max_length=32, blank=True, default='')
|
||||
description = models.TextField(blank=True)
|
||||
color = models.CharField(max_length=7, blank=True, null=True)
|
||||
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
space = models.ForeignKey(Space, on_delete=models.CASCADE)
|
||||
objects = ScopedManager(space='space')
|
||||
|
||||
|
||||
class ShoppingListEntry(ExportModelOperationsMixin('shopping_list_entry'), models.Model, PermissionModelMixin):
|
||||
list_recipe = models.ForeignKey(ShoppingListRecipe, on_delete=models.CASCADE, null=True, blank=True, related_name='entries')
|
||||
food = models.ForeignKey(Food, on_delete=models.CASCADE, related_name='shopping_entries')
|
||||
|
||||
@@ -37,7 +37,7 @@ from cookbook.models import (Automation, BookmarkletImport, Comment, CookLog, Cu
|
||||
ShareLink, ShoppingListEntry, ShoppingListRecipe, Space,
|
||||
Step, Storage, Supermarket, SupermarketCategory,
|
||||
SupermarketCategoryRelation, Sync, SyncLog, Unit, UnitConversion,
|
||||
UserFile, UserPreference, UserSpace, ViewLog, ConnectorConfig, SearchPreference, SearchFields, AiLog, AiProvider, ShoppingList)
|
||||
UserFile, UserPreference, UserSpace, ViewLog, ConnectorConfig, SearchPreference, SearchFields, AiLog, AiProvider)
|
||||
from cookbook.templatetags.custom_tags import markdown
|
||||
from recipes.settings import AWS_ENABLED, MEDIA_URL, EMAIL_HOST
|
||||
|
||||
@@ -1397,20 +1397,6 @@ class ShoppingListRecipeSerializer(serializers.ModelSerializer):
|
||||
read_only_fields = ('id', 'created_by',)
|
||||
|
||||
|
||||
class ShoppingListSerializer(SpacedModelSerializer, WritableNestedModelSerializer):
|
||||
|
||||
def create(self, validated_data):
|
||||
validated_data['name'] = validated_data['name'].strip()
|
||||
space = validated_data.pop('space', self.context['request'].space)
|
||||
obj, created = ShoppingList.objects.get_or_create(name__iexact=validated_data['name'], space=space, defaults=validated_data)
|
||||
return obj
|
||||
|
||||
class Meta:
|
||||
model = ShoppingList
|
||||
fields = ('id', 'name', 'description', 'color', 'created_at', 'updated_at',)
|
||||
read_only_fields = ('id', 'created_at', 'updated_at',)
|
||||
|
||||
|
||||
class ShoppingListEntrySerializer(WritableNestedModelSerializer):
|
||||
food = FoodSerializer(allow_null=True)
|
||||
unit = UnitSerializer(allow_null=True, required=False)
|
||||
@@ -1743,7 +1729,6 @@ class GenericModelReferenceSerializer(serializers.Serializer):
|
||||
model = serializers.CharField()
|
||||
name = serializers.CharField()
|
||||
|
||||
|
||||
# Export/Import Serializers
|
||||
|
||||
class KeywordExportSerializer(KeywordSerializer):
|
||||
|
||||
@@ -40,7 +40,6 @@ router.register(r'recipe-book-entry', api.RecipeBookEntryViewSet)
|
||||
router.register(r'unit-conversion', api.UnitConversionViewSet)
|
||||
router.register(r'property-type', api.PropertyTypeViewSet) # NOTE: if regenerating the legacy API these need renamed to food-property
|
||||
router.register(r'property', api.PropertyViewSet)
|
||||
router.register(r'shopping-list', api.ShoppingListViewSet)
|
||||
router.register(r'shopping-list-entry', api.ShoppingListEntryViewSet)
|
||||
router.register(r'shopping-list-recipe', api.ShoppingListRecipeViewSet)
|
||||
router.register(r'space', api.SpaceViewSet)
|
||||
|
||||
@@ -88,7 +88,7 @@ from cookbook.models import (Automation, BookmarkletImport, ConnectorConfig, Coo
|
||||
RecipeBookEntry, ShareLink, ShoppingListEntry,
|
||||
ShoppingListRecipe, Space, Step, Storage, Supermarket, SupermarketCategory,
|
||||
SupermarketCategoryRelation, Sync, SyncLog, Unit, UnitConversion,
|
||||
UserFile, UserPreference, UserSpace, ViewLog, RecipeImport, SearchPreference, SearchFields, AiLog, AiProvider, ShoppingList
|
||||
UserFile, UserPreference, UserSpace, ViewLog, RecipeImport, SearchPreference, SearchFields, AiLog, AiProvider
|
||||
)
|
||||
from cookbook.provider.dropbox import Dropbox
|
||||
from cookbook.provider.local import Local
|
||||
@@ -114,7 +114,7 @@ from cookbook.serializer import (AccessTokenSerializer, AutomationSerializer, Au
|
||||
LocalizationSerializer, ServerSettingsSerializer, RecipeFromSourceResponseSerializer, ShoppingListEntryBulkCreateSerializer, FdcQuerySerializer,
|
||||
AiImportSerializer, ImportOpenDataSerializer, ImportOpenDataMetaDataSerializer, ImportOpenDataResponseSerializer, ExportRequestSerializer,
|
||||
RecipeImportSerializer, ConnectorConfigSerializer, SearchPreferenceSerializer, SearchFieldsSerializer, RecipeBatchUpdateSerializer,
|
||||
AiProviderSerializer, AiLogSerializer, FoodBatchUpdateSerializer, GenericModelReferenceSerializer, ShoppingListSerializer
|
||||
AiProviderSerializer, AiLogSerializer, FoodBatchUpdateSerializer, GenericModelReferenceSerializer
|
||||
)
|
||||
from cookbook.version_info import TANDOOR_VERSION
|
||||
from cookbook.views.import_export import get_integration
|
||||
@@ -307,8 +307,7 @@ class FuzzyFilterMixin(viewsets.ModelViewSet, ExtendedRecipeMixin):
|
||||
filter = Q(name__icontains=query)
|
||||
if self.request.user.is_authenticated:
|
||||
if any([self.model.__name__.lower() in x for x in
|
||||
self.request.user.searchpreference.unaccent.values_list('field', flat=True)]) and (
|
||||
settings.DATABASES['default']['ENGINE'] == 'django.db.backends.postgresql'):
|
||||
self.request.user.searchpreference.unaccent.values_list('field', flat=True)]):
|
||||
filter |= Q(name__unaccent__icontains=query)
|
||||
|
||||
self.queryset = (
|
||||
@@ -2011,17 +2010,6 @@ class ShoppingListRecipeViewSet(LoggingMixin, viewsets.ModelViewSet):
|
||||
return Response(serializer.errors, 400)
|
||||
|
||||
|
||||
class ShoppingListViewSet(LoggingMixin, viewsets.ModelViewSet, DeleteRelationMixing):
|
||||
queryset = ShoppingList.objects
|
||||
serializer_class = ShoppingListSerializer
|
||||
permission_classes = [CustomIsUser & CustomTokenHasReadWriteScope]
|
||||
pagination_class = DefaultPagination
|
||||
|
||||
def get_queryset(self):
|
||||
queryset = self.queryset.filter(space=self.request.space).all()
|
||||
return queryset
|
||||
|
||||
|
||||
@extend_schema_view(list=extend_schema(parameters=[
|
||||
OpenApiParameter(name='updated_after',
|
||||
description=_('Returns only elements updated after the given timestamp in ISO 8601 format.'),
|
||||
@@ -3068,20 +3056,11 @@ def meal_plans_to_ical(queryset, filename):
|
||||
for p in queryset:
|
||||
event = Event()
|
||||
event['uid'] = p.id
|
||||
|
||||
start_date_time = p.from_date
|
||||
end_date_time = p.from_date
|
||||
|
||||
event.add('dtstart', p.from_date)
|
||||
if p.to_date:
|
||||
end_date_time = p.to_date
|
||||
|
||||
if p.meal_type.time:
|
||||
start_date_time = datetime.datetime.combine(p.from_date, p.meal_type.time)
|
||||
end_date_time = datetime.datetime.combine(p.to_date, p.meal_type.time) + datetime.timedelta(minutes=60)
|
||||
|
||||
event.add('dtstart', start_date_time)
|
||||
event.add('dtend', end_date_time)
|
||||
|
||||
event.add('dtend', p.to_date)
|
||||
else:
|
||||
event.add('dtend', p.from_date)
|
||||
event['summary'] = f'{p.meal_type.name}: {p.get_label()}'
|
||||
event['description'] = p.note
|
||||
cal.add_component(event)
|
||||
|
||||
@@ -43,10 +43,7 @@ def index(request, path=None, resource=None):
|
||||
return HttpResponseRedirect(reverse_lazy('view_setup'))
|
||||
|
||||
if 'signup_token' in request.session:
|
||||
value = request.session['signup_token']
|
||||
del request.session['signup_token']
|
||||
request.session.modified = True
|
||||
return HttpResponseRedirect(reverse('view_invite', args=[value]))
|
||||
return HttpResponseRedirect(reverse('view_invite', args=[request.session.pop('signup_token', '')]))
|
||||
|
||||
if request.user.is_authenticated or re.search(r'/recipe/\d+/', request.path[:512]) and request.GET.get('share'):
|
||||
return render(request, 'frontend/tandoor.html', {})
|
||||
|
||||
@@ -675,4 +675,4 @@ DISABLE_EXTERNAL_CONNECTORS = extract_bool('DISABLE_EXTERNAL_CONNECTORS', False)
|
||||
EXTERNAL_CONNECTORS_QUEUE_SIZE = int(os.getenv('EXTERNAL_CONNECTORS_QUEUE_SIZE', 100))
|
||||
|
||||
mimetypes.add_type("text/javascript", ".js", True)
|
||||
mimetypes.add_type("text/javascript", ".mjs", True)
|
||||
mimetypes.add_type("text/javascript", ".mjs", True)
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
<!-- <v-text-field density="compact" variant="outlined" class="pt-2 pb-2" :label="$t('Search')" hide-details clearable></v-text-field>-->
|
||||
<!-- </v-list-item>-->
|
||||
<!-- <v-divider></v-divider>-->
|
||||
<v-list-item link :title="$t('Start')" @click="window = 'start'" prepend-icon="fa-solid fa-house"></v-list-item>
|
||||
<v-list-item link :title="$t('Space')" @click="window = 'space'" prepend-icon="fa-solid fa-database"></v-list-item>
|
||||
<v-list-item link title="Start" @click="window = 'start'" prepend-icon="fa-solid fa-house"></v-list-item>
|
||||
<v-list-item link title="Space" @click="window = 'space'" prepend-icon="fa-solid fa-database"></v-list-item>
|
||||
<v-list-item link :title="$t('Recipes')" @click="window = 'recipes'" prepend-icon="$recipes"></v-list-item>
|
||||
<v-list-item link :title="$t('Import')" @click="window = 'import'" prepend-icon="$import"></v-list-item>
|
||||
<v-list-item link :title="$t('AI')" @click="window = 'ai'" prepend-icon="$ai"></v-list-item>
|
||||
<v-list-item link :title="$t('Unit')" @click="window = 'unit'" prepend-icon="fa-solid fa-scale-balanced"></v-list-item>
|
||||
<v-list-item link :title="$t('Food')" @click="window = 'food'" prepend-icon="fa-solid fa-carrot"></v-list-item>
|
||||
<v-list-item link :title="$t('Keyword')" @click="window = 'keyword'" prepend-icon="fa-solid fa-tags"></v-list-item>
|
||||
<v-list-item link :title="$t('Recipe Structure')" @click="window = 'recipe_structure'" prepend-icon="fa-solid fa-diagram-project"></v-list-item>
|
||||
<v-list-item link title="Recipe Structure" @click="window = 'recipe_structure'" prepend-icon="fa-solid fa-diagram-project"></v-list-item>
|
||||
<v-list-item link :title="$t('Properties')" @click="window = 'properties'" prepend-icon="fa-solid fa-database"></v-list-item>
|
||||
<v-list-item link :title="$t('Search')" @click="window = 'recipe_search'" prepend-icon="$search"></v-list-item>
|
||||
<v-list-item link :title="$t('SavedSearch')" @click="window = 'search_filter'" prepend-icon="fa-solid fa-sd-card"></v-list-item>
|
||||
@@ -31,8 +31,6 @@
|
||||
|
||||
<v-main>
|
||||
<v-container>
|
||||
<v-select v-model="window" :items="mobileMenuItems" class="d-block d-lg-none"> </v-select>
|
||||
|
||||
<v-window v-model="window">
|
||||
<v-window-item value="start">
|
||||
<h2>Welcome to Tandoor 2</h2>
|
||||
@@ -48,8 +46,7 @@
|
||||
<v-btn class="mt-2 ms-2" color="info" href="https://github.com/TandoorRecipes/recipes" target="_blank" prepend-icon="fa-solid fa-code-branch">GitHub
|
||||
</v-btn>
|
||||
|
||||
<v-alert class="mt-3" border="start" variant="tonal" color="success"
|
||||
v-if="(!useUserPreferenceStore().serverSettings.hosted && !useUserPreferenceStore().activeSpace.demo)">
|
||||
<v-alert class="mt-3" border="start" variant="tonal" color="success" v-if="(!useUserPreferenceStore().serverSettings.hosted && !useUserPreferenceStore().activeSpace.demo)">
|
||||
<v-alert-title>Did you know?</v-alert-title>
|
||||
Tandoor is Open Source and available to anyone for free to host on their own server. Thousands of hours have been spend
|
||||
making Tandoor what it is today. You can help make Tandoor even better by contributing or helping financing the effort.
|
||||
@@ -63,12 +60,10 @@
|
||||
|
||||
</v-window-item>
|
||||
<v-window-item value="space">
|
||||
<p class="mt-3">All your data is stored in a Space where you can invite other people to collaborate on your recipe database. Typcially the members of a
|
||||
space
|
||||
<p class="mt-3">All your data is stored in a Space where you can invite other people to collaborate on your recipe database. Typcially the members of a space
|
||||
belong to one family/household/organization.</p>
|
||||
|
||||
<p class="mt-3">While everyone can access all recipes by default, Books, Shopping Lists and Mealplans are not shared by default. You can share them with
|
||||
other
|
||||
<p class="mt-3">While everyone can access all recipes by default, Books, Shopping Lists and Mealplans are not shared by default. You can share them with other
|
||||
members of your space
|
||||
using the settings.
|
||||
</p>
|
||||
@@ -82,24 +77,19 @@
|
||||
|
||||
</v-window-item>
|
||||
<v-window-item value="recipes">
|
||||
<p class="mt-3">Recipes are the foundation of your Tandoor space. A Recipe has one or more steps that contain ingredients, instructions and other
|
||||
information.
|
||||
<p class="mt-3">Recipes are the foundation of your Tandoor space. A Recipe has one or more steps that contain ingredients, instructions and other information.
|
||||
Ingredients in turn consist of an amount, a unit and a food, allowing recipes to be scaled, nutrition's to be calculated and shopping to be organized.
|
||||
</p>
|
||||
|
||||
<p class="mt-3">Besides manually creating them you can also import them from various different places.
|
||||
</p>
|
||||
<p class="mt-3">Recipes, by default, are visible to all members of your space. Setting them to private means only you can see it. After setting it to
|
||||
private you
|
||||
<p class="mt-3">Recipes, by default, are visible to all members of your space. Setting them to private means only you can see it. After setting it to private you
|
||||
can manually specify the people who should be able to view the recipe.
|
||||
You can also create a share link for the recipe to share it with everyone that has access to the link.
|
||||
</p>
|
||||
<p class="mt-3"></p>
|
||||
|
||||
<v-btn color="primary" variant="tonal" prepend-icon="$create" class="me-2" :to="{name: 'ModelEditPage', params: {model: 'Recipe'}}">{{
|
||||
$t('Create')
|
||||
}}
|
||||
</v-btn>
|
||||
<v-btn color="primary" variant="tonal" prepend-icon="$create" class="me-2" :to="{name: 'ModelEditPage', params: {model: 'Recipe'}}">{{ $t('Create') }}</v-btn>
|
||||
<v-btn color="primary" variant="tonal" prepend-icon="$search" class="me-2" :to="{name: 'SearchPage'}">{{ $t('Search') }}</v-btn>
|
||||
|
||||
</v-window-item>
|
||||
@@ -129,8 +119,7 @@
|
||||
</p>
|
||||
|
||||
<p class="mt-3" v-if="useUserPreferenceStore().serverSettings.hosted">
|
||||
To prevent accidental AI cost you can review your AI usage using the AI Log. The Server Administrator can also set AI usage limits for your space
|
||||
(either monthly or using a balance).
|
||||
To prevent accidental AI cost you can review your AI usage using the AI Log. The Server Administrator can also set AI usage limits for your space (either monthly or using a balance).
|
||||
</p>
|
||||
<p class="mt-3" v-if="!useUserPreferenceStore().serverSettings.hosted">
|
||||
Depending on your subscription you will have different AI Credits available for your space every month. Additionally you might have a Credit balance
|
||||
@@ -164,8 +153,7 @@
|
||||
<v-btn color="primary" variant="tonal" prepend-icon="fa-solid fa-scale-balanced" class="me-2" :to="{name: 'ModelListPage', params: {model: 'Unit'}}">
|
||||
{{ $t('Unit') }}
|
||||
</v-btn>
|
||||
<v-btn color="primary" variant="tonal" prepend-icon="fa-solid fa-exchange-alt" class="me-2"
|
||||
:to="{name: 'ModelListPage', params: {model: 'UnitConversion'}}">
|
||||
<v-btn color="primary" variant="tonal" prepend-icon="fa-solid fa-exchange-alt" class="me-2" :to="{name: 'ModelListPage', params: {model: 'UnitConversion'}}">
|
||||
{{ $t('Conversion') }}
|
||||
</v-btn>
|
||||
|
||||
@@ -235,8 +223,7 @@
|
||||
calculate the property amount if a Food is given in a different unit (e.g. 1kg or 1 cup).
|
||||
</p>
|
||||
|
||||
<v-btn color="primary" variant="tonal" prepend-icon="fa-solid fa-database" class="me-2 mt-2 mb-2"
|
||||
:to="{name: 'ModelListPage', params: {model: 'PropertyType'}}">
|
||||
<v-btn color="primary" variant="tonal" prepend-icon="fa-solid fa-database" class="me-2 mt-2 mb-2" :to="{name: 'ModelListPage', params: {model: 'PropertyType'}}">
|
||||
{{ $t('Property') }}
|
||||
</v-btn>
|
||||
<h3>Editor</h3>
|
||||
@@ -307,8 +294,7 @@
|
||||
</p>
|
||||
|
||||
<p class="mt-3">
|
||||
You can assign Supermarket Categories to your Foods, either trough the Food Editor or directly by clicking on a Shopping List Entry, to automatically
|
||||
sort the list
|
||||
You can assign Supermarket Categories to your Foods, either trough the Food Editor or directly by clicking on a Shopping List Entry, to automatically sort the list
|
||||
according to the Category Order defined in the Supermarket.
|
||||
</p>
|
||||
|
||||
@@ -347,8 +333,7 @@
|
||||
|
||||
<p class="mt-3">
|
||||
When selecting a Recipe in a Meal Plan you can automatically add its ingredients to the shopping list. You can also manually add more entries trough the
|
||||
shopping tab in the Meal Plan editor. When deleting a Meal Plan all Shopping List Entries associated with that Meal Plan are deleted as well. When
|
||||
changing the
|
||||
shopping tab in the Meal Plan editor. When deleting a Meal Plan all Shopping List Entries associated with that Meal Plan are deleted as well. When changing the
|
||||
number of servings in a Meal Plan the Servings of the connected Recipe in the Shopping list are automatically changed as well.
|
||||
|
||||
</p>
|
||||
@@ -383,30 +368,10 @@
|
||||
|
||||
import {ref} from "vue";
|
||||
import {useUserPreferenceStore} from "@/stores/UserPreferenceStore.ts";
|
||||
import {useI18n} from "vue-i18n";
|
||||
|
||||
const {t} = useI18n()
|
||||
const drawer = defineModel()
|
||||
const window = ref('start')
|
||||
|
||||
const mobileMenuItems = ref([
|
||||
{title: t('Start'), props: {prependIcon: 'fa-solid fa-house'}, value: 'start'},
|
||||
{title: t('Space'), props: {prependIcon: 'fa-solid fa-database'}, value: 'space'},
|
||||
{title: t('Recipes'), props: {prependIcon: '$recipes'}, value: 'recipes'},
|
||||
{title: t('Import'), props: {prependIcon: '$import'}, value: 'import'},
|
||||
{title: t('AI'), props: {prependIcon: '$ai'}, value: 'ai'},
|
||||
{title: t('Unit'), props: {prependIcon: 'fa-solid fa-scale-balanced'}, value: 'unit'},
|
||||
{title: t('Food'), props: {prependIcon: 'fa-solid fa-carrot'}, value: 'food'},
|
||||
{title: t('Keyword'), props: {prependIcon: 'fa-solid fa-tags'}, value: 'keyword'},
|
||||
{title: t('RecipeStructure'), props: {prependIcon: 'fa-solid fa-diagram-project'}, value: 'recipe_structure'},
|
||||
{title: t('Properties'), props: {prependIcon: 'fa-solid fa-database'}, value: 'properties'},
|
||||
{title: t('Search'), props: {prependIcon: '$search'}, value: 'recipe_search'},
|
||||
{title: t('SavedSearch'), props: {prependIcon: 'fa-solid fa-sd-card'}, value: 'search_filter'},
|
||||
{title: t('Books'), props: {prependIcon: '$books'}, value: 'books'},
|
||||
{title: t('Shopping'), props: {prependIcon: '$shopping'}, value: 'shopping'},
|
||||
{title: t('Meal_Plan'), props: {prependIcon: '$mealplan'}, value: 'meal_plan'}
|
||||
])
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -146,11 +146,7 @@ onMounted(() => {
|
||||
|
||||
function clickMealPlan(plan: MealPlan) {
|
||||
if (plan.recipe) {
|
||||
router.push({
|
||||
name: 'RecipeViewPage',
|
||||
params: { id: String(plan.recipe.id) }, // keep id in params
|
||||
query: { servings: String(plan.servings ?? '') } // pass servings as query
|
||||
})
|
||||
router.push({name: 'RecipeViewPage', params: {id: plan.recipe.id}})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,15 +37,15 @@
|
||||
|
||||
<v-dialog max-width="900px" v-model="dialog">
|
||||
<v-card v-if="dialogProperty" :loading="loading">
|
||||
<v-closable-card-title :title="`${dialogProperty.propertyAmountTotal} ${(dialogProperty.unit != null) ? dialogProperty.unit : ''} ${dialogProperty.name}`" :sub-title="$t('total')" icon="$properties"
|
||||
<v-closable-card-title :title="`${dialogProperty.propertyAmountTotal} ${dialogProperty.unit} ${dialogProperty.name}`" :sub-title="$t('total')" icon="$properties"
|
||||
v-model="dialog"></v-closable-card-title>
|
||||
<v-card-text>
|
||||
<v-list>
|
||||
<v-list-item border v-for="fv in dialogProperty.foodValues" :key="`${dialogProperty.id}_${fv.id}`">
|
||||
<template #prepend>
|
||||
<v-progress-circular size="55" width="5" :model-value="(fv.value* props.ingredientFactor/dialogProperty.propertyAmountTotal)*100"
|
||||
:color="colorScale((fv.value* props.ingredientFactor/dialogProperty.propertyAmountTotal)*100)" v-if="fv.value != null && dialogProperty.propertyAmountTotal > 0">
|
||||
{{ Math.round((fv.value* props.ingredientFactor / dialogProperty.propertyAmountTotal) * 100) }}%
|
||||
<v-progress-circular size="55" width="5" :model-value="(fv.value/dialogProperty.propertyAmountTotal)*100"
|
||||
:color="colorScale((fv.value/dialogProperty.propertyAmountTotal)*100)" v-if="fv.value != null && dialogProperty.propertyAmountTotal > 0">
|
||||
{{ Math.round((fv.value / dialogProperty.propertyAmountTotal) * 100) }}%
|
||||
</v-progress-circular>
|
||||
<v-progress-circular size="55" width="5" v-if="fv.value == null">?</v-progress-circular>
|
||||
</template>
|
||||
@@ -59,7 +59,7 @@
|
||||
<model-edit-dialog model="UnitConversion" @create="refreshRecipe()"
|
||||
:item-defaults="{baseAmount: 1, baseUnit: fv.missing_conversion.base_unit, convertedUnit: fv.missing_conversion.converted_unit, food: fv.food}"></model-edit-dialog>
|
||||
</v-chip>
|
||||
<v-chip v-else-if="fv.value != undefined">{{ $n(fv.value * props.ingredientFactor) }} {{ dialogProperty.unit }}</v-chip>
|
||||
<v-chip v-else-if="fv.value != undefined">{{ $n(fv.value) }} {{ dialogProperty.unit }}</v-chip>
|
||||
<v-chip color="warning" prepend-icon="$edit" class="cursor-pointer" :to="{name: 'ModelEditPage', params: {model: 'Recipe', id: recipe.id}}" v-else-if="fv.missing_unit">
|
||||
{{ $t('NoUnit') }}
|
||||
</v-chip>
|
||||
@@ -101,10 +101,7 @@ type PropertyWrapper = {
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
ingredientFactor: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
servings: {type: Number, required: true,},
|
||||
})
|
||||
|
||||
const recipe = defineModel<Recipe>({required: true})
|
||||
@@ -146,7 +143,7 @@ const propertyList = computed(() => {
|
||||
description: rp.propertyType.description,
|
||||
foodValues: [],
|
||||
propertyAmountPerServing: rp.propertyAmount,
|
||||
propertyAmountTotal: rp.propertyAmount * recipe.value.servings * props.ingredientFactor,
|
||||
propertyAmountTotal: rp.propertyAmount * recipe.value.servings * (props.servings / recipe.value.servings),
|
||||
missingValue: false,
|
||||
unit: rp.propertyType.unit,
|
||||
type: rp.propertyType,
|
||||
@@ -164,7 +161,7 @@ const propertyList = computed(() => {
|
||||
icon: fp.icon,
|
||||
foodValues: fp.food_values,
|
||||
propertyAmountPerServing: fp.total_value / recipe.value.servings,
|
||||
propertyAmountTotal: fp.total_value * props.ingredientFactor,
|
||||
propertyAmountTotal: fp.total_value * (props.servings / recipe.value.servings),
|
||||
missingValue: fp.missing_value,
|
||||
unit: fp.unit,
|
||||
type: fp,
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
import {onMounted, PropType, ref, watch} from "vue";
|
||||
import {onMounted, PropType, ref} from "vue";
|
||||
import {ApiApi, CookLog, Recipe} from "@/openapi";
|
||||
import {DateTime} from "luxon";
|
||||
import {ErrorMessageType, useMessageStore} from "@/stores/MessageStore";
|
||||
@@ -82,10 +82,6 @@ const props = defineProps({
|
||||
type: Object as PropType<Recipe>,
|
||||
required: true
|
||||
},
|
||||
servings: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
const newCookLog = ref({} as CookLog);
|
||||
@@ -125,7 +121,7 @@ function recLoadCookLog(recipeId: number, page: number = 1) {
|
||||
*/
|
||||
function resetForm() {
|
||||
newCookLog.value = {} as CookLog
|
||||
newCookLog.value.servings = props.servings
|
||||
newCookLog.value.servings = props.recipe.servings
|
||||
newCookLog.value.createdAt = new Date()
|
||||
newCookLog.value.recipe = props.recipe.id!
|
||||
}
|
||||
@@ -144,13 +140,6 @@ function saveCookLog() {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* watch for changes in servings prop and update the servings input field
|
||||
*/
|
||||
watch(() => props.servings, (newVal) => {
|
||||
newCookLog.value.servings = newVal
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<template v-if="!props.loading">
|
||||
|
||||
<router-link :to="dest" :target="linkTarget">
|
||||
<router-link :to="{name: 'RecipeViewPage', params: {id: props.recipe.id}}" :target="linkTarget">
|
||||
<recipe-image :style="{height: props.height}" :recipe="props.recipe" rounded="lg" class="mr-3 ml-3">
|
||||
|
||||
</recipe-image>
|
||||
@@ -36,7 +36,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<v-card :to="dest" :style="{'height': props.height}" v-if="false">
|
||||
<v-card :to="{name: 'RecipeViewPage', params: {id: props.recipe.id}}" :style="{'height': props.height}" v-if="false">
|
||||
<v-tooltip
|
||||
class="align-center justify-center"
|
||||
location="top center" origin="overlap"
|
||||
@@ -97,7 +97,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {computed, PropType} from 'vue'
|
||||
import {PropType} from 'vue'
|
||||
import KeywordsComponent from "@/components/display/KeywordsBar.vue";
|
||||
import {Recipe, RecipeOverview} from "@/openapi";
|
||||
|
||||
@@ -113,29 +113,20 @@ const props = defineProps({
|
||||
show_description: {type: Boolean, required: false},
|
||||
height: {type: String, required: false, default: '15vh'},
|
||||
linkTarget: {type: String, required: false, default: ''},
|
||||
showMenu: {type: Boolean, default: true, required: false},
|
||||
servings: {type: Number, required: false},
|
||||
showMenu: {type: Boolean, default: true, required: false}
|
||||
})
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const dest = computed(() => {
|
||||
const route: any = { name: 'RecipeViewPage', params: { id: props.recipe.id } };
|
||||
if (props.servings !== undefined) {
|
||||
route.query = { servings: String(props.servings) };
|
||||
}
|
||||
return route;
|
||||
})
|
||||
|
||||
/**
|
||||
* open the recipe either in the same tab or in a new tab depending on the link target prop
|
||||
*/
|
||||
function openRecipe() {
|
||||
if (props.linkTarget != '') {
|
||||
const routeData = router.resolve(dest.value);
|
||||
const routeData = router.resolve({name: 'RecipeViewPage', params: {id: props.recipe.id}});
|
||||
window.open(routeData.href, props.linkTarget);
|
||||
} else {
|
||||
router.push(dest.value);
|
||||
router.push({name: 'RecipeViewPage', params: {id: props.recipe.id}})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<template v-if="recipe.name != undefined">
|
||||
|
||||
<template class="d-block d-lg-none d-print-none">
|
||||
<template class="d-block d-lg-none">
|
||||
|
||||
<!-- mobile layout -->
|
||||
<v-card class="rounded-0">
|
||||
@@ -25,7 +25,7 @@
|
||||
<span class="ps-2 text-h5 flex-grow-1 pa-1" :class="{'text-truncate': !showFullRecipeName}" @click="showFullRecipeName = !showFullRecipeName">
|
||||
{{ recipe.name }}
|
||||
</span>
|
||||
<recipe-context-menu :recipe="recipe" :servings="servings" v-if="useUserPreferenceStore().isAuthenticated"></recipe-context-menu>
|
||||
<recipe-context-menu :recipe="recipe" v-if="useUserPreferenceStore().isAuthenticated"></recipe-context-menu>
|
||||
</v-sheet>
|
||||
<keywords-component variant="flat" class="ms-1" :keywords="recipe.keywords"></keywords-component>
|
||||
<private-recipe-badge :users="recipe.shared" v-if="recipe._private"></private-recipe-badge>
|
||||
@@ -61,7 +61,7 @@
|
||||
</v-card>
|
||||
</template>
|
||||
<!-- Desktop horizontal layout -->
|
||||
<template class="d-none d-lg-block d-print-block">
|
||||
<template class="d-none d-lg-block">
|
||||
<v-row dense>
|
||||
<v-col cols="8">
|
||||
<recipe-image
|
||||
@@ -75,7 +75,7 @@
|
||||
<v-card-text class="flex-grow-1">
|
||||
<div class="d-flex">
|
||||
<h1 class="flex-column flex-grow-1">{{ recipe.name }}</h1>
|
||||
<recipe-context-menu :recipe="recipe" :servings="servings" v-if="useUserPreferenceStore().isAuthenticated"
|
||||
<recipe-context-menu :recipe="recipe" v-if="useUserPreferenceStore().isAuthenticated"
|
||||
class="flex-column mb-auto mt-2 float-right"></recipe-context-menu>
|
||||
</div>
|
||||
<p>
|
||||
@@ -118,7 +118,7 @@
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
<template v-if="recipe.filePath && !useUserPreferenceStore().isPrintMode">
|
||||
<template v-if="recipe.filePath">
|
||||
<external-recipe-viewer class="mt-2" :recipe="recipe"></external-recipe-viewer>
|
||||
|
||||
<v-card :title="$t('AI')" prepend-icon="$ai" :loading="fileApiLoading || loading" :disabled="fileApiLoading || loading || !useUserPreferenceStore().activeSpace.aiEnabled"
|
||||
@@ -144,7 +144,7 @@
|
||||
<step-view v-model="recipe.steps[index]" :step-number="index+1" :ingredientFactor="ingredientFactor"></step-view>
|
||||
</v-card>
|
||||
|
||||
<property-view v-model="recipe" :ingredientFactor="ingredientFactor"></property-view>
|
||||
<property-view v-model="recipe" :servings="servings"></property-view>
|
||||
|
||||
<v-card class="mt-2">
|
||||
<v-card-text>
|
||||
@@ -190,7 +190,7 @@
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
|
||||
<recipe-activity :recipe="recipe" :servings="servings" v-if="useUserPreferenceStore().userSettings.comments"></recipe-activity>
|
||||
<recipe-activity :recipe="recipe" v-if="useUserPreferenceStore().userSettings.comments"></recipe-activity>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@@ -220,11 +220,8 @@ const {doAiImport, fileApiLoading} = useFileApi()
|
||||
|
||||
const loading = ref(false)
|
||||
const recipe = defineModel<Recipe>({required: true})
|
||||
const props = defineProps<{
|
||||
servings: {type: Number, required: false},
|
||||
}>()
|
||||
|
||||
const servings = ref(props.servings ?? recipe.value.servings ?? 1)
|
||||
const servings = ref(1)
|
||||
const showFullRecipeName = ref(false)
|
||||
|
||||
const selectedAiProvider = ref<undefined | AiProvider>(useUserPreferenceStore().activeSpace.aiDefaultProvider)
|
||||
@@ -239,13 +236,11 @@ const ingredientFactor = computed(() => {
|
||||
/**
|
||||
* change servings when recipe servings are changed
|
||||
*/
|
||||
if (props.servings === undefined) {
|
||||
watch(() => recipe.value.servings, () => {
|
||||
if (recipe.value.servings) {
|
||||
servings.value = recipe.value.servings
|
||||
}
|
||||
})
|
||||
}
|
||||
watch(() => recipe.value.servings, () => {
|
||||
if (recipe.value.servings) {
|
||||
servings.value = recipe.value.servings
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
//keep screen on while viewing a recipe
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
<timer :seconds="step.time != undefined ? step.time*60 : 0" @stop="timerRunning = false" v-if="timerRunning"></timer>
|
||||
<v-card-text v-if="step.ingredients.length > 0 || step.instruction != ''">
|
||||
<v-row>
|
||||
<v-col :cols="(useUserPreferenceStore().isPrintMode) ? 6 : 12" md="6" v-if="step.ingredients.length > 0 && (step.showIngredientsTable || step.show_ingredients_table)">
|
||||
<v-col cols="12" md="6" v-if="step.ingredients.length > 0 && (step.showIngredientsTable || step.show_ingredients_table)">
|
||||
<ingredients-table v-model="step.ingredients" :ingredient-factor="ingredientFactor"></ingredients-table>
|
||||
</v-col>
|
||||
<v-col :cols="(useUserPreferenceStore().isPrintMode) ? 6 : 12" md="6" class="markdown-body">
|
||||
<v-col cols="12" md="6" class="markdown-body">
|
||||
<instructions :instructions_html="step.instructionsMarkdown" :ingredient_factor="ingredientFactor"
|
||||
v-if="step.instructionsMarkdown != undefined"></instructions>
|
||||
<!-- sub recipes dont have a correct schema, thus they use different variable naming -->
|
||||
@@ -62,7 +62,6 @@ import {Step} from "@/openapi";
|
||||
|
||||
import Instructions from "@/components/display/Instructions.vue";
|
||||
import Timer from "@/components/display/Timer.vue";
|
||||
import {useUserPreferenceStore} from "@/stores/UserPreferenceStore.ts";
|
||||
|
||||
const step = defineModel<Step>({required: true})
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<v-progress-circular v-if="duplicateLoading" indeterminate size="small"></v-progress-circular>
|
||||
</template>
|
||||
</v-list-item>
|
||||
<v-list-item :to="{ name: 'RecipeViewPage', params: { id: recipe.id}, query: {print: 'true', servings: props.servings} }" :active="false" target="_blank" prepend-icon="fa-solid fa-print">
|
||||
<v-list-item :to="{ name: 'RecipeViewPage', params: { id: recipe.id}, query: {print: 'true'} }" :active="false" target="_blank" prepend-icon="fa-solid fa-print">
|
||||
{{ $t('Print') }}
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
@@ -47,21 +47,22 @@ import AddToShoppingDialog from "@/components/dialogs/AddToShoppingDialog.vue";
|
||||
import {ErrorMessageType, useMessageStore} from "@/stores/MessageStore.ts";
|
||||
import {useRouter} from "vue-router";
|
||||
import {useFileApi} from "@/composables/useFileApi.ts";
|
||||
import {useI18n} from "vue-i18n";
|
||||
|
||||
const router = useRouter()
|
||||
const {t} = useI18n()
|
||||
const {updateRecipeImage} = useFileApi()
|
||||
|
||||
const props = defineProps({
|
||||
recipe: {type: Object as PropType<Recipe | RecipeOverview>, required: true},
|
||||
servings: {type: Number, default: undefined},
|
||||
size: {type: String, default: 'medium'},
|
||||
})
|
||||
|
||||
const mealPlanDialog = ref(false)
|
||||
const duplicateLoading = ref(false)
|
||||
|
||||
function openPrintView() {
|
||||
print()
|
||||
}
|
||||
|
||||
/**
|
||||
* create a duplicate of the recipe by pulling its current data and creating a new recipe with the same data
|
||||
*/
|
||||
@@ -69,27 +70,7 @@ function duplicateRecipe() {
|
||||
let api = new ApiApi()
|
||||
duplicateLoading.value = true
|
||||
api.apiRecipeRetrieve({id: props.recipe.id!}).then(originalRecipe => {
|
||||
|
||||
let recipe = {...originalRecipe, ...{id: undefined, name: originalRecipe.name + `(${t('Copy')})`}}
|
||||
recipe.steps = recipe.steps.map((step) => {
|
||||
return {
|
||||
...step,
|
||||
...{
|
||||
id: undefined,
|
||||
ingredients: step.ingredients.map((ingredient) => {
|
||||
return {...ingredient, ...{id: undefined}}
|
||||
}),
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
if (recipe.properties != null) {
|
||||
recipe.properties = recipe.properties.map((p) => {
|
||||
return {...p, ...{id: undefined}}
|
||||
})
|
||||
}
|
||||
|
||||
api.apiRecipeCreate({recipe: recipe}).then(newRecipe => {
|
||||
api.apiRecipeCreate({recipe: originalRecipe}).then(newRecipe => {
|
||||
|
||||
if (originalRecipe.image) {
|
||||
updateRecipeImage(newRecipe.id!, null, originalRecipe.image).then(r => {
|
||||
|
||||
@@ -283,9 +283,8 @@ function parseAndInsertIngredients() {
|
||||
}
|
||||
})
|
||||
Promise.allSettled(promises).then(r => {
|
||||
step.value.ingredients = step.value.ingredients.filter(i => i.food != null || i.note != null || i.amount != 0)
|
||||
|
||||
r.forEach(i => {
|
||||
console.log(i)
|
||||
step.value.ingredients.push({
|
||||
originalText: i.value.originalText,
|
||||
amount: i.value.amount,
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
@update:modelValue="editingObj.servings = editingObj.recipe ? editingObj.recipe.servings : 1"></ModelSelect>
|
||||
<!-- <v-number-input label="Days" control-variant="split" :min="1"></v-number-input>-->
|
||||
<!--TODO create days input with +/- synced to date -->
|
||||
<recipe-card :recipe="editingObj.recipe" :servings="editingObj.servings" v-if="editingObj && editingObj.recipe" link-target="_blank"></recipe-card>
|
||||
<recipe-card :recipe="editingObj.recipe" v-if="editingObj && editingObj.recipe" link-target="_blank"></recipe-card>
|
||||
<v-btn prepend-icon="$shopping" color="create" class="mt-1" v-if="!editingObj.shopping && editingObj.recipe && isUpdate()">
|
||||
{{$t('Add')}}
|
||||
<add-to-shopping-dialog :recipe="editingObj.recipe" :meal-plan="editingObj" @created="loadShoppingListEntries(); editingObj.shopping = true;"></add-to-shopping-dialog>
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
<template>
|
||||
<model-editor-base
|
||||
:loading="loading"
|
||||
:dialog="dialog"
|
||||
@save="saveObject"
|
||||
@delete="deleteObject"
|
||||
@close="emit('close'); editingObjChanged = false"
|
||||
:is-update="isUpdate()"
|
||||
:is-changed="editingObjChanged"
|
||||
:model-class="modelClass"
|
||||
:object-name="editingObjName()"
|
||||
:editing-object="editingObj">
|
||||
<v-card-text>
|
||||
<v-form :disabled="loading">
|
||||
<v-text-field :label="$t('Name')" v-model="editingObj.name"></v-text-field>
|
||||
<v-textarea :label="$t('Description')" v-model="editingObj.description" :rows="2" auto-grow></v-textarea>
|
||||
<v-color-picker :label="$t('Color')" v-model="editingObj.color" mode="hex" :modes="['hex']" show-swatches
|
||||
:swatches="[['#ddbf86'],['#b98766'],['#b55e4f'],['#82aa8b'],['#385f84']]"></v-color-picker>
|
||||
</v-form>
|
||||
</v-card-text>
|
||||
</model-editor-base>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
import {onMounted, PropType, watch} from "vue";
|
||||
import {ShoppingList, ShoppingListEntry} from "@/openapi";
|
||||
import ModelEditorBase from "@/components/model_editors/ModelEditorBase.vue";
|
||||
import {useModelEditorFunctions} from "@/composables/useModelEditorFunctions";
|
||||
import ModelSelect from "@/components/inputs/ModelSelect.vue";
|
||||
|
||||
const props = defineProps({
|
||||
item: {type: {} as PropType<ShoppingList>, required: false, default: null},
|
||||
itemId: {type: [Number, String], required: false, default: undefined},
|
||||
itemDefaults: {type: {} as PropType<ShoppingList>, required: false, default: {} as ShoppingList},
|
||||
dialog: {type: Boolean, default: false}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['create', 'save', 'delete', 'close', 'changedState'])
|
||||
const {setupState, deleteObject, saveObject, isUpdate, editingObjName, loading, editingObj, editingObjChanged, modelClass} = useModelEditorFunctions<ShoppingList>('ShoppingList', emit)
|
||||
|
||||
/**
|
||||
* watch prop changes and re-initialize editor
|
||||
* required to embed editor directly into pages and be able to change item from the outside
|
||||
*/
|
||||
watch([() => props.item, () => props.itemId], () => {
|
||||
initializeEditor()
|
||||
})
|
||||
|
||||
// object specific data (for selects/display)
|
||||
|
||||
onMounted(() => {
|
||||
initializeEditor()
|
||||
})
|
||||
|
||||
/**
|
||||
* component specific state setup logic
|
||||
*/
|
||||
function initializeEditor(){
|
||||
setupState(props.item, props.itemId, {itemDefaults: props.itemDefaults})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -16,7 +16,7 @@ export function useNavigation() {
|
||||
{component: VListItem, prependIcon: '$recipes', title: 'Home', to: {name: 'StartPage', params: {}}},
|
||||
{component: VListItem, prependIcon: '$search', title: t('Search'), to: {name: 'SearchPage', params: {}}},
|
||||
{component: VListItem, prependIcon: '$mealplan', title: t('Meal_Plan'), to: {name: 'MealPlanPage', params: {}}},
|
||||
{component: VListItem, prependIcon: '$shopping', title: t('Shopping'), to: {name: 'ShoppingListPage', params: {}}},
|
||||
{component: VListItem, prependIcon: '$shopping', title: t('Shopping_list'), to: {name: 'ShoppingListPage', params: {}}},
|
||||
{component: VListItem, prependIcon: 'fas fa-globe', title: t('Import'), to: {name: 'RecipeImportPage', params: {}}},
|
||||
{component: VListItem, prependIcon: '$books', title: t('Books'), to: {name: 'BooksPage', params: {}}},
|
||||
{component: VListItem, prependIcon: 'fa-solid fa-folder-tree', title: t('Database'), to: {name: 'DatabasePage', params: {}}},
|
||||
|
||||
@@ -267,7 +267,6 @@
|
||||
"Ratings": "",
|
||||
"Recently_Viewed": "",
|
||||
"Recipe": "",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "",
|
||||
"Recipe_Image": "",
|
||||
"Recipes": "",
|
||||
@@ -315,7 +314,6 @@
|
||||
"SpaceMembersHelp": "",
|
||||
"SpaceName": "",
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Start": "",
|
||||
"Starting_Day": "",
|
||||
"StartsWith": "",
|
||||
"StartsWithHelp": "",
|
||||
|
||||
@@ -260,7 +260,6 @@
|
||||
"Ratings": "Рейтинги",
|
||||
"Recently_Viewed": "Наскоро разгледани",
|
||||
"Recipe": "Рецепта",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "Книга с рецепти",
|
||||
"Recipe_Image": "Изображение на рецептата",
|
||||
"Recipes": "Рецепти",
|
||||
@@ -308,7 +307,6 @@
|
||||
"SpaceMembersHelp": "",
|
||||
"SpaceName": "",
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Start": "",
|
||||
"Starting_Day": "Начален ден от седмицата",
|
||||
"StartsWith": "",
|
||||
"StartsWithHelp": "",
|
||||
|
||||
@@ -337,7 +337,6 @@
|
||||
"Ratings": "Avaluació",
|
||||
"Recently_Viewed": "Vistos recentment",
|
||||
"Recipe": "Recepta",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "Llibre de receptes",
|
||||
"Recipe_Image": "Imatge de la recepta",
|
||||
"Recipes": "Receptes",
|
||||
@@ -395,7 +394,6 @@
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Space_Cosmetic_Settings": "Un administrador de l'espai podria canviar algunes configuracions estètiques i tindrien prioritat sobre la configuració dels usuaris per a aquest espai.",
|
||||
"Split_All_Steps": "Dividir totes les files en passos separats.",
|
||||
"Start": "",
|
||||
"StartDate": "Data d'inici",
|
||||
"Starting_Day": "Dia d'inici de la setmana",
|
||||
"StartsWith": "",
|
||||
|
||||
@@ -334,7 +334,6 @@
|
||||
"Ratings": "Hodnocení",
|
||||
"Recently_Viewed": "Naposledy prohlížené",
|
||||
"Recipe": "Recept",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "Kuchařka",
|
||||
"Recipe_Image": "Obrázek k receptu",
|
||||
"Recipes": "Recepty",
|
||||
@@ -390,7 +389,6 @@
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Space_Cosmetic_Settings": "Některá kosmetická nastavení mohou měnit správci prostoru a budou mít přednost před nastavením klienta pro daný prostor.",
|
||||
"Split_All_Steps": "Rozdělit každý řádek do samostatného kroku.",
|
||||
"Start": "",
|
||||
"StartDate": "Počáteční datum",
|
||||
"Starting_Day": "První den v týdnu",
|
||||
"StartsWith": "",
|
||||
|
||||
@@ -337,7 +337,6 @@
|
||||
"Ratings": "Bedømmelser",
|
||||
"Recently_Viewed": "Vist for nylig",
|
||||
"Recipe": "Opskrift",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "Opskriftsbog",
|
||||
"Recipe_Image": "Opskriftsbillede",
|
||||
"Recipes": "Opskrifter",
|
||||
@@ -395,7 +394,6 @@
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Space_Cosmetic_Settings": "Visse kosmetiske indstillinger kan ændres af område-administratorer og vil overskrive klient-indstillinger for pågældende område.",
|
||||
"Split_All_Steps": "Opdel rækker i separate trin.",
|
||||
"Start": "",
|
||||
"StartDate": "Startdato",
|
||||
"Starting_Day": "Første dag på ugen",
|
||||
"StartsWith": "",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -337,7 +337,6 @@
|
||||
"Ratings": "Βαθμολογίες",
|
||||
"Recently_Viewed": "Προβλήθηκαν πρόσφατα",
|
||||
"Recipe": "Συνταγή",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "Βιβλίο συνταγών",
|
||||
"Recipe_Image": "Εικόνα συνταγής",
|
||||
"Recipes": "Συνταγές",
|
||||
@@ -395,7 +394,6 @@
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Space_Cosmetic_Settings": "Ορισμένες ρυθμίσεις εμφάνισης μπορούν να αλλάξουν από τους διαχειριστές του χώρου και θα παρακάμψουν τις ρυθμίσεις πελάτη για αυτόν τον χώρο.",
|
||||
"Split_All_Steps": "Διαχωρισμός όλων των γραμμών σε χωριστά βήματα.",
|
||||
"Start": "",
|
||||
"StartDate": "Ημερομηνία Έναρξης",
|
||||
"Starting_Day": "Πρώτη μέρα της εβδομάδας",
|
||||
"StartsWith": "",
|
||||
|
||||
@@ -452,7 +452,6 @@
|
||||
"RecipeBookHelp": "Recipebooks contain recipe book entries or can be automatically populated by using saved search filters. ",
|
||||
"RecipeHelp": "Recipes are the foundation of Tandoor and consist of general information and steps, made up of ingredients, instructions and more. ",
|
||||
"RecipeStepsHelp": "Ingredients, Instructions and more can be edited in the tab Steps.",
|
||||
"RecipeStructure": "Recipe Structure",
|
||||
"Recipe_Book": "Recipe Book",
|
||||
"Recipe_Image": "Recipe Image",
|
||||
"Recipes": "Recipes",
|
||||
@@ -501,12 +500,9 @@
|
||||
"Share": "Share",
|
||||
"ShopLater": "Shop later",
|
||||
"ShopNow": "Shop now",
|
||||
"Shopping": "Shopping",
|
||||
"ShoppingBackgroundSyncWarning": "Bad network, waiting to sync ...",
|
||||
"ShoppingList": "Shoppinglist",
|
||||
"ShoppingListEntry": "Shoppinglist Entry",
|
||||
"ShoppingListEntryHelp": "Shopping list entries can be created manually or trough recipes and meal plans.",
|
||||
"ShoppingListHelp": "Allows you to put entries on different lists. Can be used for different supermarkets, special offers or events. ",
|
||||
"ShoppingListRecipe": "Shoppinglist Recipe",
|
||||
"Shopping_Categories": "Shopping Categories",
|
||||
"Shopping_Category": "Shopping Category",
|
||||
@@ -543,7 +539,6 @@
|
||||
"Space_Cosmetic_Settings": "Some cosmetic settings can be changed by space administrators and will override client settings for that space.",
|
||||
"Split": "Split",
|
||||
"Split_All_Steps": "Split all rows into separate steps.",
|
||||
"Start": "Start",
|
||||
"StartDate": "Start Date",
|
||||
"Starting_Day": "Starting day of the week",
|
||||
"StartsWith": "Starts with",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -326,7 +326,6 @@
|
||||
"Ratings": "Luokitukset",
|
||||
"Recently_Viewed": "Äskettäin katsotut",
|
||||
"Recipe": "Resepti",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "Keittokirja",
|
||||
"Recipe_Image": "Reseptin Kuva",
|
||||
"Recipes": "Reseptit",
|
||||
@@ -382,7 +381,6 @@
|
||||
"SpaceName": "",
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Split_All_Steps": "Jaa kaikki rivit erillisiin vaiheisiin.",
|
||||
"Start": "",
|
||||
"StartDate": "Aloituspäivä",
|
||||
"Starting_Day": "Viikon aloituspäivä",
|
||||
"StartsWith": "",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -337,7 +337,6 @@
|
||||
"Ratings": "דירוג",
|
||||
"Recently_Viewed": "נצפו לאחרונה",
|
||||
"Recipe": "מתכון",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "ספר מתכון",
|
||||
"Recipe_Image": "תמונת מתכון",
|
||||
"Recipes": "מתכונים",
|
||||
@@ -395,7 +394,6 @@
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Space_Cosmetic_Settings": "חלק מהגדרות הקוסמטיות יכולות להיות מעודכנות על ידי מנהל המרחב וידרסו את הגדרות הקליינט עבור מרחב זה.",
|
||||
"Split_All_Steps": "פצל את כל השורות לצעדים נפרדים.",
|
||||
"Start": "",
|
||||
"StartDate": "תאריך התחלה",
|
||||
"Starting_Day": "יום תחילת השבוע",
|
||||
"StartsWith": "",
|
||||
|
||||
@@ -337,7 +337,6 @@
|
||||
"Ratings": "Ocjene",
|
||||
"Recently_Viewed": "Nedavno pogledano",
|
||||
"Recipe": "Recept",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "Knjiga recepata",
|
||||
"Recipe_Image": "Slika recepta",
|
||||
"Recipes": "Recepti",
|
||||
@@ -395,7 +394,6 @@
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Space_Cosmetic_Settings": "Neke kozmetičke postavke mogu promijeniti administratori prostora i one će poništiti postavke klijenta za taj prostor.",
|
||||
"Split_All_Steps": "Podijeli sve retke u zasebne korake.",
|
||||
"Start": "",
|
||||
"StartDate": "Početni datum",
|
||||
"Starting_Day": "Početni dan u tjednu",
|
||||
"StartsWith": "",
|
||||
|
||||
@@ -310,7 +310,6 @@
|
||||
"Ratings": "Értékelések",
|
||||
"Recently_Viewed": "Nemrég megtekintett",
|
||||
"Recipe": "Recept",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "Szakácskönyv",
|
||||
"Recipe_Image": "Receptkép",
|
||||
"Recipes": "Receptek",
|
||||
@@ -361,7 +360,6 @@
|
||||
"SpaceName": "",
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Split_All_Steps": "Ossza fel az összes sort különálló lépésekbe.",
|
||||
"Start": "",
|
||||
"StartDate": "Kezdés dátuma",
|
||||
"Starting_Day": "A hét kezdőnapja",
|
||||
"StartsWith": "",
|
||||
|
||||
@@ -143,7 +143,6 @@
|
||||
"Rating": "",
|
||||
"Recently_Viewed": "Վերջերս դիտած",
|
||||
"Recipe": "Բաղադրատոմս",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "Բաղադրատոմսերի գիրք",
|
||||
"Recipe_Image": "Բաղադրատոմսի նկար",
|
||||
"Recipes": "Բաղադրատոմսեր",
|
||||
@@ -178,7 +177,6 @@
|
||||
"SpaceMembersHelp": "",
|
||||
"SpaceName": "",
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Start": "",
|
||||
"StartsWith": "",
|
||||
"StartsWithHelp": "",
|
||||
"Step": "",
|
||||
|
||||
@@ -286,7 +286,6 @@
|
||||
"Ratings": "",
|
||||
"Recently_Viewed": "baru saja dilihat",
|
||||
"Recipe": "",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "",
|
||||
"Recipe_Image": "Gambar Resep",
|
||||
"Recipes": "Resep",
|
||||
@@ -337,7 +336,6 @@
|
||||
"SpaceMembersHelp": "",
|
||||
"SpaceName": "",
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Start": "",
|
||||
"Starting_Day": "",
|
||||
"StartsWith": "",
|
||||
"StartsWithHelp": "",
|
||||
|
||||
@@ -336,7 +336,6 @@
|
||||
"Ratings": "",
|
||||
"Recently_Viewed": "",
|
||||
"Recipe": "",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "",
|
||||
"Recipe_Image": "",
|
||||
"Recipes": "",
|
||||
@@ -393,7 +392,6 @@
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Space_Cosmetic_Settings": "",
|
||||
"Split_All_Steps": "",
|
||||
"Start": "",
|
||||
"StartDate": "",
|
||||
"Starting_Day": "",
|
||||
"StartsWith": "",
|
||||
|
||||
@@ -453,7 +453,6 @@
|
||||
"RecipeBookHelp": "I ricettari contengono voci di ricette oppure possono essere compilati automaticamente utilizzando filtri di ricerca salvati. ",
|
||||
"RecipeHelp": "Le ricette sono la base del Tandoor e sono composte da informazioni generali e passaggi, oltre che da ingredienti, istruzioni e altro ancora. ",
|
||||
"RecipeStepsHelp": "Ingredienti, istruzioni e altro possono essere modificati nella scheda Step.",
|
||||
"RecipeStructure": "Struttura ricetta",
|
||||
"Recipe_Book": "Libro di ricette",
|
||||
"Recipe_Image": "Immagine ricetta",
|
||||
"Recipes": "Ricette",
|
||||
@@ -541,7 +540,6 @@
|
||||
"Space_Cosmetic_Settings": "Alcune impostazioni cosmetiche possono essere modificate dagli amministratori dell'istanza e sovrascriveranno le impostazioni client per quell'istanza.",
|
||||
"Split": "Dividi",
|
||||
"Split_All_Steps": "Divide tutte le righe in step separati.",
|
||||
"Start": "Avvia",
|
||||
"StartDate": "Data d'inizio",
|
||||
"Starting_Day": "Giorno di inizio della settimana",
|
||||
"StartsWith": "Inizia con",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -314,7 +314,6 @@
|
||||
"Ratings": "",
|
||||
"Recently_Viewed": "Neseniai Žiūrėta",
|
||||
"Recipe": "",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "",
|
||||
"Recipe_Image": "Recepto nuotrauka",
|
||||
"Recipes": "",
|
||||
@@ -366,7 +365,6 @@
|
||||
"SpaceName": "",
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Split_All_Steps": "",
|
||||
"Start": "",
|
||||
"StartDate": "",
|
||||
"Starting_Day": "",
|
||||
"StartsWith": "",
|
||||
|
||||
@@ -337,7 +337,6 @@
|
||||
"Ratings": "",
|
||||
"Recently_Viewed": "",
|
||||
"Recipe": "",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "",
|
||||
"Recipe_Image": "",
|
||||
"Recipes": "",
|
||||
@@ -395,7 +394,6 @@
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Space_Cosmetic_Settings": "",
|
||||
"Split_All_Steps": "",
|
||||
"Start": "",
|
||||
"StartDate": "",
|
||||
"Starting_Day": "",
|
||||
"StartsWith": "",
|
||||
|
||||
@@ -321,7 +321,6 @@
|
||||
"Ratings": "",
|
||||
"Recently_Viewed": "Nylig vist",
|
||||
"Recipe": "Oppskrift",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "Oppskriftsbok",
|
||||
"Recipe_Image": "Oppskriftsbilde",
|
||||
"Recipes": "Oppskrift",
|
||||
@@ -376,7 +375,6 @@
|
||||
"SpaceName": "",
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Split_All_Steps": "",
|
||||
"Start": "",
|
||||
"StartDate": "Startdato",
|
||||
"Starting_Day": "Dag uken skal state på",
|
||||
"StartsWith": "",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -363,7 +363,6 @@
|
||||
"Ratings": "Oceny",
|
||||
"Recently_Viewed": "Ostatnio oglądane",
|
||||
"Recipe": "Przepis",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "Książka z przepisami",
|
||||
"Recipe_Image": "Obrazek dla przepisu",
|
||||
"Recipes": "Przepisy",
|
||||
@@ -421,7 +420,6 @@
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Space_Cosmetic_Settings": "Administratorzy przestrzeni mogą zmienić niektóre ustawienia kosmetyczne, które zastąpią ustawienia klienta dla tej przestrzeni.",
|
||||
"Split_All_Steps": "Traktuj każdy wiersz jako osobne kroki.",
|
||||
"Start": "",
|
||||
"StartDate": "Data początkowa",
|
||||
"Starting_Day": "Dzień rozpoczęcia tygodnia",
|
||||
"StartsWith": "",
|
||||
|
||||
@@ -236,7 +236,6 @@
|
||||
"Ratings": "Avaliações",
|
||||
"Recently_Viewed": "Vistos Recentemente",
|
||||
"Recipe": "Receita",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "Livro de Receitas",
|
||||
"Recipe_Image": "Imagem da Receita",
|
||||
"Recipes": "Receitas",
|
||||
@@ -272,7 +271,6 @@
|
||||
"Show_as_header": "Mostrar como cabeçalho",
|
||||
"Size": "Tamanho",
|
||||
"Sort_by_new": "Ordenar por mais recente",
|
||||
"Start": "",
|
||||
"StartDate": "Data de início",
|
||||
"Starting_Day": "Dia de início da semana",
|
||||
"StartsWith": "",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -298,7 +298,6 @@
|
||||
"Ratings": "Evaluări",
|
||||
"Recently_Viewed": "Vizualizate recent",
|
||||
"Recipe": "Rețetă",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "Carte de rețete",
|
||||
"Recipe_Image": "Imagine a rețetei",
|
||||
"Recipes": "Rețete",
|
||||
@@ -350,7 +349,6 @@
|
||||
"SpaceName": "",
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Split_All_Steps": "Împărțiți toate rândurile în pași separați.",
|
||||
"Start": "",
|
||||
"Starting_Day": "Ziua de început a săptămânii",
|
||||
"StartsWith": "",
|
||||
"StartsWithHelp": "",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -337,7 +337,6 @@
|
||||
"Ratings": "Derecelendirmeler",
|
||||
"Recently_Viewed": "Son Görüntülenen",
|
||||
"Recipe": "Tarif",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "Yemek Tarifi Kitabı",
|
||||
"Recipe_Image": "Tarif Resmi",
|
||||
"Recipes": "Tarifler",
|
||||
@@ -395,7 +394,6 @@
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Space_Cosmetic_Settings": "Bazı kozmetik ayarlar alan yöneticileri tarafından değiştirilebilir ve o alanın istemci ayarlarını geçersiz kılar.",
|
||||
"Split_All_Steps": "Tüm satırları ayrı adımlara bölün.",
|
||||
"Start": "",
|
||||
"StartDate": "Başlangıç Tarihi",
|
||||
"Starting_Day": "Haftanın başlangıç günü",
|
||||
"StartsWith": "",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -337,7 +337,6 @@
|
||||
"Ratings": "等级",
|
||||
"Recently_Viewed": "最近浏览",
|
||||
"Recipe": "食谱",
|
||||
"RecipeStructure": "",
|
||||
"Recipe_Book": "食谱书",
|
||||
"Recipe_Image": "食谱图像",
|
||||
"Recipes": "食谱",
|
||||
@@ -395,7 +394,6 @@
|
||||
"SpacePrivateObjectsHelp": "",
|
||||
"Space_Cosmetic_Settings": "空间管理员可以更改某些装饰设置,并将覆盖该空间的客户端设置。",
|
||||
"Split_All_Steps": "将所有行拆分为单独的步骤。",
|
||||
"Start": "",
|
||||
"StartDate": "开始日期",
|
||||
"Starting_Day": "一周中的第一天",
|
||||
"StartsWith": "",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -94,7 +94,6 @@ models/PaginatedRecipeBookList.ts
|
||||
models/PaginatedRecipeImportList.ts
|
||||
models/PaginatedRecipeOverviewList.ts
|
||||
models/PaginatedShoppingListEntryList.ts
|
||||
models/PaginatedShoppingListList.ts
|
||||
models/PaginatedShoppingListRecipeList.ts
|
||||
models/PaginatedSpaceList.ts
|
||||
models/PaginatedStepList.ts
|
||||
@@ -141,7 +140,6 @@ models/PatchedRecipeBook.ts
|
||||
models/PatchedRecipeBookEntry.ts
|
||||
models/PatchedRecipeImport.ts
|
||||
models/PatchedSearchPreference.ts
|
||||
models/PatchedShoppingList.ts
|
||||
models/PatchedShoppingListEntry.ts
|
||||
models/PatchedShoppingListRecipe.ts
|
||||
models/PatchedSpace.ts
|
||||
@@ -176,7 +174,6 @@ models/SearchFields.ts
|
||||
models/SearchPreference.ts
|
||||
models/ServerSettings.ts
|
||||
models/ShareLink.ts
|
||||
models/ShoppingList.ts
|
||||
models/ShoppingListEntry.ts
|
||||
models/ShoppingListEntryBulk.ts
|
||||
models/ShoppingListEntryBulkCreate.ts
|
||||
|
||||
@@ -85,7 +85,6 @@ import type {
|
||||
PaginatedRecipeImportList,
|
||||
PaginatedRecipeOverviewList,
|
||||
PaginatedShoppingListEntryList,
|
||||
PaginatedShoppingListList,
|
||||
PaginatedShoppingListRecipeList,
|
||||
PaginatedSpaceList,
|
||||
PaginatedStepList,
|
||||
@@ -132,7 +131,6 @@ import type {
|
||||
PatchedRecipeBookEntry,
|
||||
PatchedRecipeImport,
|
||||
PatchedSearchPreference,
|
||||
PatchedShoppingList,
|
||||
PatchedShoppingListEntry,
|
||||
PatchedShoppingListRecipe,
|
||||
PatchedSpace,
|
||||
@@ -165,7 +163,6 @@ import type {
|
||||
SearchPreference,
|
||||
ServerSettings,
|
||||
ShareLink,
|
||||
ShoppingList,
|
||||
ShoppingListEntry,
|
||||
ShoppingListEntryBulk,
|
||||
ShoppingListEntryBulkCreate,
|
||||
@@ -327,8 +324,6 @@ import {
|
||||
PaginatedRecipeOverviewListToJSON,
|
||||
PaginatedShoppingListEntryListFromJSON,
|
||||
PaginatedShoppingListEntryListToJSON,
|
||||
PaginatedShoppingListListFromJSON,
|
||||
PaginatedShoppingListListToJSON,
|
||||
PaginatedShoppingListRecipeListFromJSON,
|
||||
PaginatedShoppingListRecipeListToJSON,
|
||||
PaginatedSpaceListFromJSON,
|
||||
@@ -421,8 +416,6 @@ import {
|
||||
PatchedRecipeImportToJSON,
|
||||
PatchedSearchPreferenceFromJSON,
|
||||
PatchedSearchPreferenceToJSON,
|
||||
PatchedShoppingListFromJSON,
|
||||
PatchedShoppingListToJSON,
|
||||
PatchedShoppingListEntryFromJSON,
|
||||
PatchedShoppingListEntryToJSON,
|
||||
PatchedShoppingListRecipeFromJSON,
|
||||
@@ -487,8 +480,6 @@ import {
|
||||
ServerSettingsToJSON,
|
||||
ShareLinkFromJSON,
|
||||
ShareLinkToJSON,
|
||||
ShoppingListFromJSON,
|
||||
ShoppingListToJSON,
|
||||
ShoppingListEntryFromJSON,
|
||||
ShoppingListEntryToJSON,
|
||||
ShoppingListEntryBulkFromJSON,
|
||||
@@ -1964,21 +1955,6 @@ export interface ApiShareLinkRetrieveRequest {
|
||||
id: number;
|
||||
}
|
||||
|
||||
export interface ApiShoppingListCascadingListRequest {
|
||||
id: number;
|
||||
cache?: boolean;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface ApiShoppingListCreateRequest {
|
||||
shoppingList?: Omit<ShoppingList, 'createdAt'|'updatedAt'>;
|
||||
}
|
||||
|
||||
export interface ApiShoppingListDestroyRequest {
|
||||
id: number;
|
||||
}
|
||||
|
||||
export interface ApiShoppingListEntryBulkCreateRequest {
|
||||
shoppingListEntryBulk: Omit<ShoppingListEntryBulk, 'timestamp'>;
|
||||
}
|
||||
@@ -2012,30 +1988,6 @@ export interface ApiShoppingListEntryUpdateRequest {
|
||||
shoppingListEntry: Omit<ShoppingListEntry, 'listRecipeData'|'createdBy'|'createdAt'|'updatedAt'>;
|
||||
}
|
||||
|
||||
export interface ApiShoppingListListRequest {
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface ApiShoppingListNullingListRequest {
|
||||
id: number;
|
||||
cache?: boolean;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface ApiShoppingListPartialUpdateRequest {
|
||||
id: number;
|
||||
patchedShoppingList?: Omit<PatchedShoppingList, 'createdAt'|'updatedAt'>;
|
||||
}
|
||||
|
||||
export interface ApiShoppingListProtectingListRequest {
|
||||
id: number;
|
||||
cache?: boolean;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface ApiShoppingListRecipeBulkCreateEntriesCreateRequest {
|
||||
id: number;
|
||||
shoppingListEntryBulkCreate: ShoppingListEntryBulkCreate;
|
||||
@@ -2069,15 +2021,6 @@ export interface ApiShoppingListRecipeUpdateRequest {
|
||||
shoppingListRecipe: Omit<ShoppingListRecipe, 'recipeData'|'mealPlanData'|'createdBy'>;
|
||||
}
|
||||
|
||||
export interface ApiShoppingListRetrieveRequest {
|
||||
id: number;
|
||||
}
|
||||
|
||||
export interface ApiShoppingListUpdateRequest {
|
||||
id: number;
|
||||
shoppingList?: Omit<ShoppingList, 'createdAt'|'updatedAt'>;
|
||||
}
|
||||
|
||||
export interface ApiSpaceCreateRequest {
|
||||
space?: Omit<Space, 'createdBy'|'createdAt'|'maxRecipes'|'maxFileStorageMb'|'maxUsers'|'allowSharing'|'demo'|'userCount'|'recipeCount'|'fileSizeMb'|'aiMonthlyCreditsUsed'>;
|
||||
}
|
||||
@@ -14608,124 +14551,6 @@ export class ApiApi extends runtime.BaseAPI {
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* get a paginated list of objects that will be cascaded (deleted) when deleting the selected object
|
||||
*/
|
||||
async apiShoppingListCascadingListRaw(requestParameters: ApiShoppingListCascadingListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedGenericModelReferenceList>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiShoppingListCascadingList().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['cache'] != null) {
|
||||
queryParameters['cache'] = requestParameters['cache'];
|
||||
}
|
||||
|
||||
if (requestParameters['page'] != null) {
|
||||
queryParameters['page'] = requestParameters['page'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/api/shopping-list/{id}/cascading/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedGenericModelReferenceListFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* get a paginated list of objects that will be cascaded (deleted) when deleting the selected object
|
||||
*/
|
||||
async apiShoppingListCascadingList(requestParameters: ApiShoppingListCascadingListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedGenericModelReferenceList> {
|
||||
const response = await this.apiShoppingListCascadingListRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiShoppingListCreateRaw(requestParameters: ApiShoppingListCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ShoppingList>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/api/shopping-list/`,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ShoppingListToJSON(requestParameters['shoppingList']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ShoppingListFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiShoppingListCreate(requestParameters: ApiShoppingListCreateRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ShoppingList> {
|
||||
const response = await this.apiShoppingListCreateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiShoppingListDestroyRaw(requestParameters: ApiShoppingListDestroyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiShoppingListDestroy().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/api/shopping-list/{id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiShoppingListDestroy(requestParameters: ApiShoppingListDestroyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiShoppingListDestroyRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
* individual entries of a shopping list automatically filtered to only contain unchecked items that are not older than the shopping recent days setting to not bloat endpoint
|
||||
*/
|
||||
@@ -15012,182 +14837,6 @@ export class ApiApi extends runtime.BaseAPI {
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiShoppingListListRaw(requestParameters: ApiShoppingListListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedShoppingListList>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['page'] != null) {
|
||||
queryParameters['page'] = requestParameters['page'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/api/shopping-list/`,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedShoppingListListFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiShoppingListList(requestParameters: ApiShoppingListListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedShoppingListList> {
|
||||
const response = await this.apiShoppingListListRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* get a paginated list of objects where the selected object will be removed whe its deleted
|
||||
*/
|
||||
async apiShoppingListNullingListRaw(requestParameters: ApiShoppingListNullingListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedGenericModelReferenceList>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiShoppingListNullingList().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['cache'] != null) {
|
||||
queryParameters['cache'] = requestParameters['cache'];
|
||||
}
|
||||
|
||||
if (requestParameters['page'] != null) {
|
||||
queryParameters['page'] = requestParameters['page'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/api/shopping-list/{id}/nulling/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedGenericModelReferenceListFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* get a paginated list of objects where the selected object will be removed whe its deleted
|
||||
*/
|
||||
async apiShoppingListNullingList(requestParameters: ApiShoppingListNullingListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedGenericModelReferenceList> {
|
||||
const response = await this.apiShoppingListNullingListRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiShoppingListPartialUpdateRaw(requestParameters: ApiShoppingListPartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ShoppingList>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiShoppingListPartialUpdate().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/api/shopping-list/{id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PATCH',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: PatchedShoppingListToJSON(requestParameters['patchedShoppingList']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ShoppingListFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiShoppingListPartialUpdate(requestParameters: ApiShoppingListPartialUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ShoppingList> {
|
||||
const response = await this.apiShoppingListPartialUpdateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* get a paginated list of objects that are protecting the selected object form being deleted
|
||||
*/
|
||||
async apiShoppingListProtectingListRaw(requestParameters: ApiShoppingListProtectingListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedGenericModelReferenceList>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiShoppingListProtectingList().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['cache'] != null) {
|
||||
queryParameters['cache'] = requestParameters['cache'];
|
||||
}
|
||||
|
||||
if (requestParameters['page'] != null) {
|
||||
queryParameters['page'] = requestParameters['page'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['page_size'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/api/shopping-list/{id}/protecting/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedGenericModelReferenceListFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* get a paginated list of objects that are protecting the selected object form being deleted
|
||||
*/
|
||||
async apiShoppingListProtectingList(requestParameters: ApiShoppingListProtectingListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedGenericModelReferenceList> {
|
||||
const response = await this.apiShoppingListProtectingListRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
@@ -15477,83 +15126,6 @@ export class ApiApi extends runtime.BaseAPI {
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiShoppingListRetrieveRaw(requestParameters: ApiShoppingListRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ShoppingList>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiShoppingListRetrieve().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/api/shopping-list/{id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ShoppingListFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiShoppingListRetrieve(requestParameters: ApiShoppingListRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ShoppingList> {
|
||||
const response = await this.apiShoppingListRetrieveRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiShoppingListUpdateRaw(requestParameters: ApiShoppingListUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ShoppingList>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiShoppingListUpdate().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // ApiKeyAuth authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
path: `/api/shopping-list/{id}/`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
||||
method: 'PUT',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ShoppingListToJSON(requestParameters['shoppingList']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ShoppingListFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
async apiShoppingListUpdate(requestParameters: ApiShoppingListUpdateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ShoppingList> {
|
||||
const response = await this.apiShoppingListUpdateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* logs request counts to redis cache total/per user/
|
||||
*/
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Tandoor
|
||||
* Tandoor API Docs
|
||||
*
|
||||
* The version of the OpenAPI document: 0.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { ShoppingList } from './ShoppingList';
|
||||
import {
|
||||
ShoppingListFromJSON,
|
||||
ShoppingListFromJSONTyped,
|
||||
ShoppingListToJSON,
|
||||
} from './ShoppingList';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface PaginatedShoppingListList
|
||||
*/
|
||||
export interface PaginatedShoppingListList {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof PaginatedShoppingListList
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PaginatedShoppingListList
|
||||
*/
|
||||
next?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PaginatedShoppingListList
|
||||
*/
|
||||
previous?: string;
|
||||
/**
|
||||
*
|
||||
* @type {Array<ShoppingList>}
|
||||
* @memberof PaginatedShoppingListList
|
||||
*/
|
||||
results: Array<ShoppingList>;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof PaginatedShoppingListList
|
||||
*/
|
||||
timestamp?: Date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the PaginatedShoppingListList interface.
|
||||
*/
|
||||
export function instanceOfPaginatedShoppingListList(value: object): value is PaginatedShoppingListList {
|
||||
if (!('count' in value) || value['count'] === undefined) return false;
|
||||
if (!('results' in value) || value['results'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function PaginatedShoppingListListFromJSON(json: any): PaginatedShoppingListList {
|
||||
return PaginatedShoppingListListFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function PaginatedShoppingListListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedShoppingListList {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'count': json['count'],
|
||||
'next': json['next'] == null ? undefined : json['next'],
|
||||
'previous': json['previous'] == null ? undefined : json['previous'],
|
||||
'results': ((json['results'] as Array<any>).map(ShoppingListFromJSON)),
|
||||
'timestamp': json['timestamp'] == null ? undefined : (new Date(json['timestamp'])),
|
||||
};
|
||||
}
|
||||
|
||||
export function PaginatedShoppingListListToJSON(value?: PaginatedShoppingListList | null): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
|
||||
'count': value['count'],
|
||||
'next': value['next'],
|
||||
'previous': value['previous'],
|
||||
'results': ((value['results'] as Array<any>).map(ShoppingListToJSON)),
|
||||
'timestamp': value['timestamp'] == null ? undefined : ((value['timestamp']).toISOString()),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Tandoor
|
||||
* Tandoor API Docs
|
||||
*
|
||||
* The version of the OpenAPI document: 0.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
* Adds nested create feature
|
||||
* @export
|
||||
* @interface PatchedShoppingList
|
||||
*/
|
||||
export interface PatchedShoppingList {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof PatchedShoppingList
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PatchedShoppingList
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PatchedShoppingList
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof PatchedShoppingList
|
||||
*/
|
||||
color?: string;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof PatchedShoppingList
|
||||
*/
|
||||
readonly createdAt?: Date;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof PatchedShoppingList
|
||||
*/
|
||||
readonly updatedAt?: Date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the PatchedShoppingList interface.
|
||||
*/
|
||||
export function instanceOfPatchedShoppingList(value: object): value is PatchedShoppingList {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function PatchedShoppingListFromJSON(json: any): PatchedShoppingList {
|
||||
return PatchedShoppingListFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function PatchedShoppingListFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedShoppingList {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'name': json['name'] == null ? undefined : json['name'],
|
||||
'description': json['description'] == null ? undefined : json['description'],
|
||||
'color': json['color'] == null ? undefined : json['color'],
|
||||
'createdAt': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
|
||||
'updatedAt': json['updated_at'] == null ? undefined : (new Date(json['updated_at'])),
|
||||
};
|
||||
}
|
||||
|
||||
export function PatchedShoppingListToJSON(value?: Omit<PatchedShoppingList, 'createdAt'|'updatedAt'> | null): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'name': value['name'],
|
||||
'description': value['description'],
|
||||
'color': value['color'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Tandoor
|
||||
* Tandoor API Docs
|
||||
*
|
||||
* The version of the OpenAPI document: 0.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
* Adds nested create feature
|
||||
* @export
|
||||
* @interface ShoppingList
|
||||
*/
|
||||
export interface ShoppingList {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof ShoppingList
|
||||
*/
|
||||
id?: number;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ShoppingList
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ShoppingList
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof ShoppingList
|
||||
*/
|
||||
color?: string;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof ShoppingList
|
||||
*/
|
||||
readonly createdAt: Date;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof ShoppingList
|
||||
*/
|
||||
readonly updatedAt: Date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the ShoppingList interface.
|
||||
*/
|
||||
export function instanceOfShoppingList(value: object): value is ShoppingList {
|
||||
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
||||
if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function ShoppingListFromJSON(json: any): ShoppingList {
|
||||
return ShoppingListFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function ShoppingListFromJSONTyped(json: any, ignoreDiscriminator: boolean): ShoppingList {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'name': json['name'] == null ? undefined : json['name'],
|
||||
'description': json['description'] == null ? undefined : json['description'],
|
||||
'color': json['color'] == null ? undefined : json['color'],
|
||||
'createdAt': (new Date(json['created_at'])),
|
||||
'updatedAt': (new Date(json['updated_at'])),
|
||||
};
|
||||
}
|
||||
|
||||
export function ShoppingListToJSON(value?: Omit<ShoppingList, 'createdAt'|'updatedAt'> | null): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'name': value['name'],
|
||||
'description': value['description'],
|
||||
'color': value['color'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -92,7 +92,6 @@ export * from './PaginatedRecipeBookList';
|
||||
export * from './PaginatedRecipeImportList';
|
||||
export * from './PaginatedRecipeOverviewList';
|
||||
export * from './PaginatedShoppingListEntryList';
|
||||
export * from './PaginatedShoppingListList';
|
||||
export * from './PaginatedShoppingListRecipeList';
|
||||
export * from './PaginatedSpaceList';
|
||||
export * from './PaginatedStepList';
|
||||
@@ -139,7 +138,6 @@ export * from './PatchedRecipeBook';
|
||||
export * from './PatchedRecipeBookEntry';
|
||||
export * from './PatchedRecipeImport';
|
||||
export * from './PatchedSearchPreference';
|
||||
export * from './PatchedShoppingList';
|
||||
export * from './PatchedShoppingListEntry';
|
||||
export * from './PatchedShoppingListRecipe';
|
||||
export * from './PatchedSpace';
|
||||
@@ -174,7 +172,6 @@ export * from './SearchFields';
|
||||
export * from './SearchPreference';
|
||||
export * from './ServerSettings';
|
||||
export * from './ShareLink';
|
||||
export * from './ShoppingList';
|
||||
export * from './ShoppingListEntry';
|
||||
export * from './ShoppingListEntryBulk';
|
||||
export * from './ShoppingListEntryBulkCreate';
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
</v-row>
|
||||
<v-row dense>
|
||||
<database-model-col model="Supermarket"></database-model-col>
|
||||
<database-model-col model="ShoppingList"></database-model-col>
|
||||
<database-model-col model="SupermarketCategory"></database-model-col>
|
||||
<database-model-col model="MealType"></database-model-col>
|
||||
</v-row>
|
||||
|
||||
@@ -95,9 +95,6 @@
|
||||
<v-chip label v-if="item.id == useUserPreferenceStore().activeSpace.id!" color="success">{{ $t('Active') }}</v-chip>
|
||||
<v-chip label v-else color="info" @click="useUserPreferenceStore().switchSpace(item)">{{ $t('Select') }}</v-chip>
|
||||
</template>
|
||||
<template v-slot:item.color="{ item }">
|
||||
<v-chip label :color="item.color">{{ item.color }}</v-chip>
|
||||
</template>
|
||||
<template v-slot:item.action="{ item }">
|
||||
<v-btn class="float-right" icon="$menu" variant="plain">
|
||||
<v-icon icon="$menu"></v-icon>
|
||||
|
||||
@@ -606,7 +606,7 @@ function importFromUrlList() {
|
||||
setTimeout(importFromUrlList, 500)
|
||||
})
|
||||
}).catch(err => {
|
||||
setTimeout(importFromUrlList, 500)
|
||||
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
<v-container :class="{'ps-0 pe-0 pt-0': mobile}">
|
||||
<v-defaults-provider :defaults="(useUserPreferenceStore().isPrintMode ? {VCard: {variant: 'flat'}} : {})">
|
||||
|
||||
|
||||
<recipe-view v-model="recipe" :servings="servings"></recipe-view>
|
||||
<recipe-view v-model="recipe"></recipe-view>
|
||||
|
||||
<div class="mt-2" v-if="isShared && Object.keys(recipe).length > 0">
|
||||
<import-tandoor-dialog></import-tandoor-dialog>
|
||||
@@ -36,13 +35,6 @@ const isShared = computed(() => {
|
||||
return params.share && typeof params.share == "string"
|
||||
})
|
||||
|
||||
const servings = computed(() => {
|
||||
const value = params.servings
|
||||
if (!value) return undefined
|
||||
const parsed = parseInt(value as string, 10)
|
||||
return parsed > 0 ? parsed : undefined
|
||||
})
|
||||
|
||||
const recipe = ref({} as Recipe)
|
||||
|
||||
watch(() => props.id, () => {
|
||||
|
||||
@@ -184,7 +184,7 @@ import RecipeCard from "@/components/display/RecipeCard.vue";
|
||||
import {useDisplay} from "vuetify";
|
||||
import {useUserPreferenceStore} from "@/stores/UserPreferenceStore";
|
||||
import {useRouteQuery} from "@vueuse/router";
|
||||
import {numberOrUndefinedTransformer, routeQueryDateTransformer, stringToBool, toNumberArray} from "@/utils/utils";
|
||||
import {routeQueryDateTransformer, stringToBool, toNumberArray} from "@/utils/utils";
|
||||
import RandomIcon from "@/components/display/RandomIcon.vue";
|
||||
import {VSelect, VTextField, VNumberInput} from "vuetify/components";
|
||||
import RatingField from "@/components/inputs/RatingField.vue";
|
||||
@@ -759,30 +759,27 @@ const filters = ref({
|
||||
label: `${t('Rating')} (${t('exact')})`,
|
||||
hint: '',
|
||||
enabled: false,
|
||||
clearable: true,
|
||||
default: undefined,
|
||||
is: RatingField,
|
||||
modelValue: useRouteQuery('rating', undefined, {transform: numberOrUndefinedTransformer}),
|
||||
modelValue: useRouteQuery('rating', undefined, {transform: Number}),
|
||||
},
|
||||
ratingGte: {
|
||||
id: 'ratingGte',
|
||||
label: `${t('Rating')} (>=)`,
|
||||
hint: '',
|
||||
enabled: false,
|
||||
clearable: true,
|
||||
default: undefined,
|
||||
is: RatingField,
|
||||
modelValue: useRouteQuery('ratingGte', undefined, {transform: numberOrUndefinedTransformer}),
|
||||
modelValue: useRouteQuery('ratingGte', undefined, {transform: Number}),
|
||||
},
|
||||
ratingLte: {
|
||||
id: 'ratingLte',
|
||||
label: `${t('Rating')} (<=)`,
|
||||
hint: '',
|
||||
enabled: false,
|
||||
clearable: true,
|
||||
default: undefined,
|
||||
is: RatingField,
|
||||
modelValue: useRouteQuery('ratingLte', undefined, {transform: numberOrUndefinedTransformer}),
|
||||
modelValue: useRouteQuery('ratingLte', undefined, {transform: Number}),
|
||||
},
|
||||
timescooked: {
|
||||
id: 'timescooked',
|
||||
@@ -790,29 +787,26 @@ const filters = ref({
|
||||
hint: 'Recipes that were cooked at least X times',
|
||||
enabled: false,
|
||||
default: undefined,
|
||||
clearable: true,
|
||||
is: VNumberInput,
|
||||
modelValue: useRouteQuery('timescooked', undefined, {transform: numberOrUndefinedTransformer}),
|
||||
modelValue: useRouteQuery('timescooked', undefined, {transform: Number}),
|
||||
},
|
||||
timescookedGte: {
|
||||
id: 'timescookedGte',
|
||||
label: `${t('times_cooked')} (>=)`,
|
||||
hint: '',
|
||||
enabled: false,
|
||||
clearable: true,
|
||||
default: undefined,
|
||||
is: VNumberInput,
|
||||
modelValue: useRouteQuery('timescookedGte', undefined, {transform: numberOrUndefinedTransformer}),
|
||||
modelValue: useRouteQuery('timescookedGte', undefined, {transform: Number}),
|
||||
},
|
||||
timescookedLte: {
|
||||
id: 'timescookedLte',
|
||||
label: `${t('times_cooked')} (<=)`,
|
||||
hint: '',
|
||||
enabled: false,
|
||||
clearable: true,
|
||||
default: undefined,
|
||||
is: VNumberInput,
|
||||
modelValue: useRouteQuery('timescookedLte', undefined, {transform: numberOrUndefinedTransformer}),
|
||||
modelValue: useRouteQuery('timescookedLte', undefined, {transform: Number}),
|
||||
},
|
||||
makenow: {
|
||||
id: 'makenow',
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
MealPlan,
|
||||
MealType,
|
||||
Property, PropertyType,
|
||||
Recipe, RecipeBook, RecipeBookEntry, RecipeImport, SearchFields, ShoppingList, ShoppingListEntry, Space,
|
||||
Recipe, RecipeBook, RecipeBookEntry, RecipeImport, SearchFields, ShoppingListEntry, Space,
|
||||
Step,
|
||||
Supermarket,
|
||||
SupermarketCategory, Sync, SyncLog,
|
||||
@@ -144,7 +144,6 @@ export type EditorSupportedModels =
|
||||
| 'Automation'
|
||||
| 'Keyword'
|
||||
| 'UserFile'
|
||||
| 'ShoppingList'
|
||||
| 'ShoppingListEntry'
|
||||
| 'User'
|
||||
| 'RecipeBook'
|
||||
@@ -183,7 +182,6 @@ export type EditorSupportedTypes =
|
||||
| Automation
|
||||
| Keyword
|
||||
| UserFile
|
||||
| ShoppingList
|
||||
| ShoppingListEntry
|
||||
| User
|
||||
| RecipeBook
|
||||
@@ -486,28 +484,6 @@ export const TSupermarketCategory = {
|
||||
} as Model
|
||||
registerModel(TSupermarketCategory)
|
||||
|
||||
|
||||
export const TShoppingList = {
|
||||
name: 'ShoppingList',
|
||||
localizationKey: 'ShoppingList',
|
||||
localizationKeyDescription: 'ShoppingListHelp',
|
||||
icon: 'fa-solid fa-list-check',
|
||||
|
||||
editorComponent: defineAsyncComponent(() => import(`@/components/model_editors/ShoppingListEditor.vue`)),
|
||||
|
||||
disableListView: true,
|
||||
isPaginated: true,
|
||||
toStringKeys: ['name'],
|
||||
|
||||
tableHeaders: [
|
||||
{title: 'Name', key: 'name'},
|
||||
{title: 'Color', key: 'color'},
|
||||
{title: 'Description', key: 'description'},
|
||||
{title: 'Actions', key: 'action', align: 'end'},
|
||||
]
|
||||
} as Model
|
||||
registerModel(TShoppingList)
|
||||
|
||||
export const TShoppingListEntry = {
|
||||
name: 'ShoppingListEntry',
|
||||
localizationKey: 'ShoppingListEntry',
|
||||
|
||||
@@ -79,20 +79,4 @@ export function stringToBool(param: string): boolean | undefined {
|
||||
export const routeQueryDateTransformer = {
|
||||
get: (value: string | null | Date) => ((value == null) ? null : (new Date(value))),
|
||||
set: (value: string | null | Date) => ((value == null) ? null : (DateTime.fromJSDate(new Date(value)).toISODate()))
|
||||
}
|
||||
|
||||
/**
|
||||
* routeQueryParam transformer for boolean fields converting string bools to real bools
|
||||
*/
|
||||
export const boolOrUndefinedTransformer = {
|
||||
get: (value: string | null | undefined) => ((value == null) ? undefined : value == 'true'),
|
||||
set: (value: boolean | null | undefined) => ((value == null) ? undefined : value.toString())
|
||||
}
|
||||
|
||||
/**
|
||||
* routeQueryParam transformer for number fields converting string numbers to real numbers and allowing undefined for resettable parameters
|
||||
*/
|
||||
export const numberOrUndefinedTransformer = {
|
||||
get: (value: string | null | undefined) => ((value == null) ? undefined : Number(value)),
|
||||
set: (value: string | null | undefined) => ((value == null) ? undefined : value.toString())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user