Removed unused variables (#6704) (#6750)

This commit is contained in:
Ben Lam authored and GitHub committed 2023-01-31 22:29:24 +00:00
1 parent 0ffed24359
commit 7a6e7c2f1d
27 files changed
+15 -42

No files matched your search

@@ -29,7 +29,7 @@ export default function CancelBooking(props: Props) {
const [cancellationReason, setCancellationReason] = useState<string>("");
const { t } = useLocale();
const router = useRouter();
const { booking, profile, team, allRemainingBookings } = props;
const { booking, allRemainingBookings } = props;
const [loading, setLoading] = useState(false);
const telemetry = useTelemetry();
const [error, setError] = useState<string | null>(booking ? null : t("booking_already_cancelled"));
@@ -1,4 +1,4 @@
import { EventTypeSetupProps, FormValues } from "pages/event-types/[type]";
import { EventTypeSetupProps } from "pages/event-types/[type]";
import { useState } from "react";
import { TbWebhook } from "react-icons/tb";
@@ -1,5 +1,3 @@
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { CalendarSwitch } from "./CalendarSwitch";
interface IConnectedCalendarItem {
@@ -21,7 +19,7 @@ interface IConnectedCalendarItem {
const ConnectedCalendarItem = (prop: IConnectedCalendarItem) => {
const { name, logo, externalId, calendars, integrationType } = prop;
const { t } = useLocale();
return (
<>
<div className="flex flex-row items-center p-4">
-1
View File
@@ -1,6 +1,5 @@
import MarkdownIt from "markdown-it";
import { GetStaticPaths, GetStaticPropsContext } from "next";
import { JSONObject } from "superjson/dist/types";
import { z } from "zod";
import { privacyFilteredLocations, LocationObject } from "@calcom/app-store/locations";
-1
View File
@@ -1,5 +1,4 @@
import { GetServerSidePropsContext } from "next";
import { JSONObject } from "superjson/dist/types";
import { LocationObject, privacyFilteredLocations } from "@calcom/app-store/locations";
import { parseRecurringEvent } from "@calcom/lib";
+2 -2
View File
@@ -1,5 +1,5 @@
import { IdentityProvider } from "@prisma/client";
import { NextApiRequest, NextApiResponse } from "next";
import { NextApiRequest } from "next";
import z from "zod";
import { isPasswordValid } from "@calcom/lib/auth";
@@ -50,7 +50,7 @@ async function handler(req: NextApiRequest) {
},
});
return { message: "First admin user created successfuly." };
return { message: "First admin user created successfully." };
}
export default defaultHandler({
-1
View File
@@ -1,5 +1,4 @@
import { GetServerSidePropsContext } from "next";
import { JSONObject } from "superjson/dist/types";
import { parseRecurringEvent } from "@calcom/lib";
import prisma from "@calcom/prisma";
@@ -10,8 +10,6 @@ import { z } from "zod";
import { EventLocationType } from "@calcom/core/location";
import { validateBookingLimitOrder } from "@calcom/lib";
import { CAL_URL } from "@calcom/lib/constants";
import convertToNewDurationType from "@calcom/lib/convertToNewDurationType";
import findDurationType from "@calcom/lib/findDurationType";
import getEventTypeById from "@calcom/lib/getEventTypeById";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { useTypedQuery } from "@calcom/lib/hooks/useTypedQuery";
@@ -7,7 +7,6 @@ import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout";
import { classNames } from "@calcom/lib";
import { WEBAPP_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
import { Button, Meta } from "@calcom/ui";
import { FiExternalLink } from "@calcom/ui/components/icon";
@@ -37,7 +36,6 @@ const CtaRow = ({ title, description, className, children }: CtaRowProps) => {
const BillingView = () => {
const { t } = useLocale();
const { data: user } = trpc.viewer.me.useQuery();
const [, loadChat] = useChat();
const [showChat, setShowChat] = useState(false);
const router = useRouter();
@@ -1,5 +1,4 @@
import { GetServerSidePropsContext } from "next";
import { useSession } from "next-auth/react";
import { Controller, useForm } from "react-hook-form";
import { getLayout } from "@calcom/features/settings/layouts/SettingsLayout";
@@ -47,7 +46,6 @@ const SkeletonLoader = ({ title, description }: { title: string; description: st
const AppearanceView = () => {
const { t } = useLocale();
const session = useSession();
const utils = trpc.useContext();
const { data: user, isLoading } = trpc.viewer.me.useQuery();
-1
View File
@@ -1,5 +1,4 @@
import { GetServerSidePropsContext } from "next";
import { JSONObject } from "superjson/dist/types";
import { LocationObject, privacyFilteredLocations } from "@calcom/app-store/locations";
import { parseRecurringEvent } from "@calcom/lib";
@@ -1,7 +1,3 @@
import { expect } from "@playwright/test";
import { WEBAPP_URL } from "@calcom/lib/constants";
import { test } from "../lib/fixtures";
import { todo } from "../lib/testUtils";
+1 -1
View File
@@ -1,4 +1,4 @@
import { expect, test } from "@playwright/test";
import { test } from "@playwright/test";
import { todo } from "./lib/testUtils";
@@ -1,7 +1,6 @@
import type { InstallAppButtonProps } from "@calcom/app-store/types";
import useAddAppMutation from "../../_utils/useAddAppMutation";
import appConfig from "../config.json";
export default function InstallAppButton(props: InstallAppButtonProps) {
const mutation = useAddAppMutation("around_video");
-2
View File
@@ -1,8 +1,6 @@
import type { NextApiRequest, NextApiResponse } from "next";
import { z, ZodError } from "zod";
import prisma from "@calcom/prisma";
import { GiphyManager } from "../lib";
const giphyUrlRegexp = new RegExp("^https://(.*).giphy.com/media/(.*)/giphy.gif(.*)");
@@ -1,4 +1,4 @@
import { useState, useEffect } from "react";
import { useState } from "react";
import type { InstallAppButtonProps } from "@calcom/app-store/types";
import useApp from "@calcom/lib/hooks/useApp";
@@ -1,7 +1,6 @@
import type { InstallAppButtonProps } from "@calcom/app-store/types";
import useAddAppMutation from "../../_utils/useAddAppMutation";
import appConfig from "../config.json";
export default function InstallAppButton(props: InstallAppButtonProps) {
const mutation = useAddAppMutation("riverside_video");
@@ -11,7 +11,6 @@ import getInstalledAppPath from "../../_utils/getInstalledAppPath";
let consumer_key = "";
let consumer_secret = "";
const instance_url = "";
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
const { code } = req.query;
@@ -5,7 +5,6 @@ import { getLocation } from "@calcom/lib/CalEventParser";
import { WEBAPP_URL } from "@calcom/lib/constants";
import { HttpError } from "@calcom/lib/http-error";
import logger from "@calcom/lib/logger";
import prisma from "@calcom/prisma";
import type {
Calendar,
CalendarEvent,
@@ -75,13 +75,13 @@ export default class CloseComCalendarService implements Calendar {
async updateEvent(uid: string, event: CalendarEvent): Promise<any> {
// Unless we want to be able to support modifying an event to add more attendees
// to have them created in Sendgrid, ingoring this use case for now
// to have them created in Sendgrid, ignoring this use case for now
return Promise.resolve();
}
async deleteEvent(uid: string): Promise<void> {
// Unless we want to delete the contact in Sendgrid once the event
// is deleted just ingoring this use case for now
// is deleted just ignoring this use case for now
return Promise.resolve();
}
+2 -1
View File
@@ -12,7 +12,7 @@ import prisma from "@calcom/prisma";
import { Reschedule } from "../lib";
import { initVitalClient, vitalEnv } from "../lib/client";
// @Note: not being used anymore but left as example
/* @Note: not being used anymore but left as example
const getOuraSleepScore = async (user_id: string, bedtime_start: Date) => {
const vitalClient = await initVitalClient();
if (!vitalClient) throw Error("Missing vital client");
@@ -22,6 +22,7 @@ const getOuraSleepScore = async (user_id: string, bedtime_start: Date) => {
}
return +sleep_data.sleep[0].data.score;
};
*/
/**
* This is will generate a user token for a client_user_id`
@@ -1,7 +1,6 @@
import { Booking, BookingReference, BookingStatus, User } from "@prisma/client";
import type { TFunction } from "next-i18next";
import EventManager from "@calcom/core/EventManager";
import { CalendarEventBuilder } from "@calcom/core/builders/CalendarEvent/builder";
import { CalendarEventDirector } from "@calcom/core/builders/CalendarEvent/director";
import { deleteMeeting } from "@calcom/core/videoClient";
@@ -1,7 +1,6 @@
import { Booking, BookingReference, BookingStatus, User } from "@prisma/client";
import type { TFunction } from "next-i18next";
import EventManager from "@calcom/core/EventManager";
import { CalendarEventBuilder } from "@calcom/core/builders/CalendarEvent/builder";
import { CalendarEventDirector } from "@calcom/core/builders/CalendarEvent/director";
import { deleteMeeting } from "@calcom/core/videoClient";
@@ -55,7 +55,7 @@ export class ModalBox extends HTMLElement {
once: true,
}
);
this.shadowRoot!.host.addEventListener("click", (e) => {
this.shadowRoot!.host.addEventListener("click", () => {
this.close();
});
@@ -108,8 +108,6 @@ interface EmbedNonStylesConfig {
};
}
type ReactEmbedStylesSetter = React.Dispatch<React.SetStateAction<EmbedStyles | EmbedNonStylesConfig>>;
const setEmbedStyles = (stylesConfig: UiConfig["styles"]) => {
embedStore.styles = stylesConfig;
for (const [, setEmbedStyle] of Object.entries(embedStore.reactStylesStateSetters)) {
@@ -308,7 +306,6 @@ const messageParent = (data: any) => {
function keepParentInformedAboutDimensionChanges() {
let knownIframeHeight: number | null = null;
let knownIframeWidth: number | null = null;
let numDimensionChanges = 0;
let isFirstTime = true;
let isWindowLoadComplete = false;
runAsap(function informAboutScroll() {
@@ -355,7 +352,6 @@ function keepParentInformedAboutDimensionChanges() {
if (knownIframeHeight !== iframeHeight || knownIframeWidth !== iframeWidth) {
knownIframeHeight = iframeHeight;
knownIframeWidth = iframeWidth;
numDimensionChanges++;
// FIXME: This event shouldn't be subscribable by the user. Only by the SDK.
sdkActionManager?.fire("__dimensionChanged", {
iframeHeight,
+2 -2
View File
@@ -482,7 +482,7 @@ export class Cal {
}
});
this.actionManager.on("__iframeReady", (e) => {
this.actionManager.on("__iframeReady", () => {
this.iframeReady = true;
this.doInIframe({ method: "parentKnowsIframeReady", arg: undefined });
this.iframeDoQueue.forEach(({ method, arg }) => {
@@ -499,7 +499,7 @@ export class Cal {
}
});
this.actionManager.on("linkReady", (e) => {
this.actionManager.on("linkReady", () => {
this.modalBox?.setAttribute("state", "loaded");
this.inlineEl?.setAttribute("loading", "done");
});
@@ -12,7 +12,7 @@ type Props = InputHTMLAttributes<HTMLInputElement> & {
};
const CheckboxField = forwardRef<HTMLInputElement, Props>(
({ label, description, error, informationIconText, disabled, ...rest }, ref) => {
({ label, description, error, disabled, ...rest }, ref) => {
const descriptionAsLabel = !label || rest.descriptionAsLabel;
return (
<div className="block items-center sm:flex">