Normalize certification type handling

Introduce `NormalizeCertificationType` method to ensure consistent handling of certification types across the application. Update `CreateEnvelopeCommandHandler`, `CreateEnvelopeWizardPopup.razor`, and `SenderEditorPage.razor` to use this method. Modify `CertificationType` enum to include `ElectronicSignature` and remove `QualifiedSignature`. Update UI components to reflect these changes by removing the `QualifiedSignature` option.
This commit is contained in:
2026-10-26 16:58:06 +01:00
parent 4dcfe67038
commit ae1ecbc15f
5 changed files with 33 additions and 13 deletions

View File

@@ -120,7 +120,6 @@
<select @bind="_certificationType" class="sender-create-wizard__select">
<option value="1">@L("AdvancedElectronicSignature", "Advanced Electronic Signature")</option>
<option value="2">@L("ElectronicSignature", "Electronic Signature")</option>
<option value="3">@L("QualifiedSignature", "Qualified Signature")</option>
</select>
</div>
@@ -1026,7 +1025,7 @@
_useAccessCode = true;
if (envelopeType.CertificationType.HasValue)
_certificationType = envelopeType.CertificationType.Value;
_certificationType = NormalizeCertificationType(envelopeType.CertificationType.Value);
if (envelopeType.FinalEmailToCreator.HasValue)
_finalEmailToCreator = envelopeType.FinalEmailToCreator.Value;
@@ -1055,6 +1054,7 @@
private void NormalizeSettings()
{
_language = string.IsNullOrWhiteSpace(_language) ? "de-DE" : _language.Trim();
_certificationType = NormalizeCertificationType(_certificationType);
if (_tfaEnabled)
_useAccessCode = true;
@@ -1068,6 +1068,13 @@
_expiresWarningWhenDays = _expiresWhenDays;
}
private static int NormalizeCertificationType(int value)
{
return value == 2
? 2
: (int)CertificationType.AdvancedElectronicSignature;
}
private bool ValidateSettings(out string? message)
{
NormalizeSettings();

View File

@@ -128,7 +128,6 @@
<select @bind="_certificationType" class="sender-settings-select">
<option value="1">@L("AdvancedElectronicSignature", "Advanced Electronic Signature")</option>
<option value="2">@L("ElectronicSignature", "Electronic Signature")</option>
<option value="3">@L("QualifiedSignature", "Qualified Signature")</option>
</select>
</div>
@@ -746,7 +745,7 @@
_language = string.IsNullOrWhiteSpace(payload.Language) ? "de-DE" : payload.Language;
_useAccessCode = payload.UseAccessCode;
_tfaEnabled = payload.TFAEnabled;
_certificationType = payload.CertificationType;
_certificationType = NormalizeCertificationType(payload.CertificationType);
_finalEmailToCreator = payload.FinalEmailToCreator;
_finalEmailToReceivers = payload.FinalEmailToReceivers;
_sendReminderEmails = payload.SendReminderEmails;
@@ -853,7 +852,7 @@
if (_tfaEnabled)
_useAccessCode = true;
_certificationType = envelope.CertificationType ?? (int)CertificationType.AdvancedElectronicSignature;
_certificationType = NormalizeCertificationType(envelope.CertificationType ?? (int)CertificationType.AdvancedElectronicSignature);
_finalEmailToCreator = envelope.FinalEmailToCreator ?? (int)FinalEmailType.No;
_finalEmailToReceivers = envelope.FinalEmailToReceivers ?? (int)FinalEmailType.No;
@@ -1047,7 +1046,7 @@
_useAccessCode = true;
if (envelopeType.CertificationType.HasValue)
_certificationType = envelopeType.CertificationType.Value;
_certificationType = NormalizeCertificationType(envelopeType.CertificationType.Value);
if (envelopeType.FinalEmailToCreator.HasValue)
_finalEmailToCreator = envelopeType.FinalEmailToCreator.Value;
@@ -1434,6 +1433,7 @@
void NormalizeSettings()
{
_language = string.IsNullOrWhiteSpace(_language) ? "de-DE" : _language.Trim();
_certificationType = NormalizeCertificationType(_certificationType);
if (_tfaEnabled)
_useAccessCode = true;
@@ -1447,6 +1447,13 @@
_expiresWarningWhenDays = _expiresWhenDays;
}
static int NormalizeCertificationType(int value)
{
return value == 2
? 2
: (int)CertificationType.AdvancedElectronicSignature;
}
bool ValidateSettings(out string? message)
{
NormalizeSettings();