Commit Graph

2544 Commits

Author SHA1 Message Date
315a022cb8 feat: Add sender-side UI resource strings for all languages
Added 46 new localized strings to support sender-side UI implementation:

Resources added:
- Resource.de-DE.resx (German)
- Resource.en-US.resx (English)
- Resource.fr-FR.resx (French)

Categories covered:
- Dashboard actions (NewEnvelope, LoadEnvelope, DeleteEnvelope, etc.)
- Grid columns (Receivers, Status, Type, CreatedOn, etc.)
- Toolbar actions (RefreshData, ShowDocument, ResendInvitation, etc.)
- Envelope editor (AddFile, MergeFiles, EditFields, SendEnvelope, etc.)
- Settings (Language, UseAccessCode, TwoFactorEnabled, etc.)
- Reminders & expiry (FirstReminderDays, ExpiresWhenDays, etc.)

Source: Migrated from EnvelopeGenerator.Form resx files
Purpose: Support upcoming ReceiverUI sender pages implementation
2026-06-17 15:55:13 +02:00
746635979b Ensure _allEnvelopes is never null after assignment
Modified the assignment of `_allEnvelopes` to use the result of
`EnvelopeService.GetAsync()` or an empty list (`[]`) if the
result is null. This change prevents potential null reference
issues when `_allEnvelopes` is used later in the code.
2026-06-17 15:10:31 +02:00
31548728cd Refactor EnvelopeStatus to shared domain library
Moved the `EnvelopeStatus` enum and its extension methods
from `ReceiverUI.Models` to `Domain.Constants` to improve
code reuse and maintainability. Updated `EnvelopeSenderPage.razor`
to reference the new namespace.
2026-06-17 15:10:17 +02:00
06c8af2ed8 Remove EnvelopeGenerator.Dto project from solution
The `EnvelopeGenerator.Dto.csproj` file has been removed entirely, including its `<Project>` XML structure.

References to `EnvelopeGenerator.Dto` have been removed from `EnvelopeGenerator.sln`, including the project declaration, build configurations in `SolutionConfigurationPlatforms`, and nested project mappings in `NestedProjects`.

This change fully removes the `EnvelopeGenerator.Dto` project from the solution.
2026-06-17 14:38:30 +02:00
9f57baf2e5 refactor(ReceiverUI/Models): update to use Application layer's DTO 2026-06-17 14:05:01 +02:00
73d793f0a0 remove ApiExplorerSettings attribute 2026-06-17 11:53:01 +02:00
65bb68feef Update DevExpress package versions to 25.2.8
Updated the following DevExpress package references in the project:
- `DevExpress.Blazor.PdfViewer` from 25.2.3 to 25.2.8
- `DevExpress.Blazor.Reporting.JSBasedControls` from 25.2.3 to 25.2.8
- `DevExpress.Blazor.Reporting.Viewer` from 25.2.3 to 25.2.8
- `DevExpress.Drawing.Skia` from 25.2.3 to 25.2.8

No changes were made to other package references or the `NativeFileReference` entry.
2026-06-17 11:05:53 +02:00
c5e97ee30b move dto to common dir 2026-06-17 09:46:27 +02:00
3a4f449b59 Add EnvelopeGenerator.Dto project to the solution
Introduce a new project, `EnvelopeGenerator.Dto`, targeting .NET 8.0.
The project is configured with implicit `using` directives and nullable
reference types enabled. Update the solution file to include the new
project, its build configurations (Debug/Release for Any CPU), and its
hierarchical relationship in the `NestedProjects` section.
2026-06-17 09:45:22 +02:00
6ca7767e4d Enhance grid functionality in EnvelopeSenderPage
Added support for column reordering, sorting, and resizing in the grid:
- Enabled `AllowColumnReorder` for column reordering.
- Enabled `AllowSort` to allow sorting of grid columns.
- Set `ColumnResizeMode` to `GridColumnResizeMode.ColumnsContainer` for improved column resizing behavior.
2026-06-17 09:41:46 +02:00
4237f0a815 Add CellDisplayTemplate for ID column in grid
Updated the `DxGridDataColumn` for the `Id` field in
`EnvelopeSenderPage.razor` to include a `CellDisplayTemplate`.
This enables customized rendering of the `Id` property from
the `EnvelopeDto` object, allowing for additional formatting
or logic during display.
2026-06-16 17:01:38 +02:00
3302be9348 Refactor grid columns and improve UI styling
Removed fixed column widths in `EnvelopeSenderPage.razor` for dynamic sizing. Added `CellDisplayTemplate` to `Title`, `Status`, and `EnvelopeReceivers` columns for custom data rendering. Fixed gradient typo in progress bar CSS.

Added a new CSS rule to hide empty DevExpress grid cells and updated `sender-page.css` to include this rule while preserving existing styles.
2026-06-16 16:47:11 +02:00
4572e20c51 Restrict Logout method to Sender auth scheme
The `[Authorize]` attribute on the `Logout` method in the
`AuthController` class was updated to use the
`AuthenticationSchemes = AuthScheme.Sender` instead of the
`Policy = AuthPolicy.SenderOrReceiver`. This change narrows
the authorization requirement, ensuring only users under the
`Sender` authentication scheme can access the `Logout`
functionality.
2026-06-16 16:32:53 +02:00
b3a70d7259 Add sender authentication check to EnvelopeSenderPage
Added an authentication check in `EnvelopeSenderPage.razor` to verify sender access before loading envelopes. Redirects unauthorized users to the sender login page.

Introduced `CheckSenderAsync` in `AuthService` to validate sender tokens via the `/api/auth/check` endpoint. Updated `OnInitializedAsync` to use this method, enhancing security by ensuring only authorized users can access envelope-related functionality.
2026-06-16 15:55:59 +02:00
bb81920d44 Refactor sender page styles and add versioned URLs
Moved inline styles from `EnvelopeSenderPage.razor` to a new
`sender-page.css` file for better maintainability and separation
of concerns. Updated `EnvelopeSenderPage.razor` to use versioned
URLs for stylesheets via the newly injected `AppVersionService`,
enabling cache-busting. Added responsive design support in
`sender-page.css` to improve layout on smaller screens.
2026-06-16 15:05:00 +02:00
3b66de0691 Enhance EnvelopeSenderPage with new UI and features
Integrated DevExpress Blazor components and added a responsive,
modern UI for the sender dashboard. Replaced placeholder content
with a functional layout, including a grid-based envelope viewer
with filtering, pagination, and detailed row templates.

Added status badges, progress indicators, and a sender action
bar with buttons for creating, editing, deleting, refreshing
envelopes, and logging out. Introduced loading and error
handling states for better user experience.

Refactored data loading with `LoadEnvelopesAsync` to fetch and
categorize envelopes. Added methods for envelope management
and logout functionality. Improved state management and removed
unused code. These changes lay the groundwork for future
enhancements.
2026-06-15 17:00:23 +02:00
9f6004ba8c Refactor EnvelopeDto and add EnvelopeStatus enum
Updated the `EnvelopeDto` class to use a simplified receiver model (`EnvelopeReceiverSimpleDto`) for streamlined data handling. Added the `EnvelopeReceiverSimpleDto` class to represent basic receiver information (`Name`, `Email`, `Signed`).

Introduced the `EnvelopeStatus` enumeration in `EnvelopeStatus.cs` to define envelope lifecycle statuses, repurposed for the `ReceiverUI` context. Added `EnvelopeStatusExtensions` with `IsActive` and `IsCompleted` methods to evaluate envelope status states.
2026-06-15 16:59:37 +02:00
ef246bae32 Add LogoutSenderAsync method to AuthService
A new asynchronous method `LogoutSenderAsync` was added to the `AuthService` class to handle sender user logout. The method sends a POST request to the `/api/auth/logout` endpoint and removes the authentication cookie. It accepts an optional `CancellationToken` parameter and returns a `bool` indicating the success of the operation. XML documentation comments were included to describe the method's functionality.
2026-06-15 16:59:16 +02:00
e4ebb29969 Add authorization and data fetching to sender page
Added an `[Authorize]` attribute with the "Sender" policy to restrict access to the `EnvelopeSenderPage.razor`. Updated the page title to "Umschläge" and added placeholder text for data loading.

