From 6953f763d27266a1e9bfce221fd93a91cf5a9d8d Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Fri, 22 Apr 2022 21:13:00 +0200 Subject: [PATCH] improved source url field rendering --- cookbook/serializer.py | 2 +- vue/src/apps/RecipeView/RecipeView.vue | 6 ++- vue/src/locales/en.json | 1 + vue/src/utils/openapi/api.ts | 59 +++++++++++++++++++++++--- 4 files changed, 60 insertions(+), 8 deletions(-) diff --git a/cookbook/serializer.py b/cookbook/serializer.py index d913be516..0f3efc0b3 100644 --- a/cookbook/serializer.py +++ b/cookbook/serializer.py @@ -645,7 +645,7 @@ class RecipeSerializer(RecipeBaseSerializer): model = Recipe fields = ( 'id', 'name', 'description', 'image', 'keywords', 'steps', 'working_time', - 'waiting_time', 'created_by', 'created_at', 'updated_at', + 'waiting_time', 'created_by', 'created_at', 'updated_at','source_url', 'internal', 'nutrition', 'servings', 'file_path', 'servings_text', 'rating', 'last_cooked', ) read_only_fields = ['image', 'created_by', 'created_at'] diff --git a/vue/src/apps/RecipeView/RecipeView.vue b/vue/src/apps/RecipeView/RecipeView.vue index f351a672d..3250edd9c 100644 --- a/vue/src/apps/RecipeView/RecipeView.vue +++ b/vue/src/apps/RecipeView/RecipeView.vue @@ -139,8 +139,10 @@ > -
{{ $t("Imported_From") }}
- {{ recipe.source_url }} +
+
{{ $t("Imported_From") }}
+ {{ recipe.source_url }} +
diff --git a/vue/src/locales/en.json b/vue/src/locales/en.json index e319332ce..8e5492ab0 100644 --- a/vue/src/locales/en.json +++ b/vue/src/locales/en.json @@ -359,6 +359,7 @@ "last_viewed": "Last Viewed", "created_on": "Created On", "updatedon": "Updated On", + "Imported_From": "Imported from", "advanced_search_settings": "Advanced Search Settings", "nothing_planned_today": "You have nothing planned for today!", "no_pinned_recipes": "You have no pinned recipes!", diff --git a/vue/src/utils/openapi/api.ts b/vue/src/utils/openapi/api.ts index c88cb5e21..cfaa988c3 100644 --- a/vue/src/utils/openapi/api.ts +++ b/vue/src/utils/openapi/api.ts @@ -130,6 +130,37 @@ export interface BookmarkletImport { */ created_at?: string; } +/** + * + * @export + * @interface BookmarkletImportList + */ +export interface BookmarkletImportList { + /** + * + * @type {number} + * @memberof BookmarkletImportList + */ + id?: number; + /** + * + * @type {string} + * @memberof BookmarkletImportList + */ + url?: string | null; + /** + * + * @type {string} + * @memberof BookmarkletImportList + */ + created_by?: string; + /** + * + * @type {string} + * @memberof BookmarkletImportList + */ + created_at?: string; +} /** * * @export @@ -472,7 +503,7 @@ export interface FoodRecipe { * @type {string} * @memberof FoodRecipe */ - name?: string; + name: string; /** * * @type {string} @@ -537,7 +568,7 @@ export interface FoodSubstitute { * @type {string} * @memberof FoodSubstitute */ - name?: string; + name: string; } /** * @@ -752,6 +783,12 @@ export interface Ingredient { * @memberof Ingredient */ original_text?: string | null; + /** + * + * @type {string} + * @memberof Ingredient + */ + used_in_recipes?: string; } /** * @@ -1653,6 +1690,12 @@ export interface Recipe { * @memberof Recipe */ updated_at?: string; + /** + * + * @type {string} + * @memberof Recipe + */ + source_url?: string | null; /** * * @type {boolean} @@ -1923,6 +1966,12 @@ export interface RecipeIngredients { * @memberof RecipeIngredients */ original_text?: string | null; + /** + * + * @type {string} + * @memberof RecipeIngredients + */ + used_in_recipes?: string; } /** * @@ -2191,7 +2240,7 @@ export interface RecipeSimple { * @type {string} * @memberof RecipeSimple */ - name?: string; + name: string; /** * * @type {string} @@ -10374,7 +10423,7 @@ export const ApiApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listBookmarkletImports(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + async listBookmarkletImports(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.listBookmarkletImports(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -12206,7 +12255,7 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listBookmarkletImports(options?: any): AxiosPromise> { + listBookmarkletImports(options?: any): AxiosPromise> { return localVarFp.listBookmarkletImports(options).then((request) => request(axios, basePath)); }, /**