-
Notifications
You must be signed in to change notification settings - Fork 178
View as project home #8735
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
View as project home #8735
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Modified AvatarButton.svelte to show 'View As' option on all project pages, not just dashboard pages (removed dashboard param requirement) - Updated navigation behavior to preserve 'View As' state when navigating within the same project, only clearing when switching projects - Alerts/Reports links in avatar menu now only show when on a dashboard page Resolves PM-103 Co-authored-by: eric.okuma <eric.okuma@rilldata.com>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,7 +82,15 @@ | |
| ); | ||
|
|
||
| onNavigate(({ from, to }) => { | ||
| viewAsUserStore.set(null); | ||
| // Only clear "View As" state when navigating outside of the current project | ||
| const changedProject = | ||
| !from || | ||
| !to || | ||
| from.params.organization !== to.params.organization || | ||
| from.params.project !== to.params.project; | ||
| if (changedProject) { | ||
| viewAsUserStore.set(null); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This navigation guard should move to the project layout ( |
||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. onNavigate clears org-level view-as on project changeHigh Severity The Additional Locations (2) |
||
| errorStore.reset(); | ||
|
|
||
| const changedDashboard = | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This navigation guard should move to the project layout (
+layout.svelte) so it covers all project pages — home, settings, status, etc. With View As now available on the home page, activating it there and navigating to a different project won't trigger this guard since the dashboard page is never mounted.