diff --git a/hartmann-foto-documentation-app/pom.xml b/hartmann-foto-documentation-app/pom.xml index 86d8c81..92a347c 100644 --- a/hartmann-foto-documentation-app/pom.xml +++ b/hartmann-foto-documentation-app/pom.xml @@ -37,8 +37,13 @@ - - + + + org.apache.pdfbox + pdfbox + 3.0.5 + + org.wildfly.security diff --git a/hartmann-foto-documentation-app/src/main/java/marketing/heyday/hartmann/fotodocumentation/rest/PictureResource.java b/hartmann-foto-documentation-app/src/main/java/marketing/heyday/hartmann/fotodocumentation/rest/PictureResource.java index 4632df2..6e6a89b 100644 --- a/hartmann-foto-documentation-app/src/main/java/marketing/heyday/hartmann/fotodocumentation/rest/PictureResource.java +++ b/hartmann-foto-documentation-app/src/main/java/marketing/heyday/hartmann/fotodocumentation/rest/PictureResource.java @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import jakarta.ejb.EJB; import jakarta.enterprise.context.RequestScoped; import jakarta.ws.rs.*; +import jakarta.ws.rs.core.CacheControl; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.Response.ResponseBuilder; import jakarta.ws.rs.core.Response.Status; @@ -64,9 +65,9 @@ public class PictureResource { @GZIP @GET @Path("image/{id}") - @Produces(JSON_OUT) - @Operation(summary = "Get customer value") - @ApiResponse(responseCode = "200", description = "Successfully retrieved picture value") + @Produces({ "image/png", "image/jpg" }) + @Operation(summary = "Get picture") + @ApiResponse(responseCode = "200", description = "Successfully retrieved picture") public Response doGetPictureImage(@PathParam("id") Long id, @QueryParam("size") int size) { LOG.debug("Get Picture for id " + id + " with size " + size); byte[] retVal = pictureService.getImage(id, size); diff --git a/hartmann-foto-documentation-frontend/lib/pages/customer/customer_widget.dart b/hartmann-foto-documentation-frontend/lib/pages/customer/customer_widget.dart index 317a5f5..0f3665a 100644 --- a/hartmann-foto-documentation-frontend/lib/pages/customer/customer_widget.dart +++ b/hartmann-foto-documentation-frontend/lib/pages/customer/customer_widget.dart @@ -145,6 +145,7 @@ class _CustomerWidgetState extends State { padding: const EdgeInsets.all(16.0), child: Row( crossAxisAlignment: CrossAxisAlignment.start, + spacing: 8.0, children: [ Expanded( flex: 1, @@ -209,6 +210,7 @@ class _CustomerWidgetState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, + spacing: 8.0, children: [ Expanded( flex: 1, diff --git a/hartmann-foto-documentation-frontend/lib/pages/customer/picture_widget.dart b/hartmann-foto-documentation-frontend/lib/pages/customer/picture_widget.dart index 2c042fe..54cc4a7 100644 --- a/hartmann-foto-documentation-frontend/lib/pages/customer/picture_widget.dart +++ b/hartmann-foto-documentation-frontend/lib/pages/customer/picture_widget.dart @@ -111,15 +111,15 @@ class _PictureWidgetState extends State { return LayoutBuilder( builder: (context, constraints) { final isNarrow = constraints.maxWidth < 800; - final maxImageWidth = constraints.maxWidth * 0.5; + final imageWidth = isNarrow ? constraints.maxWidth : constraints.maxWidth * 0.5; return SingleChildScrollView( child: isNarrow ? Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - ConstrainedBox( - constraints: BoxConstraints(maxWidth: maxImageWidth), + SizedBox( + width: imageWidth, child: _imageWidget(selectedPicture), ), const SizedBox(height: 32), @@ -130,8 +130,8 @@ class _PictureWidgetState extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - ConstrainedBox( - constraints: BoxConstraints(maxWidth: maxImageWidth), + SizedBox( + width: imageWidth, child: _imageWidget(selectedPicture), ), const SizedBox(width: 32), @@ -259,7 +259,6 @@ class _PictureWidgetState extends State { thumbVisibility: true, child: SingleChildScrollView( controller: _commentScrollController, - padding: const EdgeInsets.all(8.0), child: Text( dto.comment ?? "", style: contentStyle, @@ -424,14 +423,11 @@ class _PictureWidgetState extends State { } void _actionNavigateToPicture(int index) { - print("navigate. too $index"); final pictures = _customerDto.pictures; if (index >= 0 && index < pictures.length) { setState(() { _selectedPicture = pictures[index]; }); - } else { - print("empty"); } } }