Skip to content
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

Admin Stack: Show Prompt if navigating into a nested Stack, even if subRoutes would normally not show Prompt #1955

Merged
merged 5 commits into from
Jul 4, 2024

Conversation

nsams
Copy link
Member

@nsams nsams commented Apr 17, 2024

Bildschirmaufzeichnung.vom.2024-04-17.18.03.01.webm

This adds:

  • a new ForcePromptRoute, to be used like react-router Route, that also registers it's path in a new context created by RouterPrompt
  • PromptHandler can now check if the navigating-to-url matches with a path from registered ForcePromptRoute
  • and show the Prompt

Also adjust StackSwitch:

  • to use the new ForcePromptRoute
  • don't use react-router Switch as that would only render the first matching route (but we need ForcePromptRoute to always render so it can register)
  • instead implement the logic from Switch by only rendering index if no other route matched

@nsams nsams requested a review from johnnyomair April 17, 2024 16:09
@nsams nsams self-assigned this Apr 17, 2024
@nsams nsams marked this pull request as draft April 18, 2024 08:54
@nsams nsams marked this pull request as ready for review April 20, 2024 18:54
.changeset/fast-dodos-compete.md Outdated Show resolved Hide resolved
.changeset/fast-dodos-compete.md Outdated Show resolved Hide resolved
packages/admin/admin/src/index.ts Show resolved Hide resolved
@johnnyomair
Copy link
Collaborator

@thomasdax98 I believe this is necessary for the stable v7 release.

@thomasdax98 thomasdax98 added this to the v7.0.0 milestone Jun 24, 2024
nsams and others added 2 commits July 3, 2024 07:55
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com>
@johnnyomair johnnyomair merged commit a0bd09a into next Jul 4, 2024
11 checks passed
@johnnyomair johnnyomair deleted the stack-subroute-prompt branch July 4, 2024 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants