Scheduling infrastructure for absolutely everyone.
chore: Clean up some code, like console.log, tsx -> ts (#23321)
Alex van Andel0ec1638ca716
diff --git a/apps/web/components/dialog/RerouteDialog.tsx b/apps/web/components/dialog/RerouteDialog.tsxindex 2ee3bf65da8..ea01b978253 100644--- a/apps/web/components/dialog/RerouteDialog.tsx+++ b/apps/web/components/dialog/RerouteDialog.tsx@@ -539,18 +539,11 @@ const NewRoutingManager = ({url: chosenEventUrls.eventBookingAbsoluteUrl,});- console.log("SETTING NEW VALUE", {- type: "reschedule_to_different_event_new_tab",- reschedulerWindow,- newBooking: null,- });reroutingState.setValue({type: "reschedule_to_different_event_new_tab",reschedulerWindow,newBooking: null,});-- console.log("VALUE NOW", JSON.stringify(reroutingState));}function reroutingPreview() {diff --git a/apps/web/components/notification-sound-handler.tsx b/apps/web/components/notification-sound-handler.tsxindex 47304396873..b052dab08cc 100644--- a/apps/web/components/notification-sound-handler.tsx+++ b/apps/web/components/notification-sound-handler.tsx@@ -22,7 +22,6 @@ export function NotificationSoundHandler() {const response = await fetch("/ring.mp3");const arrayBuffer = await response.arrayBuffer();audioBufferRef.current = await audioContextRef.current.decodeAudioData(arrayBuffer);- console.log("Audio file loaded and decoded");}return true;@@ -62,7 +61,6 @@ export function NotificationSoundHandler() {source.loop = true;source.start(0);- console.log("Sound started playing");setTimeout(() => {if (sourceRef.current === source) {@@ -101,7 +99,7 @@ export function NotificationSoundHandler() {useEffect(() => {if (!("serviceWorker" in navigator)) {- console.log("ServiceWorker not available");+ console.warn("ServiceWorker not available");return;}diff --git a/apps/web/lib/apps/[slug]/getStaticProps.tsx b/apps/web/lib/apps/[slug]/getStaticProps.tssimilarity index 100%rename from apps/web/lib/apps/[slug]/getStaticProps.tsxrename to apps/web/lib/apps/[slug]/getStaticProps.tsdiff --git a/apps/web/lib/apps/categories/[category]/getStaticProps.tsx b/apps/web/lib/apps/categories/[category]/getStaticProps.tssimilarity index 100%rename from apps/web/lib/apps/categories/[category]/getStaticProps.tsxrename to apps/web/lib/apps/categories/[category]/getStaticProps.tsdiff --git a/apps/web/lib/apps/categories/getServerSideProps.tsx b/apps/web/lib/apps/categories/getServerSideProps.tssimilarity index 100%rename from apps/web/lib/apps/categories/getServerSideProps.tsxrename to apps/web/lib/apps/categories/getServerSideProps.tsdiff --git a/apps/web/lib/buildLegacyCtx.tsx b/apps/web/lib/buildLegacyCtx.tssimilarity index 100%rename from apps/web/lib/buildLegacyCtx.tsxrename to apps/web/lib/buildLegacyCtx.tsdiff --git a/apps/web/lib/getQuery.tsx b/apps/web/lib/getQuery.tssimilarity index 100%rename from apps/web/lib/getQuery.tsxrename to apps/web/lib/getQuery.tsdiff --git a/apps/web/lib/withEmbedSsr.tsx b/apps/web/lib/withEmbedSsr.tssimilarity index 100%rename from apps/web/lib/withEmbedSsr.tsxrename to apps/web/lib/withEmbedSsr.tsdiff --git a/apps/web/modules/auth/platform/authorize-view.tsx b/apps/web/modules/auth/platform/authorize-view.tsxindex 35128b05151..241647befc3 100644--- a/apps/web/modules/auth/platform/authorize-view.tsx+++ b/apps/web/modules/auth/platform/authorize-view.tsx@@ -6,9 +6,9 @@ import { APP_NAME } from "@calcom/lib/constants";import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams";import { useLocale } from "@calcom/lib/hooks/useLocale";import { PERMISSIONS_GROUPED_MAP } from "@calcom/platform-constants/permissions";-import { Icon } from "@calcom/ui/components/icon";import { Avatar } from "@calcom/ui/components/avatar";import { Button } from "@calcom/ui/components/button";+import { Icon } from "@calcom/ui/components/icon";import { hasPermission } from "../../../../../packages/platform/utils/permissions";@@ -32,8 +32,6 @@ export default function Authorize() {permissions: 7,};- console.log("These are the search params:", queryString);-const permissions = Object.values(PERMISSIONS_GROUPED_MAP).map((value) => {let permissionsMessage = "";const hasReadPermission = hasPermission(client.permissions, value.read);diff --git a/apps/web/modules/signup-view.tsx b/apps/web/modules/signup-view.tsxindex 03a722c270a..b2662f553bf 100644--- a/apps/web/modules/signup-view.tsx+++ b/apps/web/modules/signup-view.tsx@@ -197,6 +197,7 @@ export default function Signup({useEffect(() => {if (redirectUrl) {+ // eslint-disable-next-line @calcom/eslint/avoid-web-storagelocalStorage.setItem("onBoardingRedirect", redirectUrl);}}, [redirectUrl]);@@ -216,7 +217,6 @@ export default function Signup({if (err.checkoutSessionId) {const stripe = await getStripe();if (stripe) {- console.log("Redirecting to stripe checkout");const { error } = await stripe.redirectToCheckout({sessionId: err.checkoutSessionId,});@@ -470,6 +470,7 @@ export default function Signup({showToast("error", t("username_required"));return;}+ // eslint-disable-next-line @calcom/eslint/avoid-web-storagelocalStorage.setItem("username", username);const sp = new URLSearchParams();// @NOTE: don't remove username query param as it's required right now for stripe payment page@@ -539,6 +540,7 @@ export default function Signup({if (prepopulateFormValues?.username) {// If username is present we save it in query params to check for premiumsearchQueryParams.set("username", prepopulateFormValues.username);+ // eslint-disable-next-line @calcom/eslint/avoid-web-storagelocalStorage.setItem("username", prepopulateFormValues.username);}if (token) {diff --git a/packages/features/Segment.tsx b/packages/features/Segment.tsxindex f8260e694ef..f133c0e1279 100644--- a/packages/features/Segment.tsx+++ b/packages/features/Segment.tsx@@ -193,7 +193,7 @@ export function Segment({const { t } = useLocale();if (isPending) return <span>Loading...</span>;if (!attributes) {- console.log("Error fetching attributes");+ console.error("Error fetching attributes");return <span>{t("something_went_wrong")}</span>;}diff --git a/packages/features/ee/api-keys/components/ApiKeyDialogForm.tsx b/packages/features/ee/api-keys/components/ApiKeyDialogForm.tsxindex abd0cbeac70..b709b941714 100644--- a/packages/features/ee/api-keys/components/ApiKeyDialogForm.tsx+++ b/packages/features/ee/api-keys/components/ApiKeyDialogForm.tsx@@ -128,7 +128,6 @@ export default function ApiKeyDialogForm({form={form}handleSubmit={async (event) => {if (defaultValues) {- console.log("Name changed");await updateApiKeyMutation.mutate({ id: defaultValues.id, note: event.note });} else {const apiKey = await utils.client.viewer.apiKeys.create.mutate(event);diff --git a/packages/features/ee/api-keys/components/ApiKeyListItem.tsx b/packages/features/ee/api-keys/components/ApiKeyListItem.tsxindex 3f7d27f329c..b4eae5b4d37 100644--- a/packages/features/ee/api-keys/components/ApiKeyListItem.tsx+++ b/packages/features/ee/api-keys/components/ApiKeyListItem.tsx@@ -39,7 +39,7 @@ const ApiKeyListItem = ({showToast(t("api_key_deleted"), "success");},onError(err) {- console.log(err);+ console.error(err);showToast(t("something_went_wrong"), "error");},});diff --git a/packages/features/ee/organizations/pages/settings/delegationCredential.tsx b/packages/features/ee/organizations/pages/settings/delegationCredential.tsxindex 81989cf8820..c448b2e8100 100644--- a/packages/features/ee/organizations/pages/settings/delegationCredential.tsx+++ b/packages/features/ee/organizations/pages/settings/delegationCredential.tsx@@ -174,7 +174,7 @@ function CreateDelegationDialog({serviceAccountKey: validatedKey.data,});} catch (e) {- console.log("error", e);+ console.error(e);form.setError("serviceAccountKey", { message: t("invalid_service_account_key") });return;}diff --git a/packages/lib/hooks/useDebounce.tsx b/packages/lib/hooks/useDebounce.tssimilarity index 100%rename from packages/lib/hooks/useDebounce.tsxrename to packages/lib/hooks/useDebounce.tsdiff --git a/packages/lib/hooks/useResponsive.tsx b/packages/lib/hooks/useResponsive.tssimilarity index 100%rename from packages/lib/hooks/useResponsive.tsxrename to packages/lib/hooks/useResponsive.tsdiff --git a/packages/lib/hooks/useTheme.tsx b/packages/lib/hooks/useTheme.tssimilarity index 100%rename from packages/lib/hooks/useTheme.tsxrename to packages/lib/hooks/useTheme.tsdiff --git a/packages/lib/hooks/useTraceUpdate.tsx b/packages/lib/hooks/useTraceUpdate.tssimilarity index 85%rename from packages/lib/hooks/useTraceUpdate.tsxrename to packages/lib/hooks/useTraceUpdate.tsindex 7094136da01..a43ead677c2 100644--- a/packages/lib/hooks/useTraceUpdate.tsx+++ b/packages/lib/hooks/useTraceUpdate.ts@@ -13,9 +13,6 @@ export function useTraceUpdate(props: { [s: string]: unknown } | ArrayLike<unkno}return ps;}, {});- if (Object.keys(changedProps).length > 0) {- console.log("Changed props:", changedProps);- }prev.current = props;});}diff --git a/packages/ui/components/form/step/FormStep.tsx b/packages/ui/components/form/step/FormStep.tsxindex 9866880b9e2..b0fec7ba088 100644--- a/packages/ui/components/form/step/FormStep.tsx+++ b/packages/ui/components/form/step/FormStep.tsx@@ -16,7 +16,6 @@ function FormStep({ currentStep, steps }: Props) {</p><div className="flex flex-nowrap space-x-1">{[...Array(steps)].map((_, j) => {- console.log({ j, currentStep });return (<divclassName={classNames(diff --git a/packages/ui/components/scrollable/ScrollableArea.tsx b/packages/ui/components/scrollable/ScrollableArea.tsxindex e58c2e3f841..4fb5b5047ee 100644--- a/packages/ui/components/scrollable/ScrollableArea.tsx+++ b/packages/ui/components/scrollable/ScrollableArea.tsx@@ -14,7 +14,6 @@ const ScrollableArea = ({ children, className }: PropsWithChildren<{ className?:if (scrollableElement) {const isElementOverflowing = scrollableElement.scrollHeight > scrollableElement.clientHeight;- console.log({ isElementOverflowing });setIsOverflowingY(isElementOverflowing);}}, []);