-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Unify the UX of template projects on navigation to non-existing page #62067
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
Open
ilonatommy
wants to merge
8
commits into
dotnet:main
Choose a base branch
from
ilonatommy:not-found-works-after-navigation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5fff491
Add re-exec tests for SSR + move NotFound sources into one directory.
ilonatommy 66cc974
Per-component interactivity: test navigation to non-existing page.
ilonatommy 8907524
Add streaming SSR tests.
ilonatommy 3b89c4b
Clean up tests and make them work.
ilonatommy 217e8dd
Fix interactivity tests.
ilonatommy 6e3eb98
Remove routing sandwitch.
ilonatommy e89fe2d
Trigger streaming.
ilonatommy e4b89c1
Templates use reexecution.
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
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
...ponents.TestServer/RazorComponents/Pages/NotFound/RedirectionNotFound-SSR-streaming.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,5 @@ | ||
@page "/redirection-not-found-ssr-streaming" | ||
@page "/reexecution/redirection-not-found-ssr-streaming" | ||
@attribute [StreamRendering(true)] | ||
|
||
<Components.WasmMinimal.Pages.NotFound.RedirectionNotFoundComponent StartStreaming="true" /> |
5 changes: 5 additions & 0 deletions
5
...assets/Components.TestServer/RazorComponents/Pages/NotFound/RedirectionNotFound-SSR.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,5 @@ | ||
@page "/redirection-not-found-ssr" | ||
@page "/reexecution/redirection-not-found-ssr" | ||
@attribute [StreamRendering(false)] | ||
|
||
<Components.WasmMinimal.Pages.NotFound.RedirectionNotFoundComponent /> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
...st/testassets/Components.WasmMinimal/Pages/NotFound/RedirectionNotFound-Interactive.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,19 @@ | ||
@page "/redirection-not-found" | ||
@page "/reexecution/redirection-not-found" | ||
|
||
<RedirectionNotFoundComponent @rendermode="@RenderModeHelper.GetRenderMode(_renderMode)" /> | ||
|
||
@code{ | ||
[Parameter, SupplyParameterFromQuery(Name = "renderMode")] | ||
public string? RenderModeStr { get; set; } | ||
|
||
private RenderModeId _renderMode; | ||
|
||
protected override void OnInitialized() | ||
{ | ||
if (!string.IsNullOrEmpty(RenderModeStr)) | ||
{ | ||
_renderMode = RenderModeHelper.ParseRenderMode(RenderModeStr); | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
.../test/testassets/Components.WasmMinimal/Pages/NotFound/RedirectionNotFoundComponent.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,33 @@ | ||
| ||
@inject NavigationManager NavigationManager | ||
|
||
<h1>Original page</h1> | ||
|
||
<p id="test-info">Any content</p> | ||
<a id="link-to-not-existing-page" href="@_nonExistingPath"> | ||
Go to not-existing-page | ||
</a> | ||
|
||
@code{ | ||
[Parameter] | ||
[SupplyParameterFromQuery(Name = "navigate-programmatically")] | ||
public bool? NavigateProgrammatically { get; set; } | ||
|
||
[Parameter] | ||
public bool StartStreaming { get; set; } = false; | ||
|
||
private string _nonExistingPath = string.Empty; | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
if (StartStreaming) | ||
{ | ||
await Task.Yield(); | ||
} | ||
_nonExistingPath = $"{NavigationManager.BaseUri}reexecution/not-existing-page"; | ||
if (NavigateProgrammatically == true) | ||
{ | ||
NavigationManager.NavigateTo(_nonExistingPath); | ||
} | ||
} | ||
} |
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
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.