fix: cascade organization hideBranding setting to user and team events (#21703)
- Add utility function for cascading hideBranding logic - Update all getServerSideProps files to check organization hideBranding as fallback - Ensure team queries include parent hideBranding data - Fix hideBranding not working for organization members and teams Fixes the issue where organization-level branding settings were not being applied to user and team event pages when the direct entity didn't have hideBranding enabled. Co-authored-by: Hariom Balhara <[email protected]>
This commit is contained in:
1 parent
2aaf672b10
commit
2fcb8a750d
10 files changed
+220
-7
No files matched your search
+10
-1
@@ -5,6 +5,7 @@ import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
|
||||
import { getMultipleDurationValue } from "@calcom/features/bookings/lib/get-booking";
|
||||
import { getSlugOrRequestedSlug } from "@calcom/features/ee/organizations/lib/orgDomains";
|
||||
import { orgDomainConfig } from "@calcom/features/ee/organizations/lib/orgDomains";
|
||||
import { shouldHideBrandingForTeamEvent } from "@calcom/lib/hideBranding";
|
||||
import { EventRepository } from "@calcom/lib/server/repository/event";
|
||||
import slugify from "@calcom/lib/slugify";
|
||||
import prisma from "@calcom/prisma";
|
||||
@@ -28,6 +29,11 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
|
||||
select: {
|
||||
id: true,
|
||||
hideBranding: true,
|
||||
parent: {
|
||||
select: {
|
||||
hideBranding: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -75,7 +81,10 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
|
||||
user: teamSlug,
|
||||
teamId: team.id,
|
||||
slug: meetingSlug,
|
||||
isBrandingHidden: team?.hideBranding,
|
||||
isBrandingHidden: shouldHideBrandingForTeamEvent({
|
||||
eventTypeId: eventData.id,
|
||||
team,
|
||||
}),
|
||||
themeBasis: null,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user