remove unused disableAmount props

This commit is contained in:
Michael Genson 2025-07-11 19:07:12 +00:00
commit dda68fc7f3
9 changed files with 3 additions and 68 deletions

View file

@ -140,7 +140,6 @@
<div :key="ingredientData.ingredient.quantity"> <div :key="ingredientData.ingredient.quantity">
<RecipeIngredientListItem <RecipeIngredientListItem
:ingredient="ingredientData.ingredient" :ingredient="ingredientData.ingredient"
:disable-amount="ingredientData.disableAmount"
:scale="recipeSection.recipeScale" :scale="recipeSection.recipeScale"
/> />
</div> </div>
@ -188,7 +187,6 @@ export interface RecipeWithScale extends Recipe {
export interface ShoppingListIngredient { export interface ShoppingListIngredient {
checked: boolean; checked: boolean;
ingredient: RecipeIngredient; ingredient: RecipeIngredient;
disableAmount: boolean;
} }
export interface ShoppingListIngredientSection { export interface ShoppingListIngredientSection {
@ -299,7 +297,6 @@ export default defineNuxtComponent({
return { return {
checked: !householdsWithFood.includes(userHousehold.value), checked: !householdsWithFood.includes(userHousehold.value),
ingredient: ing, ingredient: ing,
disableAmount: recipe.settings?.disableAmount || false,
}; };
}); });

View file

@ -17,32 +17,6 @@
class="d-flex flex-wrap my-1" class="d-flex flex-wrap my-1"
> >
<v-col <v-col
v-if="!disableAmount"
sm="12"
md="2"
cols="12"
class="flex-grow-0 flex-shrink-0"
>
<v-text-field
v-model="model.quantity"
variant="solo"
hide-details
density="compact"
type="number"
:placeholder="$t('recipe.quantity')"
@keypress="quantityFilter"
>
<template #prepend>
<v-icon
class="mr-n1 handle"
>
{{ $globals.icons.arrowUpDown }}
</v-icon>
</template>
</v-text-field>
</v-col>
<v-col
v-if="!disableAmount"
sm="12" sm="12"
md="3" md="3"
cols="12" cols="12"
@ -82,7 +56,6 @@
<!-- Foods Input --> <!-- Foods Input -->
<v-col <v-col
v-if="!disableAmount"
m="12" m="12"
md="3" md="3"
cols="12" cols="12"
@ -134,16 +107,7 @@
:placeholder="$t('recipe.notes')" :placeholder="$t('recipe.notes')"
class="mb-auto" class="mb-auto"
@click="$emit('clickIngredientField', 'note')" @click="$emit('clickIngredientField', 'note')"
> />
<template #prepend>
<v-icon
v-if="disableAmount && $attrs && $attrs.delete"
class="mr-n1 handle"
>
{{ $globals.icons.arrowUpDown }}
</v-icon>
</template>
</v-text-field>
<BaseButtonGroup <BaseButtonGroup
hover hover
:large="false" :large="false"
@ -185,10 +149,6 @@ import type { RecipeIngredient } from "~/lib/api/types/recipe";
const model = defineModel<RecipeIngredient>({ required: true }); const model = defineModel<RecipeIngredient>({ required: true });
const props = defineProps({ const props = defineProps({
disableAmount: {
type: Boolean,
default: false,
},
allowInsertIngredient: { allowInsertIngredient: {
type: Boolean, type: Boolean,
default: false, default: false,

View file

@ -38,10 +38,6 @@ export default defineNuxtComponent({
type: Object as () => RecipeIngredient, type: Object as () => RecipeIngredient,
required: true, required: true,
}, },
disableAmount: {
type: Boolean,
default: false,
},
scale: { scale: {
type: Number, type: Number,
default: 1, default: 1,

View file

@ -43,7 +43,6 @@
<v-list-item-title> <v-list-item-title>
<RecipeIngredientListItem <RecipeIngredientListItem
:ingredient="ingredient" :ingredient="ingredient"
:disable-amount="disableAmount"
:scale="scale" :scale="scale"
/> />
</v-list-item-title> </v-list-item-title>
@ -65,10 +64,6 @@ export default defineNuxtComponent({
type: Array as () => RecipeIngredient[], type: Array as () => RecipeIngredient[],
default: () => [], default: () => [],
}, },
disableAmount: {
type: Boolean,
default: false,
},
scale: { scale: {
type: Number, type: Number,
default: 1, default: 1,
@ -99,7 +94,7 @@ export default defineNuxtComponent({
components.push(`[${ingredient.title}]`); components.push(`[${ingredient.title}]`);
} }
components.push(parseIngredientText(ingredient, props.disableAmount, props.scale, false)); components.push(parseIngredientText(ingredient, props.scale, false));
}); });
return components.join("\n"); return components.join("\n");

View file

@ -141,7 +141,6 @@
<RecipeIngredients <RecipeIngredients
:value="notLinkedIngredients" :value="notLinkedIngredients"
:scale="scale" :scale="scale"
:disable-amount="recipe.settings.disableAmount"
:is-cook-mode="isCookMode" :is-cook-mode="isCookMode"
/> />
</v-card> </v-card>

View file

@ -27,7 +27,6 @@
:key="ingredient.referenceId" :key="ingredient.referenceId"
v-model="recipe.recipeIngredient[index]" v-model="recipe.recipeIngredient[index]"
class="list-group-item" class="list-group-item"
:disable-amount="recipe.settings.disableAmount"
@delete="recipe.recipeIngredient.splice(index, 1)" @delete="recipe.recipeIngredient.splice(index, 1)"
@insert-above="insertNewIngredient(index)" @insert-above="insertNewIngredient(index)"
@insert-below="insertNewIngredient(index + 1)" @insert-below="insertNewIngredient(index + 1)"

View file

@ -3,7 +3,6 @@
<RecipeIngredients <RecipeIngredients
:value="recipe.recipeIngredient" :value="recipe.recipeIngredient"
:scale="scale" :scale="scale"
:disable-amount="recipe.settings.disableAmount"
:is-cook-mode="isCookMode" :is-cook-mode="isCookMode"
/> />
<div v-if="!isEditMode && recipe.tools && recipe.tools.length > 0"> <div v-if="!isEditMode && recipe.tools && recipe.tools.length > 0">

View file

@ -325,7 +325,6 @@
return step.ingredientReferences.map((ref) => ref.referenceId).includes(ing.referenceId || '') return step.ingredientReferences.map((ref) => ref.referenceId).includes(ing.referenceId || '')
})" })"
:scale="scale" :scale="scale"
:disable-amount="recipe.settings.disableAmount"
:is-cook-mode="isCookMode" :is-cook-mode="isCookMode"
/> />
</div> </div>

View file

@ -2,7 +2,7 @@
<div> <div>
<v-card variant="outlined"> <v-card variant="outlined">
<v-card-text class="pb-3 pt-1"> <v-card-text class="pb-3 pt-1">
<div v-if="listItem.isFood" class="d-md-flex align-center mb-2" style="gap: 20px"> <div class="d-md-flex align-center mb-2" style="gap: 20px">
<div> <div>
<InputQuantity v-model="listItem.quantity" /> <InputQuantity v-model="listItem.quantity" />
</div> </div>
@ -26,9 +26,6 @@
/> />
</div> </div>
<div class="d-md-flex align-center" style="gap: 20px"> <div class="d-md-flex align-center" style="gap: 20px">
<div v-if="!listItem.isFood">
<InputQuantity v-model="listItem.quantity" />
</div>
<v-textarea <v-textarea
v-model="listItem.note" v-model="listItem.note"
hide-details hide-details
@ -99,11 +96,6 @@
text: $t('general.cancel'), text: $t('general.cancel'),
event: 'cancel', event: 'cancel',
}, },
{
icon: $globals.icons.foods,
text: $t('shopping-list.toggle-food'),
event: 'toggle-foods',
},
{ {
icon: $globals.icons.save, icon: $globals.icons.save,
text: $t('general.save'), text: $t('general.save'),
@ -113,7 +105,6 @@
@save="$emit('save')" @save="$emit('save')"
@cancel="$emit('cancel')" @cancel="$emit('cancel')"
@delete="$emit('delete')" @delete="$emit('delete')"
@toggle-foods="listItem.isFood = !listItem.isFood"
/> />
</v-card-actions> </v-card-actions>
</v-card> </v-card>