Skip to content

Commit

Permalink
Merge branch 'main' into 2450-weather-app
Browse files Browse the repository at this point in the history
  • Loading branch information
PeerRich authored Oct 10, 2022
2 parents c89130f + 2a0a293 commit 7a57a4e
Show file tree
Hide file tree
Showing 24 changed files with 348 additions and 308 deletions.
2 changes: 1 addition & 1 deletion .env.appStore.example
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ LARK_OPEN_VERIFICATION_TOKEN=""

# - WEB3
# Used for the Web3 plugin
# @see https://github.com/calcom/cal.com/blob/main/packages/app-store/web3/README.md
# @see https://github.com/calcom/cal.com/blob/main/packages/app-store/rainbow/README.md
ALCHEMY_API_KEY=""
INFURA_API_KEY=""
# *********************************************************************************************************
17 changes: 0 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,6 @@ Contributions are what make the open source community such an amazing place to l

- Before jumping into a PR be sure to search [existing PRs](https://github.com/calcom/cal.com/pulls) or [issues](https://github.com/calcom/cal.com/issues) for an open or closed item that relates to your submission.

## Areas of expertise

### Legend

✅ = has knowledge

🥇 = is their main priority

⚠️ = is the only one with knowledge

👀 = has no knowledge but wants to be onboarded

<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://dynamic-svgs.vercel.app/image.svg?dark">
<img alt="Areas of expertise table" src="https://dynamic-svgs.vercel.app/image.svg">
</picture>

## Developing

The development branch is `main`. This is the branch that all pull
Expand Down
8 changes: 6 additions & 2 deletions apps/web/components/booking/AvailableTimes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type AvailableTimesProps = {
eventTypeId: number;
recurringCount: number | undefined;
eventTypeSlug: string;
date: Dayjs;
date?: Dayjs;
seatsPerTimeSlot?: number | null;
slots?: Slot[];
isLoading: boolean;
Expand Down Expand Up @@ -44,8 +44,10 @@ const AvailableTimes: FC<AvailableTimesProps> = ({
setBrand(getComputedStyle(document.documentElement).getPropertyValue("--brand-color").trim());
}, []);

if (!date) return null;

return (
<div className="dark:bg-darkgray-100 mt-8 flex flex-col px-4 text-center sm:mt-0 sm:w-1/3 sm:p-5 md:-mb-5">
<div className="dark:bg-darkgray-100 mt-8 flex h-full w-full flex-col px-4 text-center sm:mt-0 sm:p-5 md:-mb-5 md:min-w-[200px] lg:min-w-[300px]">
<div className="mb-4 text-left text-base">
<span className="text-bookingdarker dark:text-darkgray-800 mb-8 w-1/2 break-words font-semibold text-gray-900">
{nameOfDay(i18n.language, Number(date.format("d")))}
Expand Down Expand Up @@ -150,4 +152,6 @@ const AvailableTimes: FC<AvailableTimesProps> = ({
);
};

AvailableTimes.displayName = "AvailableTimes";

export default AvailableTimes;
355 changes: 130 additions & 225 deletions apps/web/components/booking/pages/AvailabilityPage.tsx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/web/public/static/locales/de/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
"secret": "Passwort",
"leave_blank_to_remove_secret": "Leer lassen, um Passwort zu entfernen",
"webhook_secret_key_description": "Stellen Sie sicher, dass Ihr Server aus Sicherheitsgründen nur die erwarteten Cal.com-Anfragen empfängt",
"secret_meeting": "Geheimes Termin",
"secret_meeting": "Geheimer Termin",
"login_instead": "Stattdessen anmelden",
"already_have_an_account": "Haben Sie bereits ein Konto?",
"create_account": "Konto erstellen",
Expand Down
1 change: 1 addition & 0 deletions apps/web/public/static/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,7 @@
"update_timezone_question": "Update Timezone?",
"update_timezone_description": "It seems like your local timezone has changed to {{formattedCurrentTz}}. It's very important to have the correct timezone to prevent bookings at undesired times. Do you want to update it?",
"dont_update": "Don't update",
"email_address_action": "send email to a specific email address",
"after_event_trigger": "after event ends",
"how_long_after": "How long after event ends?"
}
6 changes: 3 additions & 3 deletions apps/web/public/static/locales/it/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@
"featured_categories": "Categorie in evidenza",
"popular_categories": "Categorie popolari",
"number_apps_one": "{{count}} App",
"number_apps_other": "{{count}} App",
"number_apps_other": "{{count}} app",
"trending_apps": "App di tendenza",
"explore_apps": "App {{category}}",
"installed_apps": "App installate",
Expand Down Expand Up @@ -1081,10 +1081,10 @@
"using_additional_inputs_as_variables": "Come usare i campi di input aggiuntivi come variabili?",
"download_desktop_app": "Scarica app desktop",
"set_ping_link": "Imposta link di Ping",
"rate_limit_exceeded": "Limite di frequenza superato",
"rate_limit_exceeded": "Limite superato",
"when_something_happens": "Quando succede qualcosa",
"action_is_performed": "Viene eseguita un'azione",
"test_action": "Azione di test",
"test_action": "Verifica azione",
"notification_sent": "Notifica inviata",
"no_input": "Nessun input",
"test_workflow_action": "Verifica azione del flusso di lavoro",
Expand Down
8 changes: 4 additions & 4 deletions apps/web/public/static/locales/ja/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@
"billing": "請求",
"manage_your_billing_info": "請求情報の管理とサブスクリプションのキャンセル。",
"availability": "利用可能期間",
"edit_availability": "空き状況を編集",
"edit_availability": "予定を編集",
"configure_availability": "予約が可能な時間を設定する。",
"copy_times_to": "次に時間をコピー",
"change_weekly_schedule": "ウィークリースケジュールを変更する",
Expand Down Expand Up @@ -1128,7 +1128,7 @@
"profile_picture": "プロフィール写真",
"upload": "アップロード",
"web3": "Web3",
"rainbow_token_gated": "このイベントタイプはトークンゲートされています",
"rainbow_token_gated": "このイベントタイプはトークンゲート(トークンを持っている人だけに制限)されています",
"rainbow_connect_wallet_gate": "<1>{{name}}</1>(<3>{{symbol}}</3>)を所有している場合、ウォレットを接続します。",
"rainbow_insufficient_balance": "接続されているウォレットには十分な<1>{{symbol}}</1>が含まれていません。",
"rainbow_sign_message_request": "ウォレットのメッセージリクエストに署名してください。",
Expand Down Expand Up @@ -1181,7 +1181,7 @@
"organizer_name_info": "あなたの名前",
"additional_notes_info": "予約の追加メモ",
"attendee_name_info": "予約者名",
"to": "宛先",
"to": "送信先",
"attendee_required_enter_number": "この場合、予約時に参加者の電話番号の入力が必要になります",
"workflow_turned_on_successfully": "{{workflowName}} ワークフローが正常に {{offOn}} になりました",
"download_responses": "回答をダウンロード",
Expand Down Expand Up @@ -1236,7 +1236,7 @@
"saml_config": "SAML 設定",
"add_webhook_description": "Cal.com で何かが起こったときにリアルタイムでミーティングデータを受信します",
"triggers_when": "次の場合にトリガー",
"test_webhook": "作成前に Ping テストを行ってください",
"test_webhook": "作成前に Ping テストを実行してください",
"enable_webhook": "ウェブフックを有効にする",
"add_webhook": "ウェブフックを追加",
"webhook_edited_successfully": "ウェブフックを保存しました",
Expand Down
4 changes: 1 addition & 3 deletions packages/app-store/rainbow/components/RainbowInstallForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ const RainbowInstallForm: React.FC<RainbowInstallFormProps> = ({

return (
<>
<hr className="my-2 border-neutral-200" />

<div className="block items-center sm:flex">
<div className="mt-4 block items-center sm:flex">
<div className="min-w-48 mb-4 sm:mb-0">
<label htmlFor="blockchainId" className="flex text-sm font-medium text-neutral-700">
{t("Blockchain")}
Expand Down
10 changes: 6 additions & 4 deletions packages/features/ee/payments/components/PaymentPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { WEBSITE_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import useTheme from "@calcom/lib/hooks/useTheme";
import { getIs24hClockFromLocalStorage, isBrowserLocale24h } from "@calcom/lib/timeFormat";
import { localStorage } from "@calcom/lib/webstorage";
import { Icon } from "@calcom/ui/Icon";

import type { PaymentPageProps } from "../pages/payment";
Expand All @@ -21,11 +22,14 @@ const PaymentPage: FC<PaymentPageProps> = (props) => {
const { t } = useLocale();
const [is24h, setIs24h] = useState(isBrowserLocale24h());
const [date, setDate] = useState(dayjs.utc(props.booking.startTime));
const [timezone, setTimezone] = useState<string | null>(null);
useTheme(props.profile.theme);
const isEmbed = useIsEmbed();
useEffect(() => {
let embedIframeWidth = 0;
setDate(date.tz(localStorage.getItem("timeOption.preferredTimeZone") || dayjs.tz.guess()));
const _timezone = localStorage.getItem("timeOption.preferredTimeZone") || dayjs.tz.guess();
setTimezone(_timezone);
setDate(date.tz(_timezone));
setIs24h(!!getIs24hClockFromLocalStorage());
if (isEmbed) {
requestAnimationFrame(function fixStripeIframe() {
Expand Down Expand Up @@ -95,9 +99,7 @@ const PaymentPage: FC<PaymentPageProps> = (props) => {
{date.format("dddd, DD MMMM YYYY")}
<br />
{date.format(is24h ? "H:mm" : "h:mma")} - {props.eventType.length} mins{" "}
<span className="text-gray-500">
({localStorage.getItem("timeOption.preferredTimeZone") || dayjs.tz.guess()})
</span>
<span className="text-gray-500">({timezone})</span>
</div>
{props.booking.location && (
<>
Expand Down
5 changes: 5 additions & 0 deletions packages/features/ee/payments/pages/payment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ import { PaymentData } from "@calcom/app-store/stripepayment/lib/server";
import prisma from "@calcom/prisma";
import type { inferSSRProps } from "@calcom/types/inferSSRProps";

import { ssrInit } from "@server/lib/ssr";

export type PaymentPageProps = inferSSRProps<typeof getServerSideProps>;

const querySchema = z.object({
uid: z.string(),
});

export const getServerSideProps = async (context: GetServerSidePropsContext) => {
const ssr = await ssrInit(context);

const { uid } = querySchema.parse(context.query);
const rawPayment = await prisma.payment.findFirst({
where: {
Expand Down Expand Up @@ -102,6 +106,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
user,
eventType,
booking,
trpcState: ssr.dehydrate(),
payment,
profile,
},
Expand Down
16 changes: 12 additions & 4 deletions packages/features/ee/workflows/api/scheduleEmailReminders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,18 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
for (const reminder of unscheduledReminders) {
if (dayjs(reminder.scheduledDate).isBefore(dateInSeventyTwoHours)) {
try {
const sendTo =
reminder.workflowStep.action === WorkflowActions.EMAIL_HOST
? reminder.booking?.user?.email
: reminder.booking?.attendees[0].email;
let sendTo;

switch (reminder.workflowStep.action) {
case WorkflowActions.EMAIL_HOST:
sendTo = reminder.booking?.user?.email;
break;
case WorkflowActions.EMAIL_ATTENDEE:
sendTo = reminder.booking?.attendees[0].email;
break;
case WorkflowActions.EMAIL_ADDRESS:
sendTo = reminder.workflowStep.sendTo;
}

const name =
reminder.workflowStep.action === WorkflowActions.EMAIL_ATTENDEE
Expand Down
30 changes: 27 additions & 3 deletions packages/features/ee/workflows/components/v2/AddActionDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ import { z } from "zod";

import { useLocale } from "@calcom/lib/hooks/useLocale";
import PhoneInput from "@calcom/ui/form/PhoneInputLazy";
import { Button, Dialog, DialogClose, DialogContent, DialogFooter, Form, Label, Select } from "@calcom/ui/v2";
import {
Button,
Dialog,
DialogClose,
DialogContent,
DialogFooter,
EmailField,
Form,
Label,
Select,
} from "@calcom/ui/v2";

import { WORKFLOW_ACTIONS } from "../../lib/constants";
import { getWorkflowActionOptions } from "../../lib/getOptions";
Expand All @@ -27,13 +37,14 @@ export const AddActionDialog = (props: IAddActionDialog) => {
const { t } = useLocale();
const { isOpenDialog, setIsOpenDialog, addAction } = props;
const [isPhoneNumberNeeded, setIsPhoneNumberNeeded] = useState(false);
const [isEmailAddressNeeded, setIsEmailAddressNeeded] = useState(false);
const actionOptions = getWorkflowActionOptions(t);

const formSchema = z.object({
action: z.enum(WORKFLOW_ACTIONS),
sendTo: z
.string()
.refine((val) => isValidPhoneNumber(val))
.refine((val) => isValidPhoneNumber(val) || val.includes("@"))
.optional(),
});

Expand All @@ -58,6 +69,7 @@ export const AddActionDialog = (props: IAddActionDialog) => {
form.unregister("action");
setIsOpenDialog(false);
setIsPhoneNumberNeeded(false);
setIsEmailAddressNeeded(false);
}}>
<div className="mt-5 space-y-1">
<Label htmlFor="label">{t("action")}:</Label>
Expand All @@ -75,11 +87,17 @@ export const AddActionDialog = (props: IAddActionDialog) => {
form.setValue("action", val.value);
if (val.value === WorkflowActions.SMS_NUMBER) {
setIsPhoneNumberNeeded(true);
setIsEmailAddressNeeded(false);
} else if (val.value === WorkflowActions.EMAIL_ADDRESS) {
setIsEmailAddressNeeded(true);
setIsPhoneNumberNeeded(false);
} else {
setIsEmailAddressNeeded(false);
setIsPhoneNumberNeeded(false);
form.unregister("sendTo");
}
form.unregister("sendTo");
form.clearErrors("action");
form.clearErrors("sendTo");
}
}}
options={actionOptions}
Expand Down Expand Up @@ -109,6 +127,11 @@ export const AddActionDialog = (props: IAddActionDialog) => {
</div>
</div>
)}
{isEmailAddressNeeded && (
<div className="mt-5">
<EmailField required label={t("email_address")} {...form.register("sendTo")} />
</div>
)}
<DialogFooter>
<DialogClose asChild>
<Button
Expand All @@ -118,6 +141,7 @@ export const AddActionDialog = (props: IAddActionDialog) => {
form.unregister("sendTo");
form.unregister("action");
setIsPhoneNumberNeeded(false);
setIsEmailAddressNeeded(false);
}}>
{t("cancel")}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ const WorkflowListItem = (props: ItemProps) => {
case WorkflowActions.SMS_NUMBER:
sendTo.add(step.sendTo || "");
break;
case WorkflowActions.EMAIL_ADDRESS:
sendTo.add(step.sendTo || "");
break;
}
});

Expand Down
Loading

0 comments on commit 7a57a4e

Please sign in to comment.