diff --git a/cookbook/views/api.py b/cookbook/views/api.py index 163572f10f..b3c8cb8859 100644 --- a/cookbook/views/api.py +++ b/cookbook/views/api.py @@ -2037,7 +2037,7 @@ def get_external_file_link(request, recipe_id): def get_recipe_file(request, recipe_id): recipe = get_object_or_404(Recipe, pk=recipe_id, space=request.space) if recipe.storage: - return FileResponse(get_recipe_provider(recipe).get_file(recipe)) + return FileResponse(get_recipe_provider(recipe).get_file(recipe), filename=f'{recipe.name}.pdf') else: return FileResponse() diff --git a/recipes/settings.py b/recipes/settings.py index cdd3d4cf56..baa95019c2 100644 --- a/recipes/settings.py +++ b/recipes/settings.py @@ -354,6 +354,7 @@ def extract_comma_list(env_key, default=None): ] SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') +X_FRAME_OPTIONS = "SAMEORIGIN" OAUTH2_PROVIDER = {'SCOPES': {'read': 'Read scope', 'write': 'Write scope', 'bookmarklet': 'only access to bookmarklet'}} READ_SCOPE = 'read' diff --git a/vue3/src/components/display/ExternalRecipeViewer.vue b/vue3/src/components/display/ExternalRecipeViewer.vue new file mode 100644 index 0000000000..7cab5823ae --- /dev/null +++ b/vue3/src/components/display/ExternalRecipeViewer.vue @@ -0,0 +1,47 @@ + + + + + \ No newline at end of file diff --git a/vue3/src/components/display/RecipeView.vue b/vue3/src/components/display/RecipeView.vue index 3e3b76e13d..c998dc7e1a 100644 --- a/vue3/src/components/display/RecipeView.vue +++ b/vue3/src/components/display/RecipeView.vue @@ -14,6 +14,7 @@ @@ -83,6 +90,9 @@ import RecipeActivity from "@/components/display/RecipeActivity.vue"; import RecipeContextMenu from "@/components/inputs/RecipeContextMenu.vue"; import KeywordsComponent from "@/components/display/KeywordsBar.vue"; import RecipeImage from "@/components/display/RecipeImage.vue"; +import PdfViewer from "../../../../vue/src/components/PdfViewer.vue"; +import ImageViewer from "../../../../vue/src/components/ImageViewer.vue"; +import ExternalRecipeViewer from "@/components/display/ExternalRecipeViewer.vue"; const props = defineProps({ recipe: { diff --git a/vue3/src/openapi/apis/ApiApi.ts b/vue3/src/openapi/apis/ApiApi.ts index 335c72484f..35f741f775 100644 --- a/vue3/src/openapi/apis/ApiApi.ts +++ b/vue3/src/openapi/apis/ApiApi.ts @@ -4023,7 +4023,7 @@ export class ApiApi extends runtime.BaseAPI { /** */ - async apiGetRecipeFileRetrieveRaw(requestParameters: ApiGetRecipeFileRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async apiGetRecipeFileRetrieveRaw(requestParameters: ApiGetRecipeFileRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction) { if (requestParameters['recipeId'] == null) { throw new runtime.RequiredError( 'recipeId', @@ -4046,13 +4046,13 @@ export class ApiApi extends runtime.BaseAPI { query: queryParameters, }, initOverrides); - return new runtime.VoidApiResponse(response); + return response; } /** */ - async apiGetRecipeFileRetrieve(requestParameters: ApiGetRecipeFileRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { - await this.apiGetRecipeFileRetrieveRaw(requestParameters, initOverrides); + async apiGetRecipeFileRetrieve(requestParameters: ApiGetRecipeFileRetrieveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction){ + return await this.apiGetRecipeFileRetrieveRaw(requestParameters, initOverrides); } /**