Add new route and redirection for PDF.js viewer

Introduce a new route `/report-viewer/{EnvelopeKey}` alongside the existing `/receiver/{EnvelopeKey}`. Add redirection logic in `OnInitializedAsync` to navigate to `/envelope/{key}` for the new PDF.js viewer if `EnvelopeKey` is provided. Ensure this redirection takes precedence over the envelope access check.
This commit is contained in:
2026-06-08 11:51:54 +02:00
parent 9535c7dd6b
commit 9aa01f8e9a

View File

@@ -1,4 +1,5 @@
@page "/receiver/{EnvelopeKey}"
@page "/report-viewer/{EnvelopeKey}"
@using System.Drawing
@using DevExpress.Blazor
@using DevExpress.Drawing
@@ -320,6 +321,12 @@ Shown="OnPopupShownAsync">
protected override async Task OnInitializedAsync() {
// ? REDIRECT: /receiver/{key} -> /envelope/{key} (NEW PDF.js viewer)
if (!string.IsNullOrWhiteSpace(EnvelopeKey)) {
Navigation.NavigateTo($"/envelope/{Uri.EscapeDataString(EnvelopeKey)}", forceLoad: false);
return;
}
if (!string.IsNullOrWhiteSpace(EnvelopeKey)) {
var hasAccess = await AuthService.CheckEnvelopeAccessAsync(EnvelopeKey);
if (!hasAccess) {