Compare commits

...

79 Commits

Author SHA1 Message Date
Alan 2dcd2d4d83 Added translations and more validations 2022-04-15 06:00:38 -06:00
Alan 1f22f85ad9 Merge branch 'main' of ssh://github.com/calcom/cal.com into feature/app-wipe-my-cal 2022-04-15 05:44:57 -06:00
Alan 96da9f6635 Fix where selections on cancelling 2022-04-15 03:59:34 -06:00
Bailey Pumfleet 6a7f07ed33
Merge branch 'main' into feature/app-wipe-my-cal 2022-04-15 10:36:15 +01:00
Bailey Pumfleet ce226529fa
Merge branch 'main' into feature/app-wipe-my-cal 2022-04-15 10:34:56 +01:00
Alan c989c94532 remove console logs 2022-04-14 20:44:04 -06:00
Alan fb89cba803 merge with main 2022-04-14 20:41:51 -06:00
Alan e1ea04df5b merge with main 2022-04-14 20:41:05 -06:00
Alan 7ed0ccd013 remove log 2022-04-14 20:36:41 -06:00
Alan 6a9cee125d Fix type string for conditional validation 2022-04-14 20:13:40 -06:00
Alan cc38f29fee Added placeholder image for app category 2022-04-14 20:10:19 -06:00
Alan a0b28716f5 Added conditional display for wipe my cal button 2022-04-14 20:07:58 -06:00
zomars a125fa3376 Merge branch 'main' into feature/app-wipe-my-cal 2022-04-14 20:04:56 -06:00
zomars 15ec20bf78 Fixes circular dependencies 2022-04-14 19:41:10 -06:00
zomars 7e054c1243 Merge branch 'main' into feature/app-wipe-my-cal 2022-04-14 18:57:23 -06:00
Alan 4d679d44fa Wipe my cal init commit 2022-04-14 17:15:38 -06:00
zomars 5b31cc23f0 Merge branch 'main' into feature/app-wipe-my-cal 2022-04-14 16:28:34 -06:00
Alan 4fe25ef05c Merge branch 'feature/reschedule-bookings' of ssh://github.com/calcom/cal.com into feature/app-wipe-my-cal 2022-04-14 15:13:21 -06:00
zomars 2899d4551c Stripe tests fixes 2022-04-14 15:10:42 -06:00
zomars e657aa36b8 E2E fixes 2022-04-14 14:44:14 -06:00
Omar López ce4f5d345f
Merge branch 'main' into feature/reschedule-bookings 2022-04-14 14:20:24 -06:00
Alan 4005bb0939 Merge branch 'feature/reschedule-bookings' of ssh://github.com/calcom/cal.com into feature/app-wipe-my-cal 2022-04-14 14:07:23 -06:00
Alan 6317da8936 Only validating input blocked once 2022-04-14 14:06:51 -06:00
Alan 68e6295304 Merge with main 2022-04-14 13:43:55 -06:00
Omar López ddcfd6afa6
Update packages/core/builders/CalendarEvent/builder.ts 2022-04-14 12:30:21 -06:00
zomars 572aa2c98f Merge branch 'main' into feature/reschedule-bookings 2022-04-14 12:27:52 -06:00
zomars cbd84cbe64 Type fixes 2022-04-14 12:26:25 -06:00
Omar López 4b7e3b3b16
Update packages/core/builders/CalendarEvent/builder.ts 2022-04-14 12:24:20 -06:00
zomars ff7b30e813 Updates rescheduling labels 2022-04-14 12:22:32 -06:00
Omar López d63191ae4c
Update apps/web/pages/success.tsx 2022-04-14 11:55:36 -06:00
Omar López de9ee071db
Update packages/core/builders/CalendarEvent/director.ts 2022-04-14 11:55:27 -06:00
Omar López 0076bb7d78
Update apps/web/components/dialog/RescheduleDialog.tsx 2022-04-14 11:55:12 -06:00
Omar López 0bd4189e4f
Update apps/web/components/booking/BookingListItem.tsx 2022-04-14 11:54:57 -06:00
zomars 4c2595294b Type fixing is my middle name 2022-04-13 16:47:46 -06:00
zomars 1e25877777 Fixes type inference 2022-04-13 16:28:41 -06:00
zomars 598770d293 Use strict compare 2022-04-13 16:15:08 -06:00
zomars 0c7c26aea9 Fixes process.env types 2022-04-13 16:11:44 -06:00
Alan 6e6b6bc38a Merge branch 'main' of ssh://github.com/calcom/cal.com into feature/reschedule-bookings 2022-04-13 11:52:32 -06:00
Alan ca90574d82 Removed logs, notes, fixed types 2022-04-13 05:14:27 -06:00
Alan 788b7e2233 Add translation 2022-04-13 04:50:43 -06:00
Alan 141ed5a4d8 Adding calendar delete and recreate placeholder of cancelled 2022-04-13 04:50:25 -06:00
Alan 0a763bd6f2 Email reschedule title fixes 2022-04-13 04:49:42 -06:00
Alan 2b07cab25a Refactor and cleaning up code 2022-04-13 03:18:24 -06:00
Alan ad2b6fbdce Fix reschedule test 2022-04-13 02:00:28 -06:00
Alan 889f78dff8 remove unused import 2022-04-12 20:46:44 -06:00
Alan 77ae81f825 remove unused file 2022-04-12 20:43:22 -06:00
Alan 3cc53881aa remove preview stripe sub 2022-04-12 20:36:23 -06:00
Alan df298ff1a6 fix types 2022-04-12 20:30:33 -06:00
Alan 0ea968e9bd Update type on createBooking 2022-04-12 20:14:29 -06:00
Alan 9a74a45db9 Update lib no required 2022-04-12 20:08:56 -06:00
Alan 7bb1450140 update on types 2022-04-12 19:54:28 -06:00
Alan 1b4ac4cda0 merge with main 2022-04-12 19:31:15 -06:00
Alan c360e383b7 Test for reschedule 2022-04-12 19:29:35 -06:00
Alan 60c7791dfd Added missing translation and refactor dialog to self component 2022-04-11 13:26:32 -06:00
Alan 2176f9e945 Fix for req.user as array 2022-04-11 11:43:00 -06:00
Alan 020b504a63 Merge branch 'main' of ssh://github.com/calcom/cal.com into feature/reschedule-bookings 2022-04-11 10:34:11 -06:00
Alan 508a2b7844 Merge branch 'main' of ssh://github.com/calcom/cal.com into feature/reschedule-bookings 2022-04-11 09:52:49 -06:00
Alan 569738d90b Working version reschedule 2022-04-11 09:52:17 -06:00
Alan c42359829e Merge with main 2022-04-08 13:10:28 -06:00
Alan 41af612355 update rescheduled emails, booking view and availability page view 2022-04-08 12:52:03 -06:00
Alan aed26340f1 Merge branch 'main' of ssh://github.com/calcom/cal.com into feature/reschedule-bookings 2022-04-06 09:47:23 -06:00
Alan 542b7b9259 Merge branch 'main' of ssh://github.com/calcom/cal.com into feature/reschedule-bookings 2022-04-06 01:42:31 -06:00
Alan b33a80138f [WIP] builder and class for CalendarEvent, email for attende 2022-04-06 01:42:04 -06:00
Alan a0935c101d Merge with main 2022-04-04 20:43:08 -06:00
Alan efda22b5ff Merge branch 'main' of ssh://github.com/calcom/cal.com into feature/reschedule-bookings 2022-04-04 12:20:51 -06:00
Alan 5c45261f5b Merge with remote 2022-04-04 12:20:30 -06:00
Alan 44c69f1ef7 Save wip 2022-04-04 12:19:37 -06:00
Peer Richelsen 20689a898a merged yarn 2022-04-04 13:49:04 +02:00
Alan c32327d26b merge with main 2022-03-31 12:24:11 -07:00
Alan e34473971a WIP 2022-03-31 10:57:06 -07:00
Alan 46563754ff merge with main 2022-03-30 11:53:11 -07:00
Alan 26bab8d0d8 WIP reschedule 2022-03-29 10:51:40 -07:00
Alan 74a42ebaf4 Merge branch 'main' of ssh://github.com/calcom/cal.com into feature/reschedule-bookings 2022-03-25 15:18:43 -07:00
Alan 1191f006a5 Fix lib import and common names 2022-03-25 13:36:02 -07:00
Alan 1367086d0a Merge branch 'main' of ssh://github.com/calcom/cal.com into feature/reschedule-bookings 2022-03-24 17:07:29 -07:00
Alan 47005cf335 Added translations 2022-03-23 17:20:06 -07:00
Alan 1e4e829e9c Ui changes mobile/desktop 2022-03-23 16:50:27 -07:00
Alan 625aadf13f Merge branch 'main' of ssh://github.com/calcom/cal.com into feature/reschedule-bookins 2022-03-23 11:55:25 -07:00
Alan 8b92475097 WIP bookings page ui changes, created api endpoint 2022-03-23 11:55:06 -07:00
5 changed files with 29 additions and 13 deletions

