diff --git a/vue/src/components/FoodEditor.vue b/vue/src/components/FoodEditor.vue
index f506c58b8..4b111ceb6 100644
--- a/vue/src/components/FoodEditor.vue
+++ b/vue/src/components/FoodEditor.vue
@@ -1,141 +1,153 @@
-
-
-
{{ food.name }} {{ food.plural_name }}
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+
+
{{ food.name }} {{
+ food.plural_name
+ }}
+
+
+
+
- {{ $t('Properties') }} {{
- food.name
- }}
-
+
+
+
+ {{ $t('OnHand') }}
+
+
+
+ {{
+ $t('Ignore_Shopping')
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{
+ $t('substitute_siblings')
+ }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{
+ $t('reset_children')
+ }}
+
+
+
-
- {{$t('Advanced')}}
-
-
-
-
-
-
-
- {{ $t('OnHand') }}
-
-
-
- {{
- $t('Ignore_Shopping')
- }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{
- $t('substitute_siblings')
- }}
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $t('reset_children') }}
-
-
-
-
- {{ $t('Save') }}
-
+
+
-
-
+
+ {{ $t('Save') }}
+ {{ $t('Advanced') }}
+
+
@@ -147,7 +159,7 @@ import {BootstrapVue} from "bootstrap-vue"
import "bootstrap-vue/dist/bootstrap-vue.css"
import {ApiApiFactory} from "@/utils/openapi/api";
import GenericMultiselect from "@/components/GenericMultiselect.vue";
-import {ApiMixin, StandardToasts} from "@/utils/utils";
+import {ApiMixin, formFunctions, getForm, StandardToasts} from "@/utils/utils";
Vue.use(BootstrapVue)
@@ -159,6 +171,22 @@ export default {
components: {
GenericMultiselect
},
+ props: {
+ id: {type: String, default: 'id_food_edit_modal_modal'},
+ show: {required: true, type: Boolean, default: false},
+ },
+ watch: {
+ show: function () {
+ console.log('trigger')
+ if (this.show) {
+ console.log('show modal')
+ this.$bvModal.show(this.id)
+ } else {
+ console.log('show modal false')
+ this.$bvModal.hide(this.id)
+ }
+ },
+ },
data() {
return {
food: undefined,
@@ -166,6 +194,7 @@ export default {
}
},
mounted() {
+ this.$bvModal.show(this.id)
this.$i18n.locale = window.CUSTOM_LOCALE
let apiClient = new ApiApiFactory()
apiClient.retrieveFood('1').then((r) => {
@@ -174,7 +203,7 @@ export default {
let property_types = []
let property_values = []
- let p1 = apiClient.listFoodPropertyTypes().then((r) => {
+ let p1 = apiClient.listPropertyTypes().then((r) => {
property_types = r.data
})
@@ -234,7 +263,10 @@ export default {
}
})
- }
+ },
+ cancelAction: function () {
+ this.$emit("hidden", "")
+ },
},
}
diff --git a/vue/src/components/FoodPropertyViewComponent.vue b/vue/src/components/FoodPropertyViewComponent.vue
index fe3d6d591..6278ffe61 100644
--- a/vue/src/components/FoodPropertyViewComponent.vue
+++ b/vue/src/components/FoodPropertyViewComponent.vue
@@ -2,23 +2,21 @@
-
-
-
+
+
+
{{ $t('Properties') }}
-
-
-
-
{{ $t('per_serving') }}
-
{{ $t('total') }}
+
+
+ {{ $t('per_serving') }}
+ {{ $t('total') }}
-
-
-
+
+
diff --git a/vue/src/components/Modals/GenericModalForm.vue b/vue/src/components/Modals/GenericModalForm.vue
index 4bf4b42ed..5012a2c76 100644
--- a/vue/src/components/Modals/GenericModalForm.vue
+++ b/vue/src/components/Modals/GenericModalForm.vue
@@ -1,10 +1,7 @@
-
-
-
-
+
@@ -43,13 +40,13 @@