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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user