Dynamic Links re-integrate with availability logic (#3687)
* -re init dynamic links * typing fix 001 * added missing div closing tag * added necessary DB column pull to satisfy Type errors * further type fixes * WIP * removed console logs * some revert * WIP * another approach * enabled dynamic links availability fetch * Added users to eventTypeObject for consistency * WIP: Moving user and changing map item name * Fix user list call * Removed explicit User type in map * modify default user attributes * adds explicit users to EventTypeObject in teams * Updated availability page * Updates Availability * Futher availability change * Remove explicit user type from slot router * more fixes * more fixes WIP * cleaning up more errors WIP * object assign used for typesafety * added check if dynamic booking is allowed by all users * cleaned up console logs * clean up * Improvement * resolving suggestions by alex * changes requested by Omar * Filter out empty usernames instead of accepting null Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: zomars <[email protected]>
This commit is contained in:
17 files changed
+197
-101
No files matched your search
@@ -1,20 +1,9 @@
|
||||
import type { EventTypeCustomInput } from "@prisma/client";
|
||||
import { PeriodType, Prisma, SchedulingType, UserPlan } from "@prisma/client";
|
||||
|
||||
import { baseUserSelect } from "@calcom/prisma/selects";
|
||||
import { userSelect } from "@calcom/prisma/selects";
|
||||
|
||||
const userSelectData = Prisma.validator<Prisma.UserArgs>()({ select: baseUserSelect });
|
||||
type User = Prisma.UserGetPayload<typeof userSelectData>;
|
||||
|
||||
const availability = [
|
||||
{
|
||||
days: [1, 2, 3, 4, 5],
|
||||
startTime: new Date().getTime(),
|
||||
endTime: new Date().getTime(),
|
||||
date: new Date(),
|
||||
scheduleId: null,
|
||||
},
|
||||
];
|
||||
type User = Prisma.UserGetPayload<typeof userSelect>;
|
||||
|
||||
type UsernameSlugLinkProps = {
|
||||
users: {
|
||||
@@ -33,6 +22,31 @@ type UsernameSlugLinkProps = {
|
||||
slug: string;
|
||||
};
|
||||
|
||||
const user: User = {
|
||||
theme: null,
|
||||
credentials: [],
|
||||
username: "john.doe",
|
||||
timeZone: "",
|
||||
bufferTime: 0,
|
||||
availability: [],
|
||||
id: 0,
|
||||
startTime: 0,
|
||||
endTime: 0,
|
||||
selectedCalendars: [],
|
||||
schedules: [],
|
||||
defaultScheduleId: null,
|
||||
locale: "en",
|
||||
email: "[email protected]",
|
||||
name: "John doe",
|
||||
avatar: "",
|
||||
destinationCalendar: null,
|
||||
plan: UserPlan.PRO,
|
||||
hideBranding: true,
|
||||
brandColor: "#797979",
|
||||
darkBrandColor: "#efefef",
|
||||
allowDynamicBooking: true,
|
||||
};
|
||||
|
||||
const customInputs: EventTypeCustomInput[] = [];
|
||||
|
||||
const commons = {
|
||||
@@ -52,6 +66,8 @@ const commons = {
|
||||
schedule: null,
|
||||
timeZone: null,
|
||||
successRedirectUrl: "",
|
||||
teamId: null,
|
||||
scheduleId: null,
|
||||
availability: [],
|
||||
price: 0,
|
||||
currency: "usd",
|
||||
@@ -70,31 +86,7 @@ const commons = {
|
||||
hidden: false,
|
||||
userId: 0,
|
||||
workflows: [],
|
||||
users: [
|
||||
{
|
||||
id: 0,
|
||||
plan: UserPlan.PRO,
|
||||
email: "[email protected]",
|
||||
name: "John Doe",
|
||||
username: "jdoe",
|
||||
avatar: "",
|
||||
hideBranding: true,
|
||||
timeZone: "",
|
||||
destinationCalendar: null,
|
||||
credentials: [],
|
||||
bufferTime: 0,
|
||||
locale: "en",
|
||||
theme: null,
|
||||
brandColor: "#292929",
|
||||
darkBrandColor: "#fafafa",
|
||||
availability: [],
|
||||
selectedCalendars: [],
|
||||
startTime: 0,
|
||||
endTime: 0,
|
||||
schedules: [],
|
||||
defaultScheduleId: null,
|
||||
} as User,
|
||||
],
|
||||
users: [user],
|
||||
};
|
||||
|
||||
const min15Event = {
|
||||
@@ -103,6 +95,7 @@ const min15Event = {
|
||||
title: "15min",
|
||||
eventName: "Dynamic Collective 15min Event",
|
||||
description: "Dynamic Collective 15min Event",
|
||||
position: 0,
|
||||
...commons,
|
||||
};
|
||||
const min30Event = {
|
||||
@@ -111,6 +104,7 @@ const min30Event = {
|
||||
title: "30min",
|
||||
eventName: "Dynamic Collective 30min Event",
|
||||
description: "Dynamic Collective 30min Event",
|
||||
position: 1,
|
||||
...commons,
|
||||
};
|
||||
const min60Event = {
|
||||
@@ -119,6 +113,7 @@ const min60Event = {
|
||||
title: "60min",
|
||||
eventName: "Dynamic Collective 60min Event",
|
||||
description: "Dynamic Collective 60min Event",
|
||||
position: 2,
|
||||
...commons,
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user