Skip to content

Commit

Permalink
Merge branch 'mealie-next' into ingredients-overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
CloCkWeRX authored Feb 1, 2025
2 parents c664f1b + 41940b8 commit c366a29
Show file tree
Hide file tree
Showing 21 changed files with 247 additions and 202 deletions.
9 changes: 5 additions & 4 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@ nav:
- OpenID Connect: "documentation/getting-started/authentication/oidc-v2.md"

- Community Guides:
- iOS Shortcuts: "documentation/community-guide/ios.md"
- Reverse Proxy (SWAG): "documentation/community-guide/swag.md"
- Home Assistant: "documentation/community-guide/home-assistant.md"
- Bring API without internet exposure: "documentation/community-guide/bring-api.md"
- Automate Backups with n8n: "documentation/community-guide/n8n-backup-automation.md"
- Bulk Url Import: "documentation/community-guide/bulk-url-import.md"
- Home Assistant: "documentation/community-guide/home-assistant.md"
- Import Bookmarklet: "documentation/community-guide/import-recipe-bookmarklet.md"
- Automate Backups with n8n: "documentation/community-guide/n8n-backup-automation.md"
- iOS Shortcuts: "documentation/community-guide/ios.md"
- Reverse Proxy (SWAG): "documentation/community-guide/swag.md"

- API Reference: "api/redoc.md"

Expand Down
7 changes: 5 additions & 2 deletions frontend/components/Domain/Recipe/RecipeCardSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,17 @@ export default defineComponent({
});
async function fetchRecipes(pageCount = 1) {
const orderDir = props.query?.orderDirection || preferences.value.orderDirection;
const orderByNullPosition = props.query?.orderByNullPosition || orderDir === "asc" ? "first" : "last";
return await fetchMore(
page.value,
perPage * pageCount,
props.query?.orderBy || preferences.value.orderBy,
props.query?.orderDirection || preferences.value.orderDirection,
orderDir,
orderByNullPosition,
props.query,
// we use a computed queryFilter to filter out recipes that have a null value for the property we're sorting by
queryFilter.value
queryFilter.value,
);
}
Expand Down
9 changes: 6 additions & 3 deletions frontend/composables/recipes/use-recipes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useAsync, useRouter, ref } from "@nuxtjs/composition-api";
import { useAsyncKey } from "../use-utils";
import { usePublicExploreApi } from "~/composables/api/api-client";
import { useUserApi } from "~/composables/api";
import { Recipe } from "~/lib/api/types/recipe";
import { OrderByNullPosition, Recipe } from "~/lib/api/types/recipe";
import { RecipeSearchQuery } from "~/lib/api/user/recipes/recipe";

