Scheduling infrastructure for absolutely everyone.
init: hide cal branding on user level (#27594)
Rajiv Sahal2c28c9c02836
diff --git a/packages/emails/src/templates/BaseScheduledEmail.tsx b/packages/emails/src/templates/BaseScheduledEmail.tsxindex 306481e4a14..279ce628d15 100644--- a/packages/emails/src/templates/BaseScheduledEmail.tsx+++ b/packages/emails/src/templates/BaseScheduledEmail.tsx@@ -65,7 +65,7 @@ export const BaseScheduledEmail = (return (<BaseEmailHtml- hideLogo={Boolean(props.calEvent.platformClientId)}+ hideLogo={Boolean(props.calEvent.platformClientId || props.calEvent.hideBranding)}headerType={props.headerType || "checkCircle"}subject={props.subject || subject}title={t(diff --git a/packages/features/CalendarEventBuilder.ts b/packages/features/CalendarEventBuilder.tsindex cdf82699264..7c034fc1e19 100644--- a/packages/features/CalendarEventBuilder.ts+++ b/packages/features/CalendarEventBuilder.ts@@ -271,6 +271,8 @@ export class CalendarEventBuilder {builder.withDestinationCalendar([user.destinationCalendar]);}+ builder.withHideBranding(!!eventType.owner?.hideBranding);+return builder;}@@ -549,6 +551,14 @@ export class CalendarEventBuilder {return this;}+ withHideBranding(hideBranding: boolean) {+ this.event = {+ ...this.event,+ hideBranding,+ };+ return this;+ }+build(): CalendarEvent | null {// Validate required fieldsif (diff --git a/packages/features/bookings/lib/handleCancelBooking.ts b/packages/features/bookings/lib/handleCancelBooking.tsindex 8f4bcfbd7af..8e494302c30 100644--- a/packages/features/bookings/lib/handleCancelBooking.ts+++ b/packages/features/bookings/lib/handleCancelBooking.ts@@ -396,6 +396,7 @@ async function handler(input: CancelBookingInput, dependencies?: Dependencies) {platformRescheduleUrl,platformCancelUrl,hideOrganizerEmail: bookingToDelete.eventType?.hideOrganizerEmail,+ hideBranding: !!bookingToDelete.eventType?.owner?.hideBranding,platformBookingUrl,customReplyToEmail: bookingToDelete.eventType?.customReplyToEmail,organizationId: ownerProfile?.organizationId ?? null,diff --git a/packages/features/bookings/lib/service/RegularBookingService.ts b/packages/features/bookings/lib/service/RegularBookingService.tsindex 074412c9a06..d15059e9851 100644--- a/packages/features/bookings/lib/service/RegularBookingService.ts+++ b/packages/features/bookings/lib/service/RegularBookingService.ts@@ -1574,6 +1574,7 @@ async function handler(}let evt: CalendarEvent = builtEvt;+ evt.hideBranding = !!eventType.owner?.hideBranding;if (input.bookingData.thirdPartyRecurringEventId) {const updatedEvt = CalendarEventBuilder.fromEvent(evt)diff --git a/packages/features/bookings/repositories/BookingRepository.ts b/packages/features/bookings/repositories/BookingRepository.tsindex 041a017486a..a1349e28c5c 100644--- a/packages/features/bookings/repositories/BookingRepository.ts+++ b/packages/features/bookings/repositories/BookingRepository.ts@@ -303,6 +303,11 @@ const selectStatementToGetBookingForCalEventBuilder = {destinationCalendar: true,},},+ owner: {+ select: {+ hideBranding: true,+ },+ },hosts: {select: {userId: true,diff --git a/packages/features/ee/managed-event-types/reassignment/services/ManagedEventManualReassignmentService.ts b/packages/features/ee/managed-event-types/reassignment/services/ManagedEventManualReassignmentService.tsindex a3d198e7080..77d431cbd99 100644--- a/packages/features/ee/managed-event-types/reassignment/services/ManagedEventManualReassignmentService.ts+++ b/packages/features/ee/managed-event-types/reassignment/services/ManagedEventManualReassignmentService.ts@@ -503,7 +503,8 @@ export class ManagedEventManualReassignmentService {.withIdentifiers({iCalUID: newBooking.iCalUID || undefined,})- .withUid(newBooking.uid);+ .withUid(newBooking.uid)+ .withHideBranding(!!newUser.hideBranding);if (newUser.destinationCalendar) {builder.withDestinationCalendar([newUser.destinationCalendar]);@@ -716,7 +717,8 @@ export class ManagedEventManualReassignmentService {.withLocation({location: bookingLocation || null,})- .withUid(newBooking.uid);+ .withUid(newBooking.uid)+ .withHideBranding(!!newUser.hideBranding);if (videoCallData) {emailBuilder.withVideoCallData(videoCallData);diff --git a/packages/features/ee/round-robin/roundRobinManualReassignment.ts b/packages/features/ee/round-robin/roundRobinManualReassignment.tsindex 61c2abcafd7..135e4519fb8 100644--- a/packages/features/ee/round-robin/roundRobinManualReassignment.ts+++ b/packages/features/ee/round-robin/roundRobinManualReassignment.ts@@ -354,6 +354,7 @@ export const roundRobinManualReassignment = async ({booking,}),customReplyToEmail: eventType?.customReplyToEmail,+ hideBranding: !!eventType?.owner?.hideBranding,location: bookingLocation,...(platformClientParams ? platformClientParams : {}),conferenceCredentialId: conferenceCredentialId ?? undefined,diff --git a/packages/features/users/repositories/UserRepository.ts b/packages/features/users/repositories/UserRepository.tsindex 252b93c8090..326f460d267 100644--- a/packages/features/users/repositories/UserRepository.ts+++ b/packages/features/users/repositories/UserRepository.ts@@ -1331,6 +1331,7 @@ export class UserRepository {locale: true,timeFormat: true,metadata: true,+ hideBranding: true,credentials: {select: credentialForCalendarServiceSelect,},diff --git a/packages/types/Calendar.d.ts b/packages/types/Calendar.d.tsindex 504928d7270..1533bf57d1e 100644--- a/packages/types/Calendar.d.ts+++ b/packages/types/Calendar.d.ts@@ -207,6 +207,7 @@ export interface CalendarEvent {iCalUID?: string | null;iCalSequence?: number | null;hideOrganizerEmail?: boolean;+ hideBranding?: boolean;disableCancelling?: boolean;disableRescheduling?: boolean;