Remove book a call step from onboarding (#22597)
The book a call screen was shown as a dedicated onboarding step after sending team invites. It is no longer part of the flow: the `BOOK_ONBOARDING` status, its pending user var, the `skipBookOnboardingStep` mutation and the `BookCallDecision` screen are removed, and onboarding completes right after the plan step. The `/book-call` Cal.com page remains, reachable only from the "Book a Call" link on the upgrade screen, with a back link to `/plan-required`. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/twentyhq/twenty/pull/22597?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
This commit is contained in:
@@ -99,12 +99,6 @@ const PaymentSuccess = lazy(() =>
|
||||
})),
|
||||
);
|
||||
|
||||
const BookCallDecision = lazy(() =>
|
||||
import('~/pages/onboarding/BookCallDecision').then((module) => ({
|
||||
default: module.BookCallDecision,
|
||||
})),
|
||||
);
|
||||
|
||||
const BookCall = lazy(() =>
|
||||
import('~/pages/onboarding/BookCall').then((module) => ({
|
||||
default: module.BookCall,
|
||||
@@ -219,14 +213,6 @@ const createWorkspaceAppRouter = (
|
||||
</LazyRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path={AppPath.BookCallDecision}
|
||||
element={
|
||||
<LazyRoute fallback={null}>
|
||||
<BookCallDecision />
|
||||
</LazyRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path={AppPath.BookCall}
|
||||
element={
|
||||
|
||||
@@ -8,6 +8,5 @@ export const ONBOARDING_PATHS = [
|
||||
AppPath.InviteTeam,
|
||||
AppPath.PlanRequired,
|
||||
AppPath.PlanRequiredSuccess,
|
||||
AppPath.BookCallDecision,
|
||||
AppPath.BookCall,
|
||||
];
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export const BOOK_CALL_MODAL_ID = 'book-call-modal';
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const SKIP_BOOK_ONBOARDING_STEP = gql`
|
||||
mutation SkipBookOnboardingStep {
|
||||
skipBookOnboardingStep {
|
||||
success
|
||||
}
|
||||
}
|
||||
`;
|
||||
-16
@@ -152,20 +152,4 @@ describe('useSetNextOnboardingStatus', () => {
|
||||
});
|
||||
expect(nextOnboardingStatus).toEqual(OnboardingStatus.PLAN_REQUIRED);
|
||||
});
|
||||
|
||||
it('should complete after booking onboarding when the workspace already has a subscription', () => {
|
||||
const nextOnboardingStatus = renderHooks(OnboardingStatus.BOOK_ONBOARDING, {
|
||||
isBillingEnabled: true,
|
||||
withSubscription: true,
|
||||
});
|
||||
expect(nextOnboardingStatus).toEqual(OnboardingStatus.COMPLETED);
|
||||
});
|
||||
|
||||
it('should require a plan after booking onboarding when billing is enabled and the workspace has no subscription', () => {
|
||||
const nextOnboardingStatus = renderHooks(OnboardingStatus.BOOK_ONBOARDING, {
|
||||
isBillingEnabled: true,
|
||||
withSubscription: false,
|
||||
});
|
||||
expect(nextOnboardingStatus).toEqual(OnboardingStatus.PLAN_REQUIRED);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
currentWorkspaceState,
|
||||
} from '@/auth/states/currentWorkspaceState';
|
||||
import { billingState } from '@/client-config/states/billingState';
|
||||
import { calendarBookingPageIdState } from '@/client-config/states/calendarBookingPageIdState';
|
||||
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
|
||||
|
||||
import { useCallback } from 'react';
|
||||
@@ -19,14 +18,12 @@ import { useStore } from 'jotai';
|
||||
type GetNextOnboardingStatusArgs = {
|
||||
currentUser: CurrentUser | null;
|
||||
currentWorkspace: CurrentWorkspace | null;
|
||||
calendarBookingPageId: string | null;
|
||||
isBillingEnabled: boolean;
|
||||
};
|
||||
|
||||
const getNextOnboardingStatus = ({
|
||||
currentUser,
|
||||
currentWorkspace,
|
||||
calendarBookingPageId,
|
||||
isBillingEnabled,
|
||||
}: GetNextOnboardingStatusArgs) => {
|
||||
const isPlanRequired =
|
||||
@@ -54,14 +51,6 @@ const getNextOnboardingStatus = ({
|
||||
: OnboardingStatus.COMPLETED;
|
||||
}
|
||||
if (currentUser?.onboardingStatus === OnboardingStatus.INVITE_TEAM) {
|
||||
if (isPlanRequired) {
|
||||
return OnboardingStatus.PLAN_REQUIRED;
|
||||
}
|
||||
return isDefined(calendarBookingPageId)
|
||||
? OnboardingStatus.BOOK_ONBOARDING
|
||||
: OnboardingStatus.COMPLETED;
|
||||
}
|
||||
if (currentUser?.onboardingStatus === OnboardingStatus.BOOK_ONBOARDING) {
|
||||
return isPlanRequired
|
||||
? OnboardingStatus.PLAN_REQUIRED
|
||||
: OnboardingStatus.COMPLETED;
|
||||
@@ -73,7 +62,6 @@ export const useSetNextOnboardingStatus = () => {
|
||||
const store = useStore();
|
||||
const currentUser = useAtomStateValue(currentUserState);
|
||||
const currentWorkspace = useAtomStateValue(currentWorkspaceState);
|
||||
const calendarBookingPageId = useAtomStateValue(calendarBookingPageIdState);
|
||||
const billing = useAtomStateValue(billingState);
|
||||
const isBillingEnabled = billing?.isBillingEnabled ?? false;
|
||||
|
||||
@@ -81,7 +69,6 @@ export const useSetNextOnboardingStatus = () => {
|
||||
const nextOnboardingStatus = getNextOnboardingStatus({
|
||||
currentUser,
|
||||
currentWorkspace,
|
||||
calendarBookingPageId,
|
||||
isBillingEnabled,
|
||||
});
|
||||
store.set(currentUserState.atom, (current) => {
|
||||
@@ -93,11 +80,5 @@ export const useSetNextOnboardingStatus = () => {
|
||||
}
|
||||
return current;
|
||||
});
|
||||
}, [
|
||||
currentUser,
|
||||
currentWorkspace,
|
||||
calendarBookingPageId,
|
||||
isBillingEnabled,
|
||||
store,
|
||||
]);
|
||||
}, [currentUser, currentWorkspace, isBillingEnabled, store]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user