Injected `EnvelopeService` and `IJSRuntime` to fetch and log active and completed envelopes. Introduced `_activeEnvelopes` and `_completedEnvelopes` fields to store fetched data. Configured `JsonSerializerOptions` for consistent JSON handling.

Implemented `OnInitializedAsync` to fetch data asynchronously, log results to the console, and handle errors gracefully.
2026-06-15 16:24:45 +02:00
83cdb9dfe9 Update launch settings for HTTPS and ReceiverUI profiles
Changed the `launchUrl` for the HTTPS profile in `launchSettings.json` from `"swagger"` to `"sender"`, updating the default URL path.
Disabled `launchBrowser` for the `EnvelopeGenerator.ReceiverUI` profile, preventing the browser from automatically opening when this profile is executed.
2026-06-15 16:20:28 +02:00
c5db676e01 Add EnvelopeService to DI container in Program.cs
Registered EnvelopeService with a scoped lifetime in the
dependency injection container by adding
`builder.Services.AddScoped<EnvelopeService>();` to Program.cs.
This ensures a new instance is created per HTTP request.
2026-06-15 15:56:49 +02:00
95c8e15887 Add EnvelopeDto and EnvelopeService for API integration
Introduced the `EnvelopeDto` class to represent envelope data with JSON property mappings. Added the `EnvelopeService` class to handle API interactions, including fetching envelopes with optional filters and query string construction using `Microsoft.AspNetCore.WebUtilities`. Updated the project file to include the required package reference for query string manipulation.
2026-06-15 15:40:59 +02:00
561b844e59 Add filtering for active and completed envelopes
Added `OnlyActive` and `OnlyCompleted` properties to the `ReadEnvelopeQuery` class to enable filtering envelopes by their active or completed status. Updated the `ReadEnvelopeQueryHandler` to apply these filters when the properties are set.

Enhanced the `EnvelopeStatus` class by introducing `Active` and `Completed` status lists and adding extension methods (`IsActive` and `IsCompleted`) to determine status categories. Included necessary `using` directives for `System` and `System.Linq`.
2026-06-15 15:07:12 +02:00
011960be75 Add EnvelopeStatus extensions and update documentation URL
The `System` namespace was added to `EnvelopeStatus.cs` to enable additional functionality. A documentation URL in the comments was updated to point to a new location, replacing the outdated link.

Introduced a new static class `EnvelopeStatusExtensions` with two extension methods for the `EnvelopeStatus` enum:
- `IsActive`: Checks if the status is active (between `EnvelopeCreated` and `EnvelopePartlySigned`).
- `IsCompleted`: Checks if the status is completed (between `EnvelopeCompletelySigned` and `EnvelopeWithdrawn`).
2026-06-15 14:55:01 +02:00
151c785af9 Enhance JSON options and authorization policies
Added JSON serialization options to ignore reference cycles in
the `AddControllers` method by configuring `ReferenceHandler`
to `IgnoreCycles`. Updated the `AddAuthorizationBuilder` to
include authentication schemes for the `SenderOrReceiver`
policy, requiring roles and schemes for enhanced security.
2026-06-12 15:21:50 +02:00
fa354a05cc Update authorization policy in ConfigController
Replaced the generic [Authorize] attribute with a more specific
[Authorize(Policy = AuthPolicy.SenderOrReceiver)] to enforce
a stricter authorization policy. Added a `using` directive for
`EnvelopeGenerator.Domain.Constants` to support the new policy.
2026-06-12 15:21:29 +02:00
1326407462 Update AuthController to use specific auth scheme
The `[Authorize]` attribute on the `Check` method was updated to specify the `AuthScheme.Sender` authentication scheme. This change ensures that the `Check` endpoint now requires authentication using this specific scheme, enhancing security and supporting multiple authentication schemes within the application.
2026-06-12 15:15:44 +02:00
a3c653ddb3 Simplify Envelope to EnvelopeDto mapping
Removed custom mapping logic for the `Receivers` property in the
`Envelope` to `EnvelopeDto` mapping within the `MappingProfile`
class. The mapping now uses default behavior without projecting
`EnvelopeReceivers` to `Receivers`.
2026-06-12 15:15:09 +02:00
8d736cdc5e Refactor EnvelopeDto property for receiver handling
Replaced the `Receivers` property with `EnvelopeReceivers` in the `EnvelopeDto` class to improve clarity and better align with the updated data model. The new property uses `IEnumerable<EnvelopeReceiverDto>?` instead of `IEnumerable<ReceiverDto>?`.
2026-06-12 15:14:51 +02:00
a3b33637fd Update authorization scheme for GetAsync method
Modified the `[Authorize]` attribute on the `GetAsync` method in the `EnvelopeController` class to specify `AuthenticationSchemes = AuthScheme.Sender`. This change enforces a more specific authentication requirement, allowing access only to users authenticated under the `Sender` scheme.
2026-06-11 23:04:53 +02:00
bc3134a033 Update Envelope to EnvelopeDto mapping configuration
The mapping for the `Envelope` entity to the `EnvelopeDto` was
modified to include a custom mapping for the `Receivers` property.
The `Receivers` property in `EnvelopeDto` is now populated by
mapping from the `EnvelopeReceivers` collection in the `Envelope`
entity, specifically selecting the `Receiver` property from each
`EnvelopeReceiver` object.
2026-06-11 23:04:43 +02:00
f106255c6b Add Receivers property to EnvelopeDto
Enhanced the EnvelopeDto class by introducing a new `Receivers` property of type `IEnumerable<ReceiverDto>?` to support including recipient information in the envelope DTO.

Added necessary `using` directives for `EnvelopeReceiver` and `Receiver` DTOs to ensure proper namespace references. Updated the class to accommodate this new functionality.
2026-06-11 23:04:31 +02:00
cb103dcb69 Restrict UserId visibility and update query includes
The `UserId` property in `ReadEnvelopeQuery` was changed from `public` to `internal` to improve encapsulation. A new `Authorize` method was added to set the `UserId` property using the `with` expression.

In `ReadEnvelopeQueryHandler`, the LINQ query was updated to replace the inclusion of `Documents` with `EnvelopeReceivers` and their associated `Receiver`, reflecting a shift in the data being eagerly loaded to support updated functionality.
2026-06-11 23:04:05 +02:00
8c1dd9c40d Make boolean properties nullable in Envelope class
Changed `SendReminderEmails`, `UseAccessCode`, and `TfaEnabled`
properties from non-nullable `bool` to nullable `bool?` to allow
representation of `null` values. Added conditional initialization
of `TfaEnabled` to `false` for `NETFRAMEWORK` target.
2026-06-11 23:03:35 +02:00
ee358ffaab Update project version to 1.4.2
Bump the project version from 1.4.1 to 1.4.2 in the `<Version>` tag for the NuGet package. Updated `<AssemblyVersion>` and `<FileVersion>` to `1.4.2.0` to maintain consistency with the new version. This reflects a minor version update for API compatibility and file versioning.
2026-06-11 17:14:20 +02:00
0780dbdd94 Enhance PDF viewer and add embed page with file upload
- Added CSS styles for `.pdf-viewer` and its child elements
  to ensure proper dimensions and layout for PDF display.
- Enhanced `EnvelopeReceiverPage_DxPdfViewer.razor` with
  conditional rendering for improved user feedback.
- Introduced `EnvelopeReceiverPage_embed.razor` with a new
  route `/envelope/Embed`, drag-and-drop file upload, and
  embedded PDF viewer using `<embed>`.
- Implemented default PDF loading from embedded resources
  and Base64 encoding for embedding.