View File

@ -736,5 +736,9 @@
"send_reschedule_request": "Send reschedule request",
"edit_booking": "Edit booking",
"reschedule_booking": "Reschedule booking",
"former_time": "Former time"
"former_time": "Former time",
"wipe_my_calendar": "Wipe My Calendar",
"wipe_my_cal_dialog_will_subtitle": "This will cancel all upcoming meetings from",
"wipe_my_cal_dialog_confirmation_text": "Are you sure? This can't be undone",
"wipe_my_cal_text_button": "Wipe Today"
}

View File

@ -36,6 +36,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
status: {
in: [BookingStatus.ACCEPTED, BookingStatus.PENDING],
},
// @NOTE: important param do not remove
userId: req.session.user.id,
},
select: {
@ -46,12 +47,15 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
});
const q = queue({ results: [] });
if (todayBookings.length > 0) {
todayBookings.forEach((booking) =>
q.push(() => {
return Reschedule(booking.uid, "");
})
);
const userId = req?.session?.user?.id;
if (userId && typeof userId === "number") {
if (todayBookings.length > 0) {
todayBookings.forEach((booking) =>
q.push(() => {
return Reschedule(booking.uid, userId, "");
})
);
}
}
await q.start();
} catch (error: unknown) {

View File

@ -87,14 +87,16 @@ export const ConfirmDialog = (props: IConfirmDialogWipe) => {
<ClockIcon className="m-auto h-6 w-6"></ClockIcon>
</div>
<div className="pt-1">
<DialogHeader title={"Wipe My Calendar"} />
<DialogHeader title={t("wipe_my_calendar")} />
<p className="mt-2 text-sm text-gray-500">
This will cancel all upcoming meetings from: <br />{" "}
{t("wipe_my_call_dialog_will_subtitle")}: <br />{" "}
<strong className="text-black">
{initialDate.format(dateFormat)} - {endDate.format(dateFormat)}
</strong>
</p>
<p className="mt-6 mb-2 text-sm font-bold text-black">Are you sure? This can&apos;t be undone</p>
<p className="mt-6 mb-2 text-sm font-bold text-black">
{t("wipe_my_cal_dialog_confirmation_text")}
</p>
</div>
</div>

View File

@ -1,5 +1,6 @@
import { useState } from "react";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import Button from "@calcom/ui/Button";
import { ConfirmDialog } from "./confirmDialog";
@ -10,7 +11,7 @@ interface IWipeMyCalActionButtonProps {
const WipeMyCalActionButton = (props: IWipeMyCalActionButtonProps) => {
const { trpc } = props;
const { t } = useLocale();
const [openDialog, setOpenDialog] = useState(false);
const { isSuccess, isLoading, data } = trpc.useQuery(["viewer.integrations"]);
@ -22,7 +23,7 @@ const WipeMyCalActionButton = (props: IWipeMyCalActionButtonProps) => {
data?.other?.items.find((item: { type: string }) => item.type === "wipemycal_other") && (
<>
<ConfirmDialog trpc={trpc} isOpenDialog={openDialog} setIsOpenDialog={setOpenDialog} />
<Button onClick={() => setOpenDialog(true)}>Wipe Today</Button>
<Button onClick={() => setOpenDialog(true)}>{t("wipe_my_cal_text_button")}</Button>
</>
)}
</div>

View File

@ -16,7 +16,11 @@ import { deleteMeeting } from "./videoClient";
type PersonAttendeeCommonFields = Pick<User, "id" | "email" | "name" | "locale" | "timeZone" | "username">;
const Reschedule = async (bookingUid: string, cancellationReason: string) => {
const Reschedule = async (
bookingUid: string,
userId: number | null | undefined,
cancellationReason: string
) => {
const bookingToReschedule = await prisma.booking.findFirst({
select: {
id: true,
@ -44,6 +48,7 @@ const Reschedule = async (bookingUid: string, cancellationReason: string) => {
},
rejectOnNotFound: true,
where: {
userId: userId,
uid: bookingUid,
NOT: {
status: {