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:
13 files changed
+997
-139
No files matched your search
@@ -134,12 +134,14 @@ export const OnboardingBrowserView = ({
|
||||
{/* Profile Header */}
|
||||
<div className="border-subtle flex flex-col gap-4 border-b p-4">
|
||||
<div className="flex flex-col items-start gap-4">
|
||||
<Avatar
|
||||
size="lg"
|
||||
imageSrc={avatar || undefined}
|
||||
alt={name || ""}
|
||||
className="border-2 border-white"
|
||||
/>
|
||||
{avatar && (
|
||||
<Avatar
|
||||
size="lg"
|
||||
imageSrc={avatar}
|
||||
alt={name || ""}
|
||||
className="border-2 border-white"
|
||||
/>
|
||||
)}
|
||||
<div className="flex w-full flex-col gap-2">
|
||||
<h2 className="text-emphasis w-full truncate text-xl font-semibold leading-tight">
|
||||
{name || t("your_name")}
|
||||
|
||||
@@ -8,6 +8,7 @@ import { trpc } from "@calcom/trpc/react";
|
||||
import { Avatar } from "@calcom/ui/components/avatar";
|
||||
|
||||
import { useOnboardingStore, type Invite } from "../store/onboarding-store";
|
||||
import classNames from "@calcom/ui/classNames";
|
||||
|
||||
type OnboardingInviteBrowserViewProps = {
|
||||
teamName?: string;
|
||||
@@ -35,8 +36,14 @@ export const OnboardingInviteBrowserView = ({
|
||||
}: OnboardingInviteBrowserViewProps) => {
|
||||
const pathname = usePathname();
|
||||
const { data: user } = trpc.viewer.me.get.useQuery();
|
||||
const { teamBrand, teamInvites, invites, teamDetails, organizationBrand, organizationDetails } =
|
||||
useOnboardingStore();
|
||||
const {
|
||||
teamBrand,
|
||||
teamInvites,
|
||||
invites,
|
||||
teamDetails,
|
||||
organizationBrand,
|
||||
organizationDetails,
|
||||
} = useOnboardingStore();
|
||||
const { t } = useLocale();
|
||||
|
||||
// Animation variants for entry and exit
|
||||
@@ -57,14 +64,19 @@ export const OnboardingInviteBrowserView = ({
|
||||
|
||||
// Use default values if not provided
|
||||
const rawInviterName = user?.name || user?.username || "Alex";
|
||||
const displayInviterName = rawInviterName.charAt(0).toUpperCase() + rawInviterName.slice(1);
|
||||
const displayInviterName =
|
||||
rawInviterName.charAt(0).toUpperCase() + rawInviterName.slice(1);
|
||||
|
||||
// Use organization or team data based on context
|
||||
const displayName = useOrganizationInvites
|
||||
? organizationDetails.name || teamName || "Deel"
|
||||
: teamName || teamDetails.name || "Deel";
|
||||
const displayBio = useOrganizationInvites ? organizationDetails.bio || "" : teamDetails.bio || "";
|
||||
const avatar = useOrganizationInvites ? organizationBrand.logo || null : teamBrand.logo || null;
|
||||
const displayBio = useOrganizationInvites
|
||||
? organizationDetails.bio || ""
|
||||
: teamDetails.bio || "";
|
||||
const avatar = useOrganizationInvites
|
||||
? organizationBrand.logo || null
|
||||
: teamBrand.logo || null;
|
||||
|
||||
// Get invites based on context - use watched invites if provided, otherwise fall back to store
|
||||
let actualInvites: Invite[] = [];
|
||||
@@ -81,7 +93,9 @@ export const OnboardingInviteBrowserView = ({
|
||||
}
|
||||
|
||||
// Filter out empty invites (where email is empty or just whitespace)
|
||||
const validInvites = actualInvites.filter((invite) => invite.email && invite.email.trim().length > 0);
|
||||
const validInvites = actualInvites.filter(
|
||||
(invite) => invite.email && invite.email.trim().length > 0
|
||||
);
|
||||
|
||||
// Create empty state items
|
||||
const emptyStateItem = {
|
||||
@@ -132,31 +146,44 @@ export const OnboardingInviteBrowserView = ({
|
||||
transition={{
|
||||
duration: 0.5,
|
||||
ease: "backOut",
|
||||
}}>
|
||||
}}
|
||||
>
|
||||
<div className="bg-default border-subtle flex flex-col rounded-2xl border">
|
||||
<div className="relative p-1">
|
||||
{/* Banner Image */}
|
||||
{organizationBrand.banner && (
|
||||
<div className="border-subtle relative h-36 w-full overflow-hidden rounded-xl border">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img
|
||||
src={organizationBrand.banner}
|
||||
alt={displayName}
|
||||
className="h-full w-full object-cover"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{organizationBrand.banner || avatar ? (
|
||||
<div className="relative p-1">
|
||||
{/* Banner Image */}
|
||||
{organizationBrand.banner && (
|
||||
<div className="border-subtle relative h-36 w-full overflow-hidden rounded-xl border">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img
|
||||
src={organizationBrand.banner}
|
||||
alt={displayName}
|
||||
className="h-full w-full object-cover"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Organization Avatar - Overlaying the banner */}
|
||||
{organizationBrand.banner && avatar && (
|
||||
<div className="absolute -bottom-6 left-4">
|
||||
<Avatar size="lg" imageSrc={avatar} alt={displayName} className="h-12 w-12 border" />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{/* Organization Avatar - Overlaying the banner */}
|
||||
{organizationBrand.banner && avatar && (
|
||||
<div className="absolute -bottom-6 left-4">
|
||||
<Avatar
|
||||
size="lg"
|
||||
imageSrc={avatar}
|
||||
alt={displayName}
|
||||
className="h-12 w-12 border"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{/* Organization Info */}
|
||||
<div className={`flex flex-col items-start gap-1 px-4 pb-4 pt-8`}>
|
||||
<div
|
||||
className={classNames(
|
||||
`flex flex-col items-start gap-1 px-4 pb-4 pt-8`,
|
||||
!organizationBrand.banner && !avatar ? "pt-4" : "pt-8"
|
||||
)}
|
||||
>
|
||||
{!organizationBrand.banner && avatar && (
|
||||
<Avatar
|
||||
size="lg"
|
||||
@@ -181,8 +208,14 @@ export const OnboardingInviteBrowserView = ({
|
||||
key={`${item.email}-${index}`}
|
||||
className={`bg-default border-subtle flex aspect-square w-full min-w-0 flex-col items-center justify-center gap-2 overflow-hidden rounded-lg border p-4 ${
|
||||
!item.isReal ? "opacity-60" : ""
|
||||
}`}>
|
||||
<Avatar size="mdLg" imageSrc={undefined} alt={item.name} className="mt-4" />
|
||||
}`}
|
||||
>
|
||||
<Avatar
|
||||
size="mdLg"
|
||||
imageSrc={undefined}
|
||||
alt={item.name}
|
||||
className="mt-4"
|
||||
/>
|
||||
<div className="flex w-full min-w-0 flex-col items-center gap-4">
|
||||
<div className="flex w-full min-w-0 flex-col items-center">
|
||||
<p className="text-default w-full truncate text-center text-sm font-semibold leading-tight">
|
||||
|
||||
Reference in new issue
Block a user