feat: redesign team creation flow to match onboarding-v3 design (#26733)

* feat: redesign team creation flow to match onboarding-v3 design

Co-Authored-By: [email protected] <[email protected]>

* feat: skip invite options and go directly to email invite step

Co-Authored-By: [email protected] <[email protected]>

* feat: invalidate teams query on submit to refresh teams list

Co-Authored-By: [email protected] <[email protected]>

* fix: use server action to invalidate server-side teams cache

Co-Authored-By: [email protected] <[email protected]>

* fix: conditionally render avatar in browser view to remove extra padding

Co-Authored-By: [email protected] <[email protected]>

* fix browser view

* test: update team creation E2E tests to use new onboarding-v3 flow

Co-Authored-By: [email protected] <[email protected]>

* test: update auth-index.e2e.ts to use new team creation flow

Co-Authored-By: [email protected] <[email protected]>

* test: update team-management.e2e.ts to use new team creation flow

Co-Authored-By: [email protected] <[email protected]>

* fix: add error handling for createTeam and improve CSV parsing for quoted fields

Co-Authored-By: [email protected] <[email protected]>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-01-19 14:53:51 +00:00
1 parent a8abe2cdf1
commit 37847c0061
13 files changed
+997 -139

No files matched your search

@@ -9,7 +9,12 @@ import { trpc } from "@calcom/trpc/react";
import type { OnboardingState } from "../store/onboarding-store";
import { useOnboardingStore } from "../store/onboarding-store";
export function useCreateTeam() {
type UseCreateTeamOptions = {
redirectBasePath?: string;
};
export function useCreateTeam(options: UseCreateTeamOptions = {}) {
const { redirectBasePath = "/onboarding/teams" } = options;
const router = useRouter();
const [isSubmitting, setIsSubmitting] = useState(false);
const flags = useFlagMap();
@@ -28,7 +33,7 @@ export function useCreateTeam() {
// Validate team details - if empty, redirect back to team details step
if (!teamDetails.name || !teamDetails.name.trim() || !teamDetails.slug || !teamDetails.slug.trim()) {
router.push("/onboarding/teams/details");
router.push(`${redirectBasePath}/details`);
setIsSubmitting(false);
return;
}
@@ -51,7 +56,7 @@ export function useCreateTeam() {
if (result.team) {
// Store the teamId and redirect to invite flow after team creation
setTeamId(result.team.id);
router.push(`/onboarding/teams/invite?teamId=${result.team.id}`);
router.push(`${redirectBasePath}/invite/email?teamId=${result.team.id}`);
}
} catch (error) {
console.error("Failed to create team:", error);