Skip to content

Commit 2dbc7c4

Browse files
committed
Merge branch 'fix/remove-add-all-team-members-toggle-for-fixed-hosts' of https://github.com/TusharBhatt1/cal.com into fix/remove-add-all-team-members-toggle-for-fixed-hosts
2 parents f5f46c9 + f0788e6 commit 2dbc7c4

File tree

35 files changed

+492
-179
lines changed

35 files changed

+492
-179
lines changed

.yarn/versions/b7d8df6e.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
undecided:
2+
- calcom-monorepo
3+
- "@calcom/app-store-cli"
4+
- "@calcom/platform-constants"
5+
- "@calcom/platform-enums"
6+
- "@calcom/platform-types"
7+
- "@calcom/platform-utils"
8+
- "@calcom/prisma"

apps/web/app/api/plain-hash/route.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { createHmac } from "crypto";
2-
import type { NextRequest } from "next/server";
2+
import { cookies, headers } from "next/headers";
33
import { NextResponse } from "next/server";
44
import { z } from "zod";
55

66
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
77
import { apiRouteMiddleware } from "@calcom/lib/server/apiRouteMiddleware";
88

9+
import { buildLegacyRequest } from "@lib/buildLegacyCtx";
10+
911
const responseSchema = z.object({
1012
hash: z.string(),
1113
email: z.string().email(),
@@ -15,9 +17,8 @@ const responseSchema = z.object({
1517
chatAvatarUrl: z.string(),
1618
});
1719

18-
async function handler(request: NextRequest) {
19-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
20-
const session = await getServerSession({ req: request as any });
20+
async function handler() {
21+
const session = await getServerSession({ req: buildLegacyRequest(headers(), cookies()) });
2122
if (!session?.user?.email) {
2223
return NextResponse.json({ error: "Unauthorized - No session email found" }, { status: 401 });
2324
}

apps/web/app/providers.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ import { TrpcProvider } from "app/_trpc/trpc-provider";
44
import { SessionProvider } from "next-auth/react";
55
import CacheProvider from "react-inlinesvg/provider";
66

7+
import PlainChat from "@lib/plain/dynamicProvider";
8+
79
export function Providers({ children }: { children: React.ReactNode }) {
810
return (
911
<SessionProvider>
1012
<TrpcProvider>
13+
<PlainChat />
1114
{/* @ts-expect-error FIXME remove this comment when upgrading typescript to v5 */}
1215
<CacheProvider>{children}</CacheProvider>
1316
</TrpcProvider>

apps/web/lib/app-providers-app-dir.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import { useFlags } from "@calcom/features/flags/hooks";
2121

2222
import useIsBookingPage from "@lib/hooks/useIsBookingPage";
2323
import useIsThemeSupported from "@lib/hooks/useIsThemeSupported";
24-
import PlainChat from "@lib/plain/dynamicProvider";
2524
import type { WithLocaleProps } from "@lib/withLocale";
2625
import type { WithNonceProps } from "@lib/withNonce";
2726

@@ -266,7 +265,6 @@ const AppProviders = (props: PageWrapperProps) => {
266265

267266
const RemainingProviders = (
268267
<EventCollectionProvider options={{ apiPath: "/api/collect-events" }}>
269-
<PlainChat />
270268
<CustomI18nextProvider i18n={props.i18n}>
271269
<TooltipProvider>
272270
{/* color-scheme makes background:transparent not work which is required by embed. We need to ensure next-theme adds color-scheme to `body` instead of `html`(https://github.com/pacocoursey/next-themes/blob/main/src/index.tsx#L74). Once that's done we can enable color-scheme support */}

apps/web/lib/app-providers.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import { useFlags } from "@calcom/features/flags/hooks";
2020
import { MetaProvider } from "@calcom/ui";
2121

2222
import useIsBookingPage from "@lib/hooks/useIsBookingPage";
23-
import PlainChat from "@lib/plain/dynamicProvider";
2423
import type { WithLocaleProps } from "@lib/withLocale";
2524
import type { WithNonceProps } from "@lib/withNonce";
2625

@@ -295,7 +294,6 @@ const AppProviders = (props: AppPropsWithChildren) => {
295294

296295
const RemainingProviders = (
297296
<EventCollectionProvider options={{ apiPath: "/api/collect-events" }}>
298-
<PlainChat />
299297
<CustomI18nextProvider {...propsWithoutNonce}>
300298
<TooltipProvider>
301299
<CalcomThemeProvider

apps/web/lib/plain/plainChat.tsx

-16
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ interface PlainChatConfig {
3434
chatButtons: Array<{
3535
icon: string;
3636
text: string;
37-
type: string;
3837
form?: {
3938
fields: Array<{
4039
type: string;
@@ -43,10 +42,7 @@ interface PlainChatConfig {
4342
icon: string;
4443
text: string;
4544
threadDetails: {
46-
severity: string;
4745
labelTypeIds: Array<string>;
48-
issueType: string;
49-
priority: string;
5046
};
5147
}>;
5248
}>;
@@ -154,17 +150,14 @@ const PlainChat = () => {
154150
{
155151
icon: "chat",
156152
text: "Ask a question",
157-
type: "primary",
158153
},
159154
{
160155
icon: "bulb",
161156
text: "Send feedback",
162-
type: "default",
163157
},
164158
{
165159
icon: "error",
166160
text: "Report an issue",
167-
type: "default",
168161
form: {
169162
fields: [
170163
{
@@ -175,30 +168,21 @@ const PlainChat = () => {
175168
icon: "support",
176169
text: "I'm unable to use the app",
177170
threadDetails: {
178-
severity: "critical",
179-
issueType: "critical",
180171
labelTypeIds: ["lt_01JFJWNWAC464N8DZ6YE71YJRF"],
181-
priority: "u",
182172
},
183173
},
184174
{
185175
icon: "error",
186176
text: "Major functionality degraded",
187177
threadDetails: {
188-
severity: "major",
189-
issueType: "major",
190178
labelTypeIds: ["lt_01JFJWP3KECF1YQES6XF212RFW"],
191-
priority: "h",
192179
},
193180
},
194181
{
195182
icon: "bug",
196183
text: "Minor annoyance",
197184
threadDetails: {
198-
severity: "minor",
199-
issueType: "minor",
200185
labelTypeIds: ["lt_01JFJWPC8ADW0PK28JHMJR6NSS"],
201-
priority: "l",
202186
},
203187
},
204188
],

apps/web/modules/bookings/views/bookings-listing-view.tsx

+9-9
Original file line numberDiff line numberDiff line change
@@ -219,17 +219,17 @@ function BookingsContent({ status }: BookingsProps) {
219219
}, [query.data]);
220220

221221
const finalData = useMemo<RowData[]>(() => {
222-
if (bookingsToday.length > 0 && status === "upcoming") {
223-
const merged: RowData[] = [
224-
{ type: "today" as const },
225-
...bookingsToday,
226-
{ type: "next" as const },
227-
...flatData,
228-
];
229-
return merged;
230-
} else {
222+
if (status !== "upcoming") {
231223
return flatData;
232224
}
225+
const merged: RowData[] = [];
226+
if (bookingsToday.length > 0) {
227+
merged.push({ type: "today" as const }, ...bookingsToday);
228+
}
229+
if (flatData.length > 0) {
230+
merged.push({ type: "next" as const }, ...flatData);
231+
}
232+
return merged;
233233
}, [bookingsToday, flatData, status]);
234234

235235
const table = useReactTable<RowData>({

apps/web/next.config.js

+13
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,14 @@ const nextConfig = {
297297
source: "/forms/:formQuery*",
298298
destination: "/apps/routing-forms/routing-link/:formQuery*",
299299
},
300+
{
301+
source: "/routing",
302+
destination: "/routing/forms",
303+
},
304+
{
305+
source: "/routing/:path*",
306+
destination: "/apps/routing-forms/:path*",
307+
},
300308
{
301309
source: "/success/:path*",
302310
has: [
@@ -528,6 +536,11 @@ const nextConfig = {
528536
},
529537
async redirects() {
530538
const redirects = [
539+
{
540+
source: "/apps/routing-forms",
541+
destination: "/routing/forms",
542+
permanent: false,
543+
},
531544
{
532545
source: "/api/app-store/:path*",
533546
destination: "/app-store/:path*",

apps/web/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@calcom/web",
3-
"version": "4.9.10",
3+
"version": "4.9.11",
44
"private": true,
55
"scripts": {
66
"analyze": "ANALYZE=true next build",

apps/web/pages/_app.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import CacheProvider from "react-inlinesvg/provider";
77
import { trpc } from "@calcom/trpc/react";
88

99
import type { AppProps } from "@lib/app-providers";
10+
import PlainChat from "@lib/plain/dynamicProvider";
1011

1112
import "../styles/globals.css";
1213

@@ -21,6 +22,7 @@ function MyApp(props: AppProps) {
2122

2223
return (
2324
<SessionProvider session={pageProps.session ?? undefined}>
25+
<PlainChat />
2426
{/* @ts-expect-error FIXME remove this comment when upgrading typescript to v5 */}
2527
<CacheProvider>
2628
{Component.PageWrapper ? <Component.PageWrapper {...props} /> : <Component {...pageProps} />}
Binary file not shown.

0 commit comments

Comments
 (0)