-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Add NotFound
method in NavigationManager
for interactive and static rendering
#60752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
e92baae
Interactive NotFound event + SSR status code.
ilonatommy d48e2bf
Remove circular DI, pass renderer on initialization instead.
ilonatommy 3a7178d
Interactive NotFound tests.
ilonatommy 580b8be
Server test.
ilonatommy 58b6895
Cleanup.
ilonatommy a5ca308
Fix the API Analyzer bug.
ilonatommy b3b4e18
Limit the added APIs by removing event cancellation.
ilonatommy 758448e
Formatting + rename.
ilonatommy ca379eb
Formatting.
ilonatommy ef94091
Address copilot's feedback.
ilonatommy bfa8145
Feedback.
ilonatommy 21314b6
Feedback - server
ilonatommy 73f0e07
Fix event registration.
ilonatommy 1877327
Trying to fix the build error.
ilonatommy 3cdd10f
Nullabillity
ilonatommy bf6041b
Limit public API.
ilonatommy 6ce7bda
Dispose renderer + move tests.
ilonatommy 95ac585
Merge remote-tracking branch 'upstream/main' into fix-45654
ilonatommy c89cd57
@javiercn's fixes
ilonatommy 2c380ea
Feedback - rename + comment.
ilonatommy aa1b149
Merge remote-tracking branch 'upstream/main' into fix-45654
ilonatommy 3ed2b74
Fix ailing test - do not subscribe if manager is not initialized.
ilonatommy d8751ab
Change the test setup instead changing the NavigationManager.
ilonatommy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/Components/test/E2ETest/ServerRenderingTests/NoInteractivityTest.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/Components/test/testassets/Components.WasmMinimal/Pages/NotFoundInteractiveServer.razor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@page "/render-not-found-server" | ||
@using Microsoft.AspNetCore.Components; | ||
@using Microsoft.AspNetCore.Components.Web; | ||
@inject NavigationManager NavigationManager | ||
|
||
<p id="test-info">Any content</p> | ||
@if(RendererInfo.IsInteractive) | ||
{ | ||
<button id="trigger-not-found" @onclick="@TriggerNotFound">Trigger not found button</button> | ||
} | ||
|
||
@code{ | ||
private void TriggerNotFound() | ||
{ | ||
NavigationManager.NotFound(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...ponents/test/testassets/Components.WasmMinimal/Pages/NotFoundInteractiveWebassembly.razor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@page "/render-not-found-webassembly" | ||
@using Microsoft.AspNetCore.Components; | ||
@using Microsoft.AspNetCore.Components.Web; | ||
@inject NavigationManager NavigationManager | ||
|
||
<p id="test-info">Any content</p> | ||
@if(RendererInfo.IsInteractive) | ||
{ | ||
<button id="trigger-not-found" @onclick="@TriggerNotFound">Trigger not found button</button> | ||
} | ||
|
||
@code{ | ||
private void TriggerNotFound() | ||
{ | ||
NavigationManager.NotFound(); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Components/test/testassets/Components.WasmMinimal/Pages/NotFoundSSR.razor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@page "/render-not-found-ssr" | ||
@inject NavigationManager NavigationManager | ||
|
||
<p id="test-info">Any content</p> | ||
|
||
@code{ | ||
protected override void OnInitialized() | ||
{ | ||
NavigationManager.NotFound(); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.