From 2cdb66684bac18676e8552602e5db1c5e9300eed Mon Sep 17 00:00:00 2001 From: Kuchenpirat Date: Sat, 28 Jun 2025 11:57:20 +0000 Subject: [PATCH 1/2] add optional axios config to requests --- frontend/composables/api/api-client.ts | 27 +++++++++++++------------ frontend/lib/api/types/non-generated.ts | 12 +++++------ frontend/lib/api/user/recipes/recipe.ts | 2 +- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/frontend/composables/api/api-client.ts b/frontend/composables/api/api-client.ts index b8739915a..012d6c0f5 100644 --- a/frontend/composables/api/api-client.ts +++ b/frontend/composables/api/api-client.ts @@ -1,16 +1,17 @@ -import type { AxiosInstance, AxiosResponse } from "axios"; +import type { AxiosInstance, AxiosResponse, AxiosRequestConfig } from "axios"; import type { ApiRequestInstance, RequestResponse } from "~/lib/api/types/non-generated"; import { AdminAPI, PublicApi, UserApi } from "~/lib/api"; import { PublicExploreApi } from "~/lib/api/client-public"; const request = { async safe( - funcCall: (url: string, data: U) => Promise>, + funcCall: (url: string, data: U, config?: AxiosRequestConfig) => Promise>, url: string, data: U, + config?: AxiosRequestConfig, ): Promise> { let error = null; - const response = await funcCall(url, data).catch(function (e) { + const response = await funcCall(url, data, config).catch(function (e) { console.log(e); // Insert Generic Error Handling Here error = e; @@ -22,9 +23,9 @@ const request = { function getRequests(axiosInstance: AxiosInstance): ApiRequestInstance { return { - async get(url: string, params = {}): Promise> { + async get(url: string, params = {}, config?: AxiosRequestConfig): Promise> { let error = null; - const response = await axiosInstance.get(url, params).catch((e) => { + const response = await axiosInstance.get(url, { ...config, params }).catch((e) => { error = e; }); if (response != null) { @@ -33,20 +34,20 @@ function getRequests(axiosInstance: AxiosInstance): ApiRequestInstance { return { response: null, error, data: null }; }, - async post(url: string, data: U) { - return await request.safe(axiosInstance.post, url, data); + async post(url: string, data: U, config?: AxiosRequestConfig) { + return await request.safe(axiosInstance.post, url, data, config); }, - async put(url: string, data: U) { - return await request.safe(axiosInstance.put, url, data); + async put(url: string, data: U, config?: AxiosRequestConfig) { + return await request.safe(axiosInstance.put, url, data, config); }, - async patch>(url: string, data: U) { - return await request.safe(axiosInstance.patch, url, data); + async patch>(url: string, data: U, config?: AxiosRequestConfig) { + return await request.safe(axiosInstance.patch, url, data, config); }, - async delete(url: string) { - return await request.safe(axiosInstance.delete, url, undefined); + async delete(url: string, config?: AxiosRequestConfig) { + return await request.safe(axiosInstance.delete, url, undefined, config); }, }; } diff --git a/frontend/lib/api/types/non-generated.ts b/frontend/lib/api/types/non-generated.ts index 1a9797ccd..801fdd1ca 100644 --- a/frontend/lib/api/types/non-generated.ts +++ b/frontend/lib/api/types/non-generated.ts @@ -1,4 +1,4 @@ -import type { AxiosResponse } from "axios"; +import type { AxiosRequestConfig, AxiosResponse } from "axios"; export type NoUndefinedField = { [P in keyof T]-?: NoUndefinedField> }; @@ -9,11 +9,11 @@ export interface RequestResponse { } export interface ApiRequestInstance { - get(url: string, data?: unknown): Promise>; - post(url: string, data: unknown): Promise>; - put(url: string, data: U): Promise>; - patch>(url: string, data: U): Promise>; - delete(url: string): Promise>; + get(url: string, data?: unknown, config?: AxiosRequestConfig): Promise>; + post(url: string, data: unknown, config?: AxiosRequestConfig): Promise>; + put(url: string, data: U, config?: AxiosRequestConfig): Promise>; + patch>(url: string, data: U, config?: AxiosRequestConfig): Promise>; + delete(url: string, config?: AxiosRequestConfig): Promise>; } export interface PaginationData { diff --git a/frontend/lib/api/user/recipes/recipe.ts b/frontend/lib/api/user/recipes/recipe.ts index cad7d590c..b89a4eb51 100644 --- a/frontend/lib/api/user/recipes/recipe.ts +++ b/frontend/lib/api/user/recipes/recipe.ts @@ -169,7 +169,7 @@ export class RecipeAPI extends BaseCRUDAPI { apiRoute = `${apiRoute}?translateLanguage=${translateLanguage}`; } - return await this.requests.post(apiRoute, formData); + return await this.requests.post(apiRoute, formData, { timeout: 120000 }); } async parseIngredients(parser: Parser, ingredients: Array) { From 084f99b0de8f04cdbd884a010cd65f30dec3fbeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ars=C3=A8ne=20Reymond?= <66876397+p0lycarpio@users.noreply.github.com> Date: Sat, 28 Jun 2025 15:59:58 +0200 Subject: [PATCH 2/2] fix: Nuxt3 upgrades UI fixes & improvements (#5589) --- .../Domain/Cookbook/CookbookPage.vue | 6 +-- .../Household/GroupMealPlanRuleForm.vue | 26 +++++----- .../components/Domain/QueryFilterBuilder.vue | 5 ++ .../Domain/Recipe/RecipeActionMenu.vue | 1 + .../components/Domain/Recipe/RecipeChips.vue | 2 +- .../Domain/Recipe/RecipeDialogSearch.vue | 2 +- .../Domain/Recipe/RecipeExplorerPage.vue | 2 +- .../Recipe/RecipeIngredientListItem.vue | 2 +- .../Domain/Recipe/RecipeIngredients.vue | 1 + .../Domain/Recipe/RecipeOrganizerPage.vue | 2 +- .../Domain/Recipe/RecipeOrganizerSelector.vue | 8 +++- .../Domain/Recipe/RecipePage/RecipePage.vue | 12 +++-- .../RecipePageEditorToolbar.vue | 47 +++++++------------ .../RecipePageParts/RecipePageInfoCard.vue | 10 ++-- .../RecipePageIngredientToolsView.vue | 3 +- .../RecipePageParts/RecipePageOrganizers.vue | 2 +- .../Domain/Recipe/RecipeTimeCard.vue | 3 ++ frontend/components/Domain/SearchFilter.vue | 1 + .../Domain/User/UserInviteDialog.vue | 2 +- .../Domain/User/UserRegistrationForm.vue | 3 +- frontend/components/Layout/DefaultLayout.vue | 2 +- frontend/components/global/AutoForm.vue | 3 -- .../global/BaseCardSectionTitle.vue | 3 +- frontend/components/global/BaseDialog.vue | 1 - frontend/components/global/BaseWizard.vue | 2 +- frontend/components/global/InputQuantity.vue | 1 - frontend/lib/icons/icons.ts | 2 + frontend/pages/admin/maintenance/index.vue | 12 +++-- .../pages/admin/manage/households/[id].vue | 1 - .../pages/admin/manage/households/index.vue | 2 - frontend/pages/admin/manage/users/create.vue | 4 -- frontend/pages/forgot-password.vue | 6 +-- .../pages/g/[groupSlug]/r/create/bulk.vue | 18 +++++-- .../pages/g/[groupSlug]/r/create/html.vue | 1 - frontend/pages/g/[groupSlug]/r/create/zip.vue | 1 - .../pages/g/[groupSlug]/recipes/timeline.vue | 2 +- frontend/pages/group/migrations.vue | 5 +- frontend/pages/household/notifiers.vue | 4 +- frontend/pages/register/index.vue | 10 ++-- frontend/pages/reset-password.vue | 21 ++++----- frontend/pages/user/profile/api-tokens.vue | 25 +++++----- frontend/pages/user/profile/index.vue | 4 +- 42 files changed, 137 insertions(+), 133 deletions(-) diff --git a/frontend/components/Domain/Cookbook/CookbookPage.vue b/frontend/components/Domain/Cookbook/CookbookPage.vue index 222419008..8793cef26 100644 --- a/frontend/components/Domain/Cookbook/CookbookPage.vue +++ b/frontend/components/Domain/Cookbook/CookbookPage.vue @@ -24,8 +24,7 @@
+ {{ $globals.icons.pages }} - {{ book.name }} - diff --git a/frontend/components/Domain/Recipe/RecipeActionMenu.vue b/frontend/components/Domain/Recipe/RecipeActionMenu.vue index 22a633e8a..0f77fbd99 100644 --- a/frontend/components/Domain/Recipe/RecipeActionMenu.vue +++ b/frontend/components/Domain/Recipe/RecipeActionMenu.vue @@ -74,6 +74,7 @@ :size="$vuetify.display.xs ? 'small' : undefined" :color="btn.color" variant="elevated" + :icon="$vuetify.display.xs" @click="emitHandler(btn.event)" > diff --git a/frontend/components/Domain/Recipe/RecipeChips.vue b/frontend/components/Domain/Recipe/RecipeChips.vue index 577e80fff..7649bc58c 100644 --- a/frontend/components/Domain/Recipe/RecipeChips.vue +++ b/frontend/components/Domain/Recipe/RecipeChips.vue @@ -10,7 +10,7 @@ v-for="category in items.slice(0, limit)" :key="category.name" label - class="ma-1" + class="mr-1 mt-1" color="accent" variant="flat" :size="small ? 'small' : 'default'" diff --git a/frontend/components/Domain/Recipe/RecipeDialogSearch.vue b/frontend/components/Domain/Recipe/RecipeDialogSearch.vue index df78a36d2..40e354868 100644 --- a/frontend/components/Domain/Recipe/RecipeDialogSearch.vue +++ b/frontend/components/Domain/Recipe/RecipeDialogSearch.vue @@ -17,7 +17,7 @@ id="arrow-search" v-model="search.query.value" autofocus - variant="solo-filled" + variant="solo" flat autocomplete="off" bg-color="primary-lighten-1" diff --git a/frontend/components/Domain/Recipe/RecipeExplorerPage.vue b/frontend/components/Domain/Recipe/RecipeExplorerPage.vue index caa06b1f1..e08d9ed59 100644 --- a/frontend/components/Domain/Recipe/RecipeExplorerPage.vue +++ b/frontend/components/Domain/Recipe/RecipeExplorerPage.vue @@ -1,7 +1,7 @@