mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 06:23:34 -07:00
add warning/tooltip for unparsed foods/units
This commit is contained in:
parent
29b121a0ac
commit
22183d4969
3 changed files with 55 additions and 0 deletions
|
@ -63,6 +63,22 @@
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter="handleUnitEnter"
|
@keyup.enter="handleUnitEnter"
|
||||||
>
|
>
|
||||||
|
<template #prepend>
|
||||||
|
<v-tooltip v-if="unitError" bottom>
|
||||||
|
<template #activator="{ props }">
|
||||||
|
<v-icon
|
||||||
|
v-bind="props"
|
||||||
|
class="ml-2 mr-n3"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
|
{{ $globals.icons.alert }}
|
||||||
|
</v-icon>
|
||||||
|
</template>
|
||||||
|
<span v-if="unitErrorTooltip">
|
||||||
|
{{ unitErrorTooltip }}
|
||||||
|
</span>
|
||||||
|
</v-tooltip>
|
||||||
|
</template>
|
||||||
<template #no-data>
|
<template #no-data>
|
||||||
<div class="caption text-center pb-2">
|
<div class="caption text-center pb-2">
|
||||||
{{ $t("recipe.press-enter-to-create") }}
|
{{ $t("recipe.press-enter-to-create") }}
|
||||||
|
@ -104,6 +120,22 @@
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter="handleFoodEnter"
|
@keyup.enter="handleFoodEnter"
|
||||||
>
|
>
|
||||||
|
<template #prepend>
|
||||||
|
<v-tooltip v-if="foodError" bottom>
|
||||||
|
<template #activator="{ props }">
|
||||||
|
<v-icon
|
||||||
|
v-bind="props"
|
||||||
|
class="ml-2 mr-n3"
|
||||||
|
color="primary"
|
||||||
|
>
|
||||||
|
{{ $globals.icons.alert }}
|
||||||
|
</v-icon>
|
||||||
|
</template>
|
||||||
|
<span v-if="foodErrorTooltip">
|
||||||
|
{{ foodErrorTooltip }}
|
||||||
|
</span>
|
||||||
|
</v-tooltip>
|
||||||
|
</template>
|
||||||
<template #no-data>
|
<template #no-data>
|
||||||
<div class="caption text-center pb-2">
|
<div class="caption text-center pb-2">
|
||||||
{{ $t("recipe.press-enter-to-create") }}
|
{{ $t("recipe.press-enter-to-create") }}
|
||||||
|
@ -188,6 +220,22 @@ const props = defineProps({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
unitError: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
unitErrorTooltip: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
foodError: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
foodErrorTooltip: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
defineEmits([
|
defineEmits([
|
||||||
|
|
|
@ -662,6 +662,9 @@
|
||||||
"no-unit": "No unit",
|
"no-unit": "No unit",
|
||||||
"missing-unit": "Create missing unit: {unit}",
|
"missing-unit": "Create missing unit: {unit}",
|
||||||
"missing-food": "Create missing food: {food}",
|
"missing-food": "Create missing food: {food}",
|
||||||
|
"this-unit-could-not-be-parsed-automatically": "This unit could not be parsed automatically",
|
||||||
|
"this-food-could-not-be-parsed-automatically": "This food could not be parsed automatically",
|
||||||
|
"confidence-score": "Confidence Score",
|
||||||
"no-food": "No Food"
|
"no-food": "No Food"
|
||||||
},
|
},
|
||||||
"reset-servings-count": "Reset Servings Count",
|
"reset-servings-count": "Reset Servings Count",
|
||||||
|
|
|
@ -103,6 +103,10 @@
|
||||||
<RecipeIngredientEditor
|
<RecipeIngredientEditor
|
||||||
v-model="parsedIng[index].ingredient"
|
v-model="parsedIng[index].ingredient"
|
||||||
allow-insert-ingredient
|
allow-insert-ingredient
|
||||||
|
:unit-error="errors[index].unitError && errors[index].unitErrorMessage !== ''"
|
||||||
|
:unit-error-tooltip="$t('recipe.parser.this-unit-could-not-be-parsed-automatically')"
|
||||||
|
:food-error="errors[index].foodError && errors[index].foodErrorMessage !== ''"
|
||||||
|
:food-error-tooltip="$t('recipe.parser.this-food-could-not-be-parsed-automatically')"
|
||||||
@insert-above="insertIngredient(index)"
|
@insert-above="insertIngredient(index)"
|
||||||
@insert-below="insertIngredient(index + 1)"
|
@insert-below="insertIngredient(index + 1)"
|
||||||
@delete="deleteIngredient(index)"
|
@delete="deleteIngredient(index)"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue