From ac41a55d4fa440fd39cb3188364deb1a870b754b Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Thu, 2 Jan 2025 18:02:54 +0100 Subject: [PATCH] ingredient editor improvements --- .../components/dialogs/ModelMergeDialog.vue | 2 +- vue3/src/components/inputs/ModelSelect.vue | 13 +++- vue3/src/pages/IngredientEditorPage.vue | 59 +++++++++++++++++-- 3 files changed, 67 insertions(+), 7 deletions(-) diff --git a/vue3/src/components/dialogs/ModelMergeDialog.vue b/vue3/src/components/dialogs/ModelMergeDialog.vue index ba89927ac0..edaebafe42 100644 --- a/vue3/src/components/dialogs/ModelMergeDialog.vue +++ b/vue3/src/components/dialogs/ModelMergeDialog.vue @@ -75,7 +75,7 @@ function mergeModel() { genericModel.merge(props.source, target.value).then(r => { useMessageStore().addPreparedMessage(PreparedMessage.UPDATE_SUCCESS) - emit('change') + emit('change', target.value) if (automate.value && target.value != null && Object.hasOwn(props.source, 'name') && Object.hasOwn(target.value, 'name')) { let automation = { diff --git a/vue3/src/components/inputs/ModelSelect.vue b/vue3/src/components/inputs/ModelSelect.vue index ca9de58dd8..895a04eb37 100644 --- a/vue3/src/components/inputs/ModelSelect.vue +++ b/vue3/src/components/inputs/ModelSelect.vue @@ -1,8 +1,12 @@ @@ -72,7 +81,7 @@ const props = defineProps({ label: {type: String, default: ''}, hint: {type: String, default: ''}, - density: {type: String as PropType<''|'compact'|'comfortable'>, default: ''}, + density: {type: String as PropType<'' | 'compact' | 'comfortable'>, default: ''}, searchOnLoad: {type: Boolean, default: false}, }) diff --git a/vue3/src/pages/IngredientEditorPage.vue b/vue3/src/pages/IngredientEditorPage.vue index 6200615612..ecc6b68b31 100644 --- a/vue3/src/pages/IngredientEditorPage.vue +++ b/vue3/src/pages/IngredientEditorPage.vue @@ -8,10 +8,56 @@ text="With the ingredient editor you can edit all Ingredients that use a certain Food and/or Unit at once. This can be used to easily correct errors or change multiple recipes at once."> - + + + - + + + @@ -27,6 +73,7 @@ :expanded="items.flatMap((i:Ingredient) => i.id)" :page="tablePage" :loading="ingredientsLoading" + disable-sort >