feat: Allow / disallow SEO indexing on booking pages (#10566)
Co-authored-by: Omar López <[email protected]>
This commit is contained in:
1 parent
e148ee7823
commit
b0d1720d92
11 files changed
+88
-42
No files matched your search
@@ -7,6 +7,7 @@ interface BookerSeoProps {
|
||||
eventSlug: string;
|
||||
rescheduleUid: string | undefined;
|
||||
hideBranding?: boolean;
|
||||
isSEOIndexable?: boolean;
|
||||
isTeamEvent?: boolean;
|
||||
entity: {
|
||||
orgSlug?: string | null;
|
||||
@@ -16,7 +17,7 @@ interface BookerSeoProps {
|
||||
}
|
||||
|
||||
export const BookerSeo = (props: BookerSeoProps) => {
|
||||
const { eventSlug, username, rescheduleUid, hideBranding, isTeamEvent, entity } = props;
|
||||
const { eventSlug, username, rescheduleUid, hideBranding, isTeamEvent, entity, isSEOIndexable } = props;
|
||||
const { t } = useLocale();
|
||||
const { data: event } = trpc.viewer.public.event.useQuery(
|
||||
{ username, eventSlug, isTeamEvent, org: entity.orgSlug ?? null },
|
||||
@@ -41,8 +42,8 @@ export const BookerSeo = (props: BookerSeoProps) => {
|
||||
],
|
||||
}}
|
||||
nextSeoProps={{
|
||||
nofollow: event?.hidden,
|
||||
noindex: event?.hidden,
|
||||
nofollow: event?.hidden || !isSEOIndexable,
|
||||
noindex: event?.hidden || !isSEOIndexable,
|
||||
}}
|
||||
isBrandingHidden={hideBranding}
|
||||
/>
|
||||
|
||||
@@ -220,6 +220,7 @@ export const buildUser = <T extends Partial<UserPayload>>(user?: T): UserPayload
|
||||
verified: false,
|
||||
weekStart: "",
|
||||
organizationId: null,
|
||||
allowSEOIndexing: null,
|
||||
...user,
|
||||
};
|
||||
};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "users" ADD COLUMN "allowSEOIndexing" BOOLEAN DEFAULT true;
|
||||
@@ -168,50 +168,54 @@ enum UserPermissionRole {
|
||||
}
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
username String?
|
||||
name String?
|
||||
id Int @id @default(autoincrement())
|
||||
username String?
|
||||
name String?
|
||||
/// @zod.email()
|
||||
email String
|
||||
emailVerified DateTime?
|
||||
password String?
|
||||
bio String?
|
||||
avatar String?
|
||||
timeZone String @default("Europe/London")
|
||||
weekStart String @default("Sunday")
|
||||
email String
|
||||
emailVerified DateTime?
|
||||
password String?
|
||||
bio String?
|
||||
avatar String?
|
||||
timeZone String @default("Europe/London")
|
||||
weekStart String @default("Sunday")
|
||||
// DEPRECATED - TO BE REMOVED
|
||||
startTime Int @default(0)
|
||||
endTime Int @default(1440)
|
||||
startTime Int @default(0)
|
||||
endTime Int @default(1440)
|
||||
// </DEPRECATED>
|
||||
bufferTime Int @default(0)
|
||||
hideBranding Boolean @default(false)
|
||||
theme String?
|
||||
createdDate DateTime @default(now()) @map(name: "created")
|
||||
trialEndsAt DateTime?
|
||||
eventTypes EventType[] @relation("user_eventtype")
|
||||
credentials Credential[]
|
||||
teams Membership[]
|
||||
bookings Booking[]
|
||||
schedules Schedule[]
|
||||
defaultScheduleId Int?
|
||||
selectedCalendars SelectedCalendar[]
|
||||
completedOnboarding Boolean @default(false)
|
||||
locale String?
|
||||
timeFormat Int? @default(12)
|
||||
twoFactorSecret String?
|
||||
twoFactorEnabled Boolean @default(false)
|
||||
identityProvider IdentityProvider @default(CAL)
|
||||
identityProviderId String?
|
||||
availability Availability[]
|
||||
invitedTo Int?
|
||||
webhooks Webhook[]
|
||||
brandColor String @default("#292929")
|
||||
darkBrandColor String @default("#fafafa")
|
||||
bufferTime Int @default(0)
|
||||
hideBranding Boolean @default(false)
|
||||
theme String?
|
||||
createdDate DateTime @default(now()) @map(name: "created")
|
||||
trialEndsAt DateTime?
|
||||
eventTypes EventType[] @relation("user_eventtype")
|
||||
credentials Credential[]
|
||||
teams Membership[]
|
||||
bookings Booking[]
|
||||
schedules Schedule[]
|
||||
defaultScheduleId Int?
|
||||
selectedCalendars SelectedCalendar[]
|
||||
completedOnboarding Boolean @default(false)
|
||||
locale String?
|
||||
timeFormat Int? @default(12)
|
||||
twoFactorSecret String?
|
||||
twoFactorEnabled Boolean @default(false)
|
||||
identityProvider IdentityProvider @default(CAL)
|
||||
identityProviderId String?
|
||||
availability Availability[]
|
||||
invitedTo Int?
|
||||
webhooks Webhook[]
|
||||
brandColor String @default("#292929")
|
||||
darkBrandColor String @default("#fafafa")
|
||||
// the location where the events will end up
|
||||
destinationCalendar DestinationCalendar?
|
||||
away Boolean @default(false)
|
||||
destinationCalendar DestinationCalendar?
|
||||
away Boolean @default(false)
|
||||
// participate in dynamic group booking or not
|
||||
allowDynamicBooking Boolean? @default(true)
|
||||
allowDynamicBooking Boolean? @default(true)
|
||||
|
||||
// participate in SEO indexing or not
|
||||
allowSEOIndexing Boolean? @default(true)
|
||||
|
||||
/// @zod.custom(imports.userMetadata)
|
||||
metadata Json?
|
||||
verified Boolean? @default(false)
|
||||
|
||||
@@ -57,6 +57,7 @@ export async function getUserFromSession(ctx: TRPCContextInner, session: Maybe<S
|
||||
role: true,
|
||||
organizationId: true,
|
||||
allowDynamicBooking: true,
|
||||
allowSEOIndexing: true,
|
||||
organization: {
|
||||
select: {
|
||||
id: true,
|
||||
|
||||
@@ -42,6 +42,7 @@ export const meHandler = async ({ ctx }: MeOptions) => {
|
||||
metadata: user.metadata,
|
||||
defaultBookerLayouts: user.defaultBookerLayouts,
|
||||
allowDynamicBooking: user.allowDynamicBooking,
|
||||
allowSEOIndexing: user.allowSEOIndexing,
|
||||
organizationId: user.organizationId,
|
||||
organization: user.organization,
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@ export const ZUpdateProfileInputSchema = z.object({
|
||||
weekStart: z.string().optional(),
|
||||
hideBranding: z.boolean().optional(),
|
||||
allowDynamicBooking: z.boolean().optional(),
|
||||
allowSEOIndexing: z.boolean().optional(),
|
||||
brandColor: z.string().optional(),
|
||||
darkBrandColor: z.string().optional(),
|
||||
theme: z.string().optional().nullable(),
|
||||
|
||||
Reference in new issue
Block a user