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