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:
@@ -1,4 +1,5 @@
|
|||||||
@page "/receiver/{EnvelopeKey}"
|
@page "/receiver/{EnvelopeKey}"
|
||||||
|
@page "/report-viewer/{EnvelopeKey}"
|
||||||
@using System.Drawing
|
@using System.Drawing
|
||||||
@using DevExpress.Blazor
|
@using DevExpress.Blazor
|
||||||
@using DevExpress.Drawing
|
@using DevExpress.Drawing
|
||||||
@@ -320,6 +321,12 @@ Shown="OnPopupShownAsync">
|
|||||||
|
|
||||||
protected override async Task OnInitializedAsync() {
|
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)) {
|
if (!string.IsNullOrWhiteSpace(EnvelopeKey)) {
|
||||||
var hasAccess = await AuthService.CheckEnvelopeAccessAsync(EnvelopeKey);
|
var hasAccess = await AuthService.CheckEnvelopeAccessAsync(EnvelopeKey);
|
||||||
if (!hasAccess) {
|
if (!hasAccess) {
|
||||||
|
|||||||
Reference in New Issue
Block a user