fix: Add organization logo to org dynamic events (#15082)
* fix: Add organization logo to org dynamic events * Slow typescript strikes again --------- Co-authored-by: sean-brydon <[email protected]>
This commit is contained in:
1 parent
7d7e0ae6a7
commit
99d4461dcc
3 files changed
+32
-7
No files matched your search
@@ -24,7 +24,6 @@ export const EventMembers = ({ schedulingType, users, profile, entity }: EventMe
|
||||
const isEmbed = useIsEmbed();
|
||||
const showMembers = !!schedulingType && schedulingType !== SchedulingType.ROUND_ROBIN;
|
||||
const shownUsers = showMembers ? users : [];
|
||||
|
||||
// In some cases we don't show the user's names, but only show the profile name.
|
||||
const showOnlyProfileName =
|
||||
(profile.name && schedulingType === SchedulingType.ROUND_ROBIN) ||
|
||||
@@ -37,7 +36,7 @@ export const EventMembers = ({ schedulingType, users, profile, entity }: EventMe
|
||||
size="sm"
|
||||
className="border-muted"
|
||||
items={[
|
||||
...(isDynamic
|
||||
...(isDynamic && !profile.image
|
||||
? []
|
||||
: [
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ import { getBookerBaseUrlSync } from "@calcom/lib/getBookerUrl/client";
|
||||
import { markdownToSafeHTML } from "@calcom/lib/markdownToSafeHTML";
|
||||
import { UserRepository } from "@calcom/lib/server/repository/user";
|
||||
import type { PrismaClient } from "@calcom/prisma";
|
||||
import type { Team } from "@calcom/prisma/client";
|
||||
import type { BookerLayoutSettings } from "@calcom/prisma/zod-utils";
|
||||
import {
|
||||
BookerLayouts,
|
||||
@@ -165,6 +166,19 @@ export const getPublicEvent = async (
|
||||
const disableBookingTitle = !defaultEvent.isDynamic;
|
||||
const unPublishedOrgUser = users.find((user) => user.profile?.organization?.slug === null);
|
||||
|
||||
let orgDetails: Pick<Team, "logoUrl" | "name"> | undefined;
|
||||
if (org) {
|
||||
orgDetails = await prisma.team.findFirstOrThrow({
|
||||
where: {
|
||||
slug: org,
|
||||
},
|
||||
select: {
|
||||
logoUrl: true,
|
||||
name: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
...defaultEvent,
|
||||
bookingFields: getBookingFieldsWithSystemFields({ ...defaultEvent, disableBookingTitle }),
|
||||
@@ -176,18 +190,20 @@ export const getPublicEvent = async (
|
||||
})),
|
||||
locations: privacyFilteredLocations(locations),
|
||||
profile: {
|
||||
username: users[0].username,
|
||||
name: users[0].name,
|
||||
weekStart: users[0].weekStart,
|
||||
image: getUserAvatarUrl({
|
||||
avatarUrl: users[0].avatarUrl,
|
||||
}),
|
||||
brandColor: users[0].brandColor,
|
||||
darkBrandColor: users[0].darkBrandColor,
|
||||
theme: null,
|
||||
bookerLayouts: bookerLayoutsSchema.parse(
|
||||
firstUsersMetadata?.defaultBookerLayouts || defaultEventBookerLayouts
|
||||
),
|
||||
...(orgDetails
|
||||
? {
|
||||
image: orgDetails?.logoUrl,
|
||||
name: orgDetails?.name,
|
||||
username: org,
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
entity: {
|
||||
considerUnpublished: !fromRedirectOfNonOrgLink && unPublishedOrgUser !== undefined,
|
||||
|
||||
Reference in new issue
Block a user