- Refactored file upload handling with `OnFilesUploading`
  and centralized allowed file types logic.
- Improved user experience with success and informational
  messages for file upload and PDF viewing.
2026-06-11 17:13:17 +02:00
d722742fe8 Remove unused DevExpress Reporting CSS file
The `dx-blazor-reporting-components.bs5.css` file reference was removed from `EnvelopeReceiverPage_DxPdfViewer.razor`. This CSS file was likely used for styling DevExpress Blazor Reporting Viewer components, which are no longer needed or have been replaced.
2026-06-11 15:55:26 +02:00
8c42105f58 Add PDF viewer with drag-and-drop file upload support
Added a new Razor page `EnvelopeReceiverPage_DxPdfViewer.razor` with a route `/envelope/DxPdfViewer`. Integrated DevExpress components, including `DxPdfViewer` for displaying PDF documents and `DxFileInput` for drag-and-drop file uploads. Styled the drag-and-drop zone with custom CSS. Initialized the viewer with a default embedded PDF file and implemented logic to handle file uploads dynamically.
2026-06-11 15:33:22 +02:00
88b196ed6d Refactor report handling and improve async operations
Refactored the `Report` property to `_report` with nullable support
and updated `EnvelopeKey` to use `init` for immutability.
Made `CreateReport` asynchronous, returning `Task<XtraReport>`,
and removed redundant `BasePdfBytes` property. Simplified predefined
report fetching by removing `ReportStorage.TryGetReport`. Improved
error handling for missing or invalid `pdfBytes` in `CreateReport`.
Made minor formatting and structural improvements for clarity.
2026-06-11 14:11:56 +02:00
c99511de29 Add FORM_APPLICATION_CONTEXT.md for migration documentation
Added a new file, `FORM_APPLICATION_CONTEXT.md`, to the solution file `EnvelopeGenerator.sln`. This file provides detailed documentation of the legacy VB.NET Windows Forms application, including its architecture, workflows, and migration plan to the ReceiverUI + API architecture.

The documentation outlines the application's purpose, primary libraries, project structure, and key forms with their respective features and behaviors. It also describes data models, controllers, and their methods, along with technical details such as coordinate systems, status colors, and master-detail grid patterns.

Additionally, the file includes implementation notes for key features like drag-and-drop file uploads, auto-complete for receiver emails, and PDF merging. Workflow summaries and a data flow diagram are provided to clarify the application's processes. The document concludes with key takeaways to ensure consistency during the migration.
2026-06-11 13:52:55 +02:00
7d0c5a0ee5 Improve error handling and logging for envelope receiver
Added a null check in `EnvelopeReceiverPage.razor` to log a warning when `_envelopeReceiver` is null. Updated `ReportViewer.razor` to wrap `EnvelopeReceiverService.GetAsync` in a `try-catch` block, logging `HttpRequestException` errors and allowing the UI to handle null values gracefully.

Enhanced `EnvelopeReceiverService.GetAsync` to throw detailed `HttpRequestException` on API failures, including status code and reason phrase. Added `using System.Net;` to support HTTP-related classes. Updated method documentation to reflect the new behavior.

These changes improve error diagnostics, logging, and maintainability across the codebase.
2026-06-11 13:40:30 +02:00
7001d7351f Remove default "fake" fallback for EnvelopeKey usage
The default value "fake" for the `EnvelopeKey` parameter has been
removed when calling `AnnotationService.GetAnnotationsAsync` and
`EnvelopeReceiverService.GetAsync`. The code now directly uses
the `EnvelopeKey` variable, assuming it will always have a valid
value or that null/empty handling is managed elsewhere.
2026-06-11 13:37:55 +02:00
cf16312394 Refactor error handling in DocumentService and consumers
Refactored `DocumentService.GetDocumentAsync` to throw
`HttpRequestException` on failure instead of returning a tuple.
Updated all consumers to handle exceptions, improving error
handling consistency across the application.

