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

@@ -267,10 +267,10 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
EnvelopeTypeId: request.EnvelopeTypeId ?? existing?.EnvelopeTypeId,
Language: ResolveLanguage(request.Language, selectedType?.Language, existing?.Language),
UseAccessCode: useAccessCode,
CertificationType: request.CertificationType
CertificationType: NormalizeCertificationType(request.CertificationType
?? (int?)selectedType?.CertificationType
?? existing?.CertificationType
?? (int)CertificationType.AdvancedElectronicSignature,
?? (int)CertificationType.AdvancedElectronicSignature),
FinalEmailToCreator: request.FinalEmailToCreator
?? (int?)selectedType?.FinalEmailToCreator
?? existing?.FinalEmailToCreator
@@ -316,6 +316,13 @@ public class CreateEnvelopeCommandHandler : IRequestHandler<CreateEnvelopeComman
return "de-DE";
}
private static int NormalizeCertificationType(int value)
{
return value == 2
? 2
: (int)CertificationType.AdvancedElectronicSignature;
}
private sealed record EnvelopeSettings(
int? EnvelopeTypeId,
string Language,

View File

@@ -2,8 +2,7 @@
{
public enum CertificationType
{
AdvancedElectronicSignature = 1
// ElectronicSignature = 1
// QualifiedSignature = 2
AdvancedElectronicSignature = 1,
ElectronicSignature = 2
}
}
}

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();

View File

@@ -59,7 +59,7 @@
"ZoomStepPercentage": 5
},
"DocumentService": {
"BaseUrl": "https://localhost:7186"
"BaseUrl": "http://172.24.12.39:9393"
},
"PSPDFKitLicenseKey": "SXCtGGY9XA-31OGUXQK-r7c6AkdLGPm2ljuyDr1qu0kkhLvydg-Do-fxpNUF4Rq3fS_xAnZRNFRHbXpE6sQ2BMcCSVTcXVJO6tPviexjpiT-HnrDEySlUERJnnvh-tmeOWprxS6BySPnSILkmaVQtUfOIUS-cUbvvEYHTvQBKbSF8di4XHQFyfv49ihr51axm3NVV3AXwh2EiKL5C5XdqBZ4sQ4O7vXBjM2zvxdPxlxdcNYmiU83uAzw7B83O_jubPzya4CdUHh_YH7Nlp2gP56MeG1Sw2JhMtfG3Rj14Sg4ctaeL9p6AEWca5dDjJ2li5tFIV2fQSsw6A_cowLu0gtMm5i8IfJXeIcQbMC2-0wGv1oe9hZYJvFMdzhTM_FiejM0agemxt3lJyzuyP8zbBSOgp7Si6A85krLWPZptyZBTG7pp7IHboUHfPMxCXqi-zMsqewOJtQBE2mjntU-lPryKnssOpMPfswwQX7QSkJYV5EMqNmEhQX6mEkp2wcqFzMC7bJQew1aO4pOpvChUaMvb1vgRek0HxLag0nwQYX2YrYGh7F_xXJs-8HNwJe8H0-eW4x4faayCgM5rB5772CCCsD9ThZcvXFrjNHHLGJ8WuBUFm6LArvSfFQdii_7j-_sqHMpeKZt26NFgivj1A==",
"Content-Security-Policy": [ // The first format parameter {0} will be replaced by the nonce value.