feat: welcome to organizations modal after creation (#24823)

## What does this PR do?

Adds a welcome modal for new organizations that appears after organization creation. The modal showcases key features of the Organizations plan and provides a better onboarding experience.

## Visual Demo (For contributors especially)

#### Image Demo:

![CleanShot 2025-10-31 at 12.19.17.gif](https://app.graphite.dev/user-attachments/assets/4f8c3286-9400-40e6-aeb4-8a012f604c64.gif)

## Mandatory Tasks (DO NOT REMOVE)

- [x] I have self-reviewed the code.
- [x] I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A
- [x] I confirm automated tests are in place that prove my fix is effective or that my feature works.

## How should this be tested?

1. Create a new organization through either:
   - The onboarding flow
   - The settings/organizations/new page
   - The organization creation form

2. After successful creation and redirect, verify the welcome modal appears showing organization features.

3. Verify the modal can be closed by:
   - Clicking the "Continue" button
   - Clicking outside the modal
   - Pressing ESC key

4. Verify the modal doesn't reappear after being closed (query param and session storage should be cleared).

## Checklist

- I have read the [contributing guide](https://github.com/calcom/cal.com/blob/main/CONTRIBUTING.md)
- My code follows the style guidelines of this project
- I have commented my code, particularly in hard-to-understand areas
- I have checked if my changes generate no new warnings
This commit is contained in:
sean-brydon authored and GitHub committed 2025-11-03 11:11:16 +00:00
1 parent c6daa61e5e
commit 79bcd6dc30
8 files changed
+262 -11

No files matched your search

@@ -5,6 +5,7 @@ import { useState } from "react";
import { useForm } from "react-hook-form";
import { z } from "zod";
import { setShowNewOrgModalFlag } from "@calcom/features/ee/organizations/hooks/useWelcomeModal";
import { useOnboarding } from "@calcom/features/ee/organizations/lib/onboardingStore";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import type { RouterOutputs } from "@calcom/trpc";
@@ -52,7 +53,9 @@ const useOrgCreation = () => {
await utils.viewer.organizations.listCurrent.invalidate();
await session.update();
reset();
window.location.href = `${window.location.origin}/settings/organizations/profile`;
// Set flag to show welcome modal (using both query param and sessionStorage for reliability)
setShowNewOrgModalFlag();
window.location.href = `${window.location.origin}/settings/organizations/profile?newOrganizationModal=true`;
} else {
// Unexpected state
setServerErrorMessage("Unexpected response from server");
@@ -28,7 +28,7 @@ const PaymentStatusView = () => {
if (organization) {
setOrganizationCreated(true);
// Organization is created, redirect to next step
router.push(`/settings/organizations`);
router.push(`/settings/organizations?newOrganizationModal=true`);
}
}, [organization, router, useOnboardingStore]);