-
-
Cal.com - {t("getting_started")}
-
-
-
- {isSubmitting && (
-
-
-
- )}
-
-
-
-
-
-
- Step {currentStep + 1} of {steps.length}
-
-
- {error && }
-
-
- {steps.map((s, index) => {
- return index <= currentStep ? (
- goToStep(index)}
- className={classnames(
- "h-1 w-1/4 bg-white",
- index < currentStep ? "cursor-pointer" : ""
- )}
- />
- ) : (
-
- );
- })}
-
-
-
-
- {steps[currentStep].Component}
-
- {!steps[currentStep].hideConfirm && (
-
- )}
-
-
-
-
- {currentStep !== 0 && (
-
- )}
-
-
-
-
-
- );
-}
-
-export async function getServerSideProps(context: NextPageContext) {
- const session = await getSession(context);
-
- if (!session?.user?.id) {
- return {
- redirect: {
- permanent: false,
- destination: "/auth/login",
- },
- };
- }
- const user = await prisma.user.findFirst({
- where: {
- id: session.user.id,
- },
- select: {
- id: true,
- startTime: true,
- endTime: true,
- username: true,
- name: true,
- email: true,
- bio: true,
- avatar: true,
- timeZone: true,
- identityProvider: true,
- completedOnboarding: true,
- weekStart: true,
- hideBranding: true,
- theme: true,
- plan: true,
- brandColor: true,
- darkBrandColor: true,
- metadata: true,
- timeFormat: true,
- allowDynamicBooking: true,
- selectedCalendars: {
- select: {
- externalId: true,
- integration: true,
- },
- },
- credentials: {
- where: {
- userId: session.user.id,
- },
- select: {
- id: true,
- type: true,
- key: true,
- userId: true,
- appId: true,
- },
- },
- schedules: {
- where: {
- userId: session.user.id,
- },
- select: {
- id: true,
- },
- },
- },
- });
- if (!user) {
- throw new Error(`Signed in as ${session.user.id} but cannot be found in db`);
- }
-
- if (user.completedOnboarding) {
- return {
- redirect: {
- permanent: false,
- destination: "/event-types",
- },
- };
- }
-
- const integrations = getApps(user.credentials)
- .filter((item) => item.type.endsWith("_calendar"))
- .map((item) => omit(item, "key"));
- const { schedules } = user;
- const hasConfigureCalendar = integrations.some((integration) => integration.credential !== null);
- const hasSchedules = schedules && schedules.length > 0;
-
- return {
- props: {
- session,
- user,
- initialStep: hasSchedules ? (hasConfigureCalendar ? 2 : 3) : 0,
- },
- };
-}
diff --git a/apps/web/pages/settings/my-account/calendars.tsx b/apps/web/pages/settings/my-account/calendars.tsx
index 968000dd4c..b3ff71a87d 100644
--- a/apps/web/pages/settings/my-account/calendars.tsx
+++ b/apps/web/pages/settings/my-account/calendars.tsx
@@ -18,7 +18,7 @@ import DisconnectIntegration from "@calcom/ui/v2/modules/integrations/Disconnect
import { QueryCell } from "@lib/QueryCell";
-import { CalendarSwitch } from "@components/v2/settings/CalendarSwitch";
+import { CalendarSwitch } from "@components/settings/CalendarSwitch";
const SkeletonLoader = () => {
return (
diff --git a/apps/web/pages/settings/security/two-factor-auth.tsx b/apps/web/pages/settings/security/two-factor-auth.tsx
index 420c5483d4..ba81a3e293 100644
--- a/apps/web/pages/settings/security/two-factor-auth.tsx
+++ b/apps/web/pages/settings/security/two-factor-auth.tsx
@@ -8,8 +8,8 @@ import Meta from "@calcom/ui/v2/core/Meta";
import Switch from "@calcom/ui/v2/core/Switch";
import { getLayout } from "@calcom/ui/v2/core/layouts/SettingsLayout";
-import DisableTwoFactorModal from "@components/v2/settings/DisableTwoFactorModal";
-import EnableTwoFactorModal from "@components/v2/settings/EnableTwoFactorModal";
+import DisableTwoFactorModal from "@components/settings/DisableTwoFactorModal";
+import EnableTwoFactorModal from "@components/settings/EnableTwoFactorModal";
const TwoFactorAuthView = () => {
const utils = trpc.useContext();