mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-23 14:55:24 -07:00
Merge branch 'mealie-next' into ingredients-overflow
This commit is contained in:
commit
c664f1b1da
5 changed files with 15 additions and 6 deletions
|
@ -12,7 +12,7 @@ repos:
|
||||||
exclude: ^tests/data/
|
exclude: ^tests/data/
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
# Ruff version.
|
# Ruff version.
|
||||||
rev: v0.9.2
|
rev: v0.9.3
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
|
|
|
@ -139,6 +139,9 @@ Below is a list of all valid merge fields:
|
||||||
- ${id}
|
- ${id}
|
||||||
- ${slug}
|
- ${slug}
|
||||||
- ${url}
|
- ${url}
|
||||||
|
- ${servings}
|
||||||
|
- ${yieldQuantity}
|
||||||
|
- ${yieldText}
|
||||||
|
|
||||||
To add, modify, or delete Recipe Actions, visit the Data Management page (more on that below).
|
To add, modify, or delete Recipe Actions, visit the Data Management page (more on that below).
|
||||||
|
|
||||||
|
|
|
@ -371,7 +371,7 @@ export default defineComponent({
|
||||||
const groupRecipeActionsStore = useGroupRecipeActions();
|
const groupRecipeActionsStore = useGroupRecipeActions();
|
||||||
|
|
||||||
async function executeRecipeAction(action: GroupRecipeActionOut) {
|
async function executeRecipeAction(action: GroupRecipeActionOut) {
|
||||||
const response = await groupRecipeActionsStore.execute(action, props.recipe);
|
const response = await groupRecipeActionsStore.execute(action, props.recipe, props.recipeScale);
|
||||||
|
|
||||||
if (action.actionType === "post") {
|
if (action.actionType === "post") {
|
||||||
if (!response?.error) {
|
if (!response?.error) {
|
||||||
|
|
|
@ -46,17 +46,23 @@ export const useGroupRecipeActions = function (
|
||||||
return groupRecipeActions.value;
|
return groupRecipeActions.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
function parseRecipeActionUrl(url: string, recipe: Recipe): string {
|
function parseRecipeActionUrl(url: string, recipe: Recipe, recipeScale: number): string {
|
||||||
|
const recipeServings = (recipe.recipeServings || 1) * recipeScale;
|
||||||
|
const recipeYieldQuantity = (recipe.recipeYieldQuantity || 1) * recipeScale;
|
||||||
|
|
||||||
/* eslint-disable no-template-curly-in-string */
|
/* eslint-disable no-template-curly-in-string */
|
||||||
return url
|
return url
|
||||||
.replace("${url}", window.location.href)
|
.replace("${url}", window.location.href)
|
||||||
.replace("${id}", recipe.id || "")
|
.replace("${id}", recipe.id || "")
|
||||||
.replace("${slug}", recipe.slug || "")
|
.replace("${slug}", recipe.slug || "")
|
||||||
|
.replace("${servings}", recipeServings.toString())
|
||||||
|
.replace("${yieldQuantity}", recipeYieldQuantity.toString())
|
||||||
|
.replace("${yieldText}", recipe.recipeYield || "")
|
||||||
/* eslint-enable no-template-curly-in-string */
|
/* eslint-enable no-template-curly-in-string */
|
||||||
};
|
};
|
||||||
|
|
||||||
async function execute(action: GroupRecipeActionOut, recipe: Recipe): Promise<void | RequestResponse<unknown>> {
|
async function execute(action: GroupRecipeActionOut, recipe: Recipe, recipeScale: number): Promise<void | RequestResponse<unknown>> {
|
||||||
const url = parseRecipeActionUrl(action.url, recipe);
|
const url = parseRecipeActionUrl(action.url, recipe, recipeScale);
|
||||||
|
|
||||||
switch (action.actionType) {
|
switch (action.actionType) {
|
||||||
case "link":
|
case "link":
|
||||||
|
|
|
@ -174,7 +174,7 @@
|
||||||
"wednesday": "Τετάρτη",
|
"wednesday": "Τετάρτη",
|
||||||
"yes": "Ναι",
|
"yes": "Ναι",
|
||||||
"foods": "Τρόφιμα",
|
"foods": "Τρόφιμα",
|
||||||
"units": "Μονάδες",
|
"units": "Μονάδες μέτρησης",
|
||||||
"back": "Πίσω",
|
"back": "Πίσω",
|
||||||
"next": "Επόμενο",
|
"next": "Επόμενο",
|
||||||
"start": "Εναρξη",
|
"start": "Εναρξη",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue