diff --git a/apps/web/public/icons/sprite.svg b/apps/web/public/icons/sprite.svg index 0ae3cf4bf0..e50f98860f 100644 --- a/apps/web/public/icons/sprite.svg +++ b/apps/web/public/icons/sprite.svg @@ -51,6 +51,10 @@ + + + + diff --git a/packages/features/auth/lib/next-auth-options.ts b/packages/features/auth/lib/next-auth-options.ts index dff904dc27..2e645671ca 100644 --- a/packages/features/auth/lib/next-auth-options.ts +++ b/packages/features/auth/lib/next-auth-options.ts @@ -531,17 +531,19 @@ export const AUTH_OPTIONS: AuthOptions = { belongsToActiveTeam, // All organizations in the token would be too big to store. It breaks the sessions request. // So, we just set the currently switched organization only here. - org: profileOrg - ? { - id: profileOrg.id, - name: profileOrg.name, - slug: profileOrg.slug ?? profileOrg.requestedSlug ?? "", - logoUrl: profileOrg.logoUrl, - fullDomain: getOrgFullOrigin(profileOrg.slug ?? profileOrg.requestedSlug ?? ""), - domainSuffix: subdomainSuffix(), - role: orgRole as MembershipRole, // It can't be undefined if we have a profileOrg - } - : null, + // platform org user don't need profiles nor domains + org: + profileOrg && !profileOrg.isPlatform + ? { + id: profileOrg.id, + name: profileOrg.name, + slug: profileOrg.slug ?? profileOrg.requestedSlug ?? "", + logoUrl: profileOrg.logoUrl, + fullDomain: getOrgFullOrigin(profileOrg.slug ?? profileOrg.requestedSlug ?? ""), + domainSuffix: subdomainSuffix(), + role: orgRole as MembershipRole, // It can't be undefined if we have a profileOrg + } + : null, } as JWT; }; if (!user) { diff --git a/packages/features/eventtypes/lib/getPublicEvent.ts b/packages/features/eventtypes/lib/getPublicEvent.ts index 570bd5e14f..68ae1973dc 100644 --- a/packages/features/eventtypes/lib/getPublicEvent.ts +++ b/packages/features/eventtypes/lib/getPublicEvent.ts @@ -248,7 +248,7 @@ export const getPublicEvent = async ( }; // In case it's not a group event, it's either a single user or a team, and we query that data. - const event = await prisma.eventType.findFirst({ + let event = await prisma.eventType.findFirst({ where: { slug: eventSlug, ...usersOrTeamQuery, @@ -256,6 +256,27 @@ export const getPublicEvent = async ( select: publicEventSelect, }); + // If no event was found, check for platform org user event + if (!event && !orgQuery) { + event = await prisma.eventType.findFirst({ + where: { + slug: eventSlug, + users: { + some: { + username, + isPlatformManaged: false, + movedToProfile: { + organization: { + isPlatform: true, + }, + }, + }, + }, + }, + select: publicEventSelect, + }); + } + if (!event) return null; const eventMetaData = EventTypeMetaDataSchema.parse(event.metadata || {}); diff --git a/packages/features/shell/Shell.tsx b/packages/features/shell/Shell.tsx index 3a9dadb70b..dc575f5384 100644 --- a/packages/features/shell/Shell.tsx +++ b/packages/features/shell/Shell.tsx @@ -384,7 +384,8 @@ function UserDropdown({ small }: UserDropdownProps) { const { data: user } = useMeQuery(); const utils = trpc.useUtils(); const bookerUrl = useBookerUrl(); - + const pathname = usePathname(); + const isPlatformPages = pathname?.startsWith("/settings/platform"); useEffect(() => { // eslint-disable-next-line @typescript-eslint/ban-ts-comment //@ts-ignore @@ -468,7 +469,7 @@ function UserDropdown({ small }: UserDropdownProps) { onHelpItemSelect()} /> ) : ( <> - {!isPlatformUser && ( + {!isPlatformPages && ( <> - {!isPlatformUser && ( + {!isPlatformPages && ( )} + {!isPlatformPages && ( + + + Platform + + + )} @@ -912,9 +924,11 @@ function SideBarContainer({ bannersHeight, isPlatformUser = false }: SideBarCont return ; } -function SideBar({ bannersHeight, user, isPlatformUser = false }: SideBarProps) { +function SideBar({ bannersHeight, user }: SideBarProps) { const { t, isLocaleReady } = useLocale(); const orgBranding = useOrgBranding(); + const pathname = usePathname(); + const isPlatformPages = pathname?.startsWith("/settings/platform"); const publicPageUrl = useMemo(() => { if (!user?.org?.id) return `${process.env.NEXT_PUBLIC_WEBSITE_URL}/${user?.username}`; @@ -953,10 +967,10 @@ function SideBar({ bannersHeight, user, isPlatformUser = false }: SideBarProps) return (