mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
remove additional flag references
This commit is contained in:
parent
dda68fc7f3
commit
a120d4debf
8 changed files with 6 additions and 36 deletions
|
@ -87,11 +87,6 @@ export default defineNuxtComponent({
|
||||||
label: i18n.t("group.disable-users-from-commenting-on-recipes"),
|
label: i18n.t("group.disable-users-from-commenting-on-recipes"),
|
||||||
description: i18n.t("group.disable-users-from-commenting-on-recipes-description"),
|
description: i18n.t("group.disable-users-from-commenting-on-recipes-description"),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
key: "recipeDisableAmount",
|
|
||||||
label: i18n.t("group.disable-organizing-recipe-ingredients-by-units-and-food"),
|
|
||||||
description: i18n.t("group.disable-organizing-recipe-ingredients-by-units-and-food-description"),
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const allDays = [
|
const allDays = [
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
<span>
|
<span>
|
||||||
<BaseButton
|
<BaseButton
|
||||||
class="mb-1"
|
class="mb-1"
|
||||||
:disabled="recipe.settings.disableAmount || hasFoodOrUnit"
|
:disabled="hasFoodOrUnit"
|
||||||
color="accent"
|
color="accent"
|
||||||
:to="`/g/${groupSlug}/r/${recipe.slug}/ingredient-parser`"
|
:to="`/g/${groupSlug}/r/${recipe.slug}/ingredient-parser`"
|
||||||
v-bind="props"
|
v-bind="props"
|
||||||
|
@ -108,10 +108,7 @@ const hasFoodOrUnit = computed(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const parserToolTip = computed(() => {
|
const parserToolTip = computed(() => {
|
||||||
if (recipe.value.settings.disableAmount) {
|
if (hasFoodOrUnit.value) {
|
||||||
return i18n.t("recipe.enable-ingredient-amounts-to-use-this-feature");
|
|
||||||
}
|
|
||||||
else if (hasFoodOrUnit.value) {
|
|
||||||
return i18n.t("recipe.recipes-with-units-or-foods-defined-cannot-be-parsed");
|
return i18n.t("recipe.recipes-with-units-or-foods-defined-cannot-be-parsed");
|
||||||
}
|
}
|
||||||
return i18n.t("recipe.parse-ingredients");
|
return i18n.t("recipe.parse-ingredients");
|
||||||
|
@ -126,7 +123,6 @@ function addIngredient(ingredients: Array<string> | null = null) {
|
||||||
note: x,
|
note: x,
|
||||||
unit: undefined,
|
unit: undefined,
|
||||||
food: undefined,
|
food: undefined,
|
||||||
disableAmount: true,
|
|
||||||
quantity: 1,
|
quantity: 1,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -145,7 +141,6 @@ function addIngredient(ingredients: Array<string> | null = null) {
|
||||||
unit: undefined,
|
unit: undefined,
|
||||||
// @ts-expect-error - prop can be null-type by NoUndefinedField type forces it to be set
|
// @ts-expect-error - prop can be null-type by NoUndefinedField type forces it to be set
|
||||||
food: undefined,
|
food: undefined,
|
||||||
disableAmount: true,
|
|
||||||
quantity: 1,
|
quantity: 1,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -160,7 +155,6 @@ function insertNewIngredient(dest: number) {
|
||||||
unit: undefined,
|
unit: undefined,
|
||||||
// @ts-expect-error - prop can be null-type by NoUndefinedField type forces it to be set
|
// @ts-expect-error - prop can be null-type by NoUndefinedField type forces it to be set
|
||||||
food: undefined,
|
food: undefined,
|
||||||
disableAmount: true,
|
|
||||||
quantity: 1,
|
quantity: 1,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
v-if="!isEditMode"
|
v-if="!isEditMode"
|
||||||
v-model.number="scaleValue"
|
v-model.number="scaleValue"
|
||||||
:recipe-servings="recipeServings"
|
:recipe-servings="recipeServings"
|
||||||
:edit-scale="!recipe.settings.disableAmount && !isEditMode"
|
:edit-scale="!isEditMode"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -31,7 +31,6 @@ const labels: Record<keyof RecipeSettings, string> = {
|
||||||
showAssets: i18n.t("asset.show-assets"),
|
showAssets: i18n.t("asset.show-assets"),
|
||||||
landscapeView: i18n.t("recipe.landscape-view-coming-soon"),
|
landscapeView: i18n.t("recipe.landscape-view-coming-soon"),
|
||||||
disableComments: i18n.t("recipe.disable-comments"),
|
disableComments: i18n.t("recipe.disable-comments"),
|
||||||
disableAmount: i18n.t("recipe.disable-amount"),
|
|
||||||
locked: i18n.t("recipe.locked"),
|
locked: i18n.t("recipe.locked"),
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -354,7 +354,6 @@ export default defineNuxtComponent({
|
||||||
confidence: {},
|
confidence: {},
|
||||||
ingredient: {
|
ingredient: {
|
||||||
quantity: 1.0,
|
quantity: 1.0,
|
||||||
disableAmount: false,
|
|
||||||
referenceId: uuid4(),
|
referenceId: uuid4(),
|
||||||
},
|
},
|
||||||
} as ParsedIngredient;
|
} as ParsedIngredient;
|
||||||
|
@ -399,10 +398,6 @@ export default defineNuxtComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
recipe.value.recipeIngredient = ingredients;
|
recipe.value.recipeIngredient = ingredients;
|
||||||
if (recipe.value.settings) {
|
|
||||||
recipe.value.settings.disableAmount = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { response } = await api.recipes.updateOne(recipe.value.slug, recipe.value);
|
const { response } = await api.recipes.updateOne(recipe.value.slug, recipe.value);
|
||||||
|
|
||||||
if (response?.status === 200) {
|
if (response?.status === 200) {
|
||||||
|
|
|
@ -415,7 +415,6 @@ export default defineNuxtComponent({
|
||||||
showAssets: false,
|
showAssets: false,
|
||||||
landscapeView: false,
|
landscapeView: false,
|
||||||
disableComments: false,
|
disableComments: false,
|
||||||
disableAmount: false,
|
|
||||||
locked: false,
|
locked: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -95,12 +95,6 @@ export default defineNuxtComponent({
|
||||||
label: i18n.t("group.disable-users-from-commenting-on-recipes"),
|
label: i18n.t("group.disable-users-from-commenting-on-recipes"),
|
||||||
description: i18n.t("group.disable-users-from-commenting-on-recipes-description"),
|
description: i18n.t("group.disable-users-from-commenting-on-recipes-description"),
|
||||||
} as Preference,
|
} as Preference,
|
||||||
{
|
|
||||||
key: "recipeDisableAmount",
|
|
||||||
value: household.value.preferences.recipeDisableAmount || false,
|
|
||||||
label: i18n.t("group.disable-organizing-recipe-ingredients-by-units-and-food"),
|
|
||||||
description: i18n.t("group.disable-organizing-recipe-ingredients-by-units-and-food-description"),
|
|
||||||
} as Preference,
|
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -758,12 +758,10 @@ export default defineNuxtComponent({
|
||||||
|
|
||||||
const contextActions = {
|
const contextActions = {
|
||||||
delete: "delete",
|
delete: "delete",
|
||||||
setIngredient: "setIngredient",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const contextMenu = [
|
const contextMenu = [
|
||||||
{ title: i18n.t("general.delete"), action: contextActions.delete },
|
{ title: i18n.t("general.delete"), action: contextActions.delete },
|
||||||
{ title: i18n.t("recipe.ingredient"), action: contextActions.setIngredient },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
function contextMenuAction(action: string, item: ShoppingListItemOut, idx: number) {
|
function contextMenuAction(action: string, item: ShoppingListItemOut, idx: number) {
|
||||||
|
@ -775,9 +773,6 @@ export default defineNuxtComponent({
|
||||||
case contextActions.delete:
|
case contextActions.delete:
|
||||||
shoppingList.value.listItems = shoppingList.value?.listItems.filter(itm => itm.id !== item.id);
|
shoppingList.value.listItems = shoppingList.value?.listItems.filter(itm => itm.id !== item.id);
|
||||||
break;
|
break;
|
||||||
case contextActions.setIngredient:
|
|
||||||
shoppingList.value.listItems[idx].isFood = !shoppingList.value.listItems[idx].isFood;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -897,7 +892,7 @@ export default defineNuxtComponent({
|
||||||
shoppingList.value.listItems.forEach((item) => {
|
shoppingList.value.listItems.forEach((item) => {
|
||||||
const key = item.checked
|
const key = item.checked
|
||||||
? checkedItemKey
|
? checkedItemKey
|
||||||
: item.isFood && item.food?.name
|
: item.food?.name
|
||||||
? item.food.name
|
? item.food.name
|
||||||
: item.note || "";
|
: item.note || "";
|
||||||
|
|
||||||
|
@ -1083,13 +1078,12 @@ export default defineNuxtComponent({
|
||||||
const createEditorOpen = ref(false);
|
const createEditorOpen = ref(false);
|
||||||
const createListItemData = ref<ShoppingListItemOut>(listItemFactory());
|
const createListItemData = ref<ShoppingListItemOut>(listItemFactory());
|
||||||
|
|
||||||
function listItemFactory(isFood = false): ShoppingListItemOut {
|
function listItemFactory(): ShoppingListItemOut {
|
||||||
return {
|
return {
|
||||||
id: uuid4(),
|
id: uuid4(),
|
||||||
shoppingListId: id,
|
shoppingListId: id,
|
||||||
checked: false,
|
checked: false,
|
||||||
position: shoppingList.value?.listItems?.length || 1,
|
position: shoppingList.value?.listItems?.length || 1,
|
||||||
isFood,
|
|
||||||
quantity: 0,
|
quantity: 0,
|
||||||
note: "",
|
note: "",
|
||||||
labelId: undefined,
|
labelId: undefined,
|
||||||
|
@ -1140,7 +1134,7 @@ export default defineNuxtComponent({
|
||||||
shoppingList.value.listItems.push(createListItemData.value);
|
shoppingList.value.listItems.push(createListItemData.value);
|
||||||
updateListItemOrder();
|
updateListItemOrder();
|
||||||
}
|
}
|
||||||
createListItemData.value = listItemFactory(createListItemData.value.isFood || false);
|
createListItemData.value = listItemFactory();
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue