Merged in chore/remove-unused-env-vars (pull request #2463)

chore: Remove unused env vars and feature toggles

* Remove unused env vars and feature toggles


Approved-by: Joakim Jäderberg
This commit is contained in:
Anton Gunnarsson
2025-06-30 07:48:05 +00:00
parent bdf66af23d
commit f0def99425
38 changed files with 28 additions and 369 deletions

View File

@@ -52,10 +52,6 @@ GOOGLE_STATIC_MAP_SIGNATURE_SECRET=""
GOOGLE_STATIC_MAP_ID="" GOOGLE_STATIC_MAP_ID=""
GOOGLE_DYNAMIC_MAP_ID="" GOOGLE_DYNAMIC_MAP_ID=""
NEXT_PUBLIC_HIDE_FOR_NEXT_RELEASE="false"
ENABLE_BOOKING_WIDGET="false"
ENABLE_BOOKING_WIDGET_HOTELRESERVATION_PATH="false"
ENABLE_SURPRISES="true" ENABLE_SURPRISES="true"
ENABLE_DTMC="true" ENABLE_DTMC="true"
@@ -64,7 +60,6 @@ SHOW_SIGNUP_FLOW="true"
USE_NEW_REWARD_MODEL="true" USE_NEW_REWARD_MODEL="true"
SAS="1"
SAS_POINT_TRANSFER_ENABLED="true" SAS_POINT_TRANSFER_ENABLED="true"
SAS_API_ENDPOINT="" SAS_API_ENDPOINT=""
SAS_AUTH_ENDPOINT="" SAS_AUTH_ENDPOINT=""

View File

@@ -41,14 +41,10 @@ GOOGLE_STATIC_MAP_KEY="test"
GOOGLE_STATIC_MAP_SIGNATURE_SECRET="test" GOOGLE_STATIC_MAP_SIGNATURE_SECRET="test"
GOOGLE_STATIC_MAP_ID="test" GOOGLE_STATIC_MAP_ID="test"
GOOGLE_DYNAMIC_MAP_ID="test" GOOGLE_DYNAMIC_MAP_ID="test"
NEXT_PUBLIC_HIDE_FOR_NEXT_RELEASE="true"
NEXT_PUBLIC_HIDE_FOR_NEXT_RELEASE_LANG="en,sv,da,de,fi,no"
SALESFORCE_PREFERENCE_BASE_URL="test" SALESFORCE_PREFERENCE_BASE_URL="test"
USE_NEW_REWARD_MODEL="true" USE_NEW_REWARD_MODEL="true"
TZ=UTC TZ=UTC
ENABLE_BOOKING_WIDGET="false"
ENABLE_BOOKING_WIDGET_HOTELRESERVATION_PATH="false"
ENABLE_SURPRISES="true" ENABLE_SURPRISES="true"
SHOW_SITE_WIDE_ALERT="false" SHOW_SITE_WIDE_ALERT="false"

View File

@@ -1,12 +1,5 @@
import { env } from "@/env/server"
import CurrentLoadingSpinner from "@/components/Current/LoadingSpinner"
import LoadingSpinner from "@/components/LoadingSpinner" import LoadingSpinner from "@/components/LoadingSpinner"
export default function Loading() { export default function Loading() {
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
return <CurrentLoadingSpinner />
}
return <LoadingSpinner /> return <LoadingSpinner />
} }

View File

@@ -1,8 +1,5 @@
import { notFound } from "next/navigation"
import { Suspense } from "react" import { Suspense } from "react"
import { env } from "@/env/server"
import DestinationCityPage from "@/components/ContentType/DestinationPage/DestinationCityPage" import DestinationCityPage from "@/components/ContentType/DestinationPage/DestinationCityPage"
import DestinationCityPageSkeleton from "@/components/ContentType/DestinationPage/DestinationCityPage/DestinationCityPageSkeleton" import DestinationCityPageSkeleton from "@/components/ContentType/DestinationPage/DestinationCityPage/DestinationCityPageSkeleton"
@@ -14,10 +11,6 @@ export default async function DestinationCityPagePage(
props: PageArgs<{}, { view?: "map"; filterFromUrl?: string }> props: PageArgs<{}, { view?: "map"; filterFromUrl?: string }>
) { ) {
const searchParams = await props.searchParams const searchParams = await props.searchParams
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
return notFound()
}
return ( return (
<Suspense fallback={<DestinationCityPageSkeleton />}> <Suspense fallback={<DestinationCityPageSkeleton />}>
<DestinationCityPage <DestinationCityPage

View File

@@ -1,8 +1,5 @@
import { notFound } from "next/navigation"
import { Suspense } from "react" import { Suspense } from "react"
import { env } from "@/env/server"
import DestinationCountryPage from "@/components/ContentType/DestinationPage/DestinationCountryPage" import DestinationCountryPage from "@/components/ContentType/DestinationPage/DestinationCountryPage"
import DestinationCountryPageSkeleton from "@/components/ContentType/DestinationPage/DestinationCountryPage/DestinationCountryPageSkeleton" import DestinationCountryPageSkeleton from "@/components/ContentType/DestinationPage/DestinationCountryPage/DestinationCountryPageSkeleton"
@@ -14,10 +11,6 @@ export default async function DestinationCountryPagePage(
props: PageArgs<LangParams, { view?: "map"; filterFromUrl?: string }> props: PageArgs<LangParams, { view?: "map"; filterFromUrl?: string }>
) { ) {
const searchParams = await props.searchParams const searchParams = await props.searchParams
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
return notFound()
}
return ( return (
<Suspense fallback={<DestinationCountryPageSkeleton />}> <Suspense fallback={<DestinationCountryPageSkeleton />}>
<DestinationCountryPage <DestinationCountryPage

View File

@@ -1,7 +1,3 @@
import { notFound } from "next/navigation"
import { env } from "@/env/server"
import DestinationOverviewPage from "@/components/ContentType/DestinationPage/DestinationOverviewPage" import DestinationOverviewPage from "@/components/ContentType/DestinationPage/DestinationOverviewPage"
import type { LangParams, PageArgs } from "@/types/params" import type { LangParams, PageArgs } from "@/types/params"
@@ -9,9 +5,5 @@ import type { LangParams, PageArgs } from "@/types/params"
export { generateMetadata } from "@/utils/metadata/generateMetadata" export { generateMetadata } from "@/utils/metadata/generateMetadata"
export default function DestinationOverviewPagePage({}: PageArgs<LangParams>) { export default function DestinationOverviewPagePage({}: PageArgs<LangParams>) {
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
return notFound()
}
return <DestinationOverviewPage /> return <DestinationOverviewPage />
} }

View File

@@ -1,6 +1,5 @@
import { notFound } from "next/navigation" import { notFound } from "next/navigation"
import { env } from "@/env/server"
import { getHotelPage } from "@/lib/trpc/memoizedRequests" import { getHotelPage } from "@/lib/trpc/memoizedRequests"
import HotelMapPage from "@/components/ContentType/HotelMapPage" import HotelMapPage from "@/components/ContentType/HotelMapPage"
@@ -15,10 +14,6 @@ export default async function HotelPagePage(
props: PageArgs<{}, { subpage?: string; view?: "map" }> props: PageArgs<{}, { subpage?: string; view?: "map" }>
) { ) {
const searchParams = await props.searchParams const searchParams = await props.searchParams
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
return notFound()
}
const hotelPageData = await getHotelPage() const hotelPageData = await getHotelPage()
if (!hotelPageData) { if (!hotelPageData) {

View File

@@ -1,7 +1,3 @@
import { notFound } from "next/navigation"
import { env } from "@/env/server"
import StartPage from "@/components/ContentType/StartPage" import StartPage from "@/components/ContentType/StartPage"
import { parseBookingWidgetSearchParams } from "@/utils/url" import { parseBookingWidgetSearchParams } from "@/utils/url"
@@ -13,10 +9,6 @@ export default async function StartPagePage(
props: PageArgs<{}, NextSearchParams> props: PageArgs<{}, NextSearchParams>
) { ) {
const searchParams = await props.searchParams const searchParams = await props.searchParams
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
return notFound()
}
const booking = parseBookingWidgetSearchParams(searchParams) const booking = parseBookingWidgetSearchParams(searchParams)
return <StartPage booking={booking} /> return <StartPage booking={booking} />

View File

@@ -1,13 +1,8 @@
import { env } from "@/env/server" export async function generateMetadata() {
import type { LangParams, PageArgs } from "@/types/params"
export async function generateMetadata(props: PageArgs<LangParams>) {
const params = await props.params;
return { return {
robots: { robots: {
index: env.isLangLive(params.lang), index: true,
follow: env.isLangLive(params.lang), follow: true,
}, },
} }
} }

View File

@@ -1,4 +1,3 @@
import { env } from "@/env/server"
import { getDestinationCityPage } from "@/lib/trpc/memoizedRequests" import { getDestinationCityPage } from "@/lib/trpc/memoizedRequests"
import { BookingWidget } from "@/components/BookingWidget" import { BookingWidget } from "@/components/BookingWidget"
@@ -10,9 +9,6 @@ export default async function BookingWidgetDestinationCityPage(
props: PageArgs<{}, NextSearchParams> props: PageArgs<{}, NextSearchParams>
) { ) {
const searchParams = await props.searchParams const searchParams = await props.searchParams
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
return null
}
const { bookingCode } = searchParams const { bookingCode } = searchParams
const pageData = await getDestinationCityPage() const pageData = await getDestinationCityPage()

View File

@@ -1,4 +1,3 @@
import { env } from "@/env/server"
import { getHotel, getHotelPage } from "@/lib/trpc/memoizedRequests" import { getHotel, getHotelPage } from "@/lib/trpc/memoizedRequests"
import { BookingWidget } from "@/components/BookingWidget" import { BookingWidget } from "@/components/BookingWidget"
@@ -11,9 +10,6 @@ export default async function BookingWidgetHotelPage(
props: PageArgs<{}, NextSearchParams & { subpage?: string }> props: PageArgs<{}, NextSearchParams & { subpage?: string }>
) { ) {
const searchParams = await props.searchParams const searchParams = await props.searchParams
if (env.NEW_SITE_LIVE_STATUS === "NOT_LIVE") {
return null
}
const hotelPageData = await getHotelPage() const hotelPageData = await getHotelPage()
const hotelData = await getHotel({ const hotelData = await getHotel({

View File

@@ -1,5 +1,3 @@
import { env } from "@/env/server"
import { BookingWidget } from "@/components/BookingWidget" import { BookingWidget } from "@/components/BookingWidget"
import { parseBookingWidgetSearchParams } from "@/utils/url" import { parseBookingWidgetSearchParams } from "@/utils/url"
@@ -8,11 +6,7 @@ import type { LangParams, NextSearchParams, PageArgs } from "@/types/params"
export default async function BookingWidgetPage( export default async function BookingWidgetPage(
props: PageArgs<LangParams, NextSearchParams> props: PageArgs<LangParams, NextSearchParams>
) { ) {
const params = await props.params
const searchParams = await props.searchParams const searchParams = await props.searchParams
if (!env.isLangLive(params.lang)) {
return null
}
const booking = parseBookingWidgetSearchParams(searchParams) const booking = parseBookingWidgetSearchParams(searchParams)

View File

@@ -8,7 +8,6 @@ import Script from "next/script"
import { Lang } from "@scandic-hotels/common/constants/language" import { Lang } from "@scandic-hotels/common/constants/language"
import { env } from "@/env/server"
import TrpcProvider from "@/lib/trpc/Provider" import TrpcProvider from "@/lib/trpc/Provider"
import TokenRefresher from "@/components/Auth/TokenRefresher" import TokenRefresher from "@/components/Auth/TokenRefresher"
@@ -32,9 +31,6 @@ export default async function RootLayout(
const { children } = props const { children } = props
if (!env.SAS_ENABLED) {
return null
}
setLang(params.lang) setLang(params.lang)
const messages = await getMessages(params.lang) const messages = await getMessages(params.lang)

View File

@@ -1,7 +1,5 @@
import { notFound } from "next/navigation" import { notFound } from "next/navigation"
import { env } from "@/env/server"
import { getSitemapDataById } from "@/utils/sitemap" import { getSitemapDataById } from "@/utils/sitemap"
import type { NextRequest } from "next/server" import type { NextRequest } from "next/server"
@@ -12,10 +10,6 @@ export async function GET(
_request: NextRequest, _request: NextRequest,
context: { params: Promise<{ sitemapId: string }> } context: { params: Promise<{ sitemapId: string }> }
) { ) {
if (env.NEW_SITE_LIVE_STATUS !== "ALL_LANGUAGES_LIVE") {
return notFound()
}
const params = await context.params const params = await context.params
const sitemapId = params.sitemapId const sitemapId = params.sitemapId

View File

@@ -1,5 +1,3 @@
import { notFound } from "next/navigation"
import { env } from "@/env/server" import { env } from "@/env/server"
import { getLastUpdated, getSitemapIds } from "@/utils/sitemap" import { getLastUpdated, getSitemapIds } from "@/utils/sitemap"
@@ -7,10 +5,6 @@ import { getLastUpdated, getSitemapIds } from "@/utils/sitemap"
export const dynamic = "force-dynamic" export const dynamic = "force-dynamic"
export async function GET() { export async function GET() {
if (env.NEW_SITE_LIVE_STATUS !== "ALL_LANGUAGES_LIVE") {
return notFound()
}
console.log(`[SITEMAP] Fetching sitemap`) console.log(`[SITEMAP] Fetching sitemap`)
const lastUpdated = await getLastUpdated() const lastUpdated = await getLastUpdated()

View File

@@ -10,7 +10,6 @@ import {
SAS_EUROBONUS_TIER_TO_NAME_MAP, SAS_EUROBONUS_TIER_TO_NAME_MAP,
TIER_TO_FRIEND_MAP, TIER_TO_FRIEND_MAP,
} from "@/constants/membershipLevels" } from "@/constants/membershipLevels"
import { env } from "@/env/server"
import { getProfileWithExtendedPartnerData } from "@/lib/trpc/memoizedRequests" import { getProfileWithExtendedPartnerData } from "@/lib/trpc/memoizedRequests"
import SectionContainer from "@/components/Section/Container" import SectionContainer from "@/components/Section/Container"
@@ -36,10 +35,6 @@ export default async function SASLinkedAccount({
subtitle, subtitle,
link, link,
}: Props) { }: Props) {
if (!env.SAS_ENABLED) {
return null
}
const intl = await getIntl() const intl = await getIntl()
return ( return (

View File

@@ -23,7 +23,7 @@ export default async function SASTransferPoints({
subtitle, subtitle,
link, link,
}: Props) { }: Props) {
if (!env.SAS_ENABLED || !env.SAS_POINT_TRANSFER_ENABLED) { if (!env.SAS_POINT_TRANSFER_ENABLED) {
return null return null
} }

View File

@@ -1,8 +1,5 @@
import { getCurrentWebUrl } from "@scandic-hotels/common/utils/url"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import { env } from "@/env/server"
import Link from "@/components/TempDesignSystem/Link" import Link from "@/components/TempDesignSystem/Link"
import Title from "@/components/TempDesignSystem/Text/Title" import Title from "@/components/TempDesignSystem/Text/Title"
import { getIntl } from "@/i18n" import { getIntl } from "@/i18n"
@@ -13,11 +10,8 @@ import styles from "./emptyUpcomingStays.module.css"
export default async function EmptyUpcomingStaysBlock() { export default async function EmptyUpcomingStaysBlock() {
const intl = await getIntl() const intl = await getIntl()
const lang = await getLang() const lang = await getLang()
const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com"
const href = !env.isLangLive(lang) const href = `/${lang}`
? getCurrentWebUrl({ path: "/", lang, baseUrl })
: `/${lang}`
return ( return (
<section className={styles.container}> <section className={styles.container}>

View File

@@ -2,8 +2,6 @@ import { Suspense } from "react"
import { DynamicContentEnum } from "@scandic-hotels/trpc/types/dynamicContent" import { DynamicContentEnum } from "@scandic-hotels/trpc/types/dynamicContent"
import { env } from "@/env/server"
import HowItWorks from "@/components/Blocks/DynamicContent/HowItWorks" import HowItWorks from "@/components/Blocks/DynamicContent/HowItWorks"
import LoyaltyLevels from "@/components/Blocks/DynamicContent/LoyaltyLevels" import LoyaltyLevels from "@/components/Blocks/DynamicContent/LoyaltyLevels"
import Overview from "@/components/Blocks/DynamicContent/Overview" import Overview from "@/components/Blocks/DynamicContent/Overview"
@@ -41,9 +39,7 @@ function DynamicContentBlocks(props: DynamicContentProps) {
case DynamicContentEnum.Blocks.components.earn_and_burn: case DynamicContentEnum.Blocks.components.earn_and_burn:
return <EarnAndBurn {...dynamic_content} /> return <EarnAndBurn {...dynamic_content} />
case DynamicContentEnum.Blocks.components.expiring_points: case DynamicContentEnum.Blocks.components.expiring_points:
return env.NEW_SITE_LIVE_STATUS === "NOT_LIVE" ? null : ( return <ExpiringPoints {...dynamic_content} />
<ExpiringPoints {...dynamic_content} />
)
case DynamicContentEnum.Blocks.components.how_it_works: case DynamicContentEnum.Blocks.components.how_it_works:
return <HowItWorks dynamic_content={dynamic_content} /> return <HowItWorks dynamic_content={dynamic_content} />
case DynamicContentEnum.Blocks.components.jobylon_feed: case DynamicContentEnum.Blocks.components.jobylon_feed:

View File

@@ -4,7 +4,6 @@
import { useCallback, useEffect, useRef, useState } from "react" import { useCallback, useEffect, useRef, useState } from "react"
import { languages } from "@/constants/languages" import { languages } from "@/constants/languages"
import { env } from "@/env/client"
import Link from "@/components/TempDesignSystem/Link" import Link from "@/components/TempDesignSystem/Link"
import useLang from "@/hooks/useLang" import useLang from "@/hooks/useLang"
@@ -84,19 +83,11 @@ export default function Desktop({ urls }: LanguageSwitcherProps) {
className={`${styles.li} ${currentLanguage === key ? styles.active : ""}`} className={`${styles.li} ${currentLanguage === key ? styles.active : ""}`}
> >
{urls[key as Lang]?.isExternal ? ( {urls[key as Lang]?.isExternal ? (
<Link <Link className={styles.link} href={url}>
className={styles.link}
href={url}
rel={env.isLangLive(key as Lang) ? undefined : "nofollow"}
>
{languages[key as Lang]} {languages[key as Lang]}
</Link> </Link>
) : ( ) : (
<a <a className={styles.link} href={url}>
className={styles.link}
href={url}
rel={env.isLangLive(key as Lang) ? undefined : "nofollow"}
>
{languages[key as Lang]} {languages[key as Lang]}
</a> </a>
)} )}

View File

@@ -4,7 +4,6 @@
import { useState } from "react" import { useState } from "react"
import { languages } from "@/constants/languages" import { languages } from "@/constants/languages"
import { env } from "@/env/client"
import useLang from "@/hooks/useLang" import useLang from "@/hooks/useLang"
@@ -47,11 +46,7 @@ export default function Mobile({ urls }: LanguageSwitcherProps) {
if (url) { if (url) {
return ( return (
<li key={key} className={styles.li}> <li key={key} className={styles.li}>
<a <a href={url} className={styles.link}>
href={url}
className={styles.link}
rel={env.isLangLive(key as Lang) ? undefined : "nofollow"}
>
{languages[key as Lang]} {languages[key as Lang]}
</a> </a>
</li> </li>

View File

@@ -1,9 +1,5 @@
import { env } from "@/env/server"
import { getFooter } from "@/lib/trpc/memoizedRequests" import { getFooter } from "@/lib/trpc/memoizedRequests"
import CurrentFooter from "@/components/Current/Footer"
import { getLang } from "@/i18n/serverContext"
import FooterDetails from "./Details" import FooterDetails from "./Details"
import FooterNavigation from "./Navigation" import FooterNavigation from "./Navigation"
@@ -14,11 +10,6 @@ export function preload() {
} }
export default async function Footer() { export default async function Footer() {
const lang = await getLang()
if (!env.isLangLive(lang)) {
return <CurrentFooter />
}
preload() preload()
return ( return (

View File

@@ -5,20 +5,14 @@ import { Dialog, Modal } from "react-aria-components"
import { useIntl } from "react-intl" import { useIntl } from "react-intl"
import { useMediaQuery } from "usehooks-ts" import { useMediaQuery } from "usehooks-ts"
import { import { findMyBooking } from "@scandic-hotels/common/constants/routes/findMyBooking"
findMyBooking,
findMyBookingCurrentWebPath,
} from "@scandic-hotels/common/constants/routes/findMyBooking"
import { getCurrentWebUrl } from "@scandic-hotels/common/utils/url"
import { customerService } from "@/constants/webHrefs" import { customerService } from "@/constants/webHrefs"
import { env } from "@/env/client"
import useDropdownStore from "@/stores/main-menu" import useDropdownStore from "@/stores/main-menu"
import { IconName } from "@/components/Icons/iconName" import { IconName } from "@/components/Icons/iconName"
import LanguageSwitcher from "@/components/LanguageSwitcher" import LanguageSwitcher from "@/components/LanguageSwitcher"
import { useHandleKeyUp } from "@/hooks/useHandleKeyUp" import { useHandleKeyUp } from "@/hooks/useHandleKeyUp"
import { useIsLangLive } from "@/hooks/useIsLangLive"
import useLang from "@/hooks/useLang" import useLang from "@/hooks/useLang"
import HeaderLink from "../../HeaderLink" import HeaderLink from "../../HeaderLink"
@@ -34,7 +28,6 @@ export default function MobileMenu({
topLink, topLink,
isLoggedIn, isLoggedIn,
}: React.PropsWithChildren<MobileMenuProps>) { }: React.PropsWithChildren<MobileMenuProps>) {
const isLangLive = useIsLangLive()
const lang = useLang() const lang = useLang()
const intl = useIntl() const intl = useIntl()
const { const {
@@ -78,14 +71,7 @@ export default function MobileMenu({
defaultMessage: "Open menu", defaultMessage: "Open menu",
}) })
const baseUrl = env.NEXT_PUBLIC_PUBLIC_URL || "https://www.scandichotels.com" const findMyBookingUrl = findMyBooking[lang]
const findMyBookingUrl = !isLangLive
? getCurrentWebUrl({
path: findMyBookingCurrentWebPath[lang],
lang,
baseUrl,
})
: findMyBooking[lang]
return ( return (
<> <>

View File

@@ -1,10 +1,5 @@
import { import { findMyBooking } from "@scandic-hotels/common/constants/routes/findMyBooking"
findMyBooking,
findMyBookingCurrentWebPath,
} from "@scandic-hotels/common/constants/routes/findMyBooking"
import { getCurrentWebUrl } from "@scandic-hotels/common/utils/url"
import { env } from "@/env/server"
import { getHeader } from "@/lib/trpc/memoizedRequests" import { getHeader } from "@/lib/trpc/memoizedRequests"
import { IconName } from "@/components/Icons/iconName" import { IconName } from "@/components/Icons/iconName"
@@ -31,14 +26,7 @@ export default async function TopMenu() {
} }
const lang = await getLang() const lang = await getLang()
const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com" const findMyBookingUrl = findMyBooking[lang]
const findMyBookingUrl = !env.isLangLive(lang)
? getCurrentWebUrl({
path: findMyBookingCurrentWebPath[lang],
lang,
baseUrl,
})
: findMyBooking[lang]
return ( return (
<div className={styles.topMenu}> <div className={styles.topMenu}>

View File

@@ -1,12 +1,7 @@
import { Suspense } from "react" import { Suspense } from "react"
import { env } from "@/env/server"
import { getHeader, getName } from "@/lib/trpc/memoizedRequests" import { getHeader, getName } from "@/lib/trpc/memoizedRequests"
import CurrentHeader from "@/components/Current/Header"
import { getLang } from "@/i18n/serverContext"
import HeaderFallback from "../Current/Header/HeaderFallback"
import MainMenu from "./MainMenu" import MainMenu from "./MainMenu"
import TopMenu, { TopMenuSkeleton } from "./TopMenu" import TopMenu, { TopMenuSkeleton } from "./TopMenu"
@@ -14,16 +9,6 @@ import styles from "./header.module.css"
export default async function Header() { export default async function Header() {
void getName() void getName()
const lang = await getLang()
if (!env.isLangLive(lang)) {
return (
<Suspense fallback={<HeaderFallback />}>
<CurrentHeader />
</Suspense>
)
}
void getHeader() void getHeader()
return ( return (

View File

@@ -3,7 +3,6 @@ import { notFound } from "next/navigation"
import { dt } from "@scandic-hotels/common/dt" import { dt } from "@scandic-hotels/common/dt"
import * as maskValue from "@scandic-hotels/common/utils/maskValue" import * as maskValue from "@scandic-hotels/common/utils/maskValue"
import { getCurrentWebUrl } from "@scandic-hotels/common/utils/url"
import { Typography } from "@scandic-hotels/design-system/Typography" import { Typography } from "@scandic-hotels/design-system/Typography"
import { BreakfastPackageEnum } from "@scandic-hotels/trpc/enums/breakfast" import { BreakfastPackageEnum } from "@scandic-hotels/trpc/enums/breakfast"
import { parseRefId } from "@scandic-hotels/trpc/utils/refId" import { parseRefId } from "@scandic-hotels/trpc/utils/refId"
@@ -169,9 +168,7 @@ export default async function MyStay(props: {
hotel.galleryImages[0]?.imageSizes.large hotel.galleryImages[0]?.imageSizes.large
const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com" const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com"
const promoUrl = !env.isLangLive(lang) const promoUrl = new URL(`${baseUrl}/${lang}/`)
? new URL(getCurrentWebUrl({ path: "/", lang }))
: new URL(`${baseUrl}/${lang}/`)
promoUrl.searchParams.set("hotel", hotel.operaId) promoUrl.searchParams.set("hotel", hotel.operaId)

View File

@@ -7,7 +7,6 @@ import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import { Typography } from "@scandic-hotels/design-system/Typography" import { Typography } from "@scandic-hotels/design-system/Typography"
import { languages } from "@/constants/languages" import { languages } from "@/constants/languages"
import { env } from "@/env/client"
import Link from "@/components/TempDesignSystem/Link" import Link from "@/components/TempDesignSystem/Link"
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
@@ -57,7 +56,6 @@ export default function LanguageSwitcherContent({
<Link <Link
className={styles.link} className={styles.link}
href={replaceUrlPart(pathname, url)} href={replaceUrlPart(pathname, url)}
rel={env.isLangLive(key) ? undefined : "nofollow"}
onClick={() => onLanguageSwitch(key)} onClick={() => onLanguageSwitch(key)}
variant="languageSwitcher" variant="languageSwitcher"
keepSearchParams keepSearchParams

View File

@@ -1,24 +1,12 @@
import { createEnv } from "@t3-oss/env-nextjs" import { createEnv } from "@t3-oss/env-nextjs"
import { z } from "zod" import { z } from "zod"
import { getLiveStatus } from "./getLiveStatus" export const env = createEnv({
import { isLangLive } from "./isLangLive"
import type { Lang } from "@scandic-hotels/common/constants/language"
const _env = createEnv({
client: { client: {
NEXT_PUBLIC_NODE_ENV: z.enum(["development", "test", "production"]), NEXT_PUBLIC_NODE_ENV: z.enum(["development", "test", "production"]),
NEXT_PUBLIC_PORT: z.string().default("3000"), NEXT_PUBLIC_PORT: z.string().default("3000"),
NEXT_PUBLIC_SENTRY_ENVIRONMENT: z.string().default("development"), NEXT_PUBLIC_SENTRY_ENVIRONMENT: z.string().default("development"),
NEXT_PUBLIC_SENTRY_CLIENT_SAMPLERATE: z.coerce.number().default(0.001), NEXT_PUBLIC_SENTRY_CLIENT_SAMPLERATE: z.coerce.number().default(0.001),
NEXT_PUBLIC_NEW_SITE_LIVE_FOR_LANGS: z
.string()
.regex(/^([a-z]{2},)*([a-z]{2}){0,1}$/)
.transform((val) => {
return val.split(",")
})
.default(""),
NEXT_PUBLIC_PUBLIC_URL: z.string().optional(), NEXT_PUBLIC_PUBLIC_URL: z.string().optional(),
}, },
emptyStringAsUndefined: true, emptyStringAsUndefined: true,
@@ -28,15 +16,6 @@ const _env = createEnv({
NEXT_PUBLIC_SENTRY_ENVIRONMENT: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT, NEXT_PUBLIC_SENTRY_ENVIRONMENT: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT,
NEXT_PUBLIC_SENTRY_CLIENT_SAMPLERATE: NEXT_PUBLIC_SENTRY_CLIENT_SAMPLERATE:
process.env.NEXT_PUBLIC_SENTRY_CLIENT_SAMPLERATE, process.env.NEXT_PUBLIC_SENTRY_CLIENT_SAMPLERATE,
NEXT_PUBLIC_NEW_SITE_LIVE_FOR_LANGS:
process.env.NEXT_PUBLIC_NEW_SITE_LIVE_FOR_LANGS,
NEXT_PUBLIC_PUBLIC_URL: process.env.NEXT_PUBLIC_PUBLIC_URL, NEXT_PUBLIC_PUBLIC_URL: process.env.NEXT_PUBLIC_PUBLIC_URL,
}, },
}) })
export const env = {
..._env,
NEW_SITE_LIVE_STATUS: getLiveStatus(_env),
isLangLive: (lang: Lang) =>
isLangLive(lang, _env.NEXT_PUBLIC_NEW_SITE_LIVE_FOR_LANGS),
}

View File

@@ -1,53 +0,0 @@
import { Lang } from "@scandic-hotels/common/constants/language"
export function getLiveStatus(
internalEnv:
| {
NEW_SITE_LIVE_FOR_LANGS: string[]
}
| {
NEXT_PUBLIC_NEW_SITE_LIVE_FOR_LANGS: string[]
}
): "ALL_LANGUAGES_LIVE" | "SOME_LANGUAGES_LIVE" | "NOT_LIVE" {
const configuredLangs = getConfiguredLangs(internalEnv)
if (!configuredLangs) {
return "NOT_LIVE"
}
const allLangs = Object.keys(Lang)
const liveLangs = allLangs.filter((lang) => configuredLangs.includes(lang))
if (liveLangs.length === 0) {
return "NOT_LIVE"
}
if (
liveLangs.length === allLangs.length &&
allLangs.every((lang) => liveLangs.includes(lang))
) {
return "ALL_LANGUAGES_LIVE"
}
return "SOME_LANGUAGES_LIVE"
}
function getConfiguredLangs<T extends {}>(env: T): string[] | undefined {
if (
!(
"NEW_SITE_LIVE_FOR_LANGS" in env ||
"NEXT_PUBLIC_NEW_SITE_LIVE_FOR_LANGS" in env
)
) {
return undefined
}
const configuredLangs =
"NEW_SITE_LIVE_FOR_LANGS" in env
? env.NEW_SITE_LIVE_FOR_LANGS
: env.NEXT_PUBLIC_NEW_SITE_LIVE_FOR_LANGS
if (!Array.isArray(configuredLangs)) {
throw new Error("Misconfigured environment variable, expected array")
}
return configuredLangs
}

View File

@@ -1,18 +0,0 @@
import { describe, expect, it } from "@jest/globals"
import { Lang } from "@scandic-hotels/common/constants/language"
import { isLangLive } from "./isLangLive"
describe("hideForNextRelease", () => {
it("should return true if en is part of live languages", () => {
expect(isLangLive(Lang.en, ["en", "sv"])).toBe(true)
expect(isLangLive(Lang.en, ["en"])).toBe(true)
})
it("should return false if en is not part of live languages", () => {
expect(isLangLive(Lang.en, [])).toBe(false)
expect(isLangLive(Lang.en, ["sv"])).toBe(false)
expect(isLangLive(Lang.en, ["sv,fi"])).toBe(false)
})
})

View File

@@ -1,5 +0,0 @@
import type { Lang } from "@scandic-hotels/common/constants/language"
export function isLangLive(lang: Lang, liveLangs: string[]): boolean {
return liveLangs.includes(lang)
}

View File

@@ -1,14 +1,9 @@
import { createEnv } from "@t3-oss/env-nextjs" import { createEnv } from "@t3-oss/env-nextjs"
import { z } from "zod" import { z } from "zod"
import { getLiveStatus } from "./getLiveStatus"
import { isLangLive } from "./isLangLive"
import type { Lang } from "@scandic-hotels/common/constants/language"
const TWENTYFOUR_HOURS = 24 * 60 * 60 const TWENTYFOUR_HOURS = 24 * 60 * 60
const _env = createEnv({ export const env = createEnv({
/** /**
* Due to t3-env only checking typeof window === "undefined" * Due to t3-env only checking typeof window === "undefined"
* and Netlify running Deno, window is never "undefined" * and Netlify running Deno, window is never "undefined"
@@ -112,13 +107,6 @@ const _env = createEnv({
GOOGLE_STATIC_MAP_SIGNATURE_SECRET: z.string(), GOOGLE_STATIC_MAP_SIGNATURE_SECRET: z.string(),
GOOGLE_DYNAMIC_MAP_ID: z.string(), GOOGLE_DYNAMIC_MAP_ID: z.string(),
GOOGLE_STATIC_MAP_ID: z.string(), GOOGLE_STATIC_MAP_ID: z.string(),
ENABLE_BOOKING_WIDGET: z
.string()
// only allow "true" or "false"
.refine((s) => s === "true" || s === "false")
// transform to boolean
.transform((s) => s === "true")
.default("false"),
ENABLE_SURPRISES: z ENABLE_SURPRISES: z
.string() .string()
// only allow "true" or "false" // only allow "true" or "false"
@@ -155,11 +143,6 @@ const _env = createEnv({
SAS_AUTH_ENDPOINT: z.string().default(""), SAS_AUTH_ENDPOINT: z.string().default(""),
SAS_OCP_APIM: z.string().default(""), SAS_OCP_APIM: z.string().default(""),
SAS_AUTH_CLIENTID: z.string().default(""), SAS_AUTH_CLIENTID: z.string().default(""),
SAS_ENABLED: z
.string()
.refine((s) => s === "1" || s === "0")
.transform((s) => s === "1")
.default("0"),
SAS_POINT_TRANSFER_ENABLED: z SAS_POINT_TRANSFER_ENABLED: z
.string() .string()
// only allow "true" or "false" // only allow "true" or "false"
@@ -192,17 +175,6 @@ const _env = createEnv({
.transform((s) => s === "true") .transform((s) => s === "true")
.default("true"), .default("true"),
WARMUP_TOKEN: z.string().optional(), WARMUP_TOKEN: z.string().optional(),
/**
* Include the languages that should be hidden for the next release
* Should be in the format of "en,da,de,fi,no,sv" or empty
*/
NEW_SITE_LIVE_FOR_LANGS: z
.string()
.regex(/^([a-z]{2},)*([a-z]{2}){0,1}$/)
.transform((val) => {
return val.split(",")
})
.default(""),
DTMC_ENTRA_ID_CLIENT: z.string(), DTMC_ENTRA_ID_CLIENT: z.string(),
DTMC_ENTRA_ID_ISSUER: z.string(), DTMC_ENTRA_ID_ISSUER: z.string(),
/** /**
@@ -284,7 +256,6 @@ const _env = createEnv({
GOOGLE_STATIC_MAP_ID: process.env.GOOGLE_STATIC_MAP_ID, GOOGLE_STATIC_MAP_ID: process.env.GOOGLE_STATIC_MAP_ID,
GOOGLE_DYNAMIC_MAP_ID: process.env.GOOGLE_DYNAMIC_MAP_ID, GOOGLE_DYNAMIC_MAP_ID: process.env.GOOGLE_DYNAMIC_MAP_ID,
USE_NEW_REWARD_MODEL: process.env.USE_NEW_REWARD_MODEL, USE_NEW_REWARD_MODEL: process.env.USE_NEW_REWARD_MODEL,
ENABLE_BOOKING_WIDGET: process.env.ENABLE_BOOKING_WIDGET,
ENABLE_SURPRISES: process.env.ENABLE_SURPRISES, ENABLE_SURPRISES: process.env.ENABLE_SURPRISES,
ENABLE_DTMC: process.env.ENABLE_DTMC, ENABLE_DTMC: process.env.ENABLE_DTMC,
SHOW_SITE_WIDE_ALERT: process.env.SHOW_SITE_WIDE_ALERT, SHOW_SITE_WIDE_ALERT: process.env.SHOW_SITE_WIDE_ALERT,
@@ -295,7 +266,6 @@ const _env = createEnv({
SAS_AUTH_ENDPOINT: process.env.SAS_AUTH_ENDPOINT, SAS_AUTH_ENDPOINT: process.env.SAS_AUTH_ENDPOINT,
SAS_OCP_APIM: process.env.SAS_OCP_APIM, SAS_OCP_APIM: process.env.SAS_OCP_APIM,
SAS_AUTH_CLIENTID: process.env.SAS_AUTH_CLIENTID, SAS_AUTH_CLIENTID: process.env.SAS_AUTH_CLIENTID,
SAS_ENABLED: process.env.SAS,
SAS_POINT_TRANSFER_ENABLED: process.env.SAS_POINT_TRANSFER_ENABLED, SAS_POINT_TRANSFER_ENABLED: process.env.SAS_POINT_TRANSFER_ENABLED,
CACHE_TIME_HOTELS: process.env.CACHE_TIME_HOTELS, CACHE_TIME_HOTELS: process.env.CACHE_TIME_HOTELS,
@@ -307,7 +277,6 @@ const _env = createEnv({
GIT_SHA: process.env.GIT_SHA, GIT_SHA: process.env.GIT_SHA,
ENABLE_WARMUP_HOTEL: process.env.ENABLE_WARMUP_HOTEL, ENABLE_WARMUP_HOTEL: process.env.ENABLE_WARMUP_HOTEL,
WARMUP_TOKEN: process.env.WARMUP_TOKEN, WARMUP_TOKEN: process.env.WARMUP_TOKEN,
NEW_SITE_LIVE_FOR_LANGS: process.env.NEXT_PUBLIC_NEW_SITE_LIVE_FOR_LANGS,
DTMC_ENTRA_ID_CLIENT: process.env.DTMC_ENTRA_ID_CLIENT, DTMC_ENTRA_ID_CLIENT: process.env.DTMC_ENTRA_ID_CLIENT,
DTMC_ENTRA_ID_ISSUER: process.env.DTMC_ENTRA_ID_ISSUER, DTMC_ENTRA_ID_ISSUER: process.env.DTMC_ENTRA_ID_ISSUER,
@@ -316,12 +285,6 @@ const _env = createEnv({
}, },
}) })
export const env = {
..._env,
NEW_SITE_LIVE_STATUS: getLiveStatus(_env),
isLangLive: (lang: Lang) => isLangLive(lang, _env.NEW_SITE_LIVE_FOR_LANGS),
} as const
function replaceTopLevelDomain(url: string, domain: string) { function replaceTopLevelDomain(url: string, domain: string) {
return url.replaceAll("{topleveldomain}", domain) return url.replaceAll("{topleveldomain}", domain)
} }

View File

@@ -1,10 +0,0 @@
"use client"
import { env } from "@/env/client"
import useLang from "./useLang"
export function useIsLangLive(): boolean {
const lang = useLang()
return env.isLangLive(lang)
}

View File

@@ -9,8 +9,6 @@ import useStickyPositionStore, {
import { debounce } from "@/utils/debounce" import { debounce } from "@/utils/debounce"
import { useIsLangLive } from "./useIsLangLive"
interface UseStickyPositionProps { interface UseStickyPositionProps {
ref?: React.RefObject<HTMLElement | null> ref?: React.RefObject<HTMLElement | null>
name?: StickyElementNameEnum name?: StickyElementNameEnum
@@ -47,7 +45,6 @@ export default function useStickyPosition({
getAllElements, getAllElements,
} = useStickyPositionStore() } = useStickyPositionStore()
const isLangLive = useIsLangLive()
/* Used for Current mobile header since that doesn't use this hook. /* Used for Current mobile header since that doesn't use this hook.
* *
* Instead, calculate if the mobile header is shown and add the height of * Instead, calculate if the mobile header is shown and add the height of
@@ -125,12 +122,10 @@ export default function useStickyPosition({
updateHeights() updateHeights()
// Only do this special handling if we have the current header // Only do this special handling if we have the current header
if (!isLangLive) { if (document.body.clientWidth > 950) {
if (document.body.clientWidth > 950) { setBaseTopOffset(0)
setBaseTopOffset(0) } else {
} else { setBaseTopOffset(52.41) // The height of current mobile header
setBaseTopOffset(52.41) // The height of current mobile header
}
} }
}, 100) }, 100)
@@ -144,7 +139,7 @@ export default function useStickyPosition({
resizeObserver.unobserve(document.body) resizeObserver.unobserve(document.body)
} }
} }
}, [updateHeights, isLangLive]) }, [updateHeights])
return { return {
currentHeight: ref?.current?.offsetHeight || null, currentHeight: ref?.current?.offsetHeight || null,

View File

@@ -7,7 +7,6 @@ import { getDescription } from "./description"
import { getImage } from "./image" import { getImage } from "./image"
import { getTitle } from "./title" import { getTitle } from "./title"
import type { Lang } from "@scandic-hotels/common/constants/language"
import type { Metadata } from "next" import type { Metadata } from "next"
import type { AlternateURLs } from "next/dist/lib/metadata/types/alternative-urls-types" import type { AlternateURLs } from "next/dist/lib/metadata/types/alternative-urls-types"
@@ -20,12 +19,10 @@ import type {
export async function generateMetadata({ export async function generateMetadata({
searchParams, searchParams,
params,
}: PageArgs< }: PageArgs<
LangParams & ContentTypeParams & UIDParams, LangParams & ContentTypeParams & UIDParams,
{ subpage?: string; filterFromUrl?: string } { subpage?: string; filterFromUrl?: string }
>) { >) {
const { lang } = await params
const { subpage, filterFromUrl, ...otherSearchParams } = await searchParams const { subpage, filterFromUrl, ...otherSearchParams } = await searchParams
// If there are other (real) search params, we don't want to index the page as this will // If there are other (real) search params, we don't want to index the page as this will
// cause duplicate content issues. // cause duplicate content issues.
@@ -41,8 +38,8 @@ export async function generateMetadata({
if (!rawMetadata) { if (!rawMetadata) {
return { return {
robots: { robots: {
index: env.isLangLive(lang), index: true,
follow: env.isLangLive(lang), follow: true,
}, },
} }
} }
@@ -57,15 +54,14 @@ export async function generateMetadata({
...metadata, ...metadata,
robots: { robots: {
...(metadata.robots ?? {}), ...(metadata.robots ?? {}),
index: isIndexable(metadata.robots?.index, lang, alternates), index: isIndexable(metadata.robots?.index, alternates),
follow: isIndexable(metadata.robots?.follow, lang, alternates), follow: isIndexable(metadata.robots?.follow, alternates),
}, },
} }
} }
function isIndexable( function isIndexable(
pageIndexableFromSettings: boolean | null | undefined, pageIndexableFromSettings: boolean | null | undefined,
lang: Lang,
alternates: AlternateURLs | null alternates: AlternateURLs | null
) { ) {
// This is a special case for whitelisting the scandic friends pages, this can be removed when all pages are live // This is a special case for whitelisting the scandic friends pages, this can be removed when all pages are live
@@ -76,7 +72,7 @@ function isIndexable(
} }
// If we are live we want to index the page, but if the page has been marked as noindex in contentstack we don't // If we are live we want to index the page, but if the page has been marked as noindex in contentstack we don't
return (pageIndexableFromSettings ?? true) && env.isLangLive(lang) return pageIndexableFromSettings ?? true
} }
function getUrl(alternates: AlternateURLs | null): string | null { function getUrl(alternates: AlternateURLs | null): string | null {

View File

@@ -25,11 +25,6 @@ const _env = createEnv({
SAS_AUTH_ENDPOINT: z.string().default(""), SAS_AUTH_ENDPOINT: z.string().default(""),
SAS_OCP_APIM: z.string().default(""), SAS_OCP_APIM: z.string().default(""),
SAS_AUTH_CLIENTID: z.string().default(""), SAS_AUTH_CLIENTID: z.string().default(""),
SAS_ENABLED: z
.string()
.refine((s) => s === "1" || s === "0")
.transform((s) => s === "1")
.default("0"),
CACHE_TIME_HOTELS: z.coerce CACHE_TIME_HOTELS: z.coerce
.number() .number()
.default(TWENTYFOUR_HOURS) .default(TWENTYFOUR_HOURS)
@@ -74,7 +69,6 @@ const _env = createEnv({
SAS_AUTH_ENDPOINT: process.env.SAS_AUTH_ENDPOINT, SAS_AUTH_ENDPOINT: process.env.SAS_AUTH_ENDPOINT,
SAS_OCP_APIM: process.env.SAS_OCP_APIM, SAS_OCP_APIM: process.env.SAS_OCP_APIM,
SAS_AUTH_CLIENTID: process.env.SAS_AUTH_CLIENTID, SAS_AUTH_CLIENTID: process.env.SAS_AUTH_CLIENTID,
SAS_ENABLED: process.env.SAS,
CACHE_TIME_HOTELS: process.env.CACHE_TIME_HOTELS, CACHE_TIME_HOTELS: process.env.CACHE_TIME_HOTELS,
CACHE_TIME_CITY_SEARCH: process.env.CACHE_TIME_CITY_SEARCH, CACHE_TIME_CITY_SEARCH: process.env.CACHE_TIME_CITY_SEARCH,
NODE_ENV: process.env.NODE_ENV, NODE_ENV: process.env.NODE_ENV,

View File

@@ -3,7 +3,6 @@ import { cache } from "react"
import * as routes from "@scandic-hotels/common/constants/routes/myPages" import * as routes from "@scandic-hotels/common/constants/routes/myPages"
import { safeTry } from "@scandic-hotels/common/utils/safeTry" import { safeTry } from "@scandic-hotels/common/utils/safeTry"
import { env } from "../../../../env/server"
import { getEurobonusMembership } from "../../user/helpers" import { getEurobonusMembership } from "../../user/helpers"
import type { Lang } from "@scandic-hotels/common/constants/language" import type { Lang } from "@scandic-hotels/common/constants/language"
@@ -67,9 +66,7 @@ export const getPrimaryLinks = cache(
const isScandicXSASActive = (loyalty: UserLoyalty) => { const isScandicXSASActive = (loyalty: UserLoyalty) => {
const eurobonusMembership = getEurobonusMembership(loyalty) const eurobonusMembership = getEurobonusMembership(loyalty)
const isLinked = Boolean(eurobonusMembership) return Boolean(eurobonusMembership)
return env.SAS_ENABLED && isLinked
} }
const showTeamMemberCard = cache(async () => { const showTeamMemberCard = cache(async () => {

View File

@@ -2,7 +2,6 @@ import { myStay } from "@scandic-hotels/common/constants/routes/myStay"
import { dt } from "@scandic-hotels/common/dt" import { dt } from "@scandic-hotels/common/dt"
import { createCounter } from "@scandic-hotels/common/telemetry" import { createCounter } from "@scandic-hotels/common/telemetry"
import * as maskValue from "@scandic-hotels/common/utils/maskValue" import * as maskValue from "@scandic-hotels/common/utils/maskValue"
import { getCurrentWebUrl } from "@scandic-hotels/common/utils/url"
import { env } from "../../../env/server" import { env } from "../../../env/server"
import * as api from "../../api" import * as api from "../../api"
@@ -340,15 +339,7 @@ export async function updateStaysBookingUrl(
const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com" const baseUrl = env.PUBLIC_URL || "https://www.scandichotels.com"
// Construct Booking URL. // Construct Booking URL.
const bookingUrl = !env.isLangLive(lang) const bookingUrl = new URL(myStay[lang], baseUrl)
? new URL(
getCurrentWebUrl({
path: myBookingPath[lang],
lang,
baseUrl,
})
)
: new URL(myStay[lang], baseUrl)
// Add search parameters. // Add search parameters.
if (encryptedBookingValue) { if (encryptedBookingValue) {