feat: Add the ability to flag a food as "on hand", to exclude from shopping list (#3777)

This commit is contained in:
boc-the-git 2024-06-29 01:16:04 +10:00 committed by GitHub
parent 4831adb0f3
commit a062a4beaa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 112 additions and 9 deletions

View file

@ -87,6 +87,14 @@
:label="$t('data-pages.foods.food-label')"
>
</v-autocomplete>
<v-checkbox
v-model="createTarget.onHand"
hide-details
:label="$t('tool.on-hand')"
/>
<p class="text-caption mt-1">
{{ $t("data-pages.foods.on-hand-checkbox-label") }}
</p>
</v-form> </v-card-text
></BaseDialog>
@ -134,6 +142,14 @@
:label="$t('data-pages.foods.food-label')"
>
</v-autocomplete>
<v-checkbox
v-model="editTarget.onHand"
hide-details
:label="$t('tool.on-hand')"
/>
<p class="text-caption mt-1">
{{ $t("data-pages.foods.on-hand-checkbox-label") }}
</p>
</v-form>
</v-card-text>
<template #custom-card-action>
@ -243,6 +259,11 @@
{{ item.label.name }}
</MultiPurposeLabel>
</template>
<template #item.onHand="{ item }">
<v-icon :color="item.onHand ? 'success' : undefined">
{{ item.onHand ? $globals.icons.check : $globals.icons.close }}
</v-icon>
</template>
<template #button-bottom>
<BaseButton @click="seedDialog = true">
<template #icon> {{ $globals.icons.database }} </template>
@ -300,6 +321,11 @@ export default defineComponent({
value: "label",
show: true,
},
{
text: i18n.tc("tool.on-hand"),
value: "onHand",
show: true,
},
];
const foodStore = useFoodStore();