-
Notifications
You must be signed in to change notification settings - Fork 167
Focus dashboard on Agent Network for netbird.ai signups #708
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 7 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
3cb76f7
Capture netbird.ai signup source before authentication
mlsmaycon b62a184
Resolve Agent Network mode from account settings
mlsmaycon b0b9c38
Enable Agent Network focused view for netbird.ai signups
mlsmaycon d4217db
Add Agent Network focused view toggle to client settings
mlsmaycon 7dd95af
Swap remaining agent network gating call sites
mlsmaycon fb409b7
Use signup_source query parameter for signup source capture
mlsmaycon b280848
Resolve Agent Network mode optimistically for pending netbird.ai signups
mlsmaycon d16672f
Respect explicit agent_network_only opt-out over deployment config
mlsmaycon 55f2847
Merge remote-tracking branch 'origin/main' into feature/agent-network…
mlsmaycon cc7b811
Add e2e spec for Agent Network focused view menu and routes
mlsmaycon 8920b2d
Anchor focused-view e2e assertions on always-present nav to avoid bac…
mlsmaycon 38dc2aa
Deflake focused-view e2e: assert route reachability instead of sideba…
mlsmaycon 2aa59ca
Fix onboarding form closing when Agent Network focused view is applied
mlsmaycon 7ad5be9
Show the agent-network signup form on cloud for netbird.ai signups
mlsmaycon dd35a33
Defer onboarding until Agent Network mode resolves to avoid wrong-for…
mlsmaycon 0fff98c
Decide onboarding form from signup_source so the regular form never f…
mlsmaycon 6c0a29b
Add e2e coverage for onboarding form selection
mlsmaycon 0ef296f
Let loginToApp expect an onboarding overlay instead of dismissing the…
mlsmaycon 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,26 @@ | ||
| "use client"; | ||
|
|
||
| import { isAgentNetworkEnabled } from "@utils/netbird"; | ||
| import { notFound } from "next/navigation"; | ||
| import * as React from "react"; | ||
| import { useAgentNetworkMode } from "@/modules/agent-network/useAgentNetworkMode"; | ||
|
|
||
| // Gates the entire Agent Network route tree behind the NETBIRD_AGENT_NETWORK | ||
| // flag. When disabled, these routes don't exist as far as the user is | ||
| // concerned — the dashboard behaves exactly as it did without the feature. | ||
| // flag or the account-level agent_network_only setting. When disabled, these | ||
| // routes don't exist as far as the user is concerned — the dashboard behaves | ||
| // exactly as it did without the feature. Rendering waits for the account to | ||
| // load so accounts enabled via settings don't get a redirect flash. | ||
| export default function AgentNetworkLayout({ | ||
| children, | ||
| }: { | ||
| children: React.ReactNode; | ||
| }) { | ||
| if (!isAgentNetworkEnabled()) { | ||
| notFound(); | ||
| const { enabled, loading } = useAgentNetworkMode(); | ||
|
|
||
| if (enabled) { | ||
| return <>{children}</>; | ||
| } | ||
| if (loading) { | ||
| return null; | ||
| } | ||
| return <>{children}</>; | ||
| } | ||
| notFound(); | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { useEffect } from "react"; | ||
|
|
||
| export const SIGNUP_SOURCE_QUERY_PARAM = "signup_source"; | ||
| export const SIGNUP_SOURCE_LOCAL_STORAGE_KEY = "netbird-signup-source"; | ||
| export const AGENT_NETWORK_SIGNUP_SOURCE = "netbird.ai"; | ||
|
|
||
| /** | ||
| * Store the signup_source query parameter into localStorage so it survives | ||
| * the OIDC redirect and can be applied once the account is available. | ||
| */ | ||
| export function useSignupSource() { | ||
| useEffect(() => { | ||
| if (typeof window === "undefined") return; | ||
|
|
||
| const params = new URLSearchParams(window.location.search); | ||
| const source = params.get(SIGNUP_SOURCE_QUERY_PARAM); | ||
|
|
||
| if (source === AGENT_NETWORK_SIGNUP_SOURCE) { | ||
| try { | ||
| localStorage.setItem(SIGNUP_SOURCE_LOCAL_STORAGE_KEY, source); | ||
| } catch (e) {} | ||
| } | ||
| }, []); | ||
| } |
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
Oops, something went wrong.
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.