Enhanced error messages for better user feedback and added
logging for improved traceability. Updated `EnvelopeReceiverPage`,
`EnvelopeReceiverPage_DxReportViewer`, and `ReportViewer` to
use the new exception-based API and handle errors gracefully.

This change simplifies the API, improves maintainability, and
makes the application more robust and user-friendly.
2026-06-11 13:33:15 +02:00
ecb7f45f14 Refactor report creation and property initialization
Replaced nullable fields with non-nullable properties for `Report`
and `BasePdfBytes` to improve initialization and encapsulation.
Updated `OnInitializedAsync` to use `BasePdfBytes` and added
error handling for missing PDF bytes.

Refactored report creation logic by removing `BuildFreshBaseReport`
and `CreateReportInstance`, consolidating functionality into a
new `CreateReport` method. Enhanced `CreateReport` to support
both predefined and dynamically generated reports, simplifying
the code structure and improving maintainability.
2026-06-11 13:12:40 +02:00
0ba5578d94 Update appsettings.json configuration options
Removed the `ForceToUseFakeDocument` property from the `Api` section, as it is no longer needed. Added a new property, `UsePredefinedReports`, to the `Api` section with a default value of `false` to enable or disable the use of predefined reports.
2026-06-11 13:11:51 +02:00
e093471a24 Refactor: Replace ForceToUseFakeDocument property
Replaced the `ForceToUseFakeDocument` property in `ApiOptions`
with `UsePredefinedReports` to improve clarity and better align
with business requirements. Updated all references in
`EnvelopeReceiverPage_DxReportViewer.razor` and
`ReportViewer.razor` to use the new property, ensuring
consistency and maintaining functionality.
2026-06-11 13:07:17 +02:00
b16ae70762 Remove signature-related functionality
This commit removes all features and UI elements related to signature handling in the `EnvelopeReceiverPage_DxReportViewer.razor` file.

Key changes include:
- Removed signature creation (drawing, typing, uploading) and associated UI components like the signature popup and action bar.
- Removed annotation handling logic, including toggling checkboxes and applying signatures to annotations.
- Removed PDF export functionality for signed documents.
- Deleted methods and properties related to signature handling, such as `AddSignature`, `OnInitializedAsync`, and `SignaturePopupVisible`.
- Removed `@inject` services and JavaScript interop calls related to signature handling.
- Simplified the `DxReportViewer` usage to only display the report without overlays or interactions.
- Removed envelope metadata display and logout functionality.

The page now focuses solely on displaying reports without any signature-related features.
2026-06-11 13:02:53 +02:00
c3e8f09291 Simplify EnvelopeReceiverPage logic and update settings
Removed redundant `EnvelopeKey` checks in `LogoutAsync` and
`OnInitializedAsync` methods, simplifying logout and initialization
logic. Updated navigation URL to `/envelope/login/`. Streamlined
document fetching logic by removing unnecessary conditions.

Added logging in `CreateReportInstance` to track report creation.
Enabled `ForceToUseFakeDocument` in `appsettings.json` to default
to using fake documents. These changes improve code clarity and
align behavior with updated requirements.
2026-06-11 12:51:04 +02:00
a9fb82bbea Refactor _dotNetRef type and remove unused redirection
Updated the `_dotNetRef` field to use a more specific type, `DotNetObjectReference<EnvelopeReceiverPage_DxReportViewer>`, for better alignment with the component. Removed obsolete redirection logic from `/receiver/{key}` to `/envelope/{key}` in `OnInitializedAsync`, as it is no longer needed or handled elsewhere. Retained envelope access validation logic.
2026-06-11 11:59:21 +02:00
895fd5c509 Add route for DxReportViewer in yarp.json
Introduce a new route configuration for `receiver-ui-envelope-dxreportviewer` in `yarp.json`.
The route matches requests to `/envelope/{EnvelopeKey}/DxReportViewer` for `GET` and `HEAD` methods.
It is part of the `receiver-ui` cluster, with an order of `90`, and includes a transformation to redirect the path to `/index.html`.
This change supports a new endpoint in the application.
2026-06-11 11:58:58 +02:00