Compare commits

...

2 Commits

Author SHA1 Message Date
0cf603fc79 Swap steps 1 and 3 in CreateEnvelopeWizardPopup
Reorganize the wizard steps to prioritize "Receivers" (step 1)
before "Message and Options" (step 3). Update `_currentStep`
logic, conditional checks, and validation to reflect the new
step order. Adjust `GetStepTitle` and `GetStepDescription`
methods to align with the updated step titles and descriptions.
Ensure user input handling and step-skipping behavior are
consistent with the new flow.
2026-11-05 16:18:17 +01:00
e3d2225a44 Refactor and enhance envelope wizard with MudBlazor
Replaced custom wizard UI with MudBlazor's MudStepper for a modern and consistent design. Added dynamic step titles, descriptions, and forms for envelope creation, including advanced settings like certification, reminders, and email notifications. Integrated PDF upload with preview functionality.

Refactored `CreateEnvelopeWizardPopup.razor` for better maintainability and modularity. Removed redundant code and centralized step-related logic. Improved localization, accessibility, and user experience.

Updated `EnvelopeGenerator.Server.Client.csproj` and `EnvelopeGenerator.Server.csproj` to include MudBlazor. Registered MudBlazor services in `Program.cs` and added required CSS/JS in `App.razor`. Updated styles in `sender-page.css` to align with the new stepper design.
2026-11-05 15:22:21 +01:00
8 changed files with 399 additions and 367 deletions

View File

@@ -1,9 +1,6 @@
using DigitalData.Core.Abstraction.Application.Repository; using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.MessagingService.Application.Common.Dto;
using DigitalData.MessagingService.Application.Common.Interfaces; using DigitalData.MessagingService.Application.Common.Interfaces;
using DigitalData.MessagingService.Application.EmailSending.Commands; using DigitalData.MessagingService.Application.EmailSending.Commands;
using DigitalData.MessagingService.Client;
using DigitalData.MessagingService.Domain.Entities;
using EnvelopeGenerator.Application.Common.Interfaces.Services.Notification; using EnvelopeGenerator.Application.Common.Interfaces.Services.Notification;
using EnvelopeGenerator.Domain.Constants; using EnvelopeGenerator.Domain.Constants;
using EnvelopeGenerator.Domain.Entities; using EnvelopeGenerator.Domain.Entities;

View File

