fix: #16028 Org Settings - SEOIndexing,Disable Org Url (#16075)

Co-authored-by: Amit Sharma <[email protected]>
Co-authored-by: Hariom <[email protected]>
Co-authored-by: Syed Ali Shahbaz <[email protected]>
This commit is contained in:
authored and GitHub committed 2024-11-29 10:21:14 +05:30
1 parent b5c6d7af91
commit f631abfdc4
20 files changed
+454 -23

No files matched your search

@@ -47,6 +47,7 @@ function mockedUserPageComponentProps(props: Partial<React.ComponentProps<typeof
...(props.entity ?? null),
},
eventTypes: [],
isOrgSEOIndexable: false,
} satisfies React.ComponentProps<typeof UserPage>;
}
@@ -22,7 +22,7 @@ import type { getServerSideProps } from "@server/lib/[user]/getServerSideProps";
export type PageProps = InferGetServerSidePropsType<typeof getServerSideProps>;
export function UserPage(props: PageProps) {
const { users, profile, eventTypes, markdownStrippedBio, entity } = props;
const { users, profile, eventTypes, markdownStrippedBio, entity, isOrgSEOIndexable } = props;
const [user] = users; //To be used when we only have a single user, not dynamic group
useTheme(profile.theme);
@@ -59,6 +59,13 @@ export function UserPage(props: PageProps) {
const isEventListEmpty = eventTypes.length === 0;
const isOrg = !!user?.profile?.organization;
const allowSEOIndexing = isOrg
? isOrgSEOIndexable
? profile.allowSEOIndexing
: false
: profile.allowSEOIndexing;
return (
<>
<HeadSeo
@@ -71,8 +78,8 @@ export function UserPage(props: PageProps) {
users: [{ username: `${user.username}`, name: `${user.name}` }],
}}
nextSeoProps={{
noindex: !profile.allowSEOIndexing,
nofollow: !profile.allowSEOIndexing,
noindex: !allowSEOIndexing,
nofollow: !allowSEOIndexing,
}}
/>