Skip to content

Commit

Permalink
added more editing capabilities to line item modal
Browse files Browse the repository at this point in the history
  • Loading branch information
vabene1111 committed Feb 10, 2024
1 parent 61ccc60 commit 6aa2aa4
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions vue/src/components/ShoppingLineItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,29 @@

</div>
<b-button variant="outline-danger"
@click="detail_modal_visible = false; useShoppingListStore().deleteObject(e)"><i
@click="useShoppingListStore().deleteObject(e)"><i
class="fas fa-trash"></i></b-button>
</b-button-group>

<generic-multiselect
class="mt-1"
v-if="e.recipe_mealplan === null"
:initial_single_selection="e.unit"
:model="Models.UNIT"
:multiple="false"
@change="e.unit = $event.val; useShoppingListStore().updateObject(e)"
>
</generic-multiselect>

<number-scaler-component :number="e.amount"
@change="e.amount = $event; useShoppingListStore().updateObject(e)"
v-if="e.recipe_mealplan === null"></number-scaler-component>
<hr class="m-2"/>
</b-col>

</b-row>

<b-button variant="success" block @click="useShoppingListStore().createObject({ amount: 0, unit: null, food: food, })"> {{ $t("Add") }}</b-button>
<b-button variant="warning" block @click="detail_modal_visible = false; setFoodIgnoredAndChecked(food)"> {{ $t("Ignore_Shopping") }}</b-button>
<b-button variant="danger" block class="mt-2"
@click="detail_modal_visible = false;useShoppingListStore().deleteEntries(entries)">
Expand Down Expand Up @@ -131,14 +143,15 @@ import {ApiApiFactory} from "@/utils/openapi/api";
import {useUserPreferenceStore} from "@/stores/UserPreferenceStore";
import NumberScalerComponent from "@/components/NumberScalerComponent.vue";
import GenericModalForm from "@/components/Modals/GenericModalForm.vue";
import GenericMultiselect from "@/components/GenericMultiselect.vue";


Vue.use(BootstrapVue)

export default {
name: "ShoppingLineItem",
mixins: [ApiMixin, FormatMixin],
components: {GenericModalForm, NumberScalerComponent},
components: {GenericMultiselect, GenericModalForm, NumberScalerComponent},
props: {
entries: {type: Object,},
},
Expand Down

0 comments on commit 6aa2aa4

Please sign in to comment.