Added a `Zoom` property with a value of `1.3` to the `DxReportViewer` component in `ReportViewer.razor`. This change adjusts the default display scale to improve readability and enhance the user experience.
Simplified the `OpenSignaturePopupAsync` method by converting it to a synchronous `void` method and removing unnecessary asynchronous calls. Introduced a new `OnPopupShownAsync` method to handle popup initialization logic.
Updated the `<Popup>` component to include the `Shown="OnPopupShownAsync"` attribute and re-added the `CloseOnOutsideClick="false"` attribute. Improved the logic for opening the signature popup by setting the active tab and resetting validation messages inline.
Enhanced the `OnAfterRenderAsync` lifecycle method to include additional checks for `Report`, annotations, and signature state before triggering JavaScript runtime calls. These changes improve the popup's behavior and overall state management.
Modified `<DxPopup>` properties to prevent closing via Escape,
outside clicks, or the close button. Updated the "Schliessen"
button to always be enabled, regardless of `_capturedSignature`
state.
Updated the signature button text and SVG icon for clarity.
Enhanced the `DxPopup` component with better interaction
properties (`CloseOnEscape` and `CloseOnOutsideClick`).
Disabled the "Close" button in the popup when no signature
is captured.
Reformatted and restructured constants and fields in the
`@code` block for readability. Reintroduced previously
removed fields, constants, and methods to ensure
functionality. Added a conditional block in `LogoutAsync`
to open the signature popup when the user has access.
Performed general cleanup and code reorganization to
improve maintainability.
Updated `.annot-sig-cb-wrapper` and related classes to improve
appearance, interactivity, and hover effects. Key changes include:
- Increased `border-radius` and adjusted `font-size`, `font-weight`,
and `padding` for a cleaner look.
- Replaced solid background and borders with gradient backgrounds
and updated `box-shadow` for modern styling.
- Added `cursor` property and refined `transition` effects for
smoother interactions.
- Updated hover and checked states with dynamic `filter` and
enhanced `box-shadow`.
- Hid `.annot-sig-cb` checkbox and improved `.annot-sig-cb__label`
readability with `letter-spacing`.
Simplified the `signatureInformation` string formatting by removing the `"Empfaengerunterschrift\n"` prefix and starting directly with `signerFullName`. Adjusted `infoHeight` from `65F` to `48.75F` to refine layout spacing.
Added a `BackColor` property to both `XRPictureBox` and `XRLabel` for consistent background styling (`Color.FromArgb(219, 219, 219)`). Updated `XRLabel` properties: adjusted `BoundsF` to offset `labelY` by `-5` for better vertical alignment and changed `TextAlignment` from `TopLeft` to `TopCenter`.
Made minor formatting adjustments to improve the visual consistency of signature and label elements.
Enhanced documentation for the EnvelopeGenerator system:
- Added purpose section describing its functionality as a digital document signing system.
- Documented solution structure, listing projects, frameworks, and purposes.
- Highlighted key files in `ReceiverUI` and `API` with their roles.
- Explained `AnnotationDto` coordinate system and unit conversions.
- Detailed the signing flow in `ReceiverUI`, including page load, signature popup, and export steps.
- Documented JavaScript checkbox overlay logic for annotations.
- Provided a breakdown of `StampSignaturesOnPdf` using iText7.
- Described `BuildFreshBaseReport` behavior in real and dev modes.
- Listed NuGet packages with versions and purposes.
- Added "Mistakes History" to prevent repeated errors.
- Clarified why DevExpress X.509 signing article does not apply.
- Summarized development sessions in a change log.
Changed the `Page` property from `int?` to `int` to ensure it always has a value. Similarly, changed the `X` and `Y` properties from `double?` to `double` to enforce non-nullable values for horizontal and vertical positions.
- Added dependency injection for `AnnotationService`, `DocumentService`, and `AuthService` in `ReportViewer.razor`.
- Improved signature button logic with dynamic appearance and feedback.
- Introduced annotation checkbox overlays for marking signature fields.
- Refactored signature saving and application logic into `SaveSignatureAsync` and `SubmitSignaturesAsync`.
- Added `BuildFreshBaseReport` and `AddAnnotationPlaceholders` for dynamic report creation.
- Implemented annotation-specific signature placement with `AddSignatureAtAnnotation`.
- Enhanced state management for annotations and signature overlays.
- Updated `app.css` with styles for annotation checkboxes.
- Added cache-control headers and versioned JavaScript in `index.html`.
- Improved `receiver-signature.js` with annotation checkbox management, optimized signature pad logic, and debugging utilities.
- Performed general code cleanup and optimization for maintainability.
Replaced hardcoded `envelopeId` with dynamic retrieval from
user claims. Reintroduced and updated error handling logic
to validate the `envelopeId` and log detailed errors when
parsing fails. Improved robustness by returning a 500 error
for invalid or missing envelope claims.
Introduce a `Transforms` section in `yarp.json` for the `receiver-ui` route to enforce a no-cache policy. This includes setting the following response headers for all responses:
- `Cache-Control`: `no-cache, no-store, must-revalidate`
- `Pragma`: `no-cache`
- `Expires`: `0`
These changes ensure that client-side caching is disabled for the `receiver-ui` route.
Added `AnnotationDto` to represent signature annotation positions,
including properties for ID, page, and coordinates, with detailed
documentation on coordinate systems. Implemented `AnnotationService`
to fetch annotation data from an API endpoint, using `HttpClient`
and supporting cancellation tokens. Registered `AnnotationService`
in the DI container to enable its use across the application.
Provided development setup details for working with fake data
via YARP-proxied routes.
Added a new route configuration `receiver-ui-annotation-fake` to the `yarp.json` file. This route is associated with the `receiver-ui` cluster, has an `Order` value of `10`, and matches requests to `/api/Annotation/{envelopeKey}` with `GET` and `HEAD` methods. A path transformation rewrites the route to `/fake-data/annotations.json`.
The `Type` property in `AnnotationCreateDto` was marked as obsolete with the note: "Not required for DevExpress."
Added `X` and `Y` properties to represent the horizontal and vertical positions of the signature field on the page. Both properties use DevExpress units (hundredths of an inch) with the origin at the top-left corner of the page.
Detailed documentation was added for `X` and `Y`, including differences in coordinate systems and unit conversions between DevExpress, PSPDFKit, and GDPicture.
Added three new annotation objects to `annotations.json`.
Each annotation includes an `id`, `page`, `x`, and `y` property.
The annotations are for pages 1, 2, and 3, all with the same
coordinates (390.0, 980.0).
Refactored the `AnnotationCreateDto` class:
- Changed `ElementId` from `int` to `long` and made it mutable.
- Marked `Name`, `Value`, and `Type` as `[Obsolete]` with defaults.
- Added `[Obsolete]` attributes to `Width` and `Height`.
- Introduced a new `Page` property to replace `SignatureDto`.
Updated `appsettings.json`:
- Set `Api.BaseUrl` to an empty string.
Introduced a "Logout" button in `ReportViewer.razor` that is displayed when an `EnvelopeKey` is present. The button includes a spinner to indicate progress during the logout process.
Added the `LogoutAsync` method in `ReportViewer.razor` to handle the logout operation, preventing multiple attempts and navigating the user to the login page upon success.
Implemented `LogoutEnvelopeReceiverAsync` in `AuthService` to send a POST request to remove the per-envelope receiver cookie. This ensures proper backend handling of the logout process.
Improved user experience by providing a responsive and clear logout mechanism for envelope-based sessions.
Added a new `/login/{**catch-all}` route in `yarp.json` for the `receiver-ui` cluster. Updated `Login.razor` with a modernized UI, including a gradient header, improved error handling, and a toggle for password visibility. Integrated `AuthService` for API-based login validation.
Refactored `Login.razor` logic to handle login outcomes (`Success`, `InvalidCode`, `NotFound`, `Error`) using the new `EnvelopeLoginResult` enum. Added `LoginEnvelopeReceiverAsync` method in `AuthService` to handle login requests via `POST /api/Auth/envelope-receiver/{key}`. Improved code maintainability and user experience.
Introduced a new login page (`Login.razor`) to handle user authentication via access codes. Implemented `AuthService` to validate access codes through an API. Updated `ReportViewer.razor` to check user access and redirect unauthorized users to the login page. Modified `Program.cs` to register `AuthService` for dependency injection. Enhanced document fetching in `ReportViewer.razor` to ensure secure access control.
Replaced `DxPdfViewer` with `DxReportViewer` to unify handling of
both PDF and report rendering. Removed conditional logic for
`PdfBytes` and directly initialized `XtraReport` with PDF content
using `XRPdfContent`. Simplified `OnInitializedAsync` to fetch
PDF content, create a report, and store it in `ReportStorage`.
Removed unused fields (`PdfViewerUrl`, `PdfBytes`, and
`SignedPdfBytes`) and redundant code related to PDF handling.
Refactored the signature handling process by introducing a new
`Report` instance creation step in the `SignatureApplied` block
to streamline signed report generation. Added a validation check
in `ExportSignedPdfAsync` to ensure the `Report` object is not
null before proceeding with export. Removed redundant code for
manual signed report creation and simplified the export logic
by directly invoking `reportViewer!.ExportToAsync`. Incremented
`ViewerKey` to refresh the report viewer after signing.
Updated the `OnInitializedAsync` method in `ReportViewer.razor`
to include a check for `AppOptions.Value.ForceToUseFakeDocument`.
This ensures that the application can bypass fetching the
actual document when the configuration option is enabled.
Introduced a new `ForceToUseFakeDocument` property in `ApiOptions` to control whether the application uses a fake document for testing or bypasses certain conditions for document loading. Updated `ReportViewer.razor` to respect this configuration, including changes to conditional rendering logic and dependency injection for `IOptions<ApiOptions>`.
Removed test code that forced `EnvelopeKey` to `null` during initialization. Updated `appsettings.json` to include the new `ForceToUseFakeDocument` property with a default value of `true`. Added necessary `using` directives and dependencies for the updated functionality.
Introduced a new `DocumentService` class to handle fetching
PDF document bytes from an API endpoint. The service uses
`HttpClient` for HTTP communication and `IOptions<ApiOptions>`
for accessing API configuration. Added the `GetDocumentAsync`
method to perform the HTTP GET request, handle responses, and
return the document bytes along with the HTTP status code.
Included necessary `using` directives and encapsulated the
service in the `EnvelopeGenerator.ReceiverUI.Services` namespace.
Added a new `ApiOptions` class to encapsulate API configuration,
including the `BaseUrl` property and `SectionName` constant.
Registered `ApiOptions` in the dependency injection container
in `Program.cs` and bound it to the "Api" section in the
configuration file. Updated `appsettings.json` to include the
"Api" section with a `BaseUrl` value of "https://localhost:8088".
Integrated DevExpress WebAssembly Blazor Report Viewer and PDF Viewer to enable report and PDF rendering in the application.
Registered `EnvelopeGenerator.ReceiverUI.Services.DocumentService` for document handling. Configured `DevExpress Blazor Reporting WebAssembly` in development mode.
Added a custom implementation of `IDataSourceWizardJsonConnectionStorage` to manage JSON data connections in the data source wizard.
Upgraded DevExpress package references in `EnvelopeGenerator.ReceiverUI.csproj` from version 25.2.3 to 25.2.7, including:
- `DevExpress.Drawing.Skia`
- `DevExpress.Blazor.Reporting.JSBasedControls`
- `DevExpress.Blazor.Reporting.Viewer`
Added a new package reference for `DevExpress.Blazor.PdfViewer` (version 25.2.7) to enable PDF viewing functionality.
Updated `_Imports.razor` to include `@using DevExpress.Blazor.PdfViewer` for PdfViewer component support.
Refactored the `CreateEnvelopeCommand` method in `Fake.cs` to delegate user authentication logic to the `WithAuth` method. Added a new `CreateEnvelopeCommands` method to generate multiple commands for a set of user IDs.
Removed `ConstantsTests.cs`, which contained tests for the `Normalize` method of the `EnvelopeSigningType` enumeration, as the method or its tests are no longer relevant.
Replaced the `Authorize` method with a new `WithAuth` method
in the `CreateEnvelopeCommand` class. The new method sets
the `UserId` property and returns the current instance,
enabling method chaining and improving usability.
The `<TargetFrameworks>` property in `EnvelopeGenerator.API.csproj` was downgraded from `net9.0` to `net8.0`. Conditional package references were added for `Microsoft.AspNetCore.OpenApi` and `Microsoft.EntityFrameworkCore.SqlServer` to support both `net8.0` and `net9.0`.
Added `itext` and `itext.bouncy-castle-adapter` (version 8.0.5) as new dependencies. Updated the project to include a reference to `EnvelopeGenerator.PdfEditor.csproj`. Removed unconditional `Microsoft.AspNetCore.OpenApi` reference and replaced it with conditional references based on the target framework.
Introduced a preprocessor directive `#if NET9_0_OR_GREATER` to conditionally include the `app.MapOpenApi();` method call. This ensures that the `MapOpenApi` functionality is only executed when the application targets .NET 9.0 or later, maintaining compatibility with earlier .NET versions.
Introduced a conditional compilation directive (`#if NET9_0_OR_GREATER`) to register the `AddOpenApi` service only when the application is targeting .NET 9.0 or later. This ensures compatibility and avoids unnecessary service registration for earlier .NET versions.
Renamed the route "receiver-ui" to "receiver-ui-receiver" and added new routes for more specific path handling:
- "receiver-ui-receiver" for `/receiver/{**catch-all}`.
- "receiver-ui-sender" for `/sender/{**catch-all}`.
- "receiver-ui-envelope" for `/envelope/{**catch-all}`.
- "receiver-ui-static-assets" for `{**catch-all}` as a fallback.
These changes improve routing granularity for the "receiver-ui" cluster.
Updated the `CreateAsync` method in `EnvelopeController` to use
`WithAuth` instead of `Authorize` for handling authorization
within the `CreateEnvelopeCommand`. This change reflects a
refactor or update in the command's API to improve clarity or
functionality.
Updated the middleware pipeline in `Program.cs` to use `app.MapWhen()` for conditional routing. The reverse proxy now excludes requests to `/swagger`, `/scalar`, and `/openapi` paths, ensuring these endpoints are handled separately. This change replaces the direct `app.MapReverseProxy()` call with a more selective approach, improving request handling for specific API paths.
Added a new `receiver-ui` route under the `ReverseProxy:Routes`
section in `yarp.json` to match all paths for `GET` and `HEAD`
methods. The route is associated with the `receiver-ui` cluster
and has an `Order` value of 100.
Configured a new `receiver-ui` cluster under the
`ReverseProxy:Clusters` section with a single destination
pointing to `https://localhost:52936`. This enables reverse
proxying for the `receiver-ui` service.
Refactored the handling of `senderDoc.ByteData` by replacing
the ternary operator with an explicit `if` statement for better
readability. Added a `Content-Disposition` header to ensure
the file is displayed inline with a proper filename. Updated
the MIME type of the file response from `application/octet-stream`
to `application/pdf` to reflect the expected content type.
Added the `EnvelopeGenerator.DependencyInjection` project to the solution, including its build configurations for Debug and Release modes.
Also added build configurations for the existing `EnvelopeGenerator.ReceiverUI` project.
Both projects were associated with the parent project in the NestedProjects section.
Enhanced `ReportViewer.razor` with a new layout structure:
- Added `receiver-page-layout` with `receiver-signature-panel` and `receiver-viewer-wrapper` for better organization.
- Introduced a button to export signed PDFs, conditionally enabled based on `SignatureApplied`.
- Added a `DxPopup` for capturing signatures with a "Close" button.
Updated `MainLayout.razor` to remove unnecessary padding from `<article>`.
Refined `app.css`:
- Defined styles for `receiver-page-layout`, `receiver-signature-panel`, and `receiver-viewer-wrapper` to improve layout flexibility.
- Adjusted `article` to use flexbox and ensure hidden overflow.
The `UseDbMigration` setting in the `appsettings.json` file was updated from `true` to `false`. This change disables automatic application of database migrations, potentially requiring manual intervention or an alternative approach for managing schema updates.
Added a new `GetEnvelopeReceiverOfReceiver` method in the
`EnvelopeReceiverController` to retrieve an envelope receiver
based on the provided `envelopeKey`. The method is secured
with the `Receiver` authorization policy and uses the
`_mediator.Send` method to process a `ReadEnvelopeReceiverQuery`.
Included the `Microsoft.Extensions.Options` namespace to
support potential configuration needs. Added XML documentation
placeholders for the new method.
Updated DocumentController to include a new GetDocumentOfReceiver
endpoint for retrieving envelope documents. Added authorization
based on the Receiver policy and implemented error handling for
invalid or missing EnvelopeId claims. Integrated ILogger to log
errors and provide detailed diagnostics. Included necessary
namespace imports to support the new functionality.
Enhanced token validation logic by introducing an `OnTokenValidated` event handler. This ensures the `envelopeKey` in the request path matches the token's subject (`sub` claim). Added `return Task.CompletedTask;` to complete asynchronous operations. These changes improve security by preventing mismatches or unauthorized access.
Added `AddEnvelopeReceiverLoginOperation` to `AuthProxyDocumentFilter` to define a new Swagger operation for the `/api/Auth/envelope-receiver/{key}` endpoint. Introduced the `EnvelopeReceiverLogin` record for the request body. Updated `yarp.json` to configure routing for the new endpoint, ensuring the `cookie` query parameter is always set to `true`. Modified `Apply` to include the new operation in Swagger documentation.
Added two new endpoints to `AuthController`: `LogoutEnvelopeReceiver` for removing a specific per-envelope receiver cookie and `LogoutAllEnvelopeReceivers` for clearing all such cookies. Updated `DigitalData.Auth.Claims` package to version 1.0.3. Introduced new `using` directives to support the added functionality. Included XML documentation for the new endpoints to improve code clarity.