Skip to content

Scheduling infrastructure for absolutely everyone.

refactor: Use template literal instead of '+' operator (#11444)

Aldrin3e08c668882c
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 86837c2f940..7b477aef5f0 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -94,11 +94,13 @@ To develop locally:
6. Setup Node
If your Node version does not meet the project's requirements as instructed by the docs, "nvm" (Node Version Manager) allows using Node at the version required by the project:
+
```sh
nvm use
```
-
+
You first might need to install the specific version and then use it:
+
```sh
nvm install && nvm use
```
@@ -134,6 +136,7 @@ yarn test-e2e
```
#### Resolving issues
+
##### E2E test browsers not installed
Run `npx playwright install` to download test browsers and resolve the error below when running `yarn test-e2e`:
@@ -157,4 +160,4 @@ If you get errors, be sure to fix them before committing.
- Be sure to [check the "Allow edits from maintainers" option](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork) while creating your PR.
- If your PR refers to or fixes an issue, be sure to add `refs #XXX` or `fixes #XXX` to the PR description. Replacing `XXX` with the respective issue number. See more about [Linking a pull request to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue).
- Be sure to fill the PR Template accordingly.
-- Review [App Contribution Guidelines](./packages/app-store/CONTRIBUTING.md) when building integrations
\ No newline at end of file
+- Review [App Contribution Guidelines](./packages/app-store/CONTRIBUTING.md) when building integrations
diff --git a/README.md b/README.md
index a2fe71fa81a..1f64390a7aa 100644
--- a/README.md
+++ b/README.md
@@ -144,17 +144,20 @@ Here is what you need to be able to run Cal.com.
```
4. Set up your `.env` file
+
- Duplicate `.env.example` to `.env`
- Use `openssl rand -base64 32` to generate a key and add it under `NEXTAUTH_SECRET` in the `.env` file.
- Use `openssl rand -base64 24` to generate a key and add it under `CALENDSO_ENCRYPTION_KEY` in the `.env` file.
5. Setup Node
If your Node version does not meet the project's requirements as instructed by the docs, "nvm" (Node Version Manager) allows using Node at the version required by the project:
+
```sh
nvm use
```
-
+
You first might need to install the specific version and then use it:
+
```sh
nvm install && nvm use
```
@@ -234,6 +237,7 @@ echo 'NEXT_PUBLIC_DEBUG=1' >> .env
```
1. Run [mailhog](https://github.com/mailhog/MailHog) to view emails sent during development
+
> **_NOTE:_** Required when `E2E_TEST_MAILHOG_ENABLED` is "1"
```sh
@@ -273,6 +277,7 @@ yarn playwright show-report test-results/reports/playwright-html-report
```
#### Resolving issues
+
##### E2E test browsers not installed
Run `npx playwright install` to download test browsers and resolve the error below when running `yarn test-e2e`:
@@ -492,9 +497,8 @@ following
4. Select Basecamp 4 as the product to integrate with.
5. Set the Redirect URL for OAuth `<Cal.com URL>/api/integrations/basecamp3/callback` replacing Cal.com URL with the URI at which your application runs.
6. Click on done and copy the Client ID and secret into the `BASECAMP3_CLIENT_ID` and `BASECAMP3_CLIENT_SECRET` fields.
-7. Set the `BASECAMP3_CLIENT_SECRET` env variable to `{your_domain} ({support_email})`.
-For example, `Cal.com ([email protected])`.
-
+7. Set the `BASECAMP3_CLIENT_SECRET` env variable to `{your_domain} ({support_email})`.
+ For example, `Cal.com ([email protected])`.
### Obtaining HubSpot Client ID and Secret
@@ -529,6 +533,7 @@ For example, `Cal.com ([email protected])`.
### Obtaining Zoho Calendar Client ID and Secret
[Follow these steps](./packages/app-store/zohocalendar/)
+
### Obtaining Zoho Bigin Client ID and Secret
[Follow these steps](./packages/app-store/zoho-bigin/)
diff --git a/apps/ai/README.md b/apps/ai/README.md
index adcf03ba57c..95316cd3563 100644
--- a/apps/ai/README.md
+++ b/apps/ai/README.md
@@ -4,9 +4,9 @@ Welcome to the first stage of Cal.ai!
This app lets you chat with your calendar via email:
- - Turn informal emails into bookings eg. forward "wanna meet tmrw at 2pm?"
- - List and rearrange your bookings eg. "Cancel my next meeting"
- - Answer basic questions about your busiest times eg. "How does my Tuesday look?"
+- Turn informal emails into bookings eg. forward "wanna meet tmrw at 2pm?"
+- List and rearrange your bookings eg. "Cancel my next meeting"
+- Answer basic questions about your busiest times eg. "How does my Tuesday look?"
The core logic is contained in [agent/route.ts](/apps/ai/src/app/api/agent/route.ts). Here, a [LangChain Agent Executor](https://docs.langchain.com/docs/components/agents/agent-executor) is tasked with following your instructions. Given your last-known timezone, working hours, and busy times, it attempts to CRUD your bookings.
@@ -24,10 +24,10 @@ If you haven't yet, please run the [root setup](/README.md) steps.
Before running the app, please see [env.mjs](./src/env.mjs) for all required environment variables. You'll need:
- - An [OpenAI API key](https://platform.openai.com/account/api-keys) with access to GPT-4
- - A [SendGrid API key](https://app.sendgrid.com/settings/api_keys)
- - A default sender email (for example, `[email protected]`)
- - The Cal.ai's app ID and URL (see [add.ts](/packages/app-store/cal-ai/api/index.ts))
+- An [OpenAI API key](https://platform.openai.com/account/api-keys) with access to GPT-4
+- A [SendGrid API key](https://app.sendgrid.com/settings/api_keys)
+- A default sender email (for example, `[email protected]`)
+- The Cal.ai's app ID and URL (see [add.ts](/packages/app-store/cal-ai/api/index.ts))
To stand up the API and AI apps simultaneously, simply run `yarn dev:ai`.
diff --git a/apps/ai/src/utils/agent.ts b/apps/ai/src/utils/agent.ts
index f5694160cfa..1ef33191987 100644
--- a/apps/ai/src/utils/agent.ts
+++ b/apps/ai/src/utils/agent.ts
@@ -74,18 +74,19 @@ ${
? `The email references the following @usernames and emails: ${users
.map(
(u) =>
- (u.id ? `, id: ${u.id}` : "id: (non user)") +
- (u.username
- ? u.type === "fromUsername"
- ? `, username: @${u.username}`
- : ", username: REDACTED"
- : ", (no username)") +
- (u.email
- ? u.type === "fromEmail"
- ? `, email: ${u.email}`
- : ", email: REDACTED"
- : ", (no email)") +
- ";"
+ `${
+ (u.id ? `, id: ${u.id}` : "id: (non user)") +
+ (u.username
+ ? u.type === "fromUsername"
+ ? `, username: @${u.username}`
+ : ", username: REDACTED"
+ : ", (no username)") +
+ (u.email
+ ? u.type === "fromEmail"
+ ? `, email: ${u.email}`
+ : ", email: REDACTED"
+ : ", (no email)")
+ };`
)
.join("\n")}`
: ""
diff --git a/apps/api/test/lib/bookings/_post.test.ts b/apps/api/test/lib/bookings/_post.test.ts
index 5e4b17f23d8..a36b3b70fc3 100644
--- a/apps/api/test/lib/bookings/_post.test.ts
+++ b/apps/api/test/lib/bookings/_post.test.ts
@@ -1,3 +1,5 @@
+import prismaMock from "../../../../../tests/libs/__mocks__/prisma";
+
import type { Request, Response } from "express";
import type { NextApiRequest, NextApiResponse } from "next";
import { createMocks } from "node-mocks-http";
@@ -8,7 +10,6 @@ import sendPayload from "@calcom/features/webhooks/lib/sendPayload";
import { buildBooking, buildEventType, buildWebhook } from "@calcom/lib/test/builder";
import prisma from "@calcom/prisma";
-import prismaMock from "../../../../../tests/libs/__mocks__/prisma";
import handler from "../../../pages/api/bookings/_post";
type CustomNextApiRequest = NextApiRequest & Request;
diff --git a/apps/web/components/apps/AppPage.tsx b/apps/web/components/apps/AppPage.tsx
index 84b4102dbd0..05c095caa10 100644
--- a/apps/web/components/apps/AppPage.tsx
+++ b/apps/web/components/apps/AppPage.tsx
@@ -265,8 +265,8 @@ export const AppPage = ({
{price !== 0 && (
<span className="block text-right">
- {feeType === "usage-based" ? commission + "% + " + priceInDollar + "/booking" : priceInDollar}
- {feeType === "monthly" && "/" + t("month")}
+ {feeType === "usage-based" ? `${commission}% + ${priceInDollar}/booking` : priceInDollar}
+ {feeType === "monthly" && `/${t("month")}`}
</span>
)}
@@ -286,7 +286,7 @@ export const AppPage = ({
currency: "USD",
useGrouping: false,
}).format(price)}
- {feeType === "monthly" && "/" + t("month")}
+ {feeType === "monthly" && `/${t("month")}`}
</>
)}
</span>
@@ -323,7 +323,7 @@ export const AppPage = ({
target="_blank"
rel="noreferrer"
className="text-emphasis font-normal no-underline hover:underline"
- href={"mailto:" + email}>
+ href={`mailto:${email}`}>
<Mail className="text-subtle -mt-px mr-1 inline h-4 w-4" />
{email}
diff --git a/apps/web/components/apps/CalendarListContainer.tsx b/apps/web/components/apps/CalendarListContainer.tsx
index 87bce77cdce..b2c81351194 100644
--- a/apps/web/components/apps/CalendarListContainer.tsx
+++ b/apps/web/components/apps/CalendarListContainer.tsx
@@ -130,7 +130,7 @@ function ConnectedCalendarsList(props: Props) {
title={t("something_went_wrong")}
message={
<span>
- <Link href={"/apps/" + item.integration.slug}>{item.integration.name}</Link>:{" "}
+ <Link href={`/apps/${item.integration.slug}`}>{item.integration.name}</Link>:{" "}
{t("calendar_error")}
</span>
}
diff --git a/apps/web/components/booking/BookingListItem.tsx b/apps/web/components/booking/BookingListItem.tsx
index 86cbb4daa8e..e3f4fa7b22e 100644
--- a/apps/web/components/booking/BookingListItem.tsx
+++ b/apps/web/components/booking/BookingListItem.tsx
@@ -380,7 +380,7 @@ function BookingListItem(booking: BookingItemProps) {
</div>
</Link>
</td>
- <td className={"w-full px-4" + (isRejected ? " line-through" : "")}>
+ <td className={`w-full px-4${isRejected ? " line-through" : ""}`}>
<Link href={bookingLink}>
{/* Time and Badges for mobile */}
<div className="w-full pb-2 pt-4 sm:hidden">
@@ -576,7 +576,7 @@ const FirstAttendee = ({
<a
key={user.email}
className=" hover:text-blue-500"
- href={"mailto:" + user.email}
+ href={`mailto:${user.email}`}
onClick={(e) => e.stopPropagation()}>
{user.name}
</a>
@@ -590,7 +590,7 @@ type AttendeeProps = {
const Attendee = ({ email, name }: AttendeeProps) => {
return (
- <a className="hover:text-blue-500" href={"mailto:" + email} onClick={(e) => e.stopPropagation()}>
+ <a className="hover:text-blue-500" href={`mailto:${email}`} onClick={(e) => e.stopPropagation()}>
{name || email}
</a>
);
diff --git a/apps/web/components/dialog/EditLocationDialog.tsx b/apps/web/components/dialog/EditLocationDialog.tsx
index c1be998af38..b891235c650 100644
--- a/apps/web/components/dialog/EditLocationDialog.tsx
+++ b/apps/web/components/dialog/EditLocationDialog.tsx
@@ -121,7 +121,7 @@ export const EditLocationDialog = (props: ISetLocationDialog) => {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: `Invalid URL for ${eventLocationType.label}. ${
- sampleUrl ? "Sample URL: " + sampleUrl : ""
+ sampleUrl ? `Sample URL: ${sampleUrl}` : ""
}`,
});
}
diff --git a/apps/web/components/eventtype/EventAdvancedTab.tsx b/apps/web/components/eventtype/EventAdvancedTab.tsx
index 9379776d510..11b1366ea0a 100644
--- a/apps/web/components/eventtype/EventAdvancedTab.tsx
+++ b/apps/web/components/eventtype/EventAdvancedTab.tsx
@@ -67,7 +67,7 @@ export const EventAdvancedTab = ({ eventType, team }: Pick<EventTypeSetupProps,
(!user?.theme && typeof document !== "undefined" && document.documentElement.classList.contains("dark"));
eventType.bookingFields.forEach(({ name }) => {
- bookingFields[name] = name + " input";
+ bookingFields[name] = `${name} input`;
});
const eventNameObject: EventNameObjectType = {
diff --git a/apps/web/components/eventtype/EventLimitsTab.tsx b/apps/web/components/eventtype/EventLimitsTab.tsx
index 504bb01db38..2d422c7344f 100644
--- a/apps/web/components/eventtype/EventLimitsTab.tsx
+++ b/apps/web/components/eventtype/EventLimitsTab.tsx
@@ -189,7 +189,7 @@ export const EventLimitsTab = ({ eventType }: Pick<EventTypeSetupProps, "eventTy
value: 0,
},
...[5, 10, 15, 20, 30, 45, 60, 90, 120].map((minutes) => ({
- label: minutes + " " + t("minutes"),
+ label: `minutes ${t("minutes")}`,
value: minutes,
})),
];
@@ -225,7 +225,7 @@ export const EventLimitsTab = ({ eventType }: Pick<EventTypeSetupProps, "eventTy
value: 0,
},
...[5, 10, 15, 20, 30, 45, 60, 90, 120].map((minutes) => ({
- label: minutes + " " + t("minutes"),
+ label: `minutes ${t("minutes")}`,
value: minutes,
})),
];
@@ -272,7 +272,7 @@ export const EventLimitsTab = ({ eventType }: Pick<EventTypeSetupProps, "eventTy
value: -1,
},
...[5, 10, 15, 20, 30, 45, 60, 75, 90, 105, 120].map((minutes) => ({
- label: minutes + " " + t("minutes"),
+ label: `minutes ${t("minutes")}`,
value: minutes,
})),
];
diff --git a/apps/web/components/eventtype/EventTypeSingleLayout.tsx b/apps/web/components/eventtype/EventTypeSingleLayout.tsx
index be3953160d3..c0913422b9c 100644
--- a/apps/web/components/eventtype/EventTypeSingleLayout.tsx
+++ b/apps/web/components/eventtype/EventTypeSingleLayout.tsx
@@ -247,7 +247,7 @@ function EventTypeSingleLayout({
return (
<Shell
backPath="/event-types"
- title={eventType.title + " | " + t("event_type")}
+ title={`${eventType.title} | ${t("event_type")}`}
heading={eventType.title}
CTA={
<div className="flex items-center justify-end">
diff --git a/apps/web/components/team/screens/Team.tsx b/apps/web/components/team/screens/Team.tsx
index 1bad87cf43e..2b1c0559152 100644
--- a/apps/web/components/team/screens/Team.tsx
+++ b/apps/web/components/team/screens/Team.tsx
@@ -22,7 +22,7 @@ const Member = ({ member, teamName }: { member: MemberType; teamName: string | n
return (
<Link key={member.id} href={{ pathname: `/${member.username}`, query: queryParamsToForward }}>
<div className="sm:min-w-80 sm:max-w-80 bg-default hover:bg-muted border-subtle group flex min-h-full flex-col space-y-2 rounded-md border p-4 hover:cursor-pointer">
- <Avatar size="md" alt={member.name || ""} imageSrc={"/" + member.username + "/avatar.png"} />
+ <Avatar size="md" alt={member.name || ""} imageSrc={`/${member.username}/avatar.png`} />
<section className="mt-2 line-clamp-4 w-full space-y-1">
<p className="text-default font-medium">{member.name}</p>
<div className="text-subtle line-clamp-3 overflow-ellipsis text-sm font-normal">
diff --git a/apps/web/lib/app-providers.tsx b/apps/web/lib/app-providers.tsx
index 2c81796c72e..a3f712ed919 100644
--- a/apps/web/lib/app-providers.tsx
+++ b/apps/web/lib/app-providers.tsx
@@ -179,14 +179,14 @@ function getThemeProviderProps({
);
}
- const appearanceIdSuffix = themeBasis ? ":" + themeBasis : "";
+ const appearanceIdSuffix = themeBasis ? `:${themeBasis}` : "";
const forcedTheme = themeSupport === ThemeSupport.None ? "light" : undefined;
let embedExplicitlySetThemeSuffix = "";
if (typeof window !== "undefined") {
const embedTheme = window.getEmbedTheme();
if (embedTheme) {
- embedExplicitlySetThemeSuffix = ":" + embedTheme;
+ embedExplicitlySetThemeSuffix = `:${embedTheme}`;
}
}
diff --git a/apps/web/lib/csp.ts b/apps/web/lib/csp.ts
index 4896e9b2c84..830ad7ffff5 100644
--- a/apps/web/lib/csp.ts
+++ b/apps/web/lib/csp.ts
@@ -21,7 +21,7 @@ function getCspPolicy(nonce: string) {
script-src ${
IS_PRODUCTION
? // 'self' 'unsafe-inline' https: added for Browsers not supporting strict-dynamic not supporting strict-dynamic
- "'nonce-" + nonce + "' 'strict-dynamic' 'self' 'unsafe-inline' https:"
+ `'nonce-${nonce}' 'strict-dynamic' 'self' 'unsafe-inline' https:`
: // Note: We could use 'strict-dynamic' with 'nonce-..' instead of unsafe-inline but there are some streaming related scripts that get blocked(because they don't have nonce on them). It causes a really frustrating full page error model by Next.js to show up sometimes
"'unsafe-inline' 'unsafe-eval' https: http:"
};
diff --git a/apps/web/lib/withEmbedSsr.tsx b/apps/web/lib/withEmbedSsr.tsx
index 599704236eb..9ee8ebe1e49 100644
--- a/apps/web/lib/withEmbedSsr.tsx
+++ b/apps/web/lib/withEmbedSsr.tsx
@@ -15,14 +15,9 @@ export default function withEmbedSsr(getServerSideProps: GetServerSideProps) {
const destinationUrlObj = new URL(ssrResponse.redirect.destination, "https://base");
// Make sure that redirect happens to /embed page and pass on embed query param as is for preserving Cal JS API namespace
- const newDestinationUrl =
- destinationUrlObj.pathname +
- "/embed?" +
- destinationUrlObj.searchParams.toString() +
- "&layout=" +
- layout +
- "&embed=" +
- embed;
+ const newDestinationUrl = `${
+ destinationUrlObj.pathname
+ }/embed?${destinationUrlObj.searchParams.toString()}&layout=${layout}&embed=${embed}`;
return {
...ssrResponse,
diff --git a/apps/web/next.config.js b/apps/web/next.config.js
index 5922803442f..262e1f6e5a1 100644
--- a/apps/web/next.config.js
+++ b/apps/web/next.config.js
@@ -21,11 +21,11 @@ process.env.NEXT_PUBLIC_CALCOM_VERSION = version;
// So we can test deploy previews preview
if (process.env.VERCEL_URL && !process.env.NEXT_PUBLIC_WEBAPP_URL) {
- process.env.NEXT_PUBLIC_WEBAPP_URL = "https://" + process.env.VERCEL_URL;
+ process.env.NEXT_PUBLIC_WEBAPP_URL = `https://${process.env.VERCEL_URL}`;
}
// Check for configuration of NEXTAUTH_URL before overriding
if (!process.env.NEXTAUTH_URL && process.env.NEXT_PUBLIC_WEBAPP_URL) {
- process.env.NEXTAUTH_URL = process.env.NEXT_PUBLIC_WEBAPP_URL + "/api/auth";
+ process.env.NEXTAUTH_URL = `${process.env.NEXT_PUBLIC_WEBAPP_URL}/api/auth`;
}
if (!process.env.NEXT_PUBLIC_WEBSITE_URL) {
process.env.NEXT_PUBLIC_WEBSITE_URL = process.env.NEXT_PUBLIC_WEBAPP_URL;
diff --git a/apps/web/pages/[user].tsx b/apps/web/pages/[user].tsx
index 797684352e8..763cd86ccf6 100644
--- a/apps/web/pages/[user].tsx
+++ b/apps/web/pages/[user].tsx
@@ -125,7 +125,7 @@ export function UserPage(props: InferGetServerSidePropsType<typeof getServerSide
{user.away ? (
<div className="overflow-hidden rounded-sm border ">
<div className="text-muted p-8 text-center">
- <h2 className="font-cal text-default mb-2 text-3xl">😴{" " + t("user_away")}</h2>
+ <h2 className="font-cal text-default mb-2 text-3xl">😴{` ${t("user_away")}`}</h2>
<p className="mx-auto max-w-md">{t("user_away_description") as string}</p>
</div>
</div>
diff --git a/apps/web/pages/api/teams/googleworkspace/add.ts b/apps/web/pages/api/teams/googleworkspace/add.ts
index 2955a034541..7d2f3d4763b 100644
--- a/apps/web/pages/api/teams/googleworkspace/add.ts
+++ b/apps/web/pages/api/teams/googleworkspace/add.ts
@@ -19,7 +19,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
return res.status(400).json({ message: "Google client_secret missing." });
// use differnt callback to normal calendar connection
- const redirect_uri = WEBAPP_URL + "/api/teams/googleworkspace/callback";
+ const redirect_uri = `${WEBAPP_URL}/api/teams/googleworkspace/callback`;
const oAuth2Client = new google.auth.OAuth2(client_id, client_secret, redirect_uri);
const authUrl = oAuth2Client.generateAuthUrl({
diff --git a/apps/web/pages/api/teams/googleworkspace/callback.ts b/apps/web/pages/api/teams/googleworkspace/callback.ts
index 07b17cfaa87..8b44c5b8276 100644
--- a/apps/web/pages/api/teams/googleworkspace/callback.ts
+++ b/apps/web/pages/api/teams/googleworkspace/callback.ts
@@ -36,7 +36,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
if (!client_secret || typeof client_secret !== "string")
return res.status(400).json({ message: "Google client_secret missing." });
- const redirect_uri = WEBAPP_URL + "/api/teams/googleworkspace/callback";
+ const redirect_uri = `${WEBAPP_URL}/api/teams/googleworkspace/callback`;
const oAuth2Client = new google.auth.OAuth2(client_id, client_secret, redirect_uri);
if (!code) {
@@ -54,11 +54,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
});
if (!teamId) {
- res.redirect(getSafeRedirectUrl(WEBAPP_URL + "/settings") ?? `${WEBAPP_URL}/teams`);
+ res.redirect(getSafeRedirectUrl(`${WEBAPP_URL}/settings`) ?? `${WEBAPP_URL}/teams`);
}
res.redirect(
- getSafeRedirectUrl(WEBAPP_URL + `/settings/teams/${teamId}/members?inviteModal=true&bulk=true`) ??
+ getSafeRedirectUrl(`${WEBAPP_URL}/settings/teams/${teamId}/members?inviteModal=true&bulk=true`) ??
`${WEBAPP_URL}/teams`
);
}
diff --git a/apps/web/pages/apps/categories/index.tsx b/apps/web/pages/apps/categories/index.tsx
index 936e98804b7..7b40ade47b0 100644
--- a/apps/web/pages/apps/categories/index.tsx
+++ b/apps/web/pages/apps/categories/index.tsx
@@ -31,7 +31,7 @@ export default function Apps({ categories }: inferSSRProps<typeof getServerSideP
{categories.map((category) => (
<Link
key={category.name}
- href={"/apps/categories/" + category.name}
+ href={`/apps/categories/${category.name}`}
data-testid={`app-store-category-${category.name}`}
className="bg-subtle relative flex rounded-sm px-6 py-4 sm:block">
<div className="self-center">
diff --git a/apps/web/pages/auth/sso/[provider].tsx b/apps/web/pages/auth/sso/[provider].tsx
index a95be8c182d..f83c5e455b7 100644
--- a/apps/web/pages/auth/sso/[provider].tsx
+++ b/apps/web/pages/auth/sso/[provider].tsx
@@ -30,12 +30,12 @@ export default function Provider(props: SSOProviderPageProps) {
const email = searchParams?.get("email");
if (!email) {
- router.push("/auth/error?error=" + "Email not provided");
+ router.push(`/auth/error?error=Email not provided`);
return;
}
if (!props.isSAMLLoginEnabled) {
- router.push("/auth/error?error=" + "SAML login not enabled");
+ router.push(`/auth/error?error=SAML login not enabled`);
return;
}
@@ -56,7 +56,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
const providerParam = asStringOrNull(context.query.provider);
const emailParam = asStringOrNull(context.query.email);
const usernameParam = asStringOrNull(context.query.username);
- const successDestination = "/getting-started" + (usernameParam ? `?username=${usernameParam}` : "");
+ const successDestination = `/getting-started${usernameParam ? `?username=${usernameParam}` : ""}`;
if (!providerParam) {
throw new Error(`File is not named sso/[provider]`);
}
@@ -120,7 +120,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
if (error) {
return {
redirect: {
- destination: "/auth/error?error=" + error,
+ destination: `/auth/error?error=${error}`,
permanent: false,
},
};
diff --git a/apps/web/pages/auth/verify.tsx b/apps/web/pages/auth/verify.tsx
index 12d2c4c4f59..8f6193d5ef6 100644
--- a/apps/web/pages/auth/verify.tsx
+++ b/apps/web/pages/auth/verify.tsx
@@ -120,7 +120,7 @@ export default function Verify() {
? "Your payment failed"
: sessionId
? "Payment successful!"
- : "Verify your email" + " | " + APP_NAME}
+ : `Verify your email | ${APP_NAME}`}
</title>
</Head>
<div className="flex min-h-screen flex-col items-center justify-center px-6">
diff --git a/apps/web/pages/availability/[schedule].tsx b/apps/web/pages/availability/[schedule].tsx
index d4dd83c3814..da393efe05e 100644
--- a/apps/web/pages/availability/[schedule].tsx
+++ b/apps/web/pages/availability/[schedule].tsx
@@ -151,7 +151,7 @@ export default function Availability() {
return (
<Shell
backPath={fromEventType ? true : "/availability"}
- title={schedule?.name ? schedule.name + " | " + t("availability") : t("availability")}
+ title={schedule?.name ? `${schedule.name} | ${t("availability")}` : t("availability")}
heading={
<Controller
control={form.control}
diff --git a/apps/web/pages/availability/troubleshoot.tsx b/apps/web/pages/availability/troubleshoot.tsx
index f4a6e43400d..e3bfd24f0e7 100644
--- a/apps/web/pages/availability/troubleshoot.tsx
+++ b/apps/web/pages/availability/troubleshoot.tsx
@@ -133,7 +133,7 @@ Troubleshoot.PageWrapper = PageWrapper;
function convertMinsToHrsMins(mins: number) {
const h = Math.floor(mins / 60);
const m = mins % 60;
- const hs = h < 10 ? "0" + h : h;
- const ms = m < 10 ? "0" + m : m;
+ const hs = h < 10 ? `0${h}` : h;
+ const ms = m < 10 ? `0${m}` : m;
return `${hs}:${ms}`;
}
diff --git a/apps/web/pages/booking/[uid].tsx b/apps/web/pages/booking/[uid].tsx
index d96bc65361b..b07f79e00a6 100644
--- a/apps/web/pages/booking/[uid].tsx
+++ b/apps/web/pages/booking/[uid].tsx
@@ -269,13 +269,13 @@ export default function Success(props: SuccessProps) {
}
if (needsConfirmation) {
if (props.profile.name !== null) {
- return t("user_needs_to_confirm_or_reject_booking" + titleSuffix, {
+ return t(`user_needs_to_confirm_or_reject_booking${titleSuffix}`, {
user: props.profile.name,
});
}
- return t("needs_to_be_confirmed_or_rejected" + titleSuffix);
+ return t(`needs_to_be_confirmed_or_rejected${titleSuffix}`);
}
- return t("emailed_you_and_attendees" + titleSuffix);
+ return t(`emailed_you_and_attendees${titleSuffix}`);
}
// This is a weird case where the same route can be opened in booking flow as a success page or as a booking detail page from the app
@@ -592,23 +592,24 @@ export default function Success(props: SuccessProps) {
</span>
<div className="justify-left mt-1 flex text-left sm:mt-0">
<Link
- href={
- `https://calendar.google.com/calendar/r/eventedit?dates=${date
- .utc()
- .format("YYYYMMDDTHHmmss[Z]")}/${date
- .add(calculatedDuration, "minute")
- .utc()
- .format("YYYYMMDDTHHmmss[Z]")}&text=${eventName}&details=${
- props.eventType.description
- }` +
- (typeof locationVideoCallUrl === "string"
- ? "&location=" + encodeURIComponent(locationVideoCallUrl)
- : "") +
- (props.eventType.recurringEvent
- ? "&recur=" +
- encodeURIComponent(new RRule(props.eventType.recurringEvent).toString())
- : "")
- }
+ href={`https://calendar.google.com/calendar/r/eventedit?dates=${date
+ .utc()
+ .format("YYYYMMDDTHHmmss[Z]")}/${date
+ .add(calculatedDuration, "minute")
+ .utc()
+ .format("YYYYMMDDTHHmmss[Z]")}&text=${eventName}&details=${
+ props.eventType.description
+ }${
+ typeof locationVideoCallUrl === "string"
+ ? `&location=${encodeURIComponent(locationVideoCallUrl)}`
+ : ""
+ }${
+ props.eventType.recurringEvent
+ ? `&recur=${encodeURIComponent(
+ new RRule(props.eventType.recurringEvent).toString()
+ )}`
+ : ""
+ }`}
className="text-default border-subtle h-10 w-10 rounded-sm border px-3 py-2 ltr:mr-2 rtl:ml-2">
<svg
className="-mt-1.5 inline-block h-4 w-4"
@@ -622,17 +623,17 @@ export default function Success(props: SuccessProps) {
<Link
href={
encodeURI(
- "https://outlook.live.com/calendar/0/deeplink/compose?body=" +
- props.eventType.description +
- "&enddt=" +
- date.add(calculatedDuration, "minute").utc().format() +
- "&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt=" +
- date.utc().format() +
- "&subject=" +
- eventName
+ `https://outlook.live.com/calendar/0/deeplink/compose?body=${
+ props.eventType.description
+ }&enddt=${date
+ .add(calculatedDuration, "minute")
+ .utc()
+ .format()}&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt=${date
+ .utc()
+ .format()}&subject=${eventName}`
) +
(locationVideoCallUrl
- ? "&location=" + encodeURIComponent(locationVideoCallUrl)
+ ? `&location=${encodeURIComponent(locationVideoCallUrl)}`
: "")
}
className="border-subtle text-default mx-2 h-10 w-10 rounded-sm border px-3 py-2"
@@ -649,17 +650,17 @@ export default function Success(props: SuccessProps) {
<Link
href={
encodeURI(
- "https://outlook.office.com/calendar/0/deeplink/compose?body=" +
- props.eventType.description +
- "&enddt=" +
- date.add(calculatedDuration, "minute").utc().format() +
- "&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt=" +
- date.utc().format() +
- "&subject=" +
- eventName
+ `https://outlook.office.com/calendar/0/deeplink/compose?body=${
+ props.eventType.description
+ }&enddt=${date
+ .add(calculatedDuration, "minute")
+ .utc()
+ .format()}&path=%2Fcalendar%2Faction%2Fcompose&rru=addevent&startdt=${date
+ .utc()
+ .format()}&subject=${eventName}`
) +
(locationVideoCallUrl
- ? "&location=" + encodeURIComponent(locationVideoCallUrl)
+ ? `&location=${encodeURIComponent(locationVideoCallUrl)}`
: "")
}
className="text-default border-subtle mx-2 h-10 w-10 rounded-sm border px-3 py-2"
@@ -674,9 +675,9 @@ export default function Success(props: SuccessProps) {
</svg>
</Link>
<Link
- href={"data:text/calendar," + eventLink()}
+ href={`data:text/calendar,${eventLink()}`}
className="border-subtle text-default mx-2 h-10 w-10 rounded-sm border px-3 py-2"
- download={props.eventType.title + ".ics"}>
+ download={`${props.eventType.title}.ics`}>
<svg
version="1.1"
fill="currentColor"
diff --git a/apps/web/pages/event-types/index.tsx b/apps/web/pages/event-types/index.tsx
index cee8ee06a69..18847653c7a 100644
--- a/apps/web/pages/event-types/index.tsx
+++ b/apps/web/pages/event-types/index.tsx
@@ -140,13 +140,13 @@ const Item = ({ type, group, readOnly }: { type: EventType; group: EventTypeGrou
<div>
<span
className="text-default font-semibold ltr:mr-1 rtl:ml-1"
- data-testid={"event-type-title-" + type.id}>
+ data-testid={`event-type-title-${type.id}`}>
{type.title}
</span>
{group.profile.slug ? (
<small
className="text-subtle hidden font-normal leading-4 sm:inline"
- data-testid={"event-type-slug-" + type.id}>
+ data-testid={`event-type-slug-${type.id}`}>
{`/${
type.schedulingType !== SchedulingType.MANAGED ? group.profile.slug : t("username_placeholder")
}/${type.slug}`}
@@ -177,13 +177,13 @@ const Item = ({ type, group, readOnly }: { type: EventType; group: EventTypeGrou
<div>
<span
className="text-default font-semibold ltr:mr-1 rtl:ml-1"
- data-testid={"event-type-title-" + type.id}>
+ data-testid={`event-type-title-${type.id}`}>
{type.title}
</span>
{group.profile.slug ? (
<small
className="text-subtle hidden font-normal leading-4 sm:inline"
- data-testid={"event-type-slug-" + type.id}>
+ data-testid={`event-type-slug-${type.id}`}>
{`/${group.profile.slug}/${type.slug}`}
</small>
) : null}
@@ -479,7 +479,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL
</>
)}
<Dropdown modal={false}>
- <DropdownMenuTrigger asChild data-testid={"event-type-options-" + type.id}>
+ <DropdownMenuTrigger asChild data-testid={`event-type-options-${type.id}`}>
<Button
type="button"
variant="icon"
@@ -493,9 +493,9 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL
<DropdownMenuItem>
<DropdownItem
type="button"
- data-testid={"event-type-edit-" + type.id}
+ data-testid={`event-type-edit-${type.id}`}
StartIcon={Edit2}
- onClick={() => router.push("/event-types/" + type.id)}>
+ onClick={() => router.push(`/event-types/${type.id}`)}>
{t("edit")}
</DropdownItem>
</DropdownMenuItem>
@@ -505,7 +505,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL
<DropdownMenuItem className="outline-none">
<DropdownItem
type="button"
- data-testid={"event-type-duplicate-" + type.id}
+ data-testid={`event-type-duplicate-${type.id}`}
StartIcon={Copy}
onClick={() => openDuplicateModal(type, group)}>
{t("duplicate")}
@@ -555,7 +555,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL
</div>
<div className="min-w-9 mx-5 flex sm:hidden">
<Dropdown>
- <DropdownMenuTrigger asChild data-testid={"event-type-options-" + type.id}>
+ <DropdownMenuTrigger asChild data-testid={`event-type-options-${type.id}`}>
<Button type="button" variant="icon" color="secondary" StartIcon={MoreHorizontal} />
</DropdownMenuTrigger>
<DropdownMenuPortal>
@@ -573,7 +573,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL
</DropdownMenuItem>
<DropdownMenuItem className="outline-none">
<DropdownItem
- data-testid={"event-type-duplicate-" + type.id}
+ data-testid={`event-type-duplicate-${type.id}`}
onClick={() => {
navigator.clipboard.writeText(calLink);
showToast(t("link_copied"), "success");
@@ -588,7 +588,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL
{isNativeShare ? (
<DropdownMenuItem className="outline-none">
<DropdownItem
- data-testid={"event-type-duplicate-" + type.id}
+ data-testid={`event-type-duplicate-${type.id}`}
onClick={() => {
navigator
.share({
@@ -608,7 +608,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL
{!readOnly && (
<DropdownMenuItem className="outline-none">
<DropdownItem
- onClick={() => router.push("/event-types/" + type.id)}
+ onClick={() => router.push(`/event-types/${type.id}`)}
StartIcon={Edit}
className="w-full rounded-none">
{t("edit")}
@@ -620,7 +620,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL
<DropdownItem
onClick={() => openDuplicateModal(type, group)}
StartIcon={Copy}
- data-testid={"event-type-duplicate-" + type.id}>
+ data-testid={`event-type-duplicate-${type.id}`}>
{t("duplicate")}
</DropdownItem>
</DropdownMenuItem>
diff --git a/apps/web/pages/reschedule/[uid].tsx b/apps/web/pages/reschedule/[uid].tsx
index 5959e12c3c9..fd07ae5f610 100644
--- a/apps/web/pages/reschedule/[uid].tsx
+++ b/apps/web/pages/reschedule/[uid].tsx
@@ -63,14 +63,13 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
const eventType = booking.eventType ? booking.eventType : getDefaultEvent(dynamicEventSlugRef);
- const eventPage =
- (eventType.team
- ? "team/" + eventType.team.slug
+ const eventPage = `${
+ eventType.team
+ ? `team/${eventType.team.slug}`
: dynamicEventSlugRef
? booking.dynamicGroupSlugRef
- : booking.user?.username || "rick") /* This shouldn't happen */ +
- "/" +
- eventType?.slug;
+ : booking.user?.username || "rick" /* This shouldn't happen */
+ }/${eventType?.slug}`;
const destinationUrl = new URLSearchParams();
destinationUrl.set("rescheduleUid", seatReferenceUid || bookingId);
diff --git a/apps/web/pages/settings/my-account/calendars.tsx b/apps/web/pages/settings/my-account/calendars.tsx
index 71ca36af79f..2936f185359 100644
--- a/apps/web/pages/settings/my-account/calendars.tsx
+++ b/apps/web/pages/settings/my-account/calendars.tsx
@@ -190,7 +190,7 @@ const CalendarsView = () => {
}
<div className="flex-grow truncate pl-2">
<ListItemTitle component="h3" className="mb-1 space-x-2 rtl:space-x-reverse">
- <Link href={"/apps/" + item.integration.slug}>
+ <Link href={`/apps/${item.integration.slug}`}>
{item.integration.name || item.integration.title}
</Link>
{data?.destinationCalendar?.credentialId === item.credentialId && (
diff --git a/apps/web/pages/signup.tsx b/apps/web/pages/signup.tsx
index d9815255840..8aceea51bab 100644
--- a/apps/web/pages/signup.tsx
+++ b/apps/web/pages/signup.tsx
@@ -281,7 +281,7 @@ export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
return {
redirect: {
permanent: false,
- destination: "/auth/login?callbackUrl=" + `${WEBAPP_URL}/${ctx.query.callbackUrl}`,
+ destination: `/auth/login?callbackUrl=${WEBAPP_URL}/${ctx.query.callbackUrl}`,
},
};
}
diff --git a/apps/web/pages/team/[slug].tsx b/apps/web/pages/team/[slug].tsx
index b557bf41e8f..2adbfe768a5 100644
--- a/apps/web/pages/team/[slug].tsx
+++ b/apps/web/pages/team/[slug].tsx
@@ -102,7 +102,7 @@ function TeamPage({ team, isUnpublished, markdownStrippedBio, isValidOrgDomain }
items={type.users.map((user) => ({
alt: user.name || "",
title: user.name || "",
- image: "/" + user.username + "/avatar.png" || "",
+ image: `/${user.username}/avatar.png` || "",
}))}
/>
</div>
@@ -160,7 +160,7 @@ function TeamPage({ team, isUnpublished, markdownStrippedBio, isValidOrgDomain }
<div className="space-y-6" data-testid="event-types">
<div className="overflow-hidden rounded-sm border dark:border-gray-900">
<div className="text-muted p-8 text-center">
- <h2 className="font-cal text-emphasis mb-2 text-3xl">{" " + t("org_no_teams_yet")}</h2>
+ <h2 className="font-cal text-emphasis mb-2 text-3xl">{` ${t("org_no_teams_yet")}`}</h2>
<p className="text-emphasis mx-auto max-w-md">{t("org_no_teams_yet_description")}</p>
</div>
</div>
@@ -324,7 +324,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
...type,
users: type.users.map((user) => ({
...user,
- avatar: "/" + user.username + "/avatar.png",
+ avatar: `/${user.username}/avatar.png`,
})),
descriptionAsSafeHTML: markdownToSafeHTML(type.description),
})) ?? null;
diff --git a/apps/web/pages/video/[uid].tsx b/apps/web/pages/video/[uid].tsx
index f08568e7a85..f14fed2213f 100644
--- a/apps/web/pages/video/[uid].tsx
+++ b/apps/web/pages/video/[uid].tsx
@@ -95,12 +95,12 @@ export default function JoinCall(props: JoinCallPageProps) {
<meta property="og:image" content={SEO_IMG_OGIMG_VIDEO} />
<meta property="og:type" content="website" />
<meta property="og:url" content={`${WEBSITE_URL}/video`} />
- <meta property="og:title" content={APP_NAME + " Video"} />
+ <meta property="og:title" content={`${APP_NAME} Video`} />
<meta property="og:description" content={t("quick_video_meeting")} />
<meta property="twitter:image" content={SEO_IMG_OGIMG_VIDEO} />
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content={`${WEBSITE_URL}/video`} />
- <meta property="twitter:title" content={APP_NAME + " Video"} />
+ <meta property="twitter:title" content={`${APP_NAME} Video`} />
<meta property="twitter:description" content={t("quick_video_meeting")} />
</Head>
<div style={{ zIndex: 2, position: "relative" }}>
diff --git a/apps/web/pages/video/meeting-ended/[uid].tsx b/apps/web/pages/video/meeting-ended/[uid].tsx
index 82e78f78959..b511de96bbb 100644
--- a/apps/web/pages/video/meeting-ended/[uid].tsx
+++ b/apps/web/pages/video/meeting-ended/[uid].tsx
@@ -44,7 +44,7 @@ export default function MeetingUnavailable(props: inferSSRProps<typeof getServer
</h2>
<p className="text-subtle text-center">
<Calendar className="-mt-1 mr-1 inline-block h-4 w-4" />
- {dayjs(props.booking.startTime).format(detectBrowserTimeFormat + ", dddd DD MMMM YYYY")}
+ {dayjs(props.booking.startTime).format(`${detectBrowserTimeFormat}, dddd DD MMMM YYYY`)}
</p>
</div>
</div>
diff --git a/apps/web/pages/video/meeting-not-started/[uid].tsx b/apps/web/pages/video/meeting-not-started/[uid].tsx
index ac8d777a693..144312ac38d 100644
--- a/apps/web/pages/video/meeting-not-started/[uid].tsx
+++ b/apps/web/pages/video/meeting-not-started/[uid].tsx
@@ -24,7 +24,7 @@ export default function MeetingNotStarted(props: inferSSRProps<typeof getServerS
<h2 className="mb-2 text-center font-medium">{props.booking.title}</h2>
<p className="text-subtle text-center">
<Calendar className="-mt-1 mr-1 inline-block h-4 w-4" />
- {dayjs(props.booking.startTime).format(detectBrowserTimeFormat + ", dddd DD MMMM YYYY")}
+ {dayjs(props.booking.startTime).format(`${detectBrowserTimeFormat}, dddd DD MMMM YYYY`)}
</p>
</>
}
diff --git a/apps/web/pagesAndRewritePaths.js b/apps/web/pagesAndRewritePaths.js
index 1ad9c00727b..784e638e63f 100644
--- a/apps/web/pagesAndRewritePaths.js
+++ b/apps/web/pagesAndRewritePaths.js
@@ -23,7 +23,7 @@ const otherNonExistingRoutePrefixes = ["forms", "router", "success", "cancel"];
// book$ ensures that only /book is excluded from rewrite(which is at the end always) and not /booked
let subdomainRegExp = (exports.subdomainRegExp = getSubdomainRegExp(
- process.env.NEXT_PUBLIC_WEBAPP_URL || "https://" + process.env.VERCEL_URL
+ process.env.NEXT_PUBLIC_WEBAPP_URL || `https://${process.env.VERCEL_URL}`
));
exports.orgHostPath = `^(?<orgSlug>${subdomainRegExp})\\.(?!vercel\.app).*`;
diff --git a/apps/web/playwright/fixtures/payments.ts b/apps/web/playwright/fixtures/payments.ts
index 7d85e385828..52a801cb096 100644
--- a/apps/web/playwright/fixtures/payments.ts
+++ b/apps/web/playwright/fixtures/payments.ts
@@ -28,7 +28,7 @@ export const createPaymentsFixture = (page: Page) => {
},
},
data: {},
- externalId: "DEMO_PAYMENT_FROM_DB_" + Date.now(),
+ externalId: `DEMO_PAYMENT_FROM_DB_${Date.now()}`,
booking: {
connect: {
id: bookingId,
diff --git a/apps/web/playwright/lib/next-server.ts b/apps/web/playwright/lib/next-server.ts
index c7433f62a6d..99d73143547 100644
--- a/apps/web/playwright/lib/next-server.ts
+++ b/apps/web/playwright/lib/next-server.ts
@@ -23,7 +23,7 @@ export const nextServer = async ({ port = 3000 } = { port: 3000 }) => {
process.env.PLAYWRIGHT_TEST_BASE_URL =
process.env.NEXT_PUBLIC_WEBAPP_URL =
process.env.NEXT_PUBLIC_WEBSITE_URL =
- "http://localhost:" + port;
+ `http://localhost:${port}`;
const app = next({
dev: dev,
port,
@@ -46,7 +46,7 @@ export const nextServer = async ({ port = 3000 } = { port: 3000 }) => {
resolve(server);
});
server.on("error", (error) => {
- if (error) throw new Error("Could not start Next.js server -" + error.message);
+ if (error) throw new Error(`Could not start Next.js server - ${error.message}`);
});
});
return server;
diff --git a/apps/web/playwright/oauth-provider.e2e.ts b/apps/web/playwright/oauth-provider.e2e.ts
index 2d8c73cb897..31f1fb20e85 100644
--- a/apps/web/playwright/oauth-provider.e2e.ts
+++ b/apps/web/playwright/oauth-provider.e2e.ts
@@ -65,7 +65,7 @@ test.describe("OAuth Provider", () => {
method: "POST",
headers: {
"Content-Type": "application/json",
- Authorization: "Bearer " + tokenData.access_token,
+ Authorization: `Bearer ${tokenData.access_token}`,
},
});
@@ -96,7 +96,7 @@ test.describe("OAuth Provider", () => {
method: "POST",
headers: {
"Content-Type": "application/json",
- Authorization: "Bearer " + tokenData.access_token,
+ Authorization: `Bearer ${tokenData.access_token}`,
},
});
@@ -150,7 +150,7 @@ test.describe("OAuth Provider", () => {
method: "POST",
headers: {
"Content-Type": "application/json",
- Authorization: "Bearer " + tokenData.access_token,
+ Authorization: `Bearer ${tokenData.access_token}`,
},
});
@@ -181,7 +181,7 @@ test.describe("OAuth Provider", () => {
method: "POST",
headers: {
"Content-Type": "application/json",
- Authorization: "Bearer " + tokenData.access_token,
+ Authorization: `Bearer ${tokenData.access_token}`,
},
});
diff --git a/apps/web/test/utils/bookingScenario/bookingScenario.ts b/apps/web/test/utils/bookingScenario/bookingScenario.ts
index 3989b0159c4..ba6b3938247 100644
--- a/apps/web/test/utils/bookingScenario/bookingScenario.ts
+++ b/apps/web/test/utils/bookingScenario/bookingScenario.ts
@@ -404,8 +404,8 @@ export const getDate = (
year = year + 1;
}
- const date = _date < 10 ? "0" + _date : _date;
- const month = _month < 10 ? "0" + _month : _month;
+ const date = _date < 10 ? `0${_date}` : _date;
+ const month = _month < 10 ? `0${_month}` : _month;
return {
date,
diff --git a/packages/app-store-cli/src/components/AppCreateUpdateForm.tsx b/packages/app-store-cli/src/components/AppCreateUpdateForm.tsx
index 64aec726581..2085736a3dd 100644
--- a/packages/app-store-cli/src/components/AppCreateUpdateForm.tsx
+++ b/packages/app-store-cli/src/components/AppCreateUpdateForm.tsx
@@ -208,7 +208,7 @@ export const AppForm = ({
</Text>
<Text>
Tip : Go and change the logo of your {isTemplate ? "template" : "app"} by replacing{" "}
- {getAppDirPath(slug, isTemplate) + "/static/icon.svg"}
+ {`${getAppDirPath(slug, isTemplate)}/static/icon.svg`}
</Text>
<Newline />
<Text bold underline color="blue">
diff --git a/packages/app-store-cli/src/components/Message.tsx b/packages/app-store-cli/src/components/Message.tsx
index 949275a8751..a06a871de15 100644
--- a/packages/app-store-cli/src/components/Message.tsx
+++ b/packages/app-store-cli/src/components/Message.tsx
@@ -12,7 +12,7 @@ export function Message({
if (message.showInProgressIndicator) {
const interval = setInterval(() => {
setProgressText((progressText) => {
- return progressText.length > 3 ? "" : progressText + ".";
+ return progressText.length > 3 ? "" : `${progressText}.`;
});
}, 1000);
return () => {
diff --git a/packages/app-store-cli/src/core.ts b/packages/app-store-cli/src/core.ts
index e80d88630b0..ed36d375aae 100644
--- a/packages/app-store-cli/src/core.ts
+++ b/packages/app-store-cli/src/core.ts
@@ -1,7 +1,7 @@
import fs from "fs";
import path from "path";
-import { APP_STORE_PATH, TEMPLATES_PATH, IS_WINDOWS_PLATFORM} from "./constants";
+import { APP_STORE_PATH, TEMPLATES_PATH, IS_WINDOWS_PLATFORM } from "./constants";
import execSync from "./utils/execSync";
const slugify = (str: string) => {
@@ -70,7 +70,11 @@ export const BaseAppFork = {
const appDirPath = getAppDirPath(slug, isTemplate);
if (!editMode) {
await execSync(IS_WINDOWS_PLATFORM ? `mkdir ${appDirPath}` : `mkdir -p ${appDirPath}`);
- await execSync(IS_WINDOWS_PLATFORM ? `xcopy "${TEMPLATES_PATH}\\${template}\\*" "${appDirPath}" /e /i` : `cp -r ${TEMPLATES_PATH}/${template}/* ${appDirPath}`);
+ await execSync(
+ IS_WINDOWS_PLATFORM
+ ? `xcopy "${TEMPLATES_PATH}\\${template}\\*" "${appDirPath}" /e /i`
+ : `cp -r ${TEMPLATES_PATH}/${template}/* ${appDirPath}`
+ );
} else {
if (!oldSlug) {
throw new Error("oldSlug is required when editMode is true");
@@ -79,7 +83,9 @@ export const BaseAppFork = {
// We need to rename only if they are different
const oldAppDirPath = getAppDirPath(oldSlug, isTemplate);
- await execSync(IS_WINDOWS_PLATFORM ? `move ${oldAppDirPath} ${appDirPath}` : `mv ${oldAppDirPath} ${appDirPath}`);
+ await execSync(
+ IS_WINDOWS_PLATFORM ? `move ${oldAppDirPath} ${appDirPath}` : `mv ${oldAppDirPath} ${appDirPath}`
+ );
}
}
updatePackageJson({ slug, appDirPath, appDescription: description });
diff --git a/packages/app-store/CONTRIBUTING.md b/packages/app-store/CONTRIBUTING.md
index 0dd1cb9409f..f716be057e7 100644
--- a/packages/app-store/CONTRIBUTING.md
+++ b/packages/app-store/CONTRIBUTING.md
@@ -1,11 +1,13 @@
## App Contribution Guidelines
#### `DESCRIPTION.md`
+
1. images - include atleast 4 images (do we have a recommended size here?). Can show app in use and/or installation steps
2. add only file name for images, path not required. i.e. `1.jpeg`, not `/app-store/zohocalendar/1.jpeg`
3. description should include what the integration with Cal allows the user to do e.g. `Allows you to sync Cal bookings with your Zoho Calendar`
#### `README.md`
+
1. Include installation instructions and links to the app's website.
2. For url use `<baseUrl>/api/integrations`, rather than `<Cal.com>/api/integrations`
@@ -16,7 +18,8 @@
2. description here should not exceed 10 words (this is arbitrary, but should not be long otherwise it's truncated in the app store)
#### Others
-1. Add API documentation links in comments for files `api`, `lib` and `types`
+
+1. Add API documentation links in comments for files `api`, `lib` and `types`
2. Use [`AppDeclarativeHandler`](../types/AppHandler.d.ts) across all apps. Whatever isn't supported in it, support that.
3. README should be added in the respective app and can be linked in main README [like this](https://github.com/calcom/cal.com/pull/10429/files/155ac84537d12026f595551fe3542e810b029714#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R509)
-4. Also, no env variables should be added by an app. They should be [added in `zod.ts`](https://github.com/calcom/cal.com/blob/main/packages/app-store/jitsivideo/zod.ts) and then they would be automatically available to be modified by the cal.com app admin. In local development you can open /settings/admin with the admin credentials (see [seed.ts](packages/prisma/seed.ts))
\ No newline at end of file
+4. Also, no env variables should be added by an app. They should be [added in `zod.ts`](https://github.com/calcom/cal.com/blob/main/packages/app-store/jitsivideo/zod.ts) and then they would be automatically available to be modified by the cal.com app admin. In local development you can open /settings/admin with the admin credentials (see [seed.ts](packages/prisma/seed.ts))
diff --git a/packages/app-store/_components/AppCard.tsx b/packages/app-store/_components/AppCard.tsx
index 593aedb4748..cf06eeba104 100644
--- a/packages/app-store/_components/AppCard.tsx
+++ b/packages/app-store/_components/AppCard.tsx
@@ -44,7 +44,7 @@ export default function AppCard({
<div className="flex w-full flex-col gap-2 sm:flex-row sm:gap-0">
{/* Don't know why but w-[42px] isn't working, started happening when I started using next/dynamic */}
<Link
- href={"/apps/" + app.slug}
+ href={`/apps/${app.slug}`}
className={classNames(app?.isInstalled ? "mr-[11px]" : "mr-3", "h-auto w-10 rounded-sm")}>
<img
className={classNames(
diff --git a/packages/app-store/_utils/useAddAppMutation.ts b/packages/app-store/_utils/useAddAppMutation.ts
index d8fd1683f33..76becbbf103 100644
--- a/packages/app-store/_utils/useAddAppMutation.ts
+++ b/packages/app-store/_utils/useAddAppMutation.ts
@@ -64,7 +64,7 @@ function useAddAppMutation(_type: App["type"] | null, allOptions?: UseAddAppMuta
const stateStr = encodeURIComponent(JSON.stringify(state));
const searchParams = `?state=${stateStr}${teamId ? `&teamId=${teamId}` : ""}`;
- const res = await fetch(`/api/integrations/${type}/add` + searchParams);
+ const res = await fetch(`/api/integrations/${type}/add${searchParams}`);
if (!res.ok) {
const errorBody = await res.json();
diff --git a/packages/app-store/basecamp3/api/add.ts b/packages/app-store/basecamp3/api/add.ts
index 75ad26e8dbc..eb793c98d39 100644
--- a/packages/app-store/basecamp3/api/add.ts
+++ b/packages/app-store/basecamp3/api/add.ts
@@ -24,9 +24,7 @@ async function handler(req: NextApiRequest) {
client_id,
};
const query = stringify(params);
- const url = `https://launchpad.37signals.com/authorization/new?${query}&redirect_uri=${
- WEBAPP_URL + "/api/integrations/basecamp3/callback"
- }`;
+ const url = `https://launchpad.37signals.com/authorization/new?${query}&redirect_uri=${WEBAPP_URL}/api/integrations/basecamp3/callback`;
return { url };
}
diff --git a/packages/app-store/basecamp3/api/callback.ts b/packages/app-store/basecamp3/api/callback.ts
index 0e152e909cb..c2dbb9fad18 100644
--- a/packages/app-store/basecamp3/api/callback.ts
+++ b/packages/app-store/basecamp3/api/callback.ts
@@ -11,7 +11,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const { code } = req.query;
const { client_id, client_secret, user_agent } = await getAppKeysFromSlug("basecamp3");
- const redirectUri = WEBAPP_URL + "/api/integrations/basecamp3/callback";
+ const redirectUri = `${WEBAPP_URL}/api/integrations/basecamp3/callback`;
const params = new URLSearchParams({
type: "web_server",
diff --git a/packages/app-store/basecamp3/lib/CalendarService.ts b/packages/app-store/basecamp3/lib/CalendarService.ts
index 57f107e1009..983f8d0fdfa 100644
--- a/packages/app-store/basecamp3/lib/CalendarService.ts
+++ b/packages/app-store/basecamp3/lib/CalendarService.ts
@@ -105,14 +105,9 @@ export default class BasecampCalendarService implements Calendar {
minute: "numeric",
});
const baseString = `<div>Event title: ${event.title}<br/>Date and time: ${date}, ${startTime} - ${endTime} ${timeZone}<br/>View on Cal.com: <a target="_blank" rel="noreferrer" class="autolinked" data-behavior="truncate" href="https://app.cal.com/booking/${event.uid}">https://app.cal.com/booking/${event.uid}</a> `;
- const guestString =
- "<br/>Guests: " +
- event.attendees.reduce((acc, attendee) => {
- return (
- acc +
- `<br/><a target=\"_blank\" rel=\"noreferrer\" class=\"autolinked\" data-behavior=\"truncate\" href=\"mailto:${attendee.email}\">${attendee.email}</a>`
- );
- }, "");
+ const guestString = `<br/>Guests: ${event.attendees.reduce((acc, attendee) => {
+ return `${acc}<br/><a target=\"_blank\" rel=\"noreferrer\" class=\"autolinked\" data-behavior=\"truncate\" href=\"mailto:${attendee.email}\">${attendee.email}</a>`;
+ }, "")}`;
const videoString = event.videoCallData
? `<br/>Join on video: ${event.videoCallData.url}</div>`
diff --git a/packages/app-store/cal-ai/DESCRIPTION.md b/packages/app-store/cal-ai/DESCRIPTION.md
index 711150286e6..35437d976c4 100644
--- a/packages/app-store/cal-ai/DESCRIPTION.md
+++ b/packages/app-store/cal-ai/DESCRIPTION.md
@@ -9,4 +9,4 @@ Example questions:
- Send an email with the title: What's my schedule?
- Forward an email from someone looking to meet you
-- Ask to schedule a call with someone
\ No newline at end of file
+- Ask to schedule a call with someone
diff --git a/packages/app-store/caldavcalendar/DESCRIPTION.md b/packages/app-store/caldavcalendar/DESCRIPTION.md
index 2363578ac30..85efc31f5d1 100644
--- a/packages/app-store/caldavcalendar/DESCRIPTION.md
+++ b/packages/app-store/caldavcalendar/DESCRIPTION.md
@@ -19,4 +19,3 @@ Every CalDav Provider is different and needs minor adjustments.
Follow our CalDav Roadmap here: <a class="text-blue-500" target="_blank" href="https://github.com/calcom/cal.com/issues/3457">https://github.com/calcom/cal.com/issues/3457</a>.
If your CalDav connection is not working, please try another Calendar provider (Google Mail or another CalDav).
-
diff --git a/packages/app-store/caldavcalendar/api/add.ts b/packages/app-store/caldavcalendar/api/add.ts
index 4dab77e74e9..f0eca398785 100644
--- a/packages/app-store/caldavcalendar/api/add.ts
+++ b/packages/app-store/caldavcalendar/api/add.ts
@@ -49,12 +49,9 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
let message = e.message;
if (e.message.indexOf("Invalid credentials") > -1 && url.indexOf("dav.php") > -1) {
const parsedUrl = new URL(url);
- const adminUrl =
- parsedUrl.protocol +
- "//" +
- parsedUrl.hostname +
- (parsedUrl.port ? ":" + parsedUrl.port : "") +
- "/admin/?/settings/standard/";
+ const adminUrl = `${parsedUrl.protocol}//${parsedUrl.hostname}${
+ parsedUrl.port ? `:${parsedUrl.port}` : ""
+ }/admin/?/settings/standard/`;
message = `Couldn\'t connect to caldav account, please verify WebDAV authentication type is set to "Basic"`;
return res.status(500).json({ message, actionUrl: adminUrl });
}
diff --git a/packages/app-store/dailyvideo/lib/VideoApiAdapter.ts b/packages/app-store/dailyvideo/lib/VideoApiAdapter.ts
index 29a376732e8..5c070c2ea13 100644
--- a/packages/app-store/dailyvideo/lib/VideoApiAdapter.ts
+++ b/packages/app-store/dailyvideo/lib/VideoApiAdapter.ts
@@ -71,7 +71,7 @@ export const fetcher = async (endpoint: string, init?: RequestInit | undefined)
return fetch(`https://api.daily.co/v1${endpoint}`, {
method: "GET",
headers: {
- Authorization: "Bearer " + api_key,
+ Authorization: `Bearer ${api_key}`,
"Content-Type": "application/json",
...init?.headers,
},
diff --git a/packages/app-store/googlecalendar/api/add.ts b/packages/app-store/googlecalendar/api/add.ts
index d8e66a4818a..3a32c968fa5 100644
--- a/packages/app-store/googlecalendar/api/add.ts
+++ b/packages/app-store/googlecalendar/api/add.ts
@@ -22,7 +22,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
if (typeof appKeys.client_secret === "string") client_secret = appKeys.client_secret;
if (!client_id) return res.status(400).json({ message: "Google client_id missing." });
if (!client_secret) return res.status(400).json({ message: "Google client_secret missing." });
- const redirect_uri = WEBAPP_URL_FOR_OAUTH + "/api/integrations/googlecalendar/callback";
+ const redirect_uri = `${WEBAPP_URL_FOR_OAUTH}/api/integrations/googlecalendar/callback`;
const oAuth2Client = new google.auth.OAuth2(client_id, client_secret, redirect_uri);
const authUrl = oAuth2Client.generateAuthUrl({
diff --git a/packages/app-store/googlecalendar/api/callback.ts b/packages/app-store/googlecalendar/api/callback.ts
index c65847396aa..ccc2fe296e0 100644
--- a/packages/app-store/googlecalendar/api/callback.ts
+++ b/packages/app-store/googlecalendar/api/callback.ts
@@ -30,7 +30,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
if (!client_id) return res.status(400).json({ message: "Google client_id missing." });
if (!client_secret) return res.status(400).json({ message: "Google client_secret missing." });
- const redirect_uri = WEBAPP_URL_FOR_OAUTH + "/api/integrations/googlecalendar/callback";
+ const redirect_uri = `${WEBAPP_URL_FOR_OAUTH}/api/integrations/googlecalendar/callback`;
const oAuth2Client = new google.auth.OAuth2(client_id, client_secret, redirect_uri);
@@ -69,7 +69,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
});
res.redirect(
- getSafeRedirectUrl(CAL_URL + "/apps/installed/conferencing?hl=google-meet") ??
+ getSafeRedirectUrl(`${CAL_URL}/apps/installed/conferencing?hl=google-meet`) ??
getInstalledAppPath({ variant: "conferencing", slug: "google-meet" })
);
}
diff --git a/packages/app-store/hubspot/api/add.ts b/packages/app-store/hubspot/api/add.ts
index ed7956fce75..9d205e01fbb 100644
--- a/packages/app-store/hubspot/api/add.ts
+++ b/packages/app-store/hubspot/api/add.ts
@@ -18,7 +18,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
if (typeof appKeys.client_id === "string") client_id = appKeys.client_id;
if (!client_id) return res.status(400).json({ message: "HubSpot client id missing." });
- const redirectUri = WEBAPP_URL + "/api/integrations/hubspot/callback";
+ const redirectUri = `${WEBAPP_URL}/api/integrations/hubspot/callback`;
const url = hubspotClient.oauth.getAuthorizationUrl(
client_id,
redirectUri,
diff --git a/packages/app-store/hubspot/api/callback.ts b/packages/app-store/hubspot/api/callback.ts
index 6321fce4097..c43253fa698 100644
--- a/packages/app-store/hubspot/api/callback.ts
+++ b/packages/app-store/hubspot/api/callback.ts
@@ -39,7 +39,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const hubspotToken: HubspotToken = await hubspotClient.oauth.tokensApi.createToken(
"authorization_code",
code,
- WEBAPP_URL + "/api/integrations/hubspot/callback",
+ `${WEBAPP_URL}/api/integrations/hubspot/callback`,
client_id,
client_secret
);
diff --git a/packages/app-store/hubspot/lib/CalendarService.ts b/packages/app-store/hubspot/lib/CalendarService.ts
index 66095d6de0e..f2c41c8a360 100644
--- a/packages/app-store/hubspot/lib/CalendarService.ts
+++ b/packages/app-store/hubspot/lib/CalendarService.ts
@@ -179,7 +179,7 @@ export default class HubspotCalendarService implements Calendar {
await hubspotClient.oauth.tokensApi.createToken(
"refresh_token",
undefined,
- WEBAPP_URL + "/api/integrations/hubspot/callback",
+ `${WEBAPP_URL}/api/integrations/hubspot/callback`,
this.client_id,
this.client_secret,
refreshToken
diff --git a/packages/app-store/intercom/api/add.ts b/packages/app-store/intercom/api/add.ts
index 5487ed3bb2f..9d377301848 100644
--- a/packages/app-store/intercom/api/add.ts
+++ b/packages/app-store/intercom/api/add.ts
@@ -18,7 +18,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const params = {
client_id,
- redirect_uri: WEBAPP_URL_FOR_OAUTH + "/api/integrations/intercom/callback",
+ redirect_uri: `${WEBAPP_URL_FOR_OAUTH}/api/integrations/intercom/callback`,
state,
response_type: "code",
};
diff --git a/packages/app-store/intercom/api/callback.ts b/packages/app-store/intercom/api/callback.ts
index 5fd5f861ba4..8aa00043957 100644
--- a/packages/app-store/intercom/api/callback.ts
+++ b/packages/app-store/intercom/api/callback.ts
@@ -48,7 +48,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
if (response.status !== 200) {
log.error("get user_access_token failed", responseBody);
- return res.redirect("/apps/installed?error=" + JSON.stringify(responseBody));
+ return res.redirect(`/apps/installed?error=${JSON.stringify(responseBody)}`);
}
// Find the admin id from the accompte thanks to access_token and store it
@@ -64,7 +64,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
if (admin.status !== 200) {
log.error("get admin_id failed", adminBody);
- return res.redirect("/apps/installed?error=" + JSON.stringify(adminBody));
+ return res.redirect(`/apps/installed?error=${JSON.stringify(adminBody)}`);
}
const adminId = adminBody.id;
@@ -86,7 +86,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
);
res.redirect(
- getSafeRedirectUrl(CAL_URL + "/apps/installed/automation?hl=intercom") ??
+ getSafeRedirectUrl(`${CAL_URL}/apps/installed/automation?hl=intercom`) ??
getInstalledAppPath({ variant: "automation", slug: "intercom" })
);
}
diff --git a/packages/app-store/intercom/config.json b/packages/app-store/intercom/config.json
index 5b4b0b01864..37c68318183 100644
--- a/packages/app-store/intercom/config.json
+++ b/packages/app-store/intercom/config.json
@@ -6,9 +6,7 @@
"logo": "icon.svg",
"url": "https://github.com/vachmara",
"variant": "automation",
- "categories": [
- "automation"
- ],
+ "categories": ["automation"],
"publisher": "Valentin Chmara",
"email": "[email protected]",
"description": "Enhance your scheduling and appointment management experience with the Intercom Integration for Cal.com.",
diff --git a/packages/app-store/jitsivideo/lib/VideoApiAdapter.ts b/packages/app-store/jitsivideo/lib/VideoApiAdapter.ts
index bff005687e6..d1df116cbb3 100644
--- a/packages/app-store/jitsivideo/lib/VideoApiAdapter.ts
+++ b/packages/app-store/jitsivideo/lib/VideoApiAdapter.ts
@@ -33,7 +33,7 @@ const JitsiVideoApiAdapter = (): VideoApiAdapter => {
type: metadata.type,
id: meetingID,
password: "",
- url: hostUrl + "/" + encodeURIComponent(meetingID),
+ url: `${hostUrl}/${encodeURIComponent(meetingID)}`,
});
},
deleteMeeting: async (): Promise<void> => {
diff --git a/packages/app-store/larkcalendar/api/add.ts b/packages/app-store/larkcalendar/api/add.ts
index 5a1a5f4a3ee..61636187ef6 100644
--- a/packages/app-store/larkcalendar/api/add.ts
+++ b/packages/app-store/larkcalendar/api/add.ts
@@ -22,7 +22,7 @@ async function getHandler(req: NextApiRequest) {
const params = {
app_id,
- redirect_uri: WEBAPP_URL + "/api/integrations/larkcalendar/callback",
+ redirect_uri: `${WEBAPP_URL}/api/integrations/larkcalendar/callback`,
state,
};
diff --git a/packages/app-store/larkcalendar/api/callback.ts b/packages/app-store/larkcalendar/api/callback.ts
index accb63d9a60..9178e06c788 100644
--- a/packages/app-store/larkcalendar/api/callback.ts
+++ b/packages/app-store/larkcalendar/api/callback.ts
@@ -28,7 +28,7 @@ async function getHandler(req: NextApiRequest, res: NextApiResponse) {
const response = await fetch(`https://${LARK_HOST}/open-apis/authen/v1/access_token`, {
method: "POST",
headers: {
- Authorization: "Bearer " + appAccessToken,
+ Authorization: `Bearer ${appAccessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
@@ -41,7 +41,7 @@ async function getHandler(req: NextApiRequest, res: NextApiResponse) {
if (!response.ok || responseBody.code !== 0) {
log.error("get user_access_token failed with none 0 code", responseBody);
- return res.redirect("/apps/installed?error=" + JSON.stringify(responseBody));
+ return res.redirect(`/apps/installed?error=${JSON.stringify(responseBody)}`);
}
const key: LarkAuthCredentials = {
diff --git a/packages/app-store/larkcalendar/lib/BotService.ts b/packages/app-store/larkcalendar/lib/BotService.ts
index a09e217d944..d509cd0670e 100644
--- a/packages/app-store/larkcalendar/lib/BotService.ts
+++ b/packages/app-store/larkcalendar/lib/BotService.ts
@@ -114,7 +114,7 @@ export async function sendPostMsg(
const response = await fetch(`https://${LARK_HOST}/open-apis/im/v1/messages?receive_id_type=open_id`, {
method: "POST",
headers: {
- Authorization: "Bearer " + tenantAccessToken,
+ Authorization: `Bearer ${tenantAccessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
diff --git a/packages/app-store/larkcalendar/lib/CalendarService.ts b/packages/app-store/larkcalendar/lib/CalendarService.ts
index 6e3edaf0bfe..8c19c40868b 100644
--- a/packages/app-store/larkcalendar/lib/CalendarService.ts
+++ b/packages/app-store/larkcalendar/lib/CalendarService.ts
@@ -122,7 +122,7 @@ export default class LarkCalendarService implements Calendar {
return fetch(`${this.url}${endpoint}`, {
method: "GET",
headers: {
- Authorization: "Bearer " + accessToken,
+ Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json",
...init?.headers,
},
diff --git a/packages/app-store/locations.ts b/packages/app-store/locations.ts
index 71de22faefe..019a53507ae 100644
--- a/packages/app-store/locations.ts
+++ b/packages/app-store/locations.ts
@@ -402,8 +402,9 @@ export function getSuccessPageLocationMessage(
if (bookingStatus === BookingStatus.CANCELLED || bookingStatus === BookingStatus.REJECTED) {
locationToDisplay == t("web_conference");
} else if (isConfirmed) {
- locationToDisplay =
- getHumanReadableLocationValue(location, t) + ": " + t("meeting_url_in_confirmation_email");
+ locationToDisplay = `${getHumanReadableLocationValue(location, t)}: ${t(
+ "meeting_url_in_confirmation_email"
+ )}`;
} else {
locationToDisplay = t("web_conferencing_details_to_follow");
}
diff --git a/packages/app-store/make/DESCRIPTION.md b/packages/app-store/make/DESCRIPTION.md
index ff99243ef54..200508b623e 100644
--- a/packages/app-store/make/DESCRIPTION.md
+++ b/packages/app-store/make/DESCRIPTION.md
@@ -7,4 +7,4 @@ items:
- 5.jpeg
---
-Workflow automation for everyone. Use the Cal.com app in Make to automate your workflows when a booking is created, rescheduled, cancelled or when a meeting has ended. You can also get all your booking with the 'List Bookings' module.<br /><br />**After Installation:** Have you lost your API key? You can always generate a new key on the <a href="/apps/make/setup">**<ins>Make Setup Page</ins>**</a>
\ No newline at end of file
+Workflow automation for everyone. Use the Cal.com app in Make to automate your workflows when a booking is created, rescheduled, cancelled or when a meeting has ended. You can also get all your booking with the 'List Bookings' module.<br /><br />**After Installation:** Have you lost your API key? You can always generate a new key on the <a href="/apps/make/setup">**<ins>Make Setup Page</ins>**</a>
diff --git a/packages/app-store/make/README.md b/packages/app-store/make/README.md
index e3de1d11c79..63e4040bfbe 100644
--- a/packages/app-store/make/README.md
+++ b/packages/app-store/make/README.md
@@ -1,6 +1,5 @@
# Setting up Make Integration
-
1. Install the app from the Cal app store and generate an API key. Copy the API key.
2. Go to `/admin/apps/automation` in Cal and set the `invite_link` for Make to `https://www.make.com/en/hq/app-invitation/6cb2772b61966508dd8f414ba3b44510` to use the app.
3. Create a [Make account](https://www.make.com/en/login), if you don't have one.
@@ -19,4 +18,4 @@ Possible solution: using [https://ngrok.com/](https://ngrok.com/)
1. Create Account
2. [Download](https://ngrok.com/download) ngrok and start a tunnel to your running localhost
- Use forwarding url as your baseUrl for the URL endpoints
-3. Use the ngrok url as your Cal deployment url when creating the **Connection** in Make.
\ No newline at end of file
+3. Use the ngrok url as your Cal deployment url when creating the **Connection** in Make.
diff --git a/packages/app-store/make/api/subscriptions/listBookings.ts b/packages/app-store/make/api/subscriptions/listBookings.ts
index b4204fbe949..e921573f256 100644
--- a/packages/app-store/make/api/subscriptions/listBookings.ts
+++ b/packages/app-store/make/api/subscriptions/listBookings.ts
@@ -22,7 +22,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
return res.status(500).json({ message: "Unable to get bookings." });
}
if (bookings.length === 0) {
- const requested = validKey.teamId ? "teamId: " + validKey.teamId : "userId: " + validKey.userId;
+ const requested = validKey.teamId ? `teamId: ${validKey.teamId}` : `userId: ${validKey.userId}`;
return res.status(404).json({
message: `There are no bookings to retrieve, please create a booking first. Requested: \`${requested}\``,
});
diff --git a/packages/app-store/office365calendar/api/add.ts b/packages/app-store/office365calendar/api/add.ts
index 0cdeafaa2ee..60e06d18b1b 100644
--- a/packages/app-store/office365calendar/api/add.ts
+++ b/packages/app-store/office365calendar/api/add.ts
@@ -20,7 +20,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
response_type: "code",
scope: scopes.join(" "),
client_id,
- redirect_uri: WEBAPP_URL + "/api/integrations/office365calendar/callback",
+ redirect_uri: `${WEBAPP_URL}/api/integrations/office365calendar/callback`,
state,
};
const query = stringify(params);
diff --git a/packages/app-store/office365calendar/api/callback.ts b/packages/app-store/office365calendar/api/callback.ts
index 17ae98c4f5a..19265a33168 100644
--- a/packages/app-store/office365calendar/api/callback.ts
+++ b/packages/app-store/office365calendar/api/callback.ts
@@ -29,7 +29,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const toUrlEncoded = (payload: Record<string, string>) =>
Object.keys(payload)
- .map((key) => key + "=" + encodeURIComponent(payload[key]))
+ .map((key) => `${key}=${encodeURIComponent(payload[key])}`)
.join("&");
const body = toUrlEncoded({
@@ -37,7 +37,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
grant_type: "authorization_code",
code,
scope: scopes.join(" "),
- redirect_uri: WEBAPP_URL + "/api/integrations/office365calendar/callback",
+ redirect_uri: `${WEBAPP_URL}/api/integrations/office365calendar/callback`,
client_secret,
});
@@ -52,11 +52,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const responseBody = await response.json();
if (!response.ok) {
- return res.redirect("/apps/installed?error=" + JSON.stringify(responseBody));
+ return res.redirect(`/apps/installed?error=${JSON.stringify(responseBody)}`);
}
const whoami = await fetch("https://graph.microsoft.com/v1.0/me", {
- headers: { Authorization: "Bearer " + responseBody.access_token },
+ headers: { Authorization: `Bearer ${responseBody.access_token}` },
});
const graphUser = await whoami.json();
diff --git a/packages/app-store/office365calendar/lib/CalendarService.ts b/packages/app-store/office365calendar/lib/CalendarService.ts
index e147e1146a6..627ce3807df 100644
--- a/packages/app-store/office365calendar/lib/CalendarService.ts
+++ b/packages/app-store/office365calendar/lib/CalendarService.ts
@@ -343,7 +343,7 @@ export default class Office365CalendarService implements Calendar {
return fetch(`${this.apiGraphUrl}${endpoint}`, {
method: "get",
headers: {
- Authorization: "Bearer " + this.accessToken,
+ Authorization: `Bearer ${this.accessToken}`,
"Content-Type": "application/json",
},
...init,
@@ -479,8 +479,8 @@ export default class Office365CalendarService implements Calendar {
subResponse.body.value.reduce((acc: BufferedBusyTime[], evt: BodyValue) => {
if (evt.showAs === "free" || evt.showAs === "workingElsewhere") return acc;
return acc.concat({
- start: evt.start.dateTime + "Z",
- end: evt.end.dateTime + "Z",
+ start: `${evt.start.dateTime}Z`,
+ end: `${evt.end.dateTime}Z`,
});
}, [])
);
diff --git a/packages/app-store/office365video/api/add.ts b/packages/app-store/office365video/api/add.ts
index 2f3424cb2ea..4a2cf45b56d 100644
--- a/packages/app-store/office365video/api/add.ts
+++ b/packages/app-store/office365video/api/add.ts
@@ -20,7 +20,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
response_type: "code",
scope: scopes.join(" "),
client_id,
- redirect_uri: WEBAPP_URL + "/api/integrations/office365video/callback",
+ redirect_uri: `${WEBAPP_URL}/api/integrations/office365video/callback`,
state,
};
const query = stringify(params);
diff --git a/packages/app-store/office365video/api/callback.ts b/packages/app-store/office365video/api/callback.ts
index 27211f3dea4..aee22938cff 100644
--- a/packages/app-store/office365video/api/callback.ts
+++ b/packages/app-store/office365video/api/callback.ts
@@ -30,7 +30,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const toUrlEncoded = (payload: Record<string, string>) =>
Object.keys(payload)
- .map((key) => key + "=" + encodeURIComponent(payload[key]))
+ .map((key) => `${key}=${encodeURIComponent(payload[key])}`)
.join("&");
const body = toUrlEncoded({
@@ -38,7 +38,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
grant_type: "authorization_code",
code,
scope: scopes.join(" "),
- redirect_uri: WEBAPP_URL + "/api/integrations/office365video/callback",
+ redirect_uri: `${WEBAPP_URL}/api/integrations/office365video/callback`,
client_secret,
});
@@ -53,11 +53,11 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const responseBody = await response.json();
if (!response.ok) {
- return res.redirect("/apps/installed?error=" + JSON.stringify(responseBody));
+ return res.redirect(`/apps/installed?error=${JSON.stringify(responseBody)}`);
}
const whoami = await fetch("https://graph.microsoft.com/v1.0/me", {
- headers: { Authorization: "Bearer " + responseBody.access_token },
+ headers: { Authorization: `Bearer ${responseBody.access_token}` },
});
const graphUser = await whoami.json();
diff --git a/packages/app-store/office365video/lib/VideoApiAdapter.ts b/packages/app-store/office365video/lib/VideoApiAdapter.ts
index 06521d11239..4a9a032b3a1 100644
--- a/packages/app-store/office365video/lib/VideoApiAdapter.ts
+++ b/packages/app-store/office365video/lib/VideoApiAdapter.ts
@@ -128,7 +128,7 @@ const TeamsVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter =>
const resultString = await fetch("https://graph.microsoft.com/v1.0/me/onlineMeetings", {
method: "POST",
headers: {
- Authorization: "Bearer " + accessToken,
+ Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify(translateEvent(event)),
@@ -152,7 +152,7 @@ const TeamsVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter =>
const resultString = await fetch("https://graph.microsoft.com/v1.0/me/onlineMeetings", {
method: "POST",
headers: {
- Authorization: "Bearer " + accessToken,
+ Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify(translateEvent(event)),
diff --git a/packages/app-store/paypal/lib/Paypal.ts b/packages/app-store/paypal/lib/Paypal.ts
index ec85ece6232..e430e4d9a81 100644
--- a/packages/app-store/paypal/lib/Paypal.ts
+++ b/packages/app-store/paypal/lib/Paypal.ts
@@ -272,7 +272,7 @@ class Paypal {
webhook_id: options.body.webhook_id,
});
- const bodyToString = stringy.slice(0, -1) + `,"webhook_event":${options.body.webhook_event}` + "}";
+ const bodyToString = `${stringy.slice(0, -1)},"webhook_event":${options.body.webhook_event}}`;
try {
const response = await this.fetcher(`/v1/notifications/verify-webhook-signature`, {
diff --git a/packages/app-store/qr_code/components/EventTypeAppCardInterface.tsx b/packages/app-store/qr_code/components/EventTypeAppCardInterface.tsx
index ceb1d451fc8..acab0974a26 100644
--- a/packages/app-store/qr_code/components/EventTypeAppCardInterface.tsx
+++ b/packages/app-store/qr_code/components/EventTypeAppCardInterface.tsx
@@ -19,7 +19,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
const eventTypeURL = eventType.URL + query;
function QRCode({ size, data }: { size: number; data: string }) {
- const QR_URL = "https://api.qrserver.com/v1/create-qr-code/?size=" + size + "&data=" + data;
+ const QR_URL = `https://api.qrserver.com/v1/create-qr-code/?size=${size}&data=${data}`;
return (
<Tooltip content={eventTypeURL}>
<a download href={QR_URL} target="_blank" rel="noreferrer">
diff --git a/packages/app-store/routing-forms/api/responses/[formId].ts b/packages/app-store/routing-forms/api/responses/[formId].ts
index 0320b5d66fd..19e2a8fa5e1 100644
--- a/packages/app-store/routing-forms/api/responses/[formId].ts
+++ b/packages/app-store/routing-forms/api/responses/[formId].ts
@@ -108,10 +108,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
// Make Header
res.write(
- headerFields
+ `${headerFields
.map((field) => `${field.label}${field.deleted ? "(Deleted)" : ""}`)
.concat(["Submission Time"])
- .join(",") + "\n"
+ .join(",")}\n`
);
for await (const partialCsv of csvIterator) {
diff --git a/packages/app-store/routing-forms/lib/getQueryBuilderConfig.ts b/packages/app-store/routing-forms/lib/getQueryBuilderConfig.ts
index 89b41a43250..055e43df851 100644
--- a/packages/app-store/routing-forms/lib/getQueryBuilderConfig.ts
+++ b/packages/app-store/routing-forms/lib/getQueryBuilderConfig.ts
@@ -44,7 +44,7 @@ export function getQueryBuilderConfig(form: RoutingForm, forReporting = false) {
// preferWidgets: field.type === "textarea" ? ["textarea"] : [],
};
} else {
- throw new Error("Unsupported field type:" + field.type);
+ throw new Error(`Unsupported field type:${field.type}`);
}
});
diff --git a/packages/app-store/routing-forms/lib/getSerializableForm.ts b/packages/app-store/routing-forms/lib/getSerializableForm.ts
index df9835df1f7..96bedf8cb41 100644
--- a/packages/app-store/routing-forms/lib/getSerializableForm.ts
+++ b/packages/app-store/routing-forms/lib/getSerializableForm.ts
@@ -30,7 +30,7 @@ export async function getSerializableForm<TForm extends App_RoutingForms_Form>({
const fieldsParsed = zodFields.safeParse(form.fields);
if (!fieldsParsed.success) {
- throw new Error("Error parsing fields" + fieldsParsed.error);
+ throw new Error(`Error parsing fields: ${fieldsParsed.error}`);
}
const settings = RoutingFormSettings.parse(
@@ -91,7 +91,7 @@ export async function getSerializableForm<TForm extends App_RoutingForms_Form>({
},
});
if (!router) {
- throw new Error("Form -" + route.id + ", being used as router, not found");
+ throw new Error(`Form - ${route.id}, being used as router, not found`);
}
const parsedRouter = await getSerializableForm({ form: router });
diff --git a/packages/app-store/routing-forms/pages/forms/[...appPages].tsx b/packages/app-store/routing-forms/pages/forms/[...appPages].tsx
index 6c08123ad56..9ab27ab6d6c 100644
--- a/packages/app-store/routing-forms/pages/forms/[...appPages].tsx
+++ b/packages/app-store/routing-forms/pages/forms/[...appPages].tsx
@@ -241,7 +241,7 @@ export default function RoutingForms({
<ArrowButton onClick={() => moveRoutingForm(index, 1)} arrowDirection="down" />
)}
<ListLinkItem
- href={appUrl + "/form-edit/" + form.id}
+ href={`${appUrl}/form-edit/${form.id}`}
heading={form.name}
disabled={readOnly}
subHeading={description}
diff --git a/packages/app-store/salesforce/api/callback.ts b/packages/app-store/salesforce/api/callback.ts
index 739dbc2d962..7c9db80278f 100644
--- a/packages/app-store/salesforce/api/callback.ts
+++ b/packages/app-store/salesforce/api/callback.ts
@@ -33,7 +33,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const conn = new jsforce.Connection({
clientId: consumer_key,
clientSecret: consumer_secret,
- redirectUri: WEBAPP_URL + "/api/integrations/salesforce/callback",
+ redirectUri: `${WEBAPP_URL}/api/integrations/salesforce/callback`,
});
const salesforceTokenInfo = await conn.oauth2.requestToken(code as string);
diff --git a/packages/app-store/salesforce/lib/CalendarService.ts b/packages/app-store/salesforce/lib/CalendarService.ts
index 64ebd1c425f..41c0dd39dac 100644
--- a/packages/app-store/salesforce/lib/CalendarService.ts
+++ b/packages/app-store/salesforce/lib/CalendarService.ts
@@ -110,7 +110,7 @@ export default class SalesforceCalendarService implements Calendar {
return new jsforce.Connection({
clientId: consumer_key,
clientSecret: consumer_secret,
- redirectUri: WEBAPP_URL + "/api/integrations/salesforce/callback",
+ redirectUri: `${WEBAPP_URL}/api/integrations/salesforce/callback`,
instanceUrl: credentialKey.instance_url,
accessToken: credentialKey.access_token,
refreshToken: credentialKey.refresh_token,
diff --git a/packages/app-store/stripepayment/api/add.ts b/packages/app-store/stripepayment/api/add.ts
index ba481f3e8fe..6888ab56411 100644
--- a/packages/app-store/stripepayment/api/add.ts
+++ b/packages/app-store/stripepayment/api/add.ts
@@ -23,7 +23,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
},
});
- const redirect_uri = encodeURI(WEBAPP_URL + "/api/integrations/stripepayment/callback");
+ const redirect_uri = encodeURI(`${WEBAPP_URL}/api/integrations/stripepayment/callback`);
const stripeConnectParams: Stripe.OAuthAuthorizeUrlParams = {
client_id,
scope: "read_write",
diff --git a/packages/app-store/stripepayment/api/callback.ts b/packages/app-store/stripepayment/api/callback.ts
index 95c86fe4089..dad6067690c 100644
--- a/packages/app-store/stripepayment/api/callback.ts
+++ b/packages/app-store/stripepayment/api/callback.ts
@@ -22,7 +22,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
if (error) {
const query = stringify({ error, error_description });
- res.redirect("/apps/installed?" + query);
+ res.redirect(`/apps/installed?${query}`);
return;
}
diff --git a/packages/app-store/stripepayment/components/EventTypeAppCardInterface.tsx b/packages/app-store/stripepayment/components/EventTypeAppCardInterface.tsx
index 45b8282f99c..8056d0ce94a 100644
--- a/packages/app-store/stripepayment/components/EventTypeAppCardInterface.tsx
+++ b/packages/app-store/stripepayment/components/EventTypeAppCardInterface.tsx
@@ -60,7 +60,7 @@ const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({
return (
<AppCard
- returnTo={WEBAPP_URL + pathname + "?tabName=apps"}
+ returnTo={`${WEBAPP_URL}${pathname}?tabName=apps`}
app={app}
switchChecked={requirePayment}
switchOnClick={(enabled) => {
diff --git a/packages/app-store/stripepayment/lib/client/createPaymentLink.ts b/packages/app-store/stripepayment/lib/client/createPaymentLink.ts
index e4057a68a55..768b48edbfd 100644
--- a/packages/app-store/stripepayment/lib/client/createPaymentLink.ts
+++ b/packages/app-store/stripepayment/lib/client/createPaymentLink.ts
@@ -15,5 +15,5 @@ export function createPaymentLink(opts: {
let link = "";
if (absolute) link = WEBSITE_URL;
const query = stringify({ date, name, email });
- return link + `/payment/${paymentUid}?${query}`;
+ return `${link}/payment/${paymentUid}?${query}`;
}
diff --git a/packages/app-store/stripepayment/lib/customer.ts b/packages/app-store/stripepayment/lib/customer.ts
index dafb2fbaa7f..3d68140aa5c 100644
--- a/packages/app-store/stripepayment/lib/customer.ts
+++ b/packages/app-store/stripepayment/lib/customer.ts
@@ -73,7 +73,7 @@ export async function deleteStripeCustomer(user: UserType): Promise<string | nul
const customerId = await getStripeCustomerId(user);
if (!customerId) {
- console.warn("No stripe customer found for user:" + user.email);
+ console.warn(`No stripe customer found for user:${user.email}`);
return null;
}
diff --git a/packages/app-store/sylapsvideo/lib/VideoApiAdapter.ts b/packages/app-store/sylapsvideo/lib/VideoApiAdapter.ts
index 90b96a5ab87..4df410a45cf 100644
--- a/packages/app-store/sylapsvideo/lib/VideoApiAdapter.ts
+++ b/packages/app-store/sylapsvideo/lib/VideoApiAdapter.ts
@@ -14,7 +14,7 @@ const SylapsApiAdapter = (): VideoApiAdapter => {
type: "sylaps_video",
id: meetingID,
password: "",
- url: "https://sylaps.com/r/" + meetingID,
+ url: `https://sylaps.com/r/${meetingID}`,
});
},
deleteMeeting: async (): Promise<void> => {
diff --git a/packages/app-store/tandemvideo/api/add.ts b/packages/app-store/tandemvideo/api/add.ts
index ca364f5d385..17dedcff602 100644
--- a/packages/app-store/tandemvideo/api/add.ts
+++ b/packages/app-store/tandemvideo/api/add.ts
@@ -27,7 +27,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
if (!client_id) return res.status(400).json({ message: "Tandem client_id missing." });
if (!base_url) return res.status(400).json({ message: "Tandem base_url missing." });
- const redirect_uri = encodeURI(WEBAPP_URL + "/api/integrations/tandemvideo/callback");
+ const redirect_uri = encodeURI(`${WEBAPP_URL}/api/integrations/tandemvideo/callback`);
const params = {
client_id,
diff --git a/packages/app-store/tandemvideo/lib/VideoApiAdapter.ts b/packages/app-store/tandemvideo/lib/VideoApiAdapter.ts
index 9f7b9599593..eb63159ac95 100644
--- a/packages/app-store/tandemvideo/lib/VideoApiAdapter.ts
+++ b/packages/app-store/tandemvideo/lib/VideoApiAdapter.ts
@@ -125,7 +125,7 @@ const TandemVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter =
const result = await fetch(`${base_url}/api/v1/meetings`, {
method: "POST",
headers: {
- Authorization: "Bearer " + accessToken,
+ Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
body: _translateEvent(event, "meeting"),
@@ -141,7 +141,7 @@ const TandemVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter =
await fetch(`${base_url}/api/v1/meetings/${uid}`, {
method: "DELETE",
headers: {
- Authorization: "Bearer " + accessToken,
+ Authorization: `Bearer ${accessToken}`,
},
}).then(handleErrorsRaw);
@@ -154,7 +154,7 @@ const TandemVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter =
const result = await fetch(`${base_url}/api/v1/meetings/${bookingRef.meetingId}`, {
method: "PUT",
headers: {
- Authorization: "Bearer " + accessToken,
+ Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
body: _translateEvent(event, "updates"),
diff --git a/packages/app-store/vital/DESCRIPTION.md b/packages/app-store/vital/DESCRIPTION.md
index 9262c3026bc..94cd734f4d4 100644
--- a/packages/app-store/vital/DESCRIPTION.md
+++ b/packages/app-store/vital/DESCRIPTION.md
@@ -2,6 +2,7 @@
items:
- 1.jpg
---
+
Vital App is an app that can can help you combine your health peripherals with your calendar.
#### Supported Actions:
diff --git a/packages/app-store/vital/api/token.ts b/packages/app-store/vital/api/token.ts
index ab38427e22c..3e3c21fa83d 100644
--- a/packages/app-store/vital/api/token.ts
+++ b/packages/app-store/vital/api/token.ts
@@ -45,7 +45,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const token = await vitalClient.Link.create(
userVital?.user_id,
undefined,
- WEBAPP_URL + "/api/integrations/vital/callback"
+ `${WEBAPP_URL}/api/integrations/vital/callback`
);
return res.status(200).json({
token: token.link_token,
diff --git a/packages/app-store/webex/api/callback.ts b/packages/app-store/webex/api/callback.ts
index 9a0c4fef6da..1c3ed09934b 100644
--- a/packages/app-store/webex/api/callback.ts
+++ b/packages/app-store/webex/api/callback.ts
@@ -15,7 +15,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
/** @link https://developer.webex.com/docs/integrations#getting-an-access-token **/
const redirectUri = encodeURI(`${WEBAPP_URL}/api/integrations/${config.slug}/callback`);
- const authHeader = "Basic " + Buffer.from(client_id + ":" + client_secret).toString("base64");
+ const authHeader = `Basic ${Buffer.from(`${client_id}:${client_secret}`).toString("base64")}`;
const result = await fetch(
`https://webexapis.com/v1/access_token?grant_type=authorization_code&client_id=${client_id}&client_secret=${client_secret}&code=${code}&redirect_uri=${redirectUri}`,
{
diff --git a/packages/app-store/webex/lib/VideoApiAdapter.ts b/packages/app-store/webex/lib/VideoApiAdapter.ts
index 37b0d3b1993..eb7921263a6 100644
--- a/packages/app-store/webex/lib/VideoApiAdapter.ts
+++ b/packages/app-store/webex/lib/VideoApiAdapter.ts
@@ -154,7 +154,7 @@ const WebexVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter =>
method: "GET",
...options,
headers: {
- Authorization: "Bearer " + accessToken,
+ Authorization: `Bearer ${accessToken}`,
...options?.headers,
},
});
@@ -208,7 +208,7 @@ const WebexVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter =>
url: result.webLink,
};
}
- throw new Error("Failed to create meeting. Response is " + JSON.stringify(result));
+ throw new Error(`Failed to create meeting. Response is ${JSON.stringify(result)}`);
} catch (err) {
console.error(err);
throw new Error("Unexpected error");
@@ -258,7 +258,7 @@ const WebexVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter =>
url: result.webLink,
};
}
- throw new Error("Failed to create meeting. Response is " + JSON.stringify(result));
+ throw new Error(`Failed to create meeting. Response is ${JSON.stringify(result)}`);
} catch (err) {
console.error(err);
throw new Error("Unexpected error");
diff --git a/packages/app-store/wipemycalother/components/confirmDialog.tsx b/packages/app-store/wipemycalother/components/confirmDialog.tsx
index b2dfb41ec00..0485e0c2033 100644
--- a/packages/app-store/wipemycalother/components/confirmDialog.tsx
+++ b/packages/app-store/wipemycalother/components/confirmDialog.tsx
@@ -27,7 +27,7 @@ const wipeMyCalAction = async (props: IWipeMyCalAction) => {
};
try {
const endpoint = "/api/integrations/wipemycalother/wipe";
- return fetch(`${process.env.NEXT_PUBLIC_WEBAPP_URL}` + endpoint, {
+ return fetch(`${process.env.NEXT_PUBLIC_WEBAPP_URL}${endpoint}`, {
method: "POST",
headers: {
"Content-Type": "application/json",
diff --git a/packages/app-store/zapier/api/subscriptions/listBookings.ts b/packages/app-store/zapier/api/subscriptions/listBookings.ts
index 62d74e44c32..72324f05e29 100644
--- a/packages/app-store/zapier/api/subscriptions/listBookings.ts
+++ b/packages/app-store/zapier/api/subscriptions/listBookings.ts
@@ -26,7 +26,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
? authorizedAccount.name
: null;
- const requested = teamInfo ? "team: " + teamInfo : "user: " + userInfo;
+ const requested = teamInfo ? `team: ${teamInfo}` : `user: ${userInfo}`;
return res.status(404).json({
message: `There are no bookings to retrieve, please create a booking first. Requested: \`${requested}\``,
});
diff --git a/packages/app-store/zoho-bigin/api/add.ts b/packages/app-store/zoho-bigin/api/add.ts
index 807321df712..edf7169bbba 100644
--- a/packages/app-store/zoho-bigin/api/add.ts
+++ b/packages/app-store/zoho-bigin/api/add.ts
@@ -14,7 +14,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const clientId = typeof appKeys.client_id === "string" ? appKeys.client_id : "";
if (!clientId) return res.status(400).json({ message: "Zoho Bigin client_id missing." });
- const redirectUri = WEBAPP_URL + `/api/integrations/zoho-bigin/callback`;
+ const redirectUri = `${WEBAPP_URL}/api/integrations/zoho-bigin/callback`;
const authUrl = axios.getUri({
url: "https://accounts.zoho.com/oauth/v2/auth",
diff --git a/packages/app-store/zoho-bigin/api/callback.ts b/packages/app-store/zoho-bigin/api/callback.ts
index 85f5487d01d..f1ab94a2a8e 100644
--- a/packages/app-store/zoho-bigin/api/callback.ts
+++ b/packages/app-store/zoho-bigin/api/callback.ts
@@ -33,7 +33,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
if (!clientSecret) return res.status(400).json({ message: "Zoho Bigin client_secret missing." });
const accountsUrl = `${accountsServer}/oauth/v2/token`;
- const redirectUri = WEBAPP_URL + `/api/integrations/${appConfig.slug}/callback`;
+ const redirectUri = `${WEBAPP_URL}/api/integrations/${appConfig.slug}/callback`;
const formData = {
client_id: clientId,
diff --git a/packages/app-store/zoho-bigin/lib/CalendarService.ts b/packages/app-store/zoho-bigin/lib/CalendarService.ts
index 676c8062ef7..fb3c56c7adc 100644
--- a/packages/app-store/zoho-bigin/lib/CalendarService.ts
+++ b/packages/app-store/zoho-bigin/lib/CalendarService.ts
@@ -148,8 +148,9 @@ export default class BiginCalendarService implements Calendar {
*/
private async contactSearch(event: CalendarEvent) {
const token = await this.auth.getToken();
- const searchCriteria =
- "(" + event.attendees.map((attendee) => `(Email:equals:${encodeURI(attendee.email)})`).join("or") + ")";
+ const searchCriteria = `(${event.attendees
+ .map((attendee) => `(Email:equals:${encodeURI(attendee.email)})`)
+ .join("or")})`;
return await axios({
method: "get",
@@ -298,21 +299,9 @@ const toISO8601String = (date: Date) => {
return (num < 10 ? "0" : "") + num;
};
- return (
- date.getFullYear() +
- "-" +
- pad(date.getMonth() + 1) +
- "-" +
- pad(date.getDate()) +
- "T" +
- pad(date.getHours()) +
- ":" +
- pad(date.getMinutes()) +
- ":" +
- pad(date.getSeconds()) +
- dif +
- pad(Math.floor(Math.abs(tzo) / 60)) +
- ":" +
- pad(Math.abs(tzo) % 60)
- );
+ return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(
+ date.getHours()
+ )}:${pad(date.getMinutes())}:${pad(date.getSeconds())}${dif}${pad(Math.floor(Math.abs(tzo) / 60))}:${pad(
+ Math.abs(tzo) % 60
+ )}`;
};
diff --git a/packages/app-store/zohocalendar/DESCRIPTION.md b/packages/app-store/zohocalendar/DESCRIPTION.md
index 153614e82ed..9c2256cf1ab 100644
--- a/packages/app-store/zohocalendar/DESCRIPTION.md
+++ b/packages/app-store/zohocalendar/DESCRIPTION.md
@@ -6,4 +6,4 @@ items:
- ZCal4.jpg
---
-Zoho Calendar is an online business calendar that makes scheduling easy for you. Use this app to sync your Cal bookings with your Zoho Calendar.
\ No newline at end of file
+Zoho Calendar is an online business calendar that makes scheduling easy for you. Use this app to sync your Cal bookings with your Zoho Calendar.
diff --git a/packages/app-store/zohocalendar/README.md b/packages/app-store/zohocalendar/README.md
index 5b22a522b9a..619fbdb69fc 100644
--- a/packages/app-store/zohocalendar/README.md
+++ b/packages/app-store/zohocalendar/README.md
@@ -1,16 +1,16 @@
-## Zoho Calendar
-
-### Obtaining Zoho Calendar Client ID and Secret
-
-1. Open [Zoho API Console](https://api-console.zoho.com/) and sign into your account, or create a new one.
-2. Create a "Server-based Applications", set the Redirect URL for OAuth `<Cal.com URL>/api/integrations/zohocalendar/callback` replacing Cal.com URL with the URI at which your application runs.
-4. Fill in any information you want in the "Client Details" tab
-5. Go to tab "Client Secret" tab.
-6. Now copy the Client ID and Client Secret into your app keys in the Cal.com admin panel (`<Cal.com>/settings/admin/apps`).
-7. Back in Zoho API Console,
-8. In the "Settings" section check the "Multi-DC" option if you wish to use the same OAuth credentials for all data centers.
-9. Click the "Save"/ "UPDATE" button at the bottom footer.
-10. You're good to go. Now you can easily add your Zoho Calendar integration in the Cal.com settings at `/settings/my-account/calendars`.
-11. You can access your Zoho calendar at [https://calendar.zoho.com/](https://calendar.zoho.com/)
-
-NOTE: If you use multiple calendars with Cal, make sure you enable the toggle to prevent double-bookings across calendar. This is in `/settings/my-account/calendars`.
\ No newline at end of file
+## Zoho Calendar
+
+### Obtaining Zoho Calendar Client ID and Secret
+
+1. Open [Zoho API Console](https://api-console.zoho.com/) and sign into your account, or create a new one.
+2. Create a "Server-based Applications", set the Redirect URL for OAuth `<Cal.com URL>/api/integrations/zohocalendar/callback` replacing Cal.com URL with the URI at which your application runs.
+3. Fill in any information you want in the "Client Details" tab
+4. Go to tab "Client Secret" tab.
+5. Now copy the Client ID and Client Secret into your app keys in the Cal.com admin panel (`<Cal.com>/settings/admin/apps`).
+6. Back in Zoho API Console,
+7. In the "Settings" section check the "Multi-DC" option if you wish to use the same OAuth credentials for all data centers.
+8. Click the "Save"/ "UPDATE" button at the bottom footer.
+9. You're good to go. Now you can easily add your Zoho Calendar integration in the Cal.com settings at `/settings/my-account/calendars`.
+10. You can access your Zoho calendar at [https://calendar.zoho.com/](https://calendar.zoho.com/)
+
+NOTE: If you use multiple calendars with Cal, make sure you enable the toggle to prevent double-bookings across calendar. This is in `/settings/my-account/calendars`.
diff --git a/packages/app-store/zohocalendar/api/add.ts b/packages/app-store/zohocalendar/api/add.ts
index 2e21b71646b..5dd3d9d6268 100644
--- a/packages/app-store/zohocalendar/api/add.ts
+++ b/packages/app-store/zohocalendar/api/add.ts
@@ -20,7 +20,7 @@ async function getHandler(req: NextApiRequest, res: NextApiResponse) {
const params = {
client_id,
response_type: "code",
- redirect_uri: WEBAPP_URL + "/api/integrations/zohocalendar/callback",
+ redirect_uri: `${WEBAPP_URL}/api/integrations/zohocalendar/callback`,
scope: [
"ZohoCalendar.calendar.ALL",
"ZohoCalendar.event.ALL",
diff --git a/packages/app-store/zohocalendar/api/callback.ts b/packages/app-store/zohocalendar/api/callback.ts
index 1cbb4084b9e..52b2652a6d5 100644
--- a/packages/app-store/zohocalendar/api/callback.ts
+++ b/packages/app-store/zohocalendar/api/callback.ts
@@ -55,7 +55,7 @@ async function getHandler(req: NextApiRequest, res: NextApiResponse) {
if (!response.ok || responseBody.error) {
log.error("get access_token failed", responseBody);
- return res.redirect("/apps/installed?error=" + JSON.stringify(responseBody));
+ return res.redirect(`/apps/installed?error=${JSON.stringify(responseBody)}`);
}
const key: ZohoAuthCredentials = {
diff --git a/packages/app-store/zohocalendar/lib/CalendarService.ts b/packages/app-store/zohocalendar/lib/CalendarService.ts
index 82367f64436..993c2aceee6 100644
--- a/packages/app-store/zohocalendar/lib/CalendarService.ts
+++ b/packages/app-store/zohocalendar/lib/CalendarService.ts
@@ -92,7 +92,7 @@ export default class ZohoCalendarService implements Calendar {
method: "GET",
...init,
headers: {
- Authorization: "Bearer " + credentials.access_token,
+ Authorization: `Bearer ${credentials.access_token}`,
"Content-Type": "application/json",
...init?.headers,
},
@@ -105,7 +105,7 @@ export default class ZohoCalendarService implements Calendar {
const response = await fetch(`https://accounts.zoho.com/oauth/user/info`, {
method: "GET",
headers: {
- Authorization: "Bearer " + credentials.access_token,
+ Authorization: `Bearer ${credentials.access_token}`,
"Content-Type": "application/json",
},
});
diff --git a/packages/app-store/zohocrm/api/_getAdd.ts b/packages/app-store/zohocrm/api/_getAdd.ts
index 34fcde771d1..0a4a797de12 100644
--- a/packages/app-store/zohocrm/api/_getAdd.ts
+++ b/packages/app-store/zohocrm/api/_getAdd.ts
@@ -17,7 +17,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const params = {
client_id,
response_type: "code",
- redirect_uri: WEBAPP_URL + "/api/integrations/zohocrm/callback",
+ redirect_uri: `${WEBAPP_URL}/api/integrations/zohocrm/callback`,
scope: ["ZohoCRM.modules.ALL", "ZohoCRM.users.READ", "AaaServer.profile.READ"],
access_type: "offline",
state,
diff --git a/packages/app-store/zohocrm/api/callback.ts b/packages/app-store/zohocrm/api/callback.ts
index 224157a34c1..ff53b2d3ee5 100644
--- a/packages/app-store/zohocrm/api/callback.ts
+++ b/packages/app-store/zohocrm/api/callback.ts
@@ -31,7 +31,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
if (!client_secret) return res.status(400).json({ message: "Zoho Crm consumer secret missing." });
const url = `${req.query["accounts-server"]}/oauth/v2/token`;
- const redirectUri = WEBAPP_URL + "/api/integrations/zohocrm/callback";
+ const redirectUri = `${WEBAPP_URL}/api/integrations/zohocrm/callback`;
const formData = {
grant_type: "authorization_code",
client_id: client_id,
diff --git a/packages/app-store/zohocrm/lib/CalendarService.ts b/packages/app-store/zohocrm/lib/CalendarService.ts
index ef5bb4ec827..3ba36f3750c 100644
--- a/packages/app-store/zohocrm/lib/CalendarService.ts
+++ b/packages/app-store/zohocrm/lib/CalendarService.ts
@@ -44,23 +44,11 @@ const toISO8601String = (date: Date) => {
return (num < 10 ? "0" : "") + num;
};
- return (
- date.getFullYear() +
- "-" +
- pad(date.getMonth() + 1) +
- "-" +
- pad(date.getDate()) +
- "T" +
- pad(date.getHours()) +
- ":" +
- pad(date.getMinutes()) +
- ":" +
- pad(date.getSeconds()) +
- dif +
- pad(Math.floor(Math.abs(tzo) / 60)) +
- ":" +
- pad(Math.abs(tzo) % 60)
- );
+ return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(
+ date.getHours()
+ )}:${pad(date.getMinutes())}:${pad(date.getSeconds())}${dif}${pad(Math.floor(Math.abs(tzo) / 60))}:${pad(
+ Math.abs(tzo) % 60
+ )}`;
};
export default class ZohoCrmCalendarService implements Calendar {
private integrationName = "";
@@ -97,8 +85,9 @@ export default class ZohoCrmCalendarService implements Calendar {
};
private contactSearch = async (event: CalendarEvent) => {
- const searchCriteria =
- "(" + event.attendees.map((attendee) => `(Email:equals:${encodeURI(attendee.email)})`).join("or") + ")";
+ const searchCriteria = `(${event.attendees
+ .map((attendee) => `(Email:equals:${encodeURI(attendee.email)})`)
+ .join("or")})`;
return await axios({
method: "get",
diff --git a/packages/app-store/zoomvideo/api/add.ts b/packages/app-store/zoomvideo/api/add.ts
index 17c87979284..5ab813cade1 100644
--- a/packages/app-store/zoomvideo/api/add.ts
+++ b/packages/app-store/zoomvideo/api/add.ts
@@ -25,7 +25,7 @@ async function handler(req: NextApiRequest) {
const params = {
response_type: "code",
client_id,
- redirect_uri: WEBAPP_URL + "/api/integrations/zoomvideo/callback",
+ redirect_uri: `${WEBAPP_URL}/api/integrations/zoomvideo/callback`,
state,
};
const query = stringify(params);
diff --git a/packages/app-store/zoomvideo/api/callback.ts b/packages/app-store/zoomvideo/api/callback.ts
index 7c9c20d60ad..1d0e2599ebf 100644
--- a/packages/app-store/zoomvideo/api/callback.ts
+++ b/packages/app-store/zoomvideo/api/callback.ts
@@ -11,10 +11,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const { code } = req.query;
const { client_id, client_secret } = await getZoomAppKeys();
- const redirectUri = encodeURI(WEBAPP_URL + "/api/integrations/zoomvideo/callback");
- const authHeader = "Basic " + Buffer.from(client_id + ":" + client_secret).toString("base64");
+ const redirectUri = encodeURI(`${WEBAPP_URL}/api/integrations/zoomvideo/callback`);
+ const authHeader = `Basic ${Buffer.from(`${client_id}:${client_secret}`).toString("base64")}`;
const result = await fetch(
- "https://zoom.us/oauth/token?grant_type=authorization_code&code=" + code + "&redirect_uri=" + redirectUri,
+ `https://zoom.us/oauth/token?grant_type=authorization_code&code=${code}&redirect_uri=${redirectUri}`,
{
method: "POST",
headers: {
diff --git a/packages/app-store/zoomvideo/lib/VideoApiAdapter.ts b/packages/app-store/zoomvideo/lib/VideoApiAdapter.ts
index 670627376de..7a57472966d 100644
--- a/packages/app-store/zoomvideo/lib/VideoApiAdapter.ts
+++ b/packages/app-store/zoomvideo/lib/VideoApiAdapter.ts
@@ -76,7 +76,7 @@ const zoomRefreshedTokenSchema = z.object({
const zoomAuth = (credential: CredentialPayload) => {
const refreshAccessToken = async (refreshToken: string) => {
const { client_id, client_secret } = await getZoomAppKeys();
- const authHeader = "Basic " + Buffer.from(client_id + ":" + client_secret).toString("base64");
+ const authHeader = `Basic ${Buffer.from(`${client_id}:${client_secret}`).toString("base64")}`;
const response = await refreshOAuthTokens(
async () =>
@@ -233,7 +233,7 @@ const ZoomVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter =>
method: "GET",
...options,
headers: {
- Authorization: "Bearer " + accessToken,
+ Authorization: `Bearer ${accessToken}`,
...options?.headers,
},
});
@@ -284,7 +284,7 @@ const ZoomVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter =>
url: result.join_url,
};
}
- throw new Error("Failed to create meeting. Response is " + JSON.stringify(result));
+ throw new Error(`Failed to create meeting. Response is ${JSON.stringify(result)}`);
} catch (err) {
console.error(err);
/* Prevents meeting creation failure when Zoom Token is expired */
diff --git a/packages/config/eslint-preset.js b/packages/config/eslint-preset.js
index e608c4f4df1..e114436acec 100644
--- a/packages/config/eslint-preset.js
+++ b/packages/config/eslint-preset.js
@@ -42,6 +42,7 @@ module.exports = {
patterns: ["lodash"],
},
],
+ "prefer-template": "error",
},
overrides: [
{
diff --git a/packages/core/CalendarManager.test.ts b/packages/core/CalendarManager.test.ts
index 1ded71a905b..2ec7ce4153d 100644
--- a/packages/core/CalendarManager.test.ts
+++ b/packages/core/CalendarManager.test.ts
@@ -11,21 +11,24 @@ describe("CalendarManager tests", () => {
type: "google_calendar",
userId: "3",
key: {
- access_token: "google_calendar_key"
+ access_token: "google_calendar_key",
},
- invalid: false
+ invalid: false,
};
- const credentials = [googleCalendarCredentials, {
- id: "2",
- appId: "office365-video",
- type: "office365_video",
- userId: "4",
- key: {
- access_token: "office365_video_key"
+ const credentials = [
+ googleCalendarCredentials,
+ {
+ id: "2",
+ appId: "office365-video",
+ type: "office365_video",
+ userId: "4",
+ key: {
+ access_token: "office365_video_key",
+ },
+ invalid: false,
},
- invalid: false
- }];
+ ];
const calendarCredentials = getCalendarCredentials(credentials);
expect(calendarCredentials).toHaveLength(1);
diff --git a/packages/core/EventManager.ts b/packages/core/EventManager.ts
index 4caabdfa58d..dba0812c07f 100644
--- a/packages/core/EventManager.ts
+++ b/packages/core/EventManager.ts
@@ -477,9 +477,7 @@ export default class EventManager {
* */
if (!videoCredential) {
log.warn(
- 'Falling back to "daily" video integration for event with location: ' +
- event.location +
- " because credential is missing for the app"
+ `Falling back to "daily" video integration for event with location: ${event.location} because credential is missing for the app`
);
videoCredential = { ...FAKE_DAILY_CREDENTIAL };
}
diff --git a/packages/core/getBusyTimes.ts b/packages/core/getBusyTimes.ts
index d27a42d9e32..80dc92d609f 100644
--- a/packages/core/getBusyTimes.ts
+++ b/packages/core/getBusyTimes.ts
@@ -144,7 +144,7 @@ export async function getBusyTimes(params: {
const busyTimes = bookings.reduce(
(aggregate: EventBusyDetails[], { id, startTime, endTime, eventType, title, ...rest }) => {
if (rest._count?.seatsReferences) {
- const bookedAt = dayjs(startTime).utc().format() + "<>" + dayjs(endTime).utc().format();
+ const bookedAt = `${dayjs(startTime).utc().format()}<>${dayjs(endTime).utc().format()}`;
bookingSeatCountMap[bookedAt] = bookingSeatCountMap[bookedAt] || 0;
bookingSeatCountMap[bookedAt]++;
// Seat references on the current event are non-blocking until the event is fully booked.
diff --git a/packages/emails/src/components/EmailBodyLogo.tsx b/packages/emails/src/components/EmailBodyLogo.tsx
index 23ddc92359c..2292b629485 100644
--- a/packages/emails/src/components/EmailBodyLogo.tsx
+++ b/packages/emails/src/components/EmailBodyLogo.tsx
@@ -6,7 +6,7 @@ import Row from "./Row";
const CommentIE = ({ html = "" }) => <RawHtml html={`<!--[if mso | IE]>${html}<![endif]-->`} />;
const EmailBodyLogo = () => {
- const image = WEBAPP_URL + "/emails/logo.png";
+ const image = `${WEBAPP_URL}/emails/logo.png`;
return (
<>
diff --git a/packages/emails/src/components/EmailSchedulingBodyHeader.tsx b/packages/emails/src/components/EmailSchedulingBodyHeader.tsx
index 5b2bba240ce..863dcc92893 100644
--- a/packages/emails/src/components/EmailSchedulingBodyHeader.tsx
+++ b/packages/emails/src/components/EmailSchedulingBodyHeader.tsx
@@ -11,19 +11,19 @@ export const getHeadImage = (headerType: BodyHeadType): string => {
switch (headerType) {
case "checkCircle":
return IS_PRODUCTION
- ? BASE_URL + "/emails/[email protected]"
+ ? `${BASE_URL}/emails/[email protected]`
: "https://app.cal.com/emails/[email protected]";
case "xCircle":
return IS_PRODUCTION
- ? BASE_URL + "/emails/[email protected]"
+ ? `${BASE_URL}/emails/[email protected]`
: "https://app.cal.com/emails/[email protected]";
case "calendarCircle":
return IS_PRODUCTION
- ? BASE_URL + "/emails/[email protected]"
+ ? `${BASE_URL}/emails/[email protected]`
: "https://app.cal.com/emails/[email protected]";
case "teamCircle":
return IS_PRODUCTION
- ? BASE_URL + "/emails/[email protected]"
+ ? `${BASE_URL}/emails/[email protected]`
: "https://app.cal.com/emails/[email protected]";
}
};
diff --git a/packages/emails/src/components/LocationInfo.tsx b/packages/emails/src/components/LocationInfo.tsx
index efbde3d1907..0766f905cae 100644
--- a/packages/emails/src/components/LocationInfo.tsx
+++ b/packages/emails/src/components/LocationInfo.tsx
@@ -62,7 +62,7 @@ export function LocationInfo(props: { calEvent: CalendarEvent; t: TFunction }) {
label={t("where")}
withSpacer
description={
- <a href={"tel:" + location} title="Phone" style={{ color: "#3E3E3E" }}>
+ <a href={`tel:${location}`} title="Phone" style={{ color: "#3E3E3E" }}>
{location}
</a>
}
diff --git a/packages/emails/src/templates/BrokenIntegrationEmail.tsx b/packages/emails/src/templates/BrokenIntegrationEmail.tsx
index afb7edd31d6..4271d68c910 100644
--- a/packages/emails/src/templates/BrokenIntegrationEmail.tsx
+++ b/packages/emails/src/templates/BrokenIntegrationEmail.tsx
@@ -65,7 +65,7 @@ export const BrokenIntegrationEmail = (
location = "Cal Video";
}
if (location === "GoogleMeet") {
- location = location.slice(0, 5) + " " + location.slice(5);
+ location = `${location.slice(0, 5)} ${location.slice(5)}`;
}
return (
@@ -92,7 +92,7 @@ export const BrokenIntegrationEmail = (
if (Array.isArray(calendar)) {
const calendarCap = calendar.map((name) => name.charAt(0).toUpperCase() + name.slice(1));
- calendar = calendarCap[0] + " " + calendarCap[1];
+ calendar = `${calendarCap[0]} ${calendarCap[1]}`;
}
return (
diff --git a/packages/emails/src/templates/DailyVideoDownloadRecordingEmail.tsx b/packages/emails/src/templates/DailyVideoDownloadRecordingEmail.tsx
index 5b176c8b13e..0c81b7db063 100644
--- a/packages/emails/src/templates/DailyVideoDownloadRecordingEmail.tsx
+++ b/packages/emails/src/templates/DailyVideoDownloadRecordingEmail.tsx
@@ -15,7 +15,7 @@ interface DailyVideoDownloadRecordingEmailProps {
export const DailyVideoDownloadRecordingEmail = (
props: DailyVideoDownloadRecordingEmailProps & Partial<React.ComponentProps<typeof V2BaseEmailHtml>>
) => {
- const image = WEBAPP_URL + "/emails/logo.png";
+ const image = `${WEBAPP_URL}/emails/logo.png`;
return (
<V2BaseEmailHtml
subject={props.language("download_your_recording", {
diff --git a/packages/emails/src/templates/OrgAutoInviteEmail.tsx b/packages/emails/src/templates/OrgAutoInviteEmail.tsx
index 2133ec932e3..7bed1634733 100644
--- a/packages/emails/src/templates/OrgAutoInviteEmail.tsx
+++ b/packages/emails/src/templates/OrgAutoInviteEmail.tsx
@@ -40,7 +40,7 @@ export const OrgAutoInviteEmail = (
}}
src={
IS_PRODUCTION
- ? WEBAPP_URL + "/emails/calendar-email-hero.png"
+ ? `${WEBAPP_URL}/emails/calendar-email-hero.png`
: "http://localhost:3000/emails/calendar-email-hero.png"
}
alt=""
diff --git a/packages/emails/src/templates/TeamInviteEmail.tsx b/packages/emails/src/templates/TeamInviteEmail.tsx
index a5e34ba235d..84686cdf30a 100644
--- a/packages/emails/src/templates/TeamInviteEmail.tsx
+++ b/packages/emails/src/templates/TeamInviteEmail.tsx
@@ -42,7 +42,7 @@ export const TeamInviteEmail = (
}}
src={
IS_PRODUCTION
- ? WEBAPP_URL + "/emails/calendar-email-hero.png"
+ ? `${WEBAPP_URL}/emails/calendar-email-hero.png`
: "http://localhost:3000/emails/calendar-email-hero.png"
}
alt=""
@@ -91,7 +91,7 @@ export const TeamInviteEmail = (
translationString={props.language("email_no_user_step_one")}
iconsrc={
IS_PRODUCTION
- ? WEBAPP_URL + "/emails/[email protected]"
+ ? `${WEBAPP_URL}/emails/[email protected]`
: "http://localhost:3000/emails/[email protected]"
}
/>
@@ -99,7 +99,7 @@ export const TeamInviteEmail = (
translationString={props.language("email_no_user_step_two")}
iconsrc={
IS_PRODUCTION
- ? WEBAPP_URL + "/emails/[email protected]"
+ ? `${WEBAPP_URL}/emails/[email protected]`
: "http://localhost:3000/emails/[email protected]"
}
/>
@@ -107,7 +107,7 @@ export const TeamInviteEmail = (
translationString={props.language("email_no_user_step_three")}
iconsrc={
IS_PRODUCTION
- ? WEBAPP_URL + "/emails/[email protected]"
+ ? `${WEBAPP_URL}/emails/[email protected]`
: "http://localhost:3000/emails/[email protected]"
}
/>
@@ -115,7 +115,7 @@ export const TeamInviteEmail = (
translationString={props.language("email_no_user_step_four", { teamName: props.teamName })}
iconsrc={
IS_PRODUCTION
- ? WEBAPP_URL + "/emails/[email protected]"
+ ? `${WEBAPP_URL}/emails/[email protected]`
: "http://localhost:3000/emails/[email protected]"
}
/>
diff --git a/packages/emails/templates/organizer-scheduled-email.ts b/packages/emails/templates/organizer-scheduled-email.ts
index 740996ffffd..76b036252e0 100644
--- a/packages/emails/templates/organizer-scheduled-email.ts
+++ b/packages/emails/templates/organizer-scheduled-email.ts
@@ -82,7 +82,7 @@ export default class OrganizerScheduledEmail extends BaseEmail {
from: `${APP_NAME} <${this.getMailerOptions().from}>`,
to: toAddresses.join(","),
replyTo: [this.calEvent.organizer.email, ...this.calEvent.attendees.map(({ email }) => email)],
- subject: `${this.newSeat ? this.t("new_attendee") + ": " : ""}${this.calEvent.title}`,
+ subject: `${this.newSeat ? `${this.t("new_attendee")}: ` : ""}${this.calEvent.title}`,
html: renderEmail("OrganizerScheduledEmail", {
calEvent: clonedCalEvent,
attendee: this.calEvent.organizer,
diff --git a/packages/embeds/embed-core/playwright/lib/testUtils.ts b/packages/embeds/embed-core/playwright/lib/testUtils.ts
index 5f237ed99a3..41927b76665 100644
--- a/packages/embeds/embed-core/playwright/lib/testUtils.ts
+++ b/packages/embeds/embed-core/playwright/lib/testUtils.ts
@@ -80,10 +80,10 @@ export const getEmbedIframe = async ({
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const embedIframe = page.frame(`cal-embed=${calNamespace}`)!;
const u = new URL(embedIframe.url());
- if (u.pathname === pathname + "/embed") {
+ if (u.pathname === `${pathname}/embed`) {
return embedIframe;
}
- console.log('Embed iframe url pathname match. Expected: "' + pathname + '/embed"', "Actual: " + u.pathname);
+ console.log(`Embed iframe url pathname match. Expected: "${pathname}/embed"`, `Actual: ${u.pathname}`);
return null;
};
diff --git a/packages/embeds/embed-core/src/embed.ts b/packages/embeds/embed-core/src/embed.ts
index ef08c29e4b5..cc051bd5421 100644
--- a/packages/embeds/embed-core/src/embed.ts
+++ b/packages/embeds/embed-core/src/embed.ts
@@ -291,7 +291,7 @@ export class Cal {
urlInstance.searchParams.set("embed", this.namespace);
if (config.debug) {
- urlInstance.searchParams.set("debug", "" + config.debug);
+ urlInstance.searchParams.set("debug", `${config.debug}`);
}
// Keep iframe invisible, till the embedded calLink sets its color-scheme. This is so that there is no flash of non-transparent(white/black) background
@@ -367,7 +367,7 @@ export class Cal {
// It ensures that if the iframe is so tall that it can't fit in the parent window without scroll. Then force the scroll by restricting the max-height to innerHeight
// This case is reproducible when viewing in ModalBox on Mobile.
const spacingTopPlusBottom = 2 * 50; // 50 is the padding we want to keep to show close button comfortably. Make it same as top for bottom.
- iframe.style.maxHeight = window.innerHeight - spacingTopPlusBottom + "px";
+ iframe.style.maxHeight = `${window.innerHeight - spacingTopPlusBottom}px`;
}
});
@@ -554,10 +554,10 @@ class CalApi {
}
const dataset = el.dataset;
dataset["buttonText"] = buttonText;
- dataset["hideButtonIcon"] = "" + hideButtonIcon;
- dataset["buttonPosition"] = "" + buttonPosition;
- dataset["buttonColor"] = "" + buttonColor;
- dataset["buttonTextColor"] = "" + buttonTextColor;
+ dataset["hideButtonIcon"] = `${hideButtonIcon}`;
+ dataset["buttonPosition"] = `${buttonPosition}`;
+ dataset["buttonColor"] = `${buttonColor}`;
+ dataset["buttonTextColor"] = `${buttonTextColor}`;
}
modal({
@@ -738,7 +738,7 @@ window.addEventListener("message", (e) => {
globalCal.__logQueue.push({ ...parsedAction, data: detail.data });
if (!actionManager) {
- throw new Error("Unhandled Action" + parsedAction);
+ throw new Error(`Unhandled Action ${parsedAction}`);
}
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
diff --git a/packages/features/auth/lib/next-auth-options.ts b/packages/features/auth/lib/next-auth-options.ts
index 40d240b95f1..6e21b15b96f 100644
--- a/packages/features/auth/lib/next-auth-options.ts
+++ b/packages/features/auth/lib/next-auth-options.ts
@@ -34,7 +34,7 @@ const IS_GOOGLE_LOGIN_ENABLED = !!(GOOGLE_CLIENT_ID && GOOGLE_CLIENT_SECRET && G
const ORGANIZATIONS_AUTOLINK =
process.env.ORGANIZATIONS_AUTOLINK === "1" || process.env.ORGANIZATIONS_AUTOLINK === "true";
-const usernameSlug = (username: string) => slugify(username) + "-" + randomString(6).toLowerCase();
+const usernameSlug = (username: string) => `${slugify(username)}-${randomString(6).toLowerCase()}`;
const loginWithTotp = async (user: { email: string }) =>
`/auth/login?totp=${await (await import("./signJwt")).default({ email: user.email })}`;
diff --git a/packages/features/auth/lib/sendVerificationRequest.ts b/packages/features/auth/lib/sendVerificationRequest.ts
index 69271853052..205da0cadf2 100644
--- a/packages/features/auth/lib/sendVerificationRequest.ts
+++ b/packages/features/auth/lib/sendVerificationRequest.ts
@@ -27,7 +27,7 @@ const sendVerificationRequest = async ({ identifier, url }: SendVerificationRequ
transporter.sendMail({
from: `${process.env.EMAIL_FROM}` || APP_NAME,
to: identifier,
- subject: "Your sign-in link for " + APP_NAME,
+ subject: `Your sign-in link for ${APP_NAME}`,
html: emailTemplate({
base_url: WEBAPP_URL,
signin_url: url,
diff --git a/packages/features/bookings/lib/getBookingFields.ts b/packages/features/bookings/lib/getBookingFields.ts
index b6441d3b77b..a67b3f04f83 100644
--- a/packages/features/bookings/lib/getBookingFields.ts
+++ b/packages/features/bookings/lib/getBookingFields.ts
@@ -44,7 +44,7 @@ export const getSmsReminderNumberSource = ({
workflowId: Workflow["id"];
isSmsReminderNumberRequired: boolean;
}) => ({
- id: "" + workflowId,
+ id: `${workflowId}`,
type: "workflow",
label: "Workflow",
fieldRequired: isSmsReminderNumberRequired,
diff --git a/packages/features/bookings/lib/handleNewBooking.ts b/packages/features/bookings/lib/handleNewBooking.ts
index 997da0e8a4d..0fd86fe8156 100644
--- a/packages/features/bookings/lib/handleNewBooking.ts
+++ b/packages/features/bookings/lib/handleNewBooking.ts
@@ -1444,7 +1444,7 @@ async function handler(
await sendRescheduledEmails({
...copyEvent,
additionalNotes, // Resets back to the additionalNote input and not the override value
- cancellationReason: "$RCH$" + (rescheduleReason ? rescheduleReason : ""), // Removable code prefix to differentiate cancellation from rescheduling for email
+ cancellationReason: `$RCH$${rescheduleReason ? rescheduleReason : ""}`, // Removable code prefix to differentiate cancellation from rescheduling for email
});
}
const foundBooking = await findBookingQuery(newBooking.id);
@@ -1564,7 +1564,7 @@ async function handler(
await sendRescheduledEmails({
...copyEvent,
additionalNotes, // Resets back to the additionalNote input and not the override value
- cancellationReason: "$RCH$" + (rescheduleReason ? rescheduleReason : ""), // Removable code prefix to differentiate cancellation from rescheduling for email
+ cancellationReason: `$RCH$${rescheduleReason ? rescheduleReason : ""}`, // Removable code prefix to differentiate cancellation from rescheduling for email
});
}
@@ -2193,7 +2193,7 @@ async function handler(
...copyEvent,
additionalInformation: metadata,
additionalNotes, // Resets back to the additionalNote input and not the override value
- cancellationReason: "$RCH$" + (rescheduleReason ? rescheduleReason : ""), // Removable code prefix to differentiate cancellation from rescheduling for email
+ cancellationReason: `$RCH$${rescheduleReason ? rescheduleReason : ""}`, // Removable code prefix to differentiate cancellation from rescheduling for email
});
}
}
diff --git a/packages/features/calendars/CalendarSwitch.tsx b/packages/features/calendars/CalendarSwitch.tsx
index ba91da1aff9..06dcd889ed9 100644
--- a/packages/features/calendars/CalendarSwitch.tsx
+++ b/packages/features/calendars/CalendarSwitch.tsx
@@ -48,7 +48,7 @@ const CalendarSwitch = (props: ICalendarSwitchProps) => {
throw new Error("Something went wrong");
}
} else {
- const res = await fetch("/api/availability/calendar?" + new URLSearchParams(body), {
+ const res = await fetch(`/api/availability/calendar?${new URLSearchParams(body)}`, {
method: "DELETE",
headers: {
"Content-Type": "application/json",
diff --git a/packages/features/ee/components/PoweredBy.tsx b/packages/features/ee/components/PoweredBy.tsx
index f6eac895dc6..cbb1a95ea26 100644
--- a/packages/features/ee/components/PoweredBy.tsx
+++ b/packages/features/ee/components/PoweredBy.tsx
@@ -12,7 +12,7 @@ const PoweredByCal = ({ logoOnly }: { logoOnly?: boolean }) => {
const hasValidLicense = session.data ? session.data.hasValidLicense : null;
return (
- <div className={"p-2 text-center text-xs sm:text-right" + (isEmbed ? " max-w-3xl" : "")}>
+ <div className={`p-2 text-center text-xs sm:text-right${isEmbed ? " max-w-3xl" : ""}`}>
<Link href={POWERED_BY_URL} target="_blank" className="text-subtle">
{!logoOnly && <>{t("powered_by")} </>}
{APP_NAME === "Cal.com" || !hasValidLicense ? (
diff --git a/packages/features/ee/organizations/README.md b/packages/features/ee/organizations/README.md
index 13dad28a4a0..0ef0508b9be 100644
--- a/packages/features/ee/organizations/README.md
+++ b/packages/features/ee/organizations/README.md
@@ -6,9 +6,10 @@ From the [Original RFC](https://github.com/calcom/cal.com/issues/7142):
## App setup
- 1. Log in as admin and in Settings, turn on Organizations feature flag under Features section. Organizations feature has an operational feature flag in order to turn on the entire feature.
+1. Log in as admin and in Settings, turn on Organizations feature flag under Features section. Organizations feature has an operational feature flag in order to turn on the entire feature.
+
+2. Set the following environment variables as described:
- 2. Set the following environment variables as described:
1. **`CALCOM_LICENSE_KEY`**: Since Organizations is an EE feature, a license key should be present, either as this environment variable or visiting as an Admin `/auth/setup`. To get a license key you should visit Cal Console ([prod](https://console.cal.com) or [dev](https://console.cal.dev))
2. **`NEXT_PUBLIC_WEBAPP_URL`**: In case of local development, this variable should be set to `https://app.cal.local:3000` to be able to handle subdomains correctly in terms of authentication and cookies
3. **`NEXTAUTH_URL`**: Should be equal to `NEXT_PUBLIC_WEBAPP_URL` which is `https://app.cal.local:3000`
@@ -17,17 +18,18 @@ From the [Original RFC](https://github.com/calcom/cal.com/issues/7142):
6. **`STRIPE_ORG_MONTHLY_PRICE_ID`**: For dev and all testing should be set to your own testing key. Or ask for the shared key if you're a core member.
7. **`ORGANIZATIONS_AUTOLINK`**: Optional. Set to `1` or `true` to let new signed-up users using Google external provider join the corresponding organization based on the email domain name.
- 3. Add `app.cal.local` to your host file, either:
- 1. `sudo npx hostile app.cal.local`
+3. Add `app.cal.local` to your host file, either:
+
+ 1. `sudo npx hostile app.cal.local`
2. Add it yourself
- 4. Add `acme.cal.local` to host file given that the org create for it will be `acme`, otherwise do this for whatever slug will be assigned to the org. This is needed to test org-related public URLs, such as sub-teams, members and event-types.
+4. Add `acme.cal.local` to host file given that the org create for it will be `acme`, otherwise do this for whatever slug will be assigned to the org. This is needed to test org-related public URLs, such as sub-teams, members and event-types.
- 5. Be sure to be logged in with any type of user and visit `/settings/organizations/new` and follow setup steps with the slug matching the org slug from step 3
+5. Be sure to be logged in with any type of user and visit `/settings/organizations/new` and follow setup steps with the slug matching the org slug from step 3
- 6. Log in as admin and go to Settings and under Organizations you will need to accept the newly created organization in order to be operational
+6. Log in as admin and go to Settings and under Organizations you will need to accept the newly created organization in order to be operational
- 7. After finishing the org creation, you will be automatically logged in as the owner of the organization, and the app will be shown in organization mode
+7. After finishing the org creation, you will be automatically logged in as the owner of the organization, and the app will be shown in organization mode
## DNS setup
diff --git a/packages/features/ee/organizations/pages/components/MemberListItem.tsx b/packages/features/ee/organizations/pages/components/MemberListItem.tsx
index d2108e9fdcd..5a4437ec79f 100644
--- a/packages/features/ee/organizations/pages/components/MemberListItem.tsx
+++ b/packages/features/ee/organizations/pages/components/MemberListItem.tsx
@@ -38,7 +38,7 @@ export default function MemberListItem(props: Props) {
<div className="flex">
<Avatar
size="sm"
- imageSrc={bookerUrl + "/" + user.username + "/avatar.png"}
+ imageSrc={`${bookerUrl}/${user.username}/avatar.png`}
alt={name || ""}
className="h-10 w-10 rounded-full"
/>
@@ -94,7 +94,7 @@ export default function MemberListItem(props: Props) {
<DropdownMenuItem className="outline-none">
<DropdownItem
disabled={!member.accepted}
- href={"/" + user.username}
+ href={`/${user.username}`}
target="_blank"
type="button"
StartIcon={ExternalLink}>
diff --git a/packages/features/ee/organizations/pages/components/OtherTeamListItem.tsx b/packages/features/ee/organizations/pages/components/OtherTeamListItem.tsx
index 1ed749d5c83..35b645efe74 100644
--- a/packages/features/ee/organizations/pages/components/OtherTeamListItem.tsx
+++ b/packages/features/ee/organizations/pages/components/OtherTeamListItem.tsx
@@ -77,7 +77,7 @@ export default function OtherTeamListItem(props: Props) {
`${
orgBranding
? `${orgBranding.fullDomain}`
- : process.env.NEXT_PUBLIC_WEBSITE_URL + "/team"
+ : `${process.env.NEXT_PUBLIC_WEBSITE_URL}/team`
}/${team.slug}`
);
showToast(t("link_copied"), "success");
@@ -101,7 +101,7 @@ export default function OtherTeamListItem(props: Props) {
<DropdownMenuItem>
<DropdownItem
type="button"
- href={"/settings/teams/other/" + team.id + "/profile"}
+ href={`/settings/teams/other/${team.id}/profile`}
StartIcon={Edit2}>
{t("edit_team") as string}
</DropdownItem>
diff --git a/packages/features/ee/payments/components/PaymentPage.tsx b/packages/features/ee/payments/components/PaymentPage.tsx
index dcccdf8709d..789ca3944ac 100644
--- a/packages/features/ee/payments/components/PaymentPage.tsx
+++ b/packages/features/ee/payments/components/PaymentPage.tsx
@@ -62,7 +62,7 @@ const PaymentPage: FC<PaymentPageProps> = (props) => {
)?.parentElement;
if (stripeIframeWrapper) {
stripeIframeWrapper.style.margin = "0 auto";
- stripeIframeWrapper.style.width = embedIframeWidth + "px";
+ stripeIframeWrapper.style.width = `${embedIframeWidth}px`;
}
requestAnimationFrame(fixStripeIframe);
});
diff --git a/packages/features/ee/support/lib/intercom/useIntercom.ts b/packages/features/ee/support/lib/intercom/useIntercom.ts
index 6675a570f75..61c547a05bd 100644
--- a/packages/features/ee/support/lib/intercom/useIntercom.ts
+++ b/packages/features/ee/support/lib/intercom/useIntercom.ts
@@ -44,7 +44,7 @@ export const useIntercom = () => {
customAttributes: {
//keys should be snake cased
user_name: data?.username,
- link: CAL_URL + "/" + data?.username,
+ link: `${CAL_URL}/${data?.username}`,
identity_provider: data?.identityProvider,
timezone: data?.timeZone,
locale: data?.locale,
diff --git a/packages/features/ee/support/lib/zendesk/ZendeskMenuItem.tsx b/packages/features/ee/support/lib/zendesk/ZendeskMenuItem.tsx
index b250436c0b4..a7a67fd8a83 100644
--- a/packages/features/ee/support/lib/zendesk/ZendeskMenuItem.tsx
+++ b/packages/features/ee/support/lib/zendesk/ZendeskMenuItem.tsx
@@ -28,7 +28,7 @@ export default function ZendeskMenuItem(props: ZendeskMenuItemProps) {
{t("contact_support")}
</button>
{active && (
- <Script id="ze-snippet" src={"https://static.zdassets.com/ekr/snippet.js?key=" + ZENDESK_KEY} />
+ <Script id="ze-snippet" src={`https://static.zdassets.com/ekr/snippet.js?key=${ZENDESK_KEY}`} />
)}
</>
);
diff --git a/packages/features/ee/teams/components/AddNewTeamMembers.tsx b/packages/features/ee/teams/components/AddNewTeamMembers.tsx
index 942cd147e8e..28c8569e77a 100644
--- a/packages/features/ee/teams/components/AddNewTeamMembers.tsx
+++ b/packages/features/ee/teams/components/AddNewTeamMembers.tsx
@@ -241,7 +241,7 @@ const PendingMemberItem = (props: { member: TeamMember; index: number; teamId: n
)}
data-testid="pending-member-item">
<div className="mr-4 flex max-w-full space-x-2 overflow-hidden rtl:space-x-reverse">
- <Avatar size="mdLg" imageSrc={bookerUrl + "/" + member.username + "/avatar.png"} alt="owner-avatar" />
+ <Avatar size="mdLg" imageSrc={`${bookerUrl}/${member.username}/avatar.png`} alt="owner-avatar" />
<div className="max-w-full overflow-hidden">
<div className="flex space-x-1">
<p>{member.name || member.email || t("team_member")}</p>
diff --git a/packages/features/ee/teams/components/CreateANewTeamForm.tsx b/packages/features/ee/teams/components/CreateANewTeamForm.tsx
index 3220217f528..76b2cbc6dbd 100644
--- a/packages/features/ee/teams/components/CreateANewTeamForm.tsx
+++ b/packages/features/ee/teams/components/CreateANewTeamForm.tsx
@@ -112,7 +112,7 @@ export const CreateANewTeamForm = () => {
label={t("team_url")}
addOnLeading={`${
orgBranding
- ? orgBranding.fullDomain.replace("https://", "").replace("http://", "") + "/"
+ ? `${orgBranding.fullDomain.replace("https://", "").replace("http://", "")}/`
: `${extractDomainFromWebsiteUrl}/team/`
}`}
value={value}
diff --git a/packages/features/ee/teams/components/MemberListItem.tsx b/packages/features/ee/teams/components/MemberListItem.tsx
index 633b96bf09a..e460d52e46c 100644
--- a/packages/features/ee/teams/components/MemberListItem.tsx
+++ b/packages/features/ee/teams/components/MemberListItem.tsx
@@ -143,7 +143,7 @@ export default function MemberListItem(props: Props) {
<div className="flex">
<Avatar
size="sm"
- imageSrc={bookerUrl + "/" + props.member.username + "/avatar.png"}
+ imageSrc={`${bookerUrl}/${props.member.username}/avatar.png`}
alt={name || ""}
className="h-10 w-10 rounded-full"
/>
@@ -273,7 +273,7 @@ export default function MemberListItem(props: Props) {
<DropdownMenuItem className="outline-none">
<DropdownItem
disabled={!props.member.accepted}
- href={!props.member.accepted ? undefined : "/" + props.member.username}
+ href={!props.member.accepted ? undefined : `/${props.member.username}`}
target="_blank"
type="button"
StartIcon={ExternalLink}>
diff --git a/packages/features/ee/teams/components/TeamAvailabilityModal.tsx b/packages/features/ee/teams/components/TeamAvailabilityModal.tsx
index f2edddb91c0..7aa3c0ddefe 100644
--- a/packages/features/ee/teams/components/TeamAvailabilityModal.tsx
+++ b/packages/features/ee/teams/components/TeamAvailabilityModal.tsx
@@ -39,7 +39,7 @@ export default function TeamAvailabilityModal(props: Props) {
<div className="flex">
<Avatar
size="md"
- imageSrc={WEBAPP_URL + "/" + props.member?.username + "/avatar.png"}
+ imageSrc={`${WEBAPP_URL}/${props.member?.username}/avatar.png`}
alt={props.member?.name || ""}
/>
<div className="flex items-center justify-center ">
diff --git a/packages/features/ee/teams/components/TeamList.tsx b/packages/features/ee/teams/components/TeamList.tsx
index 6d184899f97..9cd893b95d8 100644
--- a/packages/features/ee/teams/components/TeamList.tsx
+++ b/packages/features/ee/teams/components/TeamList.tsx
@@ -71,7 +71,7 @@ export default function TeamList(props: Props) {
title={t("invite_team_member")}
description={t("meetings_are_better_with_the_right")}
actionButton={{
- href: "/settings/teams/" + team.id + "/members",
+ href: `/settings/teams/${team.id}/members`,
child: t("invite"),
}}
/>
@@ -97,7 +97,7 @@ export default function TeamList(props: Props) {
title={t("collective_or_roundrobin")}
description={t("book_your_team_members")}
actionButton={{
- href: "/event-types?dialog=new&eventPage=team%2F" + team.slug + "&teamId=" + team.id,
+ href: `/event-types?dialog=new&eventPage=team%2F${team.slug}&teamId=${team.id}`,
child: t("create"),
}}
/>
@@ -107,7 +107,7 @@ export default function TeamList(props: Props) {
title={t("appearance")}
description={t("appearance_description")}
actionButton={{
- href: "/settings/teams/" + team.id + "/appearance",
+ href: `/settings/teams/${team.id}/appearance`,
child: t("edit"),
}}
/>
diff --git a/packages/features/ee/teams/components/TeamListItem.tsx b/packages/features/ee/teams/components/TeamListItem.tsx
index 0471e5831f6..b67585d568f 100644
--- a/packages/features/ee/teams/components/TeamListItem.tsx
+++ b/packages/features/ee/teams/components/TeamListItem.tsx
@@ -183,7 +183,7 @@ export default function TeamListItem(props: Props) {
<div className={classNames("flex items-center justify-between", !isInvitee && "hover:bg-muted group")}>
{!isInvitee ? (
<Link
- href={"/settings/teams/" + team.id + "/profile"}
+ href={`/settings/teams/${team.id}/profile`}
className="flex-grow cursor-pointer truncate text-sm"
title={`${team.name}`}>
{teamInfo}
@@ -241,7 +241,7 @@ export default function TeamListItem(props: Props) {
`${
orgBranding
? `${orgBranding.fullDomain}`
- : process.env.NEXT_PUBLIC_WEBSITE_URL + "/team"
+ : `${process.env.NEXT_PUBLIC_WEBSITE_URL}/team`
}/${team.slug}`
);
showToast(t("link_copied"), "success");
@@ -266,7 +266,7 @@ export default function TeamListItem(props: Props) {
<DropdownMenuItem>
<DropdownItem
type="button"
- href={"/settings/teams/" + team.id + "/profile"}
+ href={`/settings/teams/${team.id}/profile`}
StartIcon={Edit2}>
{t("edit_team") as string}
</DropdownItem>
diff --git a/packages/features/ee/teams/components/TeamsListing.tsx b/packages/features/ee/teams/components/TeamsListing.tsx
index 4641f43bb7c..9203d888701 100644
--- a/packages/features/ee/teams/components/TeamsListing.tsx
+++ b/packages/features/ee/teams/components/TeamsListing.tsx
@@ -71,7 +71,7 @@ export function TeamsListing() {
},
{
icon: <Video className="h-5 w-5 text-purple-500" />,
- title: "Cal Video" + " " + t("recordings_title"),
+ title: `Cal Video ${t("recordings_title")}`,
description: t("upgrade_to_access_recordings_description"),
},
{
diff --git a/packages/features/ee/teams/pages/team-profile-view.tsx b/packages/features/ee/teams/pages/team-profile-view.tsx
index f29b438c326..9ae0e26cc47 100644
--- a/packages/features/ee/teams/pages/team-profile-view.tsx
+++ b/packages/features/ee/teams/pages/team-profile-view.tsx
@@ -228,7 +228,7 @@ const ProfileView = () => {
value={value}
addOnLeading={
team.parent && orgBranding
- ? getOrgFullDomain(orgBranding?.slug, { protocol: false }) + "/"
+ ? `${getOrgFullDomain(orgBranding?.slug, { protocol: false })}/`
: `${WEBAPP_URL}/team/`
}
onChange={(e) => {
diff --git a/packages/features/ee/workflows/components/EmptyScreen.tsx b/packages/features/ee/workflows/components/EmptyScreen.tsx
index 4536f981ae4..7c68104a48b 100644
--- a/packages/features/ee/workflows/components/EmptyScreen.tsx
+++ b/packages/features/ee/workflows/components/EmptyScreen.tsx
@@ -37,7 +37,7 @@ export default function EmptyScreen(props: { isFilteredView: boolean }) {
const createMutation = trpc.viewer.workflows.create.useMutation({
onSuccess: async ({ workflow }) => {
- await router.replace("/workflows/" + workflow.id);
+ await router.replace(`/workflows/${workflow.id}`);
},
onError: (err) => {
if (err instanceof HttpError) {
diff --git a/packages/features/ee/workflows/components/EventWorkflowsTab.tsx b/packages/features/ee/workflows/components/EventWorkflowsTab.tsx
index 8575571bf72..3409fb9137d 100644
--- a/packages/features/ee/workflows/components/EventWorkflowsTab.tsx
+++ b/packages/features/ee/workflows/components/EventWorkflowsTab.tsx
@@ -126,10 +126,9 @@ const WorkflowListItem = (props: ItemProps) => {
)}>
{workflow.name
? workflow.name
- : "Untitled (" +
- `${t(`${workflow.steps[0].action.toLowerCase()}_action`)}`.charAt(0).toUpperCase() +
- `${t(`${workflow.steps[0].action.toLowerCase()}_action`)}`.slice(1) +
- ")"}
+ : `Untitled (${`${t(`${workflow.steps[0].action.toLowerCase()}_action`)}`
+ .charAt(0)
+ .toUpperCase()}${`${t(`${workflow.steps[0].action.toLowerCase()}_action`)}`.slice(1)})`}
</div>
<>
<div
@@ -236,7 +235,7 @@ function EventWorkflowsTab(props: Props) {
const createMutation = trpc.viewer.workflows.create.useMutation({
onSuccess: async ({ workflow }) => {
- await router.replace("/workflows/" + workflow.id);
+ await router.replace(`/workflows/${workflow.id}`);
},
onError: (err) => {
if (err instanceof HttpError) {
diff --git a/packages/features/ee/workflows/components/WorkflowListPage.tsx b/packages/features/ee/workflows/components/WorkflowListPage.tsx
index 5f9a3b9507e..2b4f37ce682 100644
--- a/packages/features/ee/workflows/components/WorkflowListPage.tsx
+++ b/packages/features/ee/workflows/components/WorkflowListPage.tsx
@@ -113,7 +113,7 @@ export default function WorkflowListPage({ workflows }: Props) {
<ArrowButton onClick={() => moveWorkflow(index, 1)} arrowDirection="down" />
)}
<div className="first-line:group hover:bg-muted flex w-full items-center justify-between p-4 sm:px-6">
- <Link href={"/workflows/" + workflow.id} className="flex-grow cursor-pointer">
+ <Link href={`/workflows/${workflow.id}`} className="flex-grow cursor-pointer">
<div className="rtl:space-x-reverse">
<div className="flex">
<div
@@ -124,12 +124,11 @@ export default function WorkflowListPage({ workflows }: Props) {
{workflow.name
? workflow.name
: workflow.steps[0]
- ? "Untitled (" +
- `${t(`${workflow.steps[0].action.toLowerCase()}_action`)}`
+ ? `Untitled (${`${t(`${workflow.steps[0].action.toLowerCase()}_action`)}`
.charAt(0)
- .toUpperCase() +
- `${t(`${workflow.steps[0].action.toLowerCase()}_action`)}`.slice(1) +
- ")"
+ .toUpperCase()}${`${t(
+ `${workflow.steps[0].action.toLowerCase()}_action`
+ )}`.slice(1)})`
: "Untitled"}
</div>
<div>
@@ -234,7 +233,7 @@ export default function WorkflowListPage({ workflows }: Props) {
variant="icon"
StartIcon={Edit2}
disabled={workflow.readOnly}
- onClick={async () => await router.replace("/workflows/" + workflow.id)}
+ onClick={async () => await router.replace(`/workflows/${workflow.id}`)}
/>
</Tooltip>
<Tooltip content={t("delete") as string}>
@@ -267,7 +266,7 @@ export default function WorkflowListPage({ workflows }: Props) {
<DropdownItem
type="button"
StartIcon={Edit2}
- onClick={async () => await router.replace("/workflows/" + workflow.id)}>
+ onClick={async () => await router.replace(`/workflows/${workflow.id}`)}>
{t("edit")}
</DropdownItem>
</DropdownMenuItem>
diff --git a/packages/features/ee/workflows/lib/reminders/templates/emailReminderTemplate.ts b/packages/features/ee/workflows/lib/reminders/templates/emailReminderTemplate.ts
index ec8a676228d..14b1bf589e3 100644
--- a/packages/features/ee/workflows/lib/reminders/templates/emailReminderTemplate.ts
+++ b/packages/features/ee/workflows/lib/reminders/templates/emailReminderTemplate.ts
@@ -36,7 +36,7 @@ const emailReminderTemplate = (
const emailSubject = `Reminder: ${eventName} - ${eventDate}`;
const introHtml = `<body>Hi${
- name ? " " + name : ""
+ name ? ` ${name}` : ""
},<br><br>This is a reminder about your upcoming event.<br><br>`;
const eventHtml = `<div><strong class="editor-text-bold">Event: </strong></div>${eventName}<br><br>`;
diff --git a/packages/features/ee/workflows/pages/index.tsx b/packages/features/ee/workflows/pages/index.tsx
index 0ce8732f292..41ddc24559e 100644
--- a/packages/features/ee/workflows/pages/index.tsx
+++ b/packages/features/ee/workflows/pages/index.tsx
@@ -34,7 +34,7 @@ function WorkflowsPage() {
const createMutation = trpc.viewer.workflows.create.useMutation({
onSuccess: async ({ workflow }) => {
- await router.replace("/workflows/" + workflow.id);
+ await router.replace(`/workflows/${workflow.id}`);
},
onError: (err) => {
if (err instanceof HttpError) {
@@ -120,7 +120,7 @@ const Filter = (props: {
const userId = session.data?.user.id || 0;
const user = session.data?.user.name || "";
const userName = session.data?.user.username;
- const userAvatar = WEBAPP_URL + "/" + userName + "/avatar.png";
+ const userAvatar = `${WEBAPP_URL}/${userName}/avatar.png`;
const teams = props.profiles.filter((profile) => !!profile.teamId);
const { checked, setChecked } = props;
diff --git a/packages/features/embed/lib/EmbedCodes.tsx b/packages/features/embed/lib/EmbedCodes.tsx
index 464b122abbc..f8b1c83bc50 100644
--- a/packages/features/embed/lib/EmbedCodes.tsx
+++ b/packages/features/embed/lib/EmbedCodes.tsx
@@ -33,7 +33,7 @@ export const Codes = {
return <Cal
calLink="${calLink}"
style={{width:"${width}",height:"${height}",overflow:"scroll"}}
- ${previewState.layout ? "config={{layout: '" + previewState.layout + "'}}" : ""}${
+ ${previewState.layout ? `config={{layout: '${previewState.layout}'}}` : ""}${
IS_SELF_HOSTED
? `
calOrigin="${embedCalOrigin}"
@@ -174,7 +174,7 @@ const code = (partsWithoutBlock: TemplateStringsArray, ...blocksOrVariables: str
if (indentationMatch) {
indent = indentationMatch[1];
}
- constructedCode.push(partWithoutBlock + indentedBlock.join("\n" + indent));
+ constructedCode.push(partWithoutBlock + indentedBlock.join(`\n${indent}`));
}
return constructedCode.join("");
};
diff --git a/packages/features/eventtypes/components/CreateEventTypeDialog.tsx b/packages/features/eventtypes/components/CreateEventTypeDialog.tsx
index 4e192b92fc3..4d315900dca 100644
--- a/packages/features/eventtypes/components/CreateEventTypeDialog.tsx
+++ b/packages/features/eventtypes/components/CreateEventTypeDialog.tsx
@@ -116,7 +116,7 @@ export default function CreateEventTypeDialog({
const createMutation = trpc.viewer.eventTypes.create.useMutation({
onSuccess: async ({ eventType }) => {
- await router.replace("/event-types/" + eventType.id);
+ await router.replace(`/event-types/${eventType.id}`);
showToast(t("event_type_created_successfully"), "success");
},
onError: (err) => {
diff --git a/packages/features/eventtypes/components/DuplicateDialog.tsx b/packages/features/eventtypes/components/DuplicateDialog.tsx
index de31accf977..e91c9172130 100644
--- a/packages/features/eventtypes/components/DuplicateDialog.tsx
+++ b/packages/features/eventtypes/components/DuplicateDialog.tsx
@@ -65,7 +65,7 @@ const DuplicateDialog = () => {
const duplicateMutation = trpc.viewer.eventTypes.duplicate.useMutation({
onSuccess: async ({ eventType }) => {
- await router.replace("/event-types/" + eventType.id);
+ await router.replace(`/event-types/${eventType.id}`);
showToast(t("event_type_created_successfully"), "success");
},
onError: (err) => {
diff --git a/packages/features/form-builder/FormBuilder.tsx b/packages/features/form-builder/FormBuilder.tsx
index dc3b51c68de..44119ef52a3 100644
--- a/packages/features/form-builder/FormBuilder.tsx
+++ b/packages/features/form-builder/FormBuilder.tsx
@@ -550,7 +550,7 @@ function FieldLabel({ field }: { field: RhfFormField }) {
const variant = field.variant || defaultVariant;
if (!variant) {
throw new Error(
- "Field has `variantsConfig` but no `defaultVariant`" + JSON.stringify(fieldTypeConfigVariantsConfig)
+ `Field has \`variantsConfig\` but no \`defaultVariant\`${JSON.stringify(fieldTypeConfigVariantsConfig)}`
);
}
const label =
diff --git a/packages/features/form-builder/utils.ts b/packages/features/form-builder/utils.ts
index eaca1481068..bb4e513d7f4 100644
--- a/packages/features/form-builder/utils.ts
+++ b/packages/features/form-builder/utils.ts
@@ -26,7 +26,7 @@ export const getFullName = (name: string | { firstName: string; lastName?: strin
} else {
nameString = name.firstName;
if (name.lastName) {
- nameString = nameString + " " + name.lastName;
+ nameString = `${nameString} ${name.lastName}`;
}
}
return nameString;
diff --git a/packages/features/insights/components/TotalBookingUsersTable.tsx b/packages/features/insights/components/TotalBookingUsersTable.tsx
index c430dc6dec4..c117ebe125c 100644
--- a/packages/features/insights/components/TotalBookingUsersTable.tsx
+++ b/packages/features/insights/components/TotalBookingUsersTable.tsx
@@ -21,7 +21,7 @@ export const TotalBookingUsersTable = ({
<Avatar
alt={item.user.name || ""}
size="sm"
- imageSrc={"/" + item.user.username + "/avatar.png"}
+ imageSrc={`/${item.user.username}/avatar.png`}
title={item.user.name || ""}
className="m-2"
/>
diff --git a/packages/features/schedules/components/DateOverrideList.tsx b/packages/features/schedules/components/DateOverrideList.tsx
index 99d443eae03..1aa43aac4da 100644
--- a/packages/features/schedules/components/DateOverrideList.tsx
+++ b/packages/features/schedules/components/DateOverrideList.tsx
@@ -47,15 +47,11 @@ const DateOverrideList = ({
}
const timeSpan = ({ start, end }: TimeRange) => {
- return (
- new Intl.DateTimeFormat(i18n.language, { hour: "numeric", minute: "numeric", hour12 }).format(
- new Date(start.toISOString().slice(0, -1))
- ) +
- " - " +
- new Intl.DateTimeFormat(i18n.language, { hour: "numeric", minute: "numeric", hour12 }).format(
- new Date(end.toISOString().slice(0, -1))
- )
- );
+ return `${new Intl.DateTimeFormat(i18n.language, { hour: "numeric", minute: "numeric", hour12 }).format(
+ new Date(start.toISOString().slice(0, -1))
+ )} - ${new Intl.DateTimeFormat(i18n.language, { hour: "numeric", minute: "numeric", hour12 }).format(
+ new Date(end.toISOString().slice(0, -1))
+ )}`;
};
return (
diff --git a/packages/features/schedules/components/Schedule.tsx b/packages/features/schedules/components/Schedule.tsx
index 50b6c609f94..49aa75d4747 100644
--- a/packages/features/schedules/components/Schedule.tsx
+++ b/packages/features/schedules/components/Schedule.tsx
@@ -117,7 +117,7 @@ const CopyButton = ({
<DropdownMenuContent align="end">
<CopyTimes
weekStart={weekStart}
- disabled={parseInt(getValuesFromDayRange.replace(fieldArrayName + ".", ""), 10)}
+ disabled={parseInt(getValuesFromDayRange.replace(`${fieldArrayName}.`, ""), 10)}
onClick={(selected) => {
selected.forEach((day) => setValue(`${fieldArrayName}.${day}`, getValues(getValuesFromDayRange)));
setOpen(false);
diff --git a/packages/features/schedules/components/ScheduleListItem.tsx b/packages/features/schedules/components/ScheduleListItem.tsx
index 4bb0566842d..5844d57333e 100644
--- a/packages/features/schedules/components/ScheduleListItem.tsx
+++ b/packages/features/schedules/components/ScheduleListItem.tsx
@@ -44,7 +44,7 @@ export function ScheduleListItem({
<div className="hover:bg-muted flex items-center justify-between py-5 ltr:pl-4 rtl:pr-4 sm:ltr:pl-0 sm:rtl:pr-0">
<div className="group flex w-full items-center justify-between sm:px-6">
<Link
- href={"/availability/" + schedule.id}
+ href={`/availability/${schedule.id}`}
className="flex-grow truncate text-sm"
title={schedule.name}>
<div className="space-x-2 rtl:space-x-reverse">
@@ -107,7 +107,7 @@ export function ScheduleListItem({
<DropdownMenuItem className="outline-none">
<DropdownItem
type="button"
- data-testid={"schedule-duplicate" + schedule.id}
+ data-testid={`schedule-duplicate${schedule.id}`}
StartIcon={Copy}
onClick={() => {
duplicateFunction({
diff --git a/packages/features/shell/Shell.tsx b/packages/features/shell/Shell.tsx
index ab32c2a5fc4..80c428dfe6d 100644
--- a/packages/features/shell/Shell.tsx
+++ b/packages/features/shell/Shell.tsx
@@ -372,7 +372,7 @@ function UserDropdown({ small }: UserDropdownProps) {
)}>
<Avatar
size={small ? "xs" : "xsm"}
- imageSrc={bookerUrl + "/" + user.username + "/avatar.png"}
+ imageSrc={`${bookerUrl}/${user.username}/avatar.png`}
alt={user.username || "Nameless User"}
className="overflow-hidden"
/>
diff --git a/packages/features/test/orgDomains.test.ts b/packages/features/test/orgDomains.test.ts
index c8819cad512..414d54c2bf9 100644
--- a/packages/features/test/orgDomains.test.ts
+++ b/packages/features/test/orgDomains.test.ts
@@ -9,7 +9,28 @@ function setupEnvs({ WEBAPP_URL = "https://app.cal.com" } = {}) {
value: ["cal.com", "cal.dev", "cal-staging.com", "cal.community", "cal.local:3000", "localhost:3000"],
});
Object.defineProperty(constants, "RESERVED_SUBDOMAINS", {
- value: [ "app", "auth", "docs", "design", "console", "go", "status", "api", "saml", "www", "matrix", "developer", "cal", "my", "team", "support", "security", "blog", "learn", "admin"],
+ value: [
+ "app",
+ "auth",
+ "docs",
+ "design",
+ "console",
+ "go",
+ "status",
+ "api",
+ "saml",
+ "www",
+ "matrix",
+ "developer",
+ "cal",
+ "my",
+ "team",
+ "support",
+ "security",
+ "blog",
+ "learn",
+ "admin",
+ ],
});
}
diff --git a/packages/features/timezone-buddy/components/AvailabilitySliderTable.tsx b/packages/features/timezone-buddy/components/AvailabilitySliderTable.tsx
index 22a25746483..bdedad5d1c3 100644
--- a/packages/features/timezone-buddy/components/AvailabilitySliderTable.tsx
+++ b/packages/features/timezone-buddy/components/AvailabilitySliderTable.tsx
@@ -81,7 +81,7 @@ export function AvailabilitySliderTable() {
const { username, email, timeZone } = row.original;
return (
<div className="max-w-64 flex flex-shrink-0 items-center gap-2 overflow-hidden">
- <Avatar size="sm" alt={username || email} imageSrc={"/" + username + "/avatar.png"} />
+ <Avatar size="sm" alt={username || email} imageSrc={`/${username}/avatar.png`} />
<div className="">
<div className="text-emphasis max-w-64 truncate text-sm font-medium" title={email}>
{username || "No username"}
diff --git a/packages/features/timezone-buddy/components/TimeDial.tsx b/packages/features/timezone-buddy/components/TimeDial.tsx
index 88b8e91069e..2b5878bf856 100644
--- a/packages/features/timezone-buddy/components/TimeDial.tsx
+++ b/packages/features/timezone-buddy/components/TimeDial.tsx
@@ -141,7 +141,7 @@ export function TimeDial({ timezone, dateRanges }: TimeDialProps) {
rangeGradients.textGradient = `linear-gradient(90deg, rgba(0,212,255,1) 0%, rgba(2,0,36,1) 100%, rgba(9,108,121,1) 100%)`;
rangeGradients.darkTextGradient = `linear-gradient(90deg, var(--cal-text-emphasis, #111827) ${
- gradientValue === 50 ? "50%" : Math.round(gradientValue / 100) * 100 + "%"
+ gradientValue === 50 ? "50%" : `${Math.round(gradientValue / 100) * 100}%`
}, var(--cal-text-inverted, white) 0%, var(--cal-text-inverted, white) 0%)`;
} else {
rangeGradients.backgroundGradient = `linear-gradient(90deg, var(--cal-bg-success) ${rangeOverlap}%, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 0%)`;
@@ -149,7 +149,7 @@ export function TimeDial({ timezone, dateRanges }: TimeDialProps) {
rangeGradients.textGradient = `linear-gradient(90deg, rgba(0,212,255,1) 0%, rgba(2,0,36,1) 50%, rgba(9,108,121,1) 100%)`;
rangeGradients.darkTextGradient = `linear-gradient(90deg, var(--cal-text-inverted, white) ${
- rangeOverlap === 50 ? "50%" : Math.round(rangeOverlap / 100) * 100 + "%"
+ rangeOverlap === 50 ? "50%" : `${Math.round(rangeOverlap / 100) * 100}%`
}, var(--cal-text-emphasis, #111827) 0%, var(--cal-text-emphasis, #111827) 0%)`;
}
}
diff --git a/packages/features/users/components/UserTable/UserListTable.tsx b/packages/features/users/components/UserTable/UserListTable.tsx
index 5a86849ffc7..21abc1bc9af 100644
--- a/packages/features/users/components/UserTable/UserListTable.tsx
+++ b/packages/features/users/components/UserTable/UserListTable.tsx
@@ -164,7 +164,7 @@ export function UserListTable() {
const { username, email } = row.original;
return (
<div className="flex items-center gap-2">
- <Avatar size="sm" alt={username || email} imageSrc={domain + "/" + username + "/avatar.png"} />
+ <Avatar size="sm" alt={username || email} imageSrc={`${domain}/${username}/avatar.png`} />
<div className="">
<div className="text-emphasis text-sm font-medium leading-none">
{username || "No username"}
diff --git a/packages/features/users/components/UserTable/UserTableActions.tsx b/packages/features/users/components/UserTable/UserTableActions.tsx
index 3f659e556f3..4e2d6723545 100644
--- a/packages/features/users/components/UserTable/UserTableActions.tsx
+++ b/packages/features/users/components/UserTable/UserTableActions.tsx
@@ -47,7 +47,7 @@ export function TableActions({
},
});
- const usersProfileUrl = domain + "/" + user.username;
+ const usersProfileUrl = `${domain}/${user.username}`;
if (!session?.user.org?.id) return null;
diff --git a/packages/lib/CalEventParser.ts b/packages/lib/CalEventParser.ts
index efff6f5566d..29ac3ab1710 100644
--- a/packages/lib/CalEventParser.ts
+++ b/packages/lib/CalEventParser.ts
@@ -155,14 +155,13 @@ const getSeatReferenceId = (calEvent: CalendarEvent): string => {
};
export const getManageLink = (calEvent: CalendarEvent, t: TFunction) => {
- return `
-${t("need_to_reschedule_or_cancel")}
-${(calEvent.bookerUrl ?? WEBAPP_URL) + "/booking/" + getUid(calEvent) + "?changes=true"}
- `;
+ return `${t("need_to_reschedule_or_cancel")}${calEvent.bookerUrl ?? WEBAPP_URL}/booking/${getUid(
+ calEvent
+ )}?changes=true`;
};
export const getCancelLink = (calEvent: CalendarEvent): string => {
- const cancelLink = new URL((calEvent.bookerUrl ?? WEBAPP_URL) + `/booking/${getUid(calEvent)}`);
+ const cancelLink = new URL(`${calEvent.bookerUrl ?? WEBAPP_URL}/booking/${getUid(calEvent)}`);
cancelLink.searchParams.append("cancel", "true");
cancelLink.searchParams.append("allRemainingBookings", String(!!calEvent.recurringEvent));
const seatReferenceUid = getSeatReferenceId(calEvent);
@@ -220,7 +219,7 @@ export const isDailyVideoCall = (calEvent: CalendarEvent): boolean => {
};
export const getPublicVideoCallUrl = (calEvent: CalendarEvent): string => {
- return WEBAPP_URL + "/video/" + getUid(calEvent);
+ return `${WEBAPP_URL}/video/${getUid(calEvent)}`;
};
export const getVideoCallUrlFromCalEvent = (calEvent: CalendarEvent): string => {
diff --git a/packages/lib/CloseComeUtils.ts b/packages/lib/CloseComeUtils.ts
index 467329fd054..cae8337777f 100644
--- a/packages/lib/CloseComeUtils.ts
+++ b/packages/lib/CloseComeUtils.ts
@@ -168,8 +168,8 @@ export async function getCloseComCustomActivityTypeFieldsIds(
// Cal.com Custom Activity type doesn't exist
// Create Custom Activity Type
const { id: activityType } = await closeCom.customActivity.type.create({
- name: APP_NAME + " Activity",
- description: "Bookings in your " + APP_NAME + " account",
+ name: `${APP_NAME} Activity`,
+ description: `Bookings in your ${APP_NAME} account`,
});
// Create Custom Activity Fields
const fields = await Promise.all(
@@ -195,8 +195,8 @@ export async function getCloseComCustomActivityTypeFieldsIds(
export async function getCloseComLeadId(
closeCom: CloseCom,
leadInfo: CloseComLead = {
- companyName: "From " + APP_NAME,
- description: "Generic Lead for Contacts created by " + APP_NAME,
+ companyName: `From ${APP_NAME}`,
+ description: `Generic Lead for Contacts created by ${APP_NAME}`,
}
): Promise<string> {
const closeComLeadNames = await closeCom.lead.list({ query: { _fields: ["name", "id"] } });
diff --git a/packages/lib/availability.ts b/packages/lib/availability.ts
index f9574269a75..c2763786a62 100644
--- a/packages/lib/availability.ts
+++ b/packages/lib/availability.ts
@@ -154,16 +154,12 @@ export function availabilityAsString(
};
const timeSpan = (availability: Availability) => {
- return (
- new Intl.DateTimeFormat(locale, { hour: "numeric", minute: "numeric", hour12 }).format(
- new Date(availability.startTime.toISOString().slice(0, -1))
- ) +
- " - " +
- new Intl.DateTimeFormat(locale, { hour: "numeric", minute: "numeric", hour12 }).format(
- new Date(availability.endTime.toISOString().slice(0, -1))
- )
- );
+ return `${new Intl.DateTimeFormat(locale, { hour: "numeric", minute: "numeric", hour12 }).format(
+ new Date(availability.startTime.toISOString().slice(0, -1))
+ )} - ${new Intl.DateTimeFormat(locale, { hour: "numeric", minute: "numeric", hour12 }).format(
+ new Date(availability.endTime.toISOString().slice(0, -1))
+ )}`;
};
- return weekSpan(availability) + ", " + timeSpan(availability);
+ return `${weekSpan(availability)}, ${timeSpan(availability)}`;
}
diff --git a/packages/lib/crypto.ts b/packages/lib/crypto.ts
index d33f0c8f4c7..f1efba93b6e 100644
--- a/packages/lib/crypto.ts
+++ b/packages/lib/crypto.ts
@@ -19,7 +19,7 @@ export const symmetricEncrypt = function (text: string, key: string) {
const cipher = crypto.createCipheriv(ALGORITHM, _key, iv);
let ciphered = cipher.update(text, INPUT_ENCODING, OUTPUT_ENCODING);
ciphered += cipher.final(OUTPUT_ENCODING);
- const ciphertext = iv.toString(OUTPUT_ENCODING) + ":" + ciphered;
+ const ciphertext = `${iv.toString(OUTPUT_ENCODING)}:${ciphered}`;
return ciphertext;
};
diff --git a/packages/lib/defaultAvatarImage.ts b/packages/lib/defaultAvatarImage.ts
index 2fee3bffeee..8983097ef9f 100644
--- a/packages/lib/defaultAvatarImage.ts
+++ b/packages/lib/defaultAvatarImage.ts
@@ -10,6 +10,7 @@
export function getPlaceholderAvatar(avatar: string | null | undefined, name: string | null | undefined) {
return avatar
? avatar
- : "https://eu.ui-avatars.com/api/?background=fff&color=f9f9f9&bold=true&background=000000&name=" +
- encodeURIComponent(name || "");
+ : `https://eu.ui-avatars.com/api/?background=fff&color=f9f9f9&bold=true&background=000000&name=${encodeURIComponent(
+ name || ""
+ )}`;
}
diff --git a/packages/lib/parse-dates.ts b/packages/lib/parse-dates.ts
index dcb6555b33f..9529ad7f566 100644
--- a/packages/lib/parse-dates.ts
+++ b/packages/lib/parse-dates.ts
@@ -17,7 +17,7 @@ const processDate = (date: string | null | Dayjs, language: string, options?: Ex
? TimeFormat.TWELVE_HOUR
: options?.selectedTimeFormat || detectBrowserTimeFormat
);
- return formattedTime + ", " + dayjs(date).toDate().toLocaleString(language, { dateStyle: "full" });
+ return `${formattedTime}, ${dayjs(date).toDate().toLocaleString(language, { dateStyle: "full" })}`;
};
export const parseDate = (date: string | null | Dayjs, language: string, options?: ExtraOptions) => {
diff --git a/packages/lib/server/queries/teams/index.ts b/packages/lib/server/queries/teams/index.ts
index 0065d4a4603..6cf5e6f0d7b 100644
--- a/packages/lib/server/queries/teams/index.ts
+++ b/packages/lib/server/queries/teams/index.ts
@@ -185,7 +185,7 @@ export async function getTeamWithMembers(args: {
/** To prevent breaking we only return non-email attached token here, if we have one */
inviteToken: inviteTokens.find(
(token) =>
- token.identifier === "invite-link-for-teamId-" + team.id &&
+ token.identifier === `invite-link-for-teamId-${team.id}` &&
token.expires > new Date(new Date().setHours(24))
),
metadata: restTeamMetadata,
diff --git a/packages/lib/telemetry.ts b/packages/lib/telemetry.ts
index 385aaa42666..5e4636eaf84 100644
--- a/packages/lib/telemetry.ts
+++ b/packages/lib/telemetry.ts
@@ -32,7 +32,7 @@ export function collectPageParameters(
return {
page_url: route,
doc_encoding: document.characterSet,
- url: document.location.protocol + "//" + host + (docPath ?? ""),
+ url: `${document.location.protocol}//${host}${docPath ?? ""}`,
...extraData,
};
}
diff --git a/packages/trpc/react/trpc.ts b/packages/trpc/react/trpc.ts
index fc00683e299..6b34bfb2b34 100644
--- a/packages/trpc/react/trpc.ts
+++ b/packages/trpc/react/trpc.ts
@@ -101,14 +101,14 @@ export const trpc = createTRPCNext<AppRouter, NextPageContext, "ExperimentalSusp
// when condition is true, use normal request
true: (runtime) => {
const links = Object.fromEntries(
- ENDPOINTS.map((endpoint) => [endpoint, httpLink({ url: url + "/" + endpoint })(runtime)])
+ ENDPOINTS.map((endpoint) => [endpoint, httpLink({ url: `${url}/${endpoint}` })(runtime)])
);
return resolveEndpoint(links);
},
// when condition is false, use batch request
false: (runtime) => {
const links = Object.fromEntries(
- ENDPOINTS.map((endpoint) => [endpoint, httpBatchLink({ url: url + "/" + endpoint })(runtime)])
+ ENDPOINTS.map((endpoint) => [endpoint, httpBatchLink({ url: `${url}/${endpoint}` })(runtime)])
);
return resolveEndpoint(links);
},
diff --git a/packages/trpc/server/middlewares/sessionMiddleware.ts b/packages/trpc/server/middlewares/sessionMiddleware.ts
index 4cdc6b7a4e0..0a9a936a5ce 100644
--- a/packages/trpc/server/middlewares/sessionMiddleware.ts
+++ b/packages/trpc/server/middlewares/sessionMiddleware.ts
@@ -102,7 +102,7 @@ export async function getUserFromSession(ctx: TRPCContextInner, session: Maybe<S
return {
...user,
avatar:
- `${WEBAPP_URL}/${user.username}/avatar.png?` + user.organizationId && `orgId=${user.organizationId}`,
+ `${WEBAPP_URL}/${user.username}/avatar.png?${user.organizationId}` && `orgId=${user.organizationId}`,
organization: {
...user.organization,
isOrgAdmin,
diff --git a/packages/trpc/server/routers/loggedInViewer/teamsAndUserProfilesQuery.handler.ts b/packages/trpc/server/routers/loggedInViewer/teamsAndUserProfilesQuery.handler.ts
index d8e1f85b248..41f4b33072e 100644
--- a/packages/trpc/server/routers/loggedInViewer/teamsAndUserProfilesQuery.handler.ts
+++ b/packages/trpc/server/routers/loggedInViewer/teamsAndUserProfilesQuery.handler.ts
@@ -67,7 +67,7 @@ export const teamsAndUserProfilesQuery = async ({ ctx }: TeamsAndUserProfileOpti
...nonOrgTeams.map((membership) => ({
teamId: membership.team.id,
name: membership.team.name,
- slug: membership.team.slug ? "team/" + membership.team.slug : null,
+ slug: membership.team.slug ? `team/${membership.team.slug}` : null,
image: `${bookerUrl}${membership.team.slug ? "/team" : ""}/${membership.team.slug}/avatar.png`,
role: membership.role,
readOnly: !withRoleCanCreateEntity(membership.role),
diff --git a/packages/trpc/server/routers/viewer/bookings/confirm.handler.ts b/packages/trpc/server/routers/viewer/bookings/confirm.handler.ts
index d3182bdfc02..05c2f2790d8 100644
--- a/packages/trpc/server/routers/viewer/bookings/confirm.handler.ts
+++ b/packages/trpc/server/routers/viewer/bookings/confirm.handler.ts
@@ -364,7 +364,7 @@ export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => {
await handleWebhookTrigger({ subscriberOptions, eventTrigger, webhookData });
}
- const message = "Booking " + confirmed ? "confirmed" : "rejected";
+ const message = `Booking ${confirmed}` ? "confirmed" : "rejected";
const status = confirmed ? BookingStatus.ACCEPTED : BookingStatus.REJECTED;
return { message, status };
diff --git a/packages/trpc/server/routers/viewer/eventTypes/getByViewer.handler.ts b/packages/trpc/server/routers/viewer/eventTypes/getByViewer.handler.ts
index 87472bac65d..6c154cdb30e 100644
--- a/packages/trpc/server/routers/viewer/eventTypes/getByViewer.handler.ts
+++ b/packages/trpc/server/routers/viewer/eventTypes/getByViewer.handler.ts
@@ -255,7 +255,7 @@ export const getByViewerHandler = async ({ ctx, input }: GetByViewerOptions) =>
slug: membership.team.slug
? !membership.team.parentId
? `team/${membership.team.slug}`
- : "" + membership.team.slug
+ : `${membership.team.slug}`
: null,
},
metadata: {
diff --git a/packages/trpc/server/routers/viewer/teams/createInvite.handler.ts b/packages/trpc/server/routers/viewer/teams/createInvite.handler.ts
index e7c29847b0e..febefa541b8 100644
--- a/packages/trpc/server/routers/viewer/teams/createInvite.handler.ts
+++ b/packages/trpc/server/routers/viewer/teams/createInvite.handler.ts
@@ -22,7 +22,7 @@ export const createInviteHandler = async ({ ctx, input }: CreateInviteOptions) =
const token = randomBytes(32).toString("hex");
await prisma.verificationToken.create({
data: {
- identifier: "invite-link-for-teamId-" + teamId,
+ identifier: `invite-link-for-teamId-${teamId}`,
token,
expires: new Date(new Date().setHours(168)), // +1 week,
teamId,
diff --git a/packages/trpc/server/routers/viewer/teams/list.handler.ts b/packages/trpc/server/routers/viewer/teams/list.handler.ts
index e5cfa15f27f..4aa8947e190 100644
--- a/packages/trpc/server/routers/viewer/teams/list.handler.ts
+++ b/packages/trpc/server/routers/viewer/teams/list.handler.ts
@@ -41,7 +41,7 @@ export const listHandler = async ({ ctx }: ListOptions) => {
isOrgAdmin,
..._team,
/** To prevent breaking we only return non-email attached token here, if we have one */
- inviteToken: inviteTokens.find((token) => token.identifier === "invite-link-for-teamId-" + _team.id),
+ inviteToken: inviteTokens.find((token) => token.identifier === `invite-link-for-teamId-${_team.id}`),
}));
}
@@ -69,6 +69,6 @@ export const listHandler = async ({ ctx }: ListOptions) => {
accepted: membership.accepted,
..._team,
/** To prevent breaking we only return non-email attached token here, if we have one */
- inviteToken: inviteTokens.find((token) => token.identifier === "invite-link-for-teamId-" + _team.id),
+ inviteToken: inviteTokens.find((token) => token.identifier === `invite-link-for-teamId-${_team.id}`),
}));
};
diff --git a/packages/trpc/server/routers/viewer/webhook/getByViewer.handler.ts b/packages/trpc/server/routers/viewer/webhook/getByViewer.handler.ts
index a865fab1bda..c38c7d446b0 100644
--- a/packages/trpc/server/routers/viewer/webhook/getByViewer.handler.ts
+++ b/packages/trpc/server/routers/viewer/webhook/getByViewer.handler.ts
@@ -119,7 +119,7 @@ export const getByViewerHandler = async ({ ctx }: GetByViewerOptions) => {
slug: membership.team.slug
? !membership.team.parentId
? `/team`
- : "" + membership.team.slug
+ : `${membership.team.slug}`
: null,
image: `${bookerUrl}/team/${membership.team.slug}/avatar.png`,
},
diff --git a/packages/trpc/server/routers/viewer/workflows/util.ts b/packages/trpc/server/routers/viewer/workflows/util.ts
index f312718f238..52e1de8aa4c 100644
--- a/packages/trpc/server/routers/viewer/workflows/util.ts
+++ b/packages/trpc/server/routers/viewer/workflows/util.ts
@@ -108,7 +108,7 @@ export async function removeSmsReminderFieldForBooking({
name: SMS_REMINDER_NUMBER_FIELD,
},
{
- id: "" + workflowId,
+ id: `${workflowId}`,
type: "workflow",
},
eventTypeId
diff --git a/packages/ui/components/apps/AppCard.tsx b/packages/ui/components/apps/AppCard.tsx
index 4acdeb434c8..bd03245ba07 100644
--- a/packages/ui/components/apps/AppCard.tsx
+++ b/packages/ui/components/apps/AppCard.tsx
@@ -55,7 +55,7 @@ export function AppCard({ app, credentials, searchText, userAdminTeams }: AppCar
<div className="flex">
<img
src={app.logo}
- alt={app.name + " Logo"}
+ alt={`${app.name} Logo`}
className={classNames(
app.logo.includes("-dark") && "dark:invert",
"mb-4 h-12 w-12 rounded-sm",
diff --git a/packages/ui/components/apps/Categories.tsx b/packages/ui/components/apps/Categories.tsx
index 5bcf0a1826f..0db16e40704 100644
--- a/packages/ui/components/apps/Categories.tsx
+++ b/packages/ui/components/apps/Categories.tsx
@@ -33,13 +33,13 @@ export function AppStoreCategories({
renderItem={(category) => (
<Link
key={category.name}
- href={"/apps/categories/" + category.name}
+ href={`/apps/categories/${category.name}`}
data-testid={`app-store-category-${category.name}`}
className="relative flex rounded-md"
style={{ background: "radial-gradient(farthest-side at top right, #a2abbe 0%, #E3E3E3 100%)" }}>
<div className="dark:bg-muted light:bg-[url('/noise.svg')] dark:from-subtle dark:to-muted w-full self-center bg-cover bg-center bg-no-repeat px-6 py-4 dark:bg-gradient-to-tr">
<Image
- src={"/app-categories/" + category.name + ".svg"}
+ src={`/app-categories/${category.name}.svg`}
width={100}
height={100}
alt={category.name}
diff --git a/packages/ui/components/editor/plugins/ToolbarPlugin.tsx b/packages/ui/components/editor/plugins/ToolbarPlugin.tsx
index 9ec9bb5c6c2..7ef7a515589 100644
--- a/packages/ui/components/editor/plugins/ToolbarPlugin.tsx
+++ b/packages/ui/components/editor/plugins/ToolbarPlugin.tsx
@@ -420,7 +420,7 @@ export default function ToolbarPlugin(props: TextEditorProps) {
<Dropdown>
<DropdownMenuTrigger className="text-subtle">
<>
- <span className={"icon" + blockType} />
+ <span className={`icon${blockType}`} />
<span className="text text-default hidden sm:flex">
{blockTypeToBlockName[blockType as keyof BlockType]}
</span>
@@ -440,7 +440,7 @@ export default function ToolbarPlugin(props: TextEditorProps) {
blockType === key ? "bg-subtle w-full" : ""
)}>
<>
- <span className={"icon block-type " + key} />
+ <span className={`icon block-type ${key}`} />
<span>{blockTypeToBlockName[key]}</span>
</>
</Button>
diff --git a/packages/ui/components/form/inputs/Input.tsx b/packages/ui/components/form/inputs/Input.tsx
index 4f50cd9eb1a..195ce3f7256 100644
--- a/packages/ui/components/form/inputs/Input.tsx
+++ b/packages/ui/components/form/inputs/Input.tsx
@@ -126,8 +126,8 @@ export const TextAreaField = forwardRef<HTMLTextAreaElement, TextAreaFieldProps>
label = t(props.name as string),
labelProps,
/** Prevents displaying untranslated placeholder keys */
- placeholder = t(props.name + "_placeholder") !== props.name + "_placeholder"
- ? t(props.name + "_placeholder")
+ placeholder = t(`${props.name}_placeholder`) !== `${props.name}_placeholder`
+ ? `${props.name}_placeholder`
: "",
...passThrough
} = props;
diff --git a/packages/ui/components/form/inputs/TextField.tsx b/packages/ui/components/form/inputs/TextField.tsx
index fdf32e4604c..93a4d6d2a01 100644
--- a/packages/ui/components/form/inputs/TextField.tsx
+++ b/packages/ui/components/form/inputs/TextField.tsx
@@ -64,7 +64,7 @@ export const InputField = forwardRef<HTMLInputElement, InputFieldProps>(function
labelClassName,
disabled,
LockedIcon,
- placeholder = isLocaleReady && i18n.exists(name + "_placeholder") ? t(name + "_placeholder") : "",
+ placeholder = isLocaleReady && i18n.exists(`${name}_placeholder`) ? t(`${name}_placeholder`) : "",
className,
addOnLeading,
addOnSuffix,
diff --git a/packages/ui/form/PhoneInput.tsx b/packages/ui/form/PhoneInput.tsx
index 561bf44da9c..3c82f2950d8 100644
--- a/packages/ui/form/PhoneInput.tsx
+++ b/packages/ui/form/PhoneInput.tsx
@@ -40,7 +40,7 @@ function BasePhoneInput({ name, className = "", onChange, ...rest }: PhoneInputP
placeholder: rest.placeholder,
}}
onChange={(value) => {
- onChange("+" + value);
+ onChange(`+${value}`);
}}
containerClass={classNames(
"hover:border-emphasis dark:focus:border-emphasis border-default !bg-default rounded-md border focus-within:outline-none focus-within:ring-2 focus-within:ring-brand-default disabled:cursor-not-allowed",
diff --git a/packages/ui/form/fields.tsx b/packages/ui/form/fields.tsx
index 6c27d773ade..f1c0dedc41a 100644
--- a/packages/ui/form/fields.tsx
+++ b/packages/ui/form/fields.tsx
@@ -56,8 +56,8 @@ const InputField = forwardRef<HTMLInputElement, InputFieldProps>(function InputF
const {
label = t(props.name),
labelProps,
- placeholder = t(props.name + "_placeholder") !== props.name + "_placeholder"
- ? t(props.name + "_placeholder")
+ placeholder = t(`${props.name}_placeholder`) !== `${props.name}_placeholder`
+ ? t(`${props.name}_placeholder`)
: "",
className,
addOnLeading,
@@ -169,8 +169,8 @@ export const TextAreaField = forwardRef<HTMLTextAreaElement, TextAreaFieldProps>
const {
label = t(props.name as string),
labelProps,
- placeholder = t(props.name + "_placeholder") !== props.name + "_placeholder"
- ? t(props.name + "_placeholder")
+ placeholder = t(`${props.name}_placeholder`) !== `${props.name}_placeholder`
+ ? t(`${props.name}_placeholder`)
: "",
...passThrough
} = props;
diff --git a/playwright.config.ts b/playwright.config.ts
index 1111ac1261f..0317a1b6f7a 100644
--- a/playwright.config.ts
+++ b/playwright.config.ts
@@ -178,7 +178,7 @@ expect.extend({
};
}
const pathname = u.pathname;
- const expectedPathname = expectedUrlDetails.pathname + "/embed";
+ const expectedPathname = `${expectedUrlDetails.pathname}/embed`;
if (expectedPathname && expectedPathname !== pathname) {
return {
pass: false,