diff --git a/apps/web/components/booking/BookingListItem.tsx b/apps/web/components/booking/BookingListItem.tsx
index 948ba5313b..b8f77ac56f 100644
--- a/apps/web/components/booking/BookingListItem.tsx
+++ b/apps/web/components/booking/BookingListItem.tsx
@@ -248,7 +248,7 @@ function BookingListItem(booking: BookingItemProps) {
-
@@ -275,11 +275,6 @@ function BookingListItem(booking: BookingItemProps) {
{booking.eventType.team.name}
)}
- {!!booking?.eventType?.price && !booking.paid && (
-
- {t("pending_payment")}
-
- )}
{booking.paid && (
{t("paid")}
@@ -343,7 +338,9 @@ function BookingListItem(booking: BookingItemProps) {
{!!booking?.eventType?.price && !booking.paid && (
- Pending payment
+
+ {t("pending_payment")}
+
)}
{booking.description && (
@@ -531,13 +528,4 @@ const DisplayAttendees = ({
);
};
-const Tag = ({ children, className = "" }: React.PropsWithChildren<{ className?: string }>) => {
- return (
-
- {children}
-
- );
-};
-
export default BookingListItem;
diff --git a/apps/web/pages/auth/setup/index.tsx b/apps/web/pages/auth/setup/index.tsx
index c85d53544f..dfc472042d 100644
--- a/apps/web/pages/auth/setup/index.tsx
+++ b/apps/web/pages/auth/setup/index.tsx
@@ -1,6 +1,9 @@
+import { UserPermissionRole } from "@prisma/client";
+import { GetServerSidePropsContext } from "next";
import { useState } from "react";
import AdminAppsList from "@calcom/features/apps/AdminAppsList";
+import { getSession } from "@calcom/lib/auth";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import prisma from "@calcom/prisma";
import { inferSSRProps } from "@calcom/types/inferSSRProps";
@@ -32,14 +35,33 @@ export default function Setup(props: inferSSRProps) {
return (
<>
-
+ t("current_step_of_total", { currentStep, maxSteps })}
+ />
>
);
}
-export const getServerSideProps = async () => {
+export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const userCount = await prisma.user.count();
+ const { req } = context;
+ const session = await getSession({ req });
+
+ if (session?.user.role && session?.user.role !== UserPermissionRole.ADMIN) {
+ return {
+ redirect: {
+ destination: `/404`,
+ permanent: false,
+ },
+ };
+ }
+
return {
props: {
userCount,
diff --git a/apps/web/pages/event-types/index.tsx b/apps/web/pages/event-types/index.tsx
index d8545e1fc8..b8557c93c8 100644
--- a/apps/web/pages/event-types/index.tsx
+++ b/apps/web/pages/event-types/index.tsx
@@ -258,7 +258,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL
const calLink = `${CAL_URL}/${embedLink}`;
return (
-
+
{!(firstItem && firstItem.id === type.id) && (
+ ) : (
+ <>>
+ )
+ }
+ />
{!isLoading && (
<>
@@ -68,19 +86,6 @@ const MembersView = () => {
)}
>
)}
- {isAdmin && (
-
- setShowMemberInvitationModal(true)}
- data-testid="new-member-button">
- {t("add")}
-
-
- )}
{team?.members.map((member) => {
diff --git a/packages/features/ee/workflows/lib/getOptions.ts b/packages/features/ee/workflows/lib/getOptions.ts
index c3059e74e1..557bbf93ab 100644
--- a/packages/features/ee/workflows/lib/getOptions.ts
+++ b/packages/features/ee/workflows/lib/getOptions.ts
@@ -4,17 +4,18 @@ import { TFunction } from "next-i18next";
import { TIME_UNIT, WORKFLOW_ACTIONS, WORKFLOW_TEMPLATES, WORKFLOW_TRIGGER_EVENTS } from "./constants";
export function getWorkflowActionOptions(t: TFunction, isTeamsPlan?: boolean) {
- return WORKFLOW_ACTIONS.map((action) => {
- const actionString = t(`${action.toLowerCase()}_action`);
+ return WORKFLOW_ACTIONS.filter((action) => action !== WorkflowActions.EMAIL_ADDRESS) //removing EMAIL_ADDRESS for now due to abuse episode
+ .map((action) => {
+ const actionString = t(`${action.toLowerCase()}_action`);
- const isSMSAction = action === WorkflowActions.SMS_ATTENDEE || action === WorkflowActions.SMS_NUMBER;
+ const isSMSAction = action === WorkflowActions.SMS_ATTENDEE || action === WorkflowActions.SMS_NUMBER;
- return {
- label: actionString.charAt(0).toUpperCase() + actionString.slice(1),
- value: action,
- disabled: isSMSAction && !isTeamsPlan,
- };
- });
+ return {
+ label: actionString.charAt(0).toUpperCase() + actionString.slice(1),
+ value: action,
+ disabled: isSMSAction && !isTeamsPlan,
+ };
+ });
}
export function getWorkflowTriggerOptions(t: TFunction) {
diff --git a/packages/lib/hooks/useTypedQuery.ts b/packages/lib/hooks/useTypedQuery.ts
index 595ec37d32..97246781fc 100644
--- a/packages/lib/hooks/useTypedQuery.ts
+++ b/packages/lib/hooks/useTypedQuery.ts
@@ -2,6 +2,10 @@ import { useRouter } from "next/router";
import { useCallback, useMemo } from "react";
import { z } from "zod";
+type OptionalKeys = { [K in keyof T]-?: Record extends Pick ? K : never }[keyof T];
+
+type FilteredKeys = { [K in keyof T as T[K] extends U ? K : never]: T[K] };
+
// Take array as a string and return zod array
export const queryNumberArray = z
.string()
@@ -20,22 +24,19 @@ export const queryStringArray = z
.preprocess((a) => z.string().parse(a).split(","), z.string().array())
.or(z.string().array());
-export function useTypedQuery(schema: T) {
- type InferedSchema = z.infer;
- type SchemaKeys = keyof InferedSchema;
- type OptionalKeys = {
- [K in keyof InferedSchema]: undefined extends InferedSchema[K] ? K : never;
- }[keyof InferedSchema];
-
- type ArrayOnlyKeys = {
- [K in keyof InferedSchema]: InferedSchema[K] extends Array & undefined ? K : never;
- };
+export function useTypedQuery(schema: T) {
+ type Output = z.infer;
+ type FullOutput = Required |