From f36c892bb7373b00dd518f143523d1212f8cdec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ars=C3=A8ne=20Reymond?= <66876397+p0lycarpio@users.noreply.github.com> Date: Tue, 31 Mar 2026 14:34:44 +0200 Subject: [PATCH] feat: improve BaseDialog on mobile and use it globally (#7076) Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com> --- .../Domain/Recipe/RecipeDialogBulkAdd.vue | 115 ++++------- .../Domain/Recipe/RecipeOrganizerDialog.vue | 88 +++----- .../Domain/Recipe/RecipeOrganizerPage.vue | 1 + .../RecipePageInstructions.vue | 188 ++++++++---------- .../Domain/Recipe/RecipeTimelineBadge.vue | 10 +- frontend/components/global/BaseDialog.vue | 15 +- frontend/lib/icons/icons.ts | 2 + frontend/pages/admin/manage/groups/index.vue | 1 + .../pages/admin/manage/households/index.vue | 1 + frontend/pages/admin/manage/users/index.vue | 1 + frontend/pages/shopping-lists/[id].vue | 3 + frontend/pages/shopping-lists/index.vue | 2 + 12 files changed, 179 insertions(+), 248 deletions(-) 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 @@