chore: hide cal branding for platform bookings (#22979)
Co-authored-by: Anik Dhabal Babu <[email protected]> Co-authored-by: Rajiv Sahal <[email protected]>
This commit is contained in:
4 files changed
+14
-6
No files matched your search
@@ -17,6 +17,7 @@ export const getEventTypesFromDB = async (id: number) => {
|
|||||||
darkBrandColor: true,
|
darkBrandColor: true,
|
||||||
email: true,
|
email: true,
|
||||||
timeZone: true,
|
timeZone: true,
|
||||||
|
isPlatformManaged: true,
|
||||||
};
|
};
|
||||||
const eventType = await prisma.eventType.findUnique({
|
const eventType = await prisma.eventType.findUnique({
|
||||||
where: {
|
where: {
|
||||||
@@ -75,6 +76,7 @@ export const getEventTypesFromDB = async (id: number) => {
|
|||||||
hideBranding: true,
|
hideBranding: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
createdByOAuthClientId: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
workflows: {
|
workflows: {
|
||||||
|
|||||||
@@ -228,16 +228,20 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
|
|||||||
? { ...previousBooking, rescheduledBy: bookingInfo.user?.name }
|
? { ...previousBooking, rescheduledBy: bookingInfo.user?.name }
|
||||||
: previousBooking;
|
: previousBooking;
|
||||||
|
|
||||||
|
const isPlatformBooking = eventType.users[0]?.isPlatformManaged || eventType.team?.createdByOAuthClientId;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
orgSlug: currentOrgDomain,
|
orgSlug: currentOrgDomain,
|
||||||
themeBasis: eventType.team ? eventType.team.slug : eventType.users[0]?.username,
|
themeBasis: eventType.team ? eventType.team.slug : eventType.users[0]?.username,
|
||||||
hideBranding: await shouldHideBrandingForEvent({
|
hideBranding: isPlatformBooking
|
||||||
eventTypeId: eventType.id,
|
? true
|
||||||
team: eventType.team,
|
: await shouldHideBrandingForEvent({
|
||||||
owner: eventType.users[0] ?? null,
|
eventTypeId: eventType.id,
|
||||||
organizationId: session?.user?.profile?.organizationId ?? session?.user?.org?.id ?? null,
|
team: eventType.team,
|
||||||
}),
|
owner: eventType.users[0] ?? null,
|
||||||
|
organizationId: session?.user?.profile?.organizationId ?? session?.user?.org?.id ?? null,
|
||||||
|
}),
|
||||||
profile,
|
profile,
|
||||||
eventType,
|
eventType,
|
||||||
recurringBookings: await getRecurringBookings(bookingInfo.recurringEventId),
|
recurringBookings: await getRecurringBookings(bookingInfo.recurringEventId),
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ const user: User & { credentials: CredentialPayload[] } = {
|
|||||||
timeFormat: 12,
|
timeFormat: 12,
|
||||||
travelSchedules: [],
|
travelSchedules: [],
|
||||||
locked: false,
|
locked: false,
|
||||||
|
isPlatformManaged: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
const customInputs: CustomInputSchema[] = [];
|
const customInputs: CustomInputSchema[] = [];
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export const availabilityUserSelect = {
|
|||||||
endTime: true,
|
endTime: true,
|
||||||
timeFormat: true,
|
timeFormat: true,
|
||||||
defaultScheduleId: true,
|
defaultScheduleId: true,
|
||||||
|
isPlatformManaged: true,
|
||||||
// Relationships
|
// Relationships
|
||||||
schedules: {
|
schedules: {
|
||||||
select: {
|
select: {
|
||||||
|
|||||||
Reference in new issue
Block a user