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

@@ -180,7 +180,11 @@ const GeneralView = ({ localeProp, user, travelSchedules, revalidatePage }: Gene
const [isAllowDynamicBookingChecked, setIsAllowDynamicBookingChecked] = useState(
!!user.allowDynamicBooking
);
const [isAllowSEOIndexingChecked, setIsAllowSEOIndexingChecked] = useState(!!user.allowSEOIndexing);
const [isAllowSEOIndexingChecked, setIsAllowSEOIndexingChecked] = useState(
user.organizationSettings?.allowSEOIndexing === false
? !!user.organizationSettings?.allowSEOIndexing
: !!user.allowSEOIndexing
);
const [isReceiveMonthlyDigestEmailChecked, setIsReceiveMonthlyDigestEmailChecked] = useState(
!!user.receiveMonthlyDigestEmail
);
@@ -359,10 +363,11 @@ const GeneralView = ({ localeProp, user, travelSchedules, revalidatePage }: Gene
/>
<SettingsToggle
data-testid="my-seo-indexing-switch"
toggleSwitchAtTheEnd={true}
title={t("seo_indexing")}
description={t("allow_seo_indexing")}
disabled={mutation.isPending}
disabled={mutation.isPending || user.organizationSettings?.allowSEOIndexing === false}
checked={isAllowSEOIndexingChecked}
onCheckedChange={(checked) => {
setIsAllowSEOIndexingChecked(checked);
+5
View File
@@ -35,6 +35,7 @@ function TeamPage({
markdownStrippedBio,
isValidOrgDomain,
currentOrgDomain,
isSEOIndexable,
}: PageProps) {
useTheme(team.theme);
const routerQuery = useRouterQuery();
@@ -175,6 +176,10 @@ function TeamPage({
image: profileImageSrc,
},
}}
nextSeoProps={{
nofollow: !isSEOIndexable,
noindex: !isSEOIndexable,
}}
/>
<main className="dark:bg-darkgray-50 bg-subtle mx-auto max-w-3xl rounded-md px-4 pb-12 pt-12">
<div className="mx-auto mb-8 max-w-3xl text-center">
+2
View File
@@ -34,6 +34,7 @@ function Type({
teamMemberEmail,
crmOwnerRecordType,
crmAppSlug,
isSEOIndexable,
}: PageProps) {
const searchParams = useSearchParams();
@@ -47,6 +48,7 @@ function Type({
isTeamEvent
entity={eventData.entity}
bookingData={booking}
isSEOIndexable={isSEOIndexable}
/>
<Booker
username={user}
@@ -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,
}}
/>