export const allRecipes = ref<Recipe[]>([]);
Expand All @@ -11,12 +11,14 @@ export const recentRecipes = ref<Recipe[]>([]);
function getParams(
orderBy: string | null = null,
orderDirection = "desc",
orderByNullPosition: OrderByNullPosition | null = null,
query: RecipeSearchQuery | null = null,
queryFilter: string | null = null
) {
return {
orderBy,
orderDirection,
orderByNullPosition,
paginationSeed: query?._searchSeed, // propagate searchSeed to stabilize random order pagination
searchSeed: query?._searchSeed, // unused, but pass it along for completeness of data
search: query?.search,
Expand Down Expand Up @@ -47,14 +49,15 @@ export const useLazyRecipes = function (publicGroupSlug: string | null = null) {
perPage: number,
orderBy: string | null = null,
orderDirection = "desc",
orderByNullPosition: OrderByNullPosition | null = null,
query: RecipeSearchQuery | null = null,
queryFilter: string | null = null,
) {

const { data, error } = await api.recipes.getAll(
page,
perPage,
getParams(orderBy, orderDirection, query, queryFilter),
getParams(orderBy, orderDirection, orderByNullPosition, query, queryFilter),
);

if (error?.response?.status === 404) {
Expand Down Expand Up @@ -88,7 +91,7 @@ export const useLazyRecipes = function (publicGroupSlug: string | null = null) {
}

async function getRandom(query: RecipeSearchQuery | null = null, queryFilter: string | null = null) {
const { data } = await api.recipes.getAll(1, 1, getParams("random", "desc", query, queryFilter));
const { data } = await api.recipes.getAll(1, 1, getParams("random", "desc", null, query, queryFilter));
if (data?.items.length) {
return data.items[0];
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/lang/messages/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@
"categories": "Categorías",
"cholesterol-content": "Colesterol",
"comment-action": "Comentar",
"comment": "Comentar",
"comment": "Comentario",
"comments": "Comentarios",
"delete-confirmation": "¿Estás seguro de eliminar esta receta?",
"delete-recipe": "Borrar receta",
Expand Down
14 changes: 7 additions & 7 deletions frontend/lang/messages/fi-FI.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"support": "Tuki",
"version": "Versio",
"unknown-version": "tuntematon",
"sponsor": "Yhteistyökumppani"
"sponsor": "Sponsori"
},
"asset": {
"assets": "Liitteet",
Expand Down Expand Up @@ -72,7 +72,7 @@
"enable-notifier": "Ota ilmoittaja käyttöön",
"what-events": "Mistä tapahtumista tulisi ilmoittaa?",
"user-events": "Käyttäjän tapahtumat",
"mealplan-events": "Ateriasuunnittelun tapahtumat",
"mealplan-events": "Ateriasuunnitelman Tapahtumat",
"when-a-user-in-your-group-creates-a-new-mealplan": "Kun ryhmäsi käyttäjä tekee ateriasuunnitelman",
"shopping-list-events": "Ostoslistatapahtumat",
"cookbook-events": "Keittokirjatapahtumat",
Expand Down Expand Up @@ -532,7 +532,7 @@
"no-recipe": "Ei reseptiä",
"locked-by-owner": "Omistajan lukitsema",
"join-the-conversation": "Liity keskusteluun",
"add-recipe-to-mealplan": "Lisää resepti ateriasuunnitelmaan",
"add-recipe-to-mealplan": "Lisää resepti Ateriasuunnitelmaan",
"entry-type": "Merkinnän tyyppi",
"date-format-hint": "KK/PP/VVVV-muoto",
"date-format-hint-yyyy-mm-dd": "VVVV-KK-PP-muoto",
Expand Down Expand Up @@ -661,7 +661,7 @@
"missing-food": "Luo puuttuva ruoka: {food}",
"no-food": "Ei ruokaa"
},
"reset-servings-count": "Reset Servings Count",
"reset-servings-count": "Palauta Annoksien Määrä",
"not-linked-ingredients": "Additional Ingredients"
},
"recipe-finder": {
Expand Down Expand Up @@ -981,7 +981,7 @@
"register": "Rekisteröidy",
"reset-password": "Palauta salasana",
"sign-in": "Kirjaudu",
"total-mealplans": "Ateriasuunnitelmia",
"total-mealplans": "Ateriasuunnitelma Yhteensä",
"total-users": "Käyttäjien määrä",
"upload-photo": "Tuo kuva",
"use-8-characters-or-more-for-your-password": "Salasanan pituuden on oltava vähintään kahdeksan merkkiä",
Expand Down Expand Up @@ -1030,7 +1030,7 @@
"administrator": "Ylläpitäjä",
"user-can-invite-other-to-group": "Käyttäjä voi kutsua muita ryhmään",
"user-can-manage-group": "Käyttäjä voi hallita ryhmää",
"user-can-manage-household": "User can manage household",
"user-can-manage-household": "Käyttäjä voi hallita kotitaloutta",
"user-can-organize-group-data": "Käyttäjä voi järjestellä ryhmän tietoja",
"enable-advanced-features": "Salli edistyneemmät ominaisuudet",
"it-looks-like-this-is-your-first-time-logging-in": "Tämä vaikuttaa olevan ensimmäinen kirjautumisesi.",
Expand Down Expand Up @@ -1296,7 +1296,7 @@
"profile": {
"welcome-user": "👋 Tervetuloa, {0}!",
"description": "Hallitse profiiliasi, reseptejäsi ja ryhmäasetuksiasi.",
"invite-link": "Invite Link",
"invite-link": "",
"get-invite-link": "Hanki Kutsulinkki",
"get-public-link": "Julkinen linkki",
"account-summary": "Tilin Yhteenveto",
Expand Down
14 changes: 7 additions & 7 deletions frontend/lang/messages/lt-LT.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"loading": "Kraunasi",
"loading-events": "Užkrovimo įvykiai",
"loading-recipe": "Receptai kraunasi...",
"loading-ocr-data": "Loading OCR data...",
"loading-ocr-data": "Įkeliami OCR duomenys...",
"loading-recipes": "Receptai kraunasi",
"message": "Pranešimas",
"monday": "Pirmadienis",
Expand Down Expand Up @@ -210,14 +210,14 @@
"upload-file": "Įkelti failą",
"created-on-date": "Sukurta: {0}",
"unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.",
"clipboard-copy-failure": "Failed to copy to the clipboard.",
"clipboard-copy-failure": "Nepavyko nukopijuoti į iškarpinę.",
"confirm-delete-generic-items": "Are you sure you want to delete the following items?",
"organizers": "Organizers",
"caution": "Caution",
"show-advanced": "Show Advanced",
"add-field": "Add Field",
"date-created": "Date Created",
"date-updated": "Date Updated"
"show-advanced": "Rodyti plačiau",
"add-field": "Pridėti lauką",
"date-created": "Sukūrimo data",
"date-updated": "Atnaujinimo data"
},
"group": {
"are-you-sure-you-want-to-delete-the-group": "Ar tikrai norite ištrinti <b>{groupName}<b/>?",
Expand Down Expand Up @@ -322,7 +322,7 @@
"mealplan-update-failed": "Mitybos plano atnaujinti nepavyko",
"mealplan-updated": "Mitybos planas atnaujintas",
"mealplan-households-description": "If no household is selected, recipes can be added from any household",
"any-category": "Any Category",
"any-category": "Bet kuri kategorija",
"any-tag": "Any Tag",
"any-household": "Any Household",
"no-meal-plan-defined-yet": "Nėra nustatytų mitybos planų",
Expand Down
30 changes: 15 additions & 15 deletions frontend/lang/messages/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@
"create-recipe-from-an-image-description": "Create a recipe by uploading an image of it. Mealie will attempt to extract the text from the image using AI and create a recipe from it.",
"crop-and-rotate-the-image": "Crop and rotate the image so that only the text is visible, and it's in the correct orientation.",
"create-from-image": "Create from Image",
"should-translate-description": "Translate the recipe into my language",
"should-translate-description": "Перевести рецепт на мой язык",
"please-wait-image-procesing": "Подождите, идет обработка изображения.",
"bulk-url-import": "Массовый импорт по URL",
"debug-scraper": "Отладка сканирования",
Expand All @@ -611,16 +611,16 @@
"scrape-recipe-description": "Отсканировать рецепт по ссылке. Предоставьте ссылку на страницу, которую вы хотите отсканировать, и Mealie попытается вырезать рецепт с этого сайта и добавить его в свою коллекцию.",
"scrape-recipe-have-a-lot-of-recipes": "Хотите отсканировать несколько рецептов за раз?",
"scrape-recipe-suggest-bulk-importer": "Воспользуйтесь массовым импортом",
"scrape-recipe-have-raw-html-or-json-data": "Have raw HTML or JSON data?",
"scrape-recipe-have-raw-html-or-json-data": "У Вас есть данные HTML или JSON?",
"scrape-recipe-you-can-import-from-raw-data-directly": "You can import from raw data directly",
"import-original-keywords-as-tags": "Импортировать исходные ключевые слова как теги",
"stay-in-edit-mode": "Остаться в режиме редактирования",
"import-from-zip": "Импорт из архива",
"import-from-zip-description": "Импорт одного рецепта, который был экспортирован из другого экземпляра Mealie.",
"import-from-html-or-json": "Import from HTML or JSON",
"import-from-html-or-json": "Импортировать из HTML или JSON",
"import-from-html-or-json-description": "Import a single recipe from raw HTML or JSON. This is useful if you have a recipe from a site that Mealie can't scrape normally, or from some other external source.",
"json-import-format-description-colon": "To import via JSON, it must be in valid format:",
"json-editor": "JSON Editor",
"json-editor": "Редактор JSON",
"zip-files-must-have-been-exported-from-mealie": ".zip файлы должны быть экспортированы из Mealie",
"create-a-recipe-by-uploading-a-scan": "Создайте рецепт, загрузив скан.",
"upload-a-png-image-from-a-recipe-book": "Загрузить png изображение из книги рецептов",
Expand Down Expand Up @@ -661,16 +661,16 @@
"missing-food": "Create missing food: {food}",
"no-food": "Нет еды"
},
"reset-servings-count": "Reset Servings Count",
"not-linked-ingredients": "Additional Ingredients"
"reset-servings-count": "Сбросить количество порций",
"not-linked-ingredients": "Дополнительные ингредиенты"
},
"recipe-finder": {
"recipe-finder": "Recipe Finder",
"recipe-finder": "Поиск рецептов",
"recipe-finder-description": "Search for recipes based on ingredients you have on hand. You can also filter by tools you have available, and set a maximum number of missing ingredients or tools.",
"selected-ingredients": "Selected Ingredients",
"selected-ingredients": "Выбранные ингредиенты",
"no-ingredients-selected": "No ingredients selected",
"missing": "Missing",
"no-recipes-found": "No recipes found",
"no-recipes-found": "Рецепты не найдены",
"no-recipes-found-description": "Try adding more ingredients to your search or adjusting your filters",
"include-ingredients-on-hand": "Include Ingredients On Hand",
"include-tools-on-hand": "Include Tools On Hand",
Expand Down Expand Up @@ -881,10 +881,10 @@
"completed-on": "Выполнено в {date}",
"you-are-offline": "Вы не в сети",
"you-are-offline-description": "Not all features are available while offline. You can still add, modify, and remove items, but you will not be able to sync your changes to the server until you are back online.",
"are-you-sure-you-want-to-check-all-items": "Are you sure you want to check all items?",
"are-you-sure-you-want-to-check-all-items": "Вы уверены, что хотите выбрать все элементы?",
"are-you-sure-you-want-to-uncheck-all-items": "Are you sure you want to uncheck all items?",
"are-you-sure-you-want-to-delete-checked-items": "Are you sure you want to delete all checked items?",
"no-shopping-lists-found": "No Shopping Lists Found"
"no-shopping-lists-found": "Списки покупок не найдены"
},
"sidebar": {
"all-recipes": "Все рецепты",
Expand Down Expand Up @@ -1286,17 +1286,17 @@
"restore-from-v1-backup": "Have a backup from a previous instance of Mealie v1? You can restore it here.",
"manage-profile-or-get-invite-link": "Manage your own profile, or grab an invite link to share with others."
},
"debug-openai-services": "Debug OpenAI Services",
"debug-openai-services": "Отладка OpenAI сервисов",
"debug-openai-services-description": "Use this page to debug OpenAI services. You can test your OpenAI connection and see the results here. If you have image services enabled, you can also provide an image.",
"run-test": "Run Test",
"test-results": "Test Results",
"run-test": "Запустить тест",
"test-results": "Результаты тестов",
"group-delete-note": "Groups with users or households cannot be deleted",
"household-delete-note": "Households with users cannot be deleted"
},
"profile": {
"welcome-user": "👋 Добро пожаловать, {0}!",
"description": "Управление настройками профиля, рецептов и группы.",
"invite-link": "Invite Link",
"invite-link": "Ссылка-приглашение",
"get-invite-link": "Получить ссылку для приглашения",
"get-public-link": "Получить публичную ссылку",
"account-summary": "Cведения об учетной записи",
Expand Down
7 changes: 6 additions & 1 deletion frontend/lib/api/types/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ export interface GroupSummary {
slug: string;
preferences?: ReadGroupPreferences | null;
}
export interface LongLiveTokenCreateResponse {
name: string;
id: number;
createdAt?: string | null;
token: string;
}
export interface LongLiveTokenIn {
name: string;
integrationId?: string;
Expand Down Expand Up @@ -130,7 +136,6 @@ export interface PrivateUser {
lockedAt?: string | null;
}
export interface LongLiveTokenOut {
token: string;
name: string;
id: number;
createdAt?: string | null;
Expand Down
1 change: 1 addition & 0 deletions frontend/lib/api/user/recipes/recipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export type RecipeSearchQuery = {
page?: number;
perPage?: number;
orderBy?: string;
orderByNullPosition?: "first" | "last";

_searchSeed?: string;
};
Expand Down
22 changes: 11 additions & 11 deletions mealie/lang/messages/lt-LT.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
},
"recipe": {
"unique-name-error": "Receptų pavadinimai turi būti unikalūs",
"recipe-created": "Recipe Created",
"recipe-created": "Receptas sukurtas",
"recipe-defaults": {
"ingredient-note": "1 Cup Flour",
"step-text": "Recipe steps as well as other fields in the recipe page support markdown syntax.\n\n**Add a link**\n\n[My Link](https://demo.mealie.io)\n"
Expand All @@ -13,7 +13,7 @@
"makes": "Makes",
"serves": "Serves",
"serving": "Serving",
"servings": "Servings",
"servings": "Porcijos",
"yield": "Yield",
"yields": "Yields"
}
Expand Down Expand Up @@ -46,13 +46,13 @@
"generic-deleted": "{name} ištrintas"
},
"datetime": {
"year": "year|years",
"day": "day|days",
"hour": "hour|hours",
"minute": "minute|minutes",
"second": "second|seconds",
"millisecond": "millisecond|milliseconds",
"microsecond": "microsecond|microseconds"
"year": "metai|metai",
"day": "diena|dienos",
"hour": "valanda|valandos",
"minute": "minutė|minutės",
"second": "sekundė|sekundės",
"millisecond": "milisekundė|milisekundės",
"microsecond": "mikrosekundė|mikrosekundės"
},
"emails": {
"password": {
Expand All @@ -67,12 +67,12 @@
"header_text": "You're Invited!",
"message_top": "You have been invited to join Mealie.",
"message_bottom": "Please click the button above to accept the invitation.",
"button_text": "Accept Invitation"
"button_text": "Priimti pakvietimą"
},
"test": {
"subject": "Mealie Test Email",
"header_text": "Test Email",
"message_top": "This is a test email.",
"message_top": "Tai bandomasis el. laiškas.",
"message_bottom": "Please click the button above to test the email.",
"button_text": "Open Mealie"
}
Expand Down
6 changes: 3 additions & 3 deletions mealie/lang/messages/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
},
"recipe": {
"unique-name-error": "Название рецепта должно быть уникальным",
"recipe-created": "Recipe Created",
"recipe-created": "Рецепт создан",
"recipe-defaults": {
"ingredient-note": "1 Чашка муки",
"step-text": "Шаги рецепта, как и другие поля на странице рецепта, поддерживают синтаксис Markdown.\n\n**Добавить ссылку**\n\n[Моя Ссылка](https://demo.mealie.io)\n"
},
"servings-text": {
"makes": "Makes",
"serves": "Serves",
"serving": "Serving",
"servings": "Servings",
"serving": "Порция",
"servings": "Порции",
"yield": "Yield",
"yields": "Yields"
}
Expand Down
Loading

0 comments on commit c366a29

Please sign in to comment.