@@ -5,6 +5,7 @@
@using EnvelopeGenerator.Domain.Resources @using EnvelopeGenerator.Domain.Resources
@using EnvelopeGenerator.Server.Client.Components.Sender.ReceiverSuggestionFilter @using EnvelopeGenerator.Server.Client.Components.Sender.ReceiverSuggestionFilter
@using EnvelopeGenerator.Server.Client.Services @using EnvelopeGenerator.Server.Client.Services
@using MudBlazor
@using Microsoft.AspNetCore.Components.Forms @using Microsoft.AspNetCore.Components.Forms
@using Microsoft.Extensions.Localization @using Microsoft.Extensions.Localization
@inject IStringLocalizer<Model> ModelLocalizer @inject IStringLocalizer<Model> ModelLocalizer
@@ -27,28 +28,23 @@
<div class="sender-create-wizard" <div class="sender-create-wizard"
tabindex="0" tabindex="0"
@onkeydown="OnWizardKeyDownAsync"> @onkeydown="OnWizardKeyDownAsync">
<div class="sender-create-wizard__progress"> <MudPaper Class="sender-create-wizard__stepper-shell" Elevation="0">
<div class="sender-create-wizard__progress-track"></div> <MudStepper Vertical="true"
NonLinear="false"
ShowResetButton="false"
ActiveIndex="@_currentStep"
Class="sender-create-wizard__stepper">
<ChildContent>
@for (var step = 0; step < TotalSteps; step++) @for (var step = 0; step < TotalSteps; step++)
{ {
var isActive = step == _currentStep; var stepIndex = step;
var isDone = step < _currentStep;
<div class="sender-create-wizard__step @(isActive ? "sender-create-wizard__step--active" : string.Empty) @(isDone ? "sender-create-wizard__step--done" : string.Empty)">
<span class="sender-create-wizard__step-index">@(step + 1)</span>
</div>
}
</div>
<div class="sender-create-wizard__meta"> <MudStep Title="@GetStepTitle(stepIndex)">
<div class="sender-create-wizard__title">@CurrentStepTitle</div> <div class="sender-create-wizard__stepper-description">@GetStepDescription(stepIndex)</div>
<div class="sender-create-wizard__description">@CurrentStepDescription</div>
</div>
@if (!string.IsNullOrWhiteSpace(_validationMessage)) @if (stepIndex == _currentStep)
{ {
<div class="sender-create-wizard__validation">@_validationMessage</div> <div class="sender-create-wizard__step-content">
}
@if (_currentStep == 0) @if (_currentStep == 0)
{ {
<div class="sender-create-wizard__form-grid"> <div class="sender-create-wizard__form-grid">
@@ -78,7 +74,7 @@
</div> </div>
</div> </div>
} }
else if (_currentStep == 1) else if (_currentStep == 3)
{ {
<div class="sender-create-wizard__form-grid"> <div class="sender-create-wizard__form-grid">
<div class="sender-create-wizard__field sender-create-wizard__field--full"> <div class="sender-create-wizard__field sender-create-wizard__field--full">
@@ -192,7 +188,7 @@
</div> </div>
</div> </div>
} }
else if (_currentStep == 3) else if (_currentStep == 1)
{ {
<div class="sender-create-wizard__suggestions"> <div class="sender-create-wizard__suggestions">
<div class="sender-create-wizard__suggestions-title">@L("SenderWizard_RecentReceivers", "Zuletzt verwendete Empfänger")</div> <div class="sender-create-wizard__suggestions-title">@L("SenderWizard_RecentReceivers", "Zuletzt verwendete Empfänger")</div>
@@ -355,6 +351,19 @@
</div> </div>
} }
</div> </div>
}
</MudStep>
}
</ChildContent>
</MudStepper>
</MudPaper>
@if (!string.IsNullOrWhiteSpace(_validationMessage))
{
<div class="sender-create-wizard__validation">@_validationMessage</div>
}
</div>
</BodyContentTemplate> </BodyContentTemplate>
<FooterContentTemplate> <FooterContentTemplate>
<div class="sender-create-wizard__footer"> <div class="sender-create-wizard__footer">
@@ -456,7 +465,7 @@
private bool IsFirstStep => _currentStep <= 0; private bool IsFirstStep => _currentStep <= 0;
private bool IsLastStep => _currentStep >= TotalSteps - 1; private bool IsLastStep => _currentStep >= TotalSteps - 1;
private bool CanSkipCurrentStep => _currentStep == 1; private bool CanSkipCurrentStep => _currentStep == 3;
private IReadOnlyList<RecentReceiverSuggestionDto> FilteredRecentSuggestions => private IReadOnlyList<RecentReceiverSuggestionDto> FilteredRecentSuggestions =>
BuildFilteredRecentSuggestions(); BuildFilteredRecentSuggestions();
@@ -465,22 +474,26 @@
? $"data:application/pdf;base64,{Convert.ToBase64String(_documentBytes)}" ? $"data:application/pdf;base64,{Convert.ToBase64String(_documentBytes)}"
: null; : null;
private string CurrentStepTitle => _currentStep switch private string CurrentStepTitle => GetStepTitle(_currentStep);
private string CurrentStepDescription => GetStepDescription(_currentStep);
private string GetStepTitle(int step) => step switch
{ {
0 => L("SenderWizard_Step_Basics", "Grunddaten"), 0 => L("SenderWizard_Step_Basics", "Grunddaten"),
1 => L("SenderWizard_Step_Message", "Nachricht und Optionen"), 1 => L("SenderWizard_Step_Receivers", "Empfänger"),
2 => L("SenderEditor_EnvelopeSettings", "Envelope-Einstellungen"), 2 => L("SenderEditor_EnvelopeSettings", "Envelope-Einstellungen"),
3 => L("SenderWizard_Step_Receivers", "Empfänger"), 3 => L("SenderWizard_Step_Message", "Nachricht und Optionen"),
4 => L("SenderWizard_Step_Document", "Dokument"), 4 => L("SenderWizard_Step_Document", "Dokument"),
_ => L("SenderWizard_Step_Basics", "Grunddaten") _ => L("SenderWizard_Step_Basics", "Grunddaten")
}; };
private string CurrentStepDescription => _currentStep switch private string GetStepDescription(int step) => step switch
{ {
0 => L("SenderWizard_Step_Basics_Desc", "Starten Sie mit den Pflichtangaben für den Umschlag."), 0 => L("SenderWizard_Step_Basics_Desc", "Starten Sie mit den Pflichtangaben für den Umschlag."),
1 => L("SenderWizard_Step_Message_Desc", "Fügen Sie optionale Nachricht und Einstellungen hinzu."), 1 => L("SenderWizard_Step_Receivers_Desc", "Definieren Sie die Empfänger für den Signaturprozess."),
2 => L("SenderWizard_Step_Settings_Desc", "Konfigurieren Sie Sicherheits-, Erinnerungs- und Ablaufoptionen."), 2 => L("SenderWizard_Step_Settings_Desc", "Konfigurieren Sie Sicherheits-, Erinnerungs- und Ablaufoptionen."),
3 => L("SenderWizard_Step_Receivers_Desc", "Definieren Sie die Empfänger für den Signaturprozess."), 3 => L("SenderWizard_Step_Message_Desc", "Fügen Sie optionale Nachricht und Einstellungen hinzu."),
4 => L("SenderWizard_Step_Document_Desc", "Laden Sie das Dokument hoch und platzieren Sie Signaturfelder."), 4 => L("SenderWizard_Step_Document_Desc", "Laden Sie das Dokument hoch und platzieren Sie Signaturfelder."),
_ => L("SenderWizard_Step_Basics_Desc", "Starten Sie mit den Pflichtangaben für den Umschlag.") _ => L("SenderWizard_Step_Basics_Desc", "Starten Sie mit den Pflichtangaben für den Umschlag.")
}; };
@@ -703,7 +716,7 @@
{ {
_currentStep++; _currentStep++;
if (_currentStep == 3) if (_currentStep == 1)
await EnsureRecentSuggestionsLoadedAsync(); await EnsureRecentSuggestionsLoadedAsync();
} }
} }
@@ -797,10 +810,10 @@
if (!string.Equals(args.Key, "Enter", StringComparison.OrdinalIgnoreCase)) if (!string.Equals(args.Key, "Enter", StringComparison.OrdinalIgnoreCase))
return; return;
if (_currentStep == 1) if (_currentStep == 3)
return; return;
if (_currentStep == 3 && (!string.IsNullOrWhiteSpace(_receiverName) || !string.IsNullOrWhiteSpace(_receiverEmail))) if (_currentStep == 1 && (!string.IsNullOrWhiteSpace(_receiverName) || !string.IsNullOrWhiteSpace(_receiverEmail)))
{ {
await AddReceiver(); await AddReceiver();
return; return;
@@ -894,7 +907,7 @@
return true; return true;
} }
if (_currentStep == 3) if (_currentStep == 1)
{ {
if (_receivers.Count == 0) if (_receivers.Count == 0)
{ {

View File

@@ -12,6 +12,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="MudBlazor" Version="8.0.0" />
<PackageReference Include="DevExpress.Blazor.PdfViewer" Version="25.2.3" /> <PackageReference Include="DevExpress.Blazor.PdfViewer" Version="25.2.3" />
<PackageReference Include="DevExpress.Blazor.Reporting.JSBasedControls" Version="25.2.3" /> <PackageReference Include="DevExpress.Blazor.Reporting.JSBasedControls" Version="25.2.3" />
<PackageReference Include="DevExpress.Blazor.Reporting.Viewer" Version="25.2.3" /> <PackageReference Include="DevExpress.Blazor.Reporting.Viewer" Version="25.2.3" />

View File

@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using EnvelopeGenerator.Server.Client.Services; using EnvelopeGenerator.Server.Client.Services;
using EnvelopeGenerator.Server.Client.Options; using EnvelopeGenerator.Server.Client.Options;
using MudBlazor.Services;
using DevExpress.Blazor.Reporting; using DevExpress.Blazor.Reporting;
using DevExpress.XtraReports.Web.Extensions; using DevExpress.XtraReports.Web.Extensions;
using DevExpress.DataAccess.Web; using DevExpress.DataAccess.Web;
@@ -16,6 +17,7 @@ CultureInfo.DefaultThreadCurrentCulture = cultureInfo;
CultureInfo.DefaultThreadCurrentUICulture = cultureInfo; CultureInfo.DefaultThreadCurrentUICulture = cultureInfo;
builder.Services.AddLocalization(); builder.Services.AddLocalization();
builder.Services.AddMudServices();
// Named HttpClient for API calls (both for services and DevExpress components) // Named HttpClient for API calls (both for services and DevExpress components)
builder.Services.AddHttpClient("EnvelopeGenerator.Server", client => builder.Services.AddHttpClient("EnvelopeGenerator.Server", client =>

View File

@@ -9,6 +9,7 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flag-icons@7.2.3/css/flag-icons.min.css" /> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flag-icons@7.2.3/css/flag-icons.min.css" />
<link rel="stylesheet" href="css/app.css" /> <link rel="stylesheet" href="css/app.css" />
<link rel="stylesheet" href="css/envelope-viewer.css" /> <link rel="stylesheet" href="css/envelope-viewer.css" />
<link rel="stylesheet" href="_content/MudBlazor/MudBlazor.min.css" />
<link rel="stylesheet" href="EnvelopeGenerator.Server.styles.css" /> <link rel="stylesheet" href="EnvelopeGenerator.Server.styles.css" />
<HeadOutlet /> <HeadOutlet />
<!-- Apply saved theme immediately on page load — before WASM boots. <!-- Apply saved theme immediately on page load — before WASM boots.
@@ -37,6 +38,7 @@
<script src="js/receiver-signature.js?v=9"></script> <script src="js/receiver-signature.js?v=9"></script>
<script src="js/signflow-theme.js"></script> <script src="js/signflow-theme.js"></script>
<script src="js/envelope-editor.js"></script> <script src="js/envelope-editor.js"></script>
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
<script src="_framework/blazor.web.js"></script> <script src="_framework/blazor.web.js"></script>
</body> </body>

View File

@@ -30,6 +30,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.22" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.22" />
<PackageReference Include="MudBlazor" Version="8.0.0" />
<PackageReference Include="DevExpress.Blazor" Version="25.2.3" /> <PackageReference Include="DevExpress.Blazor" Version="25.2.3" />
<PackageReference Include="DevExpress.Blazor.PdfViewer" Version="25.2.3" /> <PackageReference Include="DevExpress.Blazor.PdfViewer" Version="25.2.3" />
<PackageReference Include="DevExpress.Blazor.Reporting.Viewer" Version="25.2.3" /> <PackageReference Include="DevExpress.Blazor.Reporting.Viewer" Version="25.2.3" />

View File

@@ -32,6 +32,7 @@ using NLog;
using NLog.Web; using NLog.Web;
using Scalar.AspNetCore; using Scalar.AspNetCore;
using System.Globalization; using System.Globalization;
using MudBlazor.Services;
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger(); var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
logger.Info("EnvelopeGenerator.Server logging initialized!"); logger.Info("EnvelopeGenerator.Server logging initialized!");
@@ -60,6 +61,7 @@ try
builder.Services.AddRazorComponents() builder.Services.AddRazorComponents()
.AddInteractiveServerComponents() .AddInteractiveServerComponents()
.AddInteractiveWebAssemblyComponents(); .AddInteractiveWebAssemblyComponents();
builder.Services.AddMudServices();
// Add API Controllers // Add API Controllers
builder.Services.AddControllers() builder.Services.AddControllers()

View File

@@ -1116,57 +1116,71 @@
z-index: 2; z-index: 2;
} }
.sender-create-wizard__progress { .sender-create-wizard__stepper-shell {
position: relative; border: 1px solid rgba(126, 34, 206, 0.12);
display: grid; border-radius: 10px;
grid-template-columns: repeat(5, minmax(0, 1fr)); background: rgba(126, 34, 206, 0.04);
align-items: center; padding: 0.75rem;
gap: 0.5rem;
} }
.sender-create-wizard__progress-track { .sender-create-wizard__stepper {
position: absolute; margin: 0;
left: 12px;
right: 12px;
top: 50%;
height: 2px;
transform: translateY(-50%);
background: rgba(126, 34, 206, 0.18);
z-index: 0;
} }
.sender-create-wizard__step { .sender-create-wizard__stepper .mud-step {
position: relative; pointer-events: none;
z-index: 1;
display: flex;
justify-content: center;
} }
.sender-create-wizard__step-index { .sender-create-wizard__stepper .mud-stepper-actions,
width: 24px; .sender-create-wizard__stepper .mud-stepper-action {
height: 24px; display: none !important;
border-radius: 999px; }
display: inline-flex;
align-items: center; .sender-create-wizard__stepper .mud-step-label {
justify-content: center; color: #1f2937;
font-size: 0.78rem; font-size: 0.86rem;
font-weight: 700; font-weight: 700;
}
.sender-create-wizard__stepper .mud-step-content {
color: #64748b;
}
.sender-create-wizard__stepper .mud-stepper-vertical .mud-stepper-step {
margin-bottom: 0.25rem;
}
.sender-create-wizard__stepper .mud-step-icon {
color: #64748b; color: #64748b;
background: #f8fafc; background: #f8fafc;
border: 1px solid rgba(126, 34, 206, 0.25); border: 1px solid rgba(126, 34, 206, 0.25);
} }
.sender-create-wizard__step--active .sender-create-wizard__step-index { .sender-create-wizard__stepper .mud-step-completed .mud-step-icon,
.sender-create-wizard__stepper .mud-step-current .mud-step-icon {
color: #ffffff; color: #ffffff;
background: linear-gradient(135deg, #7e22ce 0%, #2a5298 100%);
border-color: transparent; border-color: transparent;
}
.sender-create-wizard__stepper .mud-step-current .mud-step-icon {
background: linear-gradient(135deg, #7e22ce 0%, #2a5298 100%);
box-shadow: 0 0 0 3px rgba(126, 34, 206, 0.15); box-shadow: 0 0 0 3px rgba(126, 34, 206, 0.15);
} }
.sender-create-wizard__step--done .sender-create-wizard__step-index { .sender-create-wizard__stepper .mud-step-completed .mud-step-icon {
color: #ffffff;
background: #2a5298; background: #2a5298;
border-color: transparent; }
.sender-create-wizard__stepper-description {
font-size: 0.8rem;
line-height: 1.35;
color: #64748b;
margin-top: 0.2rem;
padding-right: 0.35rem;
}
.sender-create-wizard__step-content {
margin-top: 0.7rem;
} }
.sender-create-wizard__meta { .sender-create-wizard__meta {