Enforce behavior for AdvancedElectronicSignature
Added logic to enforce automatic enabling of Two-Factor Authentication (2FA) and access code usage when the `AdvancedElectronicSignature` certification type is selected. - Added `@bind:after` event handler to `<select>` for `_certificationType` to handle changes. - Introduced `IsFesSelected` property to check if `AdvancedElectronicSignature` is selected. - Updated `OnTfaChanged` to enforce `_tfaEnabled` and `_useAccessCode` when `IsFesSelected`. - Added `OnCertificationTypeChanged` method to reset validation and normalize settings. - Updated `NormalizeSettings` to ensure `_tfaEnabled` and `_useAccessCode` are set appropriately. - Called `NormalizeSettings` during component initialization to ensure consistent state. These changes ensure the UI and logic reflect the enforced behavior for the `AdvancedElectronicSignature` certification type.
This commit is contained in:
@@ -139,7 +139,7 @@
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Info" Color="Color.Tertiary" Size="Size.Small" Class="sender-create-wizard__help-icon" aria-label='@L("SenderWizard_HelpAria_CertificationType", "Hilfe zum Feld Zertifizierung")' />
|
||||
</MudTooltip>
|
||||
</label>
|
||||
<select @bind="_certificationType" class="sender-create-wizard__select">
|
||||
<select @bind="_certificationType" @bind:after="OnCertificationTypeChanged" class="sender-create-wizard__select">
|
||||
<option value="@CertificationType.AdvancedElectronicSignature">@L("AdvancedElectronicSignature", "Advanced Electronic Signature")</option>
|
||||
<option value="@CertificationType.ElectronicSignature">@L("ElectronicSignature", "Electronic Signature")</option>
|
||||
</select>
|
||||
@@ -176,7 +176,7 @@
|
||||
<div class="sender-create-wizard__field sender-create-wizard__field--full">
|
||||
<div class="sender-create-wizard__settings-toggles">
|
||||
<label class="sender-create-wizard__settings-toggle">
|
||||
<input type="checkbox" checked="@_tfaEnabled" @onchange="OnTfaChanged" />
|
||||
<input type="checkbox" checked="@_tfaEnabled" @onchange="OnTfaChanged" disabled="@IsFesSelected" />
|
||||
<span>@L("TFAEnabled", "2FA aktiviert")</span>
|
||||
<MudTooltip Text='@L("SenderWizard_Help_TfaEnabled", "Wenn aktiviert, ist die Signaturfreigabe nur mit zusaetzlicher Verifizierung moeglich.")'>
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Info" Color="Color.Tertiary" Size="Size.Small" Class="sender-create-wizard__help-icon" aria-label='@L("SenderWizard_HelpAria_TfaEnabled", "Hilfe zur Option 2FA")' />
|
||||
@@ -533,6 +533,7 @@
|
||||
private string? _validationMessage;
|
||||
|
||||
private bool IsActionLocked => _isDocumentUploading || _isStepActionRunning || _isFinishing;
|
||||
private bool IsFesSelected => _certificationType == CertificationType.AdvancedElectronicSignature;
|
||||
|
||||
private bool IsFirstStep => _currentStep <= 0;
|
||||
private bool IsLastStep => _currentStep >= TotalSteps - 1;
|
||||
@@ -1141,11 +1142,26 @@
|
||||
private void OnTfaChanged(ChangeEventArgs args)
|
||||
{
|
||||
_validationMessage = null;
|
||||
|
||||
if (IsFesSelected)
|
||||
{
|
||||
_tfaEnabled = true;
|
||||
_useAccessCode = true;
|
||||
return;
|
||||
}
|
||||
|
||||
_tfaEnabled = ParseCheckboxValue(args);
|
||||
if (_tfaEnabled)
|
||||
_useAccessCode = true;
|
||||
}
|
||||
|
||||
private Task OnCertificationTypeChanged()
|
||||
{
|
||||
_validationMessage = null;
|
||||
NormalizeSettings();
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private void OnUseAccessCodeChanged(ChangeEventArgs args)
|
||||
{
|
||||
_validationMessage = null;
|
||||
@@ -1215,6 +1231,9 @@
|
||||
{
|
||||
_language = string.IsNullOrWhiteSpace(_language) ? "de-DE" : _language.Trim();
|
||||
|
||||
if (IsFesSelected)
|
||||
_tfaEnabled = true;
|
||||
|
||||
if (_tfaEnabled)
|
||||
_useAccessCode = true;
|
||||
|
||||
@@ -1301,6 +1320,7 @@
|
||||
_isDocumentPreviewPrepared = false;
|
||||
|
||||
ApplyDefaultEnvelopeType();
|
||||
NormalizeSettings();
|
||||
}
|
||||
|
||||
private int? GetDefaultEnvelopeTypeId()
|
||||
|
||||
Reference in New Issue
Block a user