Skip to content

Commit b4d804d

Browse files
supalarryanikdhabalRyukemeister
authored
chore: hide cal branding for platform bookings (calcom#22979)
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Co-authored-by: Rajiv Sahal <sahalrajiv-extc@atharvacoe.ac.in>
1 parent f501ef3 commit b4d804d

4 files changed

Lines changed: 14 additions & 6 deletions

File tree

apps/web/lib/booking.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const getEventTypesFromDB = async (id: number) => {
1717
darkBrandColor: true,
1818
email: true,
1919
timeZone: true,
20+
isPlatformManaged: true,
2021
};
2122
const eventType = await prisma.eventType.findUnique({
2223
where: {
@@ -75,6 +76,7 @@ export const getEventTypesFromDB = async (id: number) => {
7576
hideBranding: true,
7677
},
7778
},
79+
createdByOAuthClientId: true,
7880
},
7981
},
8082
workflows: {

apps/web/modules/bookings/views/bookings-single-view.getServerSideProps.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,20 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
228228
? { ...previousBooking, rescheduledBy: bookingInfo.user?.name }
229229
: previousBooking;
230230

231+
const isPlatformBooking = eventType.users[0]?.isPlatformManaged || eventType.team?.createdByOAuthClientId;
232+
231233
return {
232234
props: {
233235
orgSlug: currentOrgDomain,
234236
themeBasis: eventType.team ? eventType.team.slug : eventType.users[0]?.username,
235-
hideBranding: await shouldHideBrandingForEvent({
236-
eventTypeId: eventType.id,
237-
team: eventType.team,
238-
owner: eventType.users[0] ?? null,
239-
organizationId: session?.user?.profile?.organizationId ?? session?.user?.org?.id ?? null,
240-
}),
237+
hideBranding: isPlatformBooking
238+
? true
239+
: await shouldHideBrandingForEvent({
240+
eventTypeId: eventType.id,
241+
team: eventType.team,
242+
owner: eventType.users[0] ?? null,
243+
organizationId: session?.user?.profile?.organizationId ?? session?.user?.org?.id ?? null,
244+
}),
241245
profile,
242246
eventType,
243247
recurringBookings: await getRecurringBookings(bookingInfo.recurringEventId),

packages/lib/defaultEvents.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const user: User & { credentials: CredentialPayload[] } = {
5656
timeFormat: 12,
5757
travelSchedules: [],
5858
locked: false,
59+
isPlatformManaged: false,
5960
};
6061

6162
const customInputs: CustomInputSchema[] = [];

packages/prisma/selects/user.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const availabilityUserSelect = {
1010
endTime: true,
1111
timeFormat: true,
1212
defaultScheduleId: true,
13+
isPlatformManaged: true,
1314
// Relationships
1415
schedules: {
1516
select: {

0 commit comments

Comments
 (0)