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.
This commit is contained in:
2026-06-11 13:07:17 +02:00
parent b16ae70762
commit e093471a24
3 changed files with 3 additions and 3 deletions

View File

@@ -6,5 +6,5 @@ public class ApiOptions
public string BaseUrl { get; set; } = string.Empty; public string BaseUrl { get; set; } = string.Empty;
public bool ForceToUseFakeDocument { get; set; } = false; public bool UsePredefinedReports { get; set; } = false;
} }

View File

@@ -23,7 +23,7 @@
byte[]? _basePdfBytes; byte[]? _basePdfBytes;
protected override async Task OnInitializedAsync() { protected override async Task OnInitializedAsync() {
if (!AppOptions.Value.ForceToUseFakeDocument) { if (!AppOptions.Value.UsePredefinedReports) {
var (pdfBytes, _) = await DocumentService.GetDocumentAsync(EnvelopeKey); var (pdfBytes, _) = await DocumentService.GetDocumentAsync(EnvelopeKey);
if (pdfBytes is { Length: > 0 }) if (pdfBytes is { Length: > 0 })
_basePdfBytes = pdfBytes; _basePdfBytes = pdfBytes;

View File

@@ -345,7 +345,7 @@ Shown="OnPopupShownAsync">
_annotations = await AnnotationService.GetAnnotationsAsync(EnvelopeKey ?? "fake"); _annotations = await AnnotationService.GetAnnotationsAsync(EnvelopeKey ?? "fake");
_envelopeReceiver = await EnvelopeReceiverService.GetAsync(EnvelopeKey ?? "fake"); _envelopeReceiver = await EnvelopeReceiverService.GetAsync(EnvelopeKey ?? "fake");
if (!AppOptions.Value.ForceToUseFakeDocument && !string.IsNullOrWhiteSpace(EnvelopeKey)) { if (!AppOptions.Value.UsePredefinedReports && !string.IsNullOrWhiteSpace(EnvelopeKey)) {
var (pdfBytes, _) = await DocumentService.GetDocumentAsync(EnvelopeKey); var (pdfBytes, _) = await DocumentService.GetDocumentAsync(EnvelopeKey);
if (pdfBytes is { Length: > 0 }) if (pdfBytes is { Length: > 0 })
_basePdfBytes = pdfBytes; _basePdfBytes = pdfBytes;