diff --git a/frontend/components/Domain/Recipe/RecipeDialogBulkAdd.vue b/frontend/components/Domain/Recipe/RecipeDialogBulkAdd.vue index dc6bfae76..64d6b00e6 100644 --- a/frontend/components/Domain/Recipe/RecipeDialogBulkAdd.vue +++ b/frontend/components/Domain/Recipe/RecipeDialogBulkAdd.vue @@ -1,91 +1,60 @@ diff --git a/frontend/components/Domain/Recipe/RecipeOrganizerDialog.vue b/frontend/components/Domain/Recipe/RecipeOrganizerDialog.vue index 18b9ac672..61dca7a56 100644 --- a/frontend/components/Domain/Recipe/RecipeOrganizerDialog.vue +++ b/frontend/components/Domain/Recipe/RecipeOrganizerDialog.vue @@ -1,62 +1,30 @@ @@ -65,6 +33,8 @@ import { useUserApi } from "~/composables/api"; import { useCategoryStore, useTagStore, useToolStore } from "~/composables/store"; import { type RecipeOrganizer, Organizer } from "~/lib/api/types/non-generated"; +const { $globals } = useNuxtApp(); + const CREATED_ITEM_EVENT = "created-item"; interface Props { @@ -115,18 +85,21 @@ const properties = computed(() => { return { title: i18n.t("tag.create-a-tag"), label: i18n.t("tag.tag-name"), + icon: $globals.icons.tags, api: userApi.tags, }; case Organizer.Tool: return { title: i18n.t("tool.create-a-tool"), label: i18n.t("tool.tool-name"), + icon: $globals.icons.potSteam, api: userApi.tools, }; default: return { title: i18n.t("category.create-a-category"), label: i18n.t("category.category-name"), + icon: $globals.icons.categories, api: userApi.categories, }; } @@ -139,12 +112,9 @@ const rules = { async function select() { if (store) { // @ts-expect-error the same state is used for different organizer types, which have different requirements - await store.actions.createOne({ name: name.value, onHand: onHand.value }); + const newItem = await store.actions.createOne({ name: name.value, onHand: onHand.value }); + emit(CREATED_ITEM_EVENT, newItem); } - - const newItem = store.store.value.find(item => item.name === name.value); - - emit(CREATED_ITEM_EVENT, newItem); dialog.value = false; } diff --git a/frontend/components/Domain/Recipe/RecipeOrganizerPage.vue b/frontend/components/Domain/Recipe/RecipeOrganizerPage.vue index 66fe5c41c..fdc49e013 100644 --- a/frontend/components/Domain/Recipe/RecipeOrganizerPage.vue +++ b/frontend/components/Domain/Recipe/RecipeOrganizerPage.vue @@ -26,6 +26,7 @@ v-if="updateTarget" v-model="dialogs.update" :title="$t('general.update')" + :icon="$globals.icons.edit" can-confirm @confirm="updateOne()" > diff --git a/frontend/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInstructions.vue b/frontend/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInstructions.vue index ab3cef376..fc764f9ec 100644 --- a/frontend/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInstructions.vue +++ b/frontend/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInstructions.vue @@ -1,117 +1,101 @@