Merged in fix/hotel-branding-env (pull request #3239)
Fix/hotel branding env * feat(env): removed hotel branding env variable * . Approved-by: Erik Tiekstra Approved-by: Anton Gunnarsson Approved-by: Matilda Landström
This commit is contained in:
@@ -53,6 +53,4 @@ DTMC_ENTRA_ID_CLIENT=""
|
|||||||
DTMC_ENTRA_ID_ISSUER=""
|
DTMC_ENTRA_ID_ISSUER=""
|
||||||
DTMC_ENTRA_ID_SECRET=""
|
DTMC_ENTRA_ID_SECRET=""
|
||||||
|
|
||||||
HOTEL_BRANDING="0" # 0 - disabled, 1 - enabled
|
|
||||||
|
|
||||||
NEW_STAYS_ON_MY_PAGES="true"
|
NEW_STAYS_ON_MY_PAGES="true"
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import {
|
|||||||
} from "@scandic-hotels/common/utils/theme"
|
} from "@scandic-hotels/common/utils/theme"
|
||||||
import { setTheme } from "@scandic-hotels/common/utils/theme/serverContext"
|
import { setTheme } from "@scandic-hotels/common/utils/theme/serverContext"
|
||||||
|
|
||||||
import { env } from "@/env/server"
|
|
||||||
import { getHotel, getHotelPage } from "@/lib/trpc/memoizedRequests"
|
import { getHotel, getHotelPage } from "@/lib/trpc/memoizedRequests"
|
||||||
|
|
||||||
import HotelMapPage from "@/components/ContentType/HotelMapPage"
|
import HotelMapPage from "@/components/ContentType/HotelMapPage"
|
||||||
@@ -46,9 +45,10 @@ export default async function HotelPagePage(
|
|||||||
return notFound()
|
return notFound()
|
||||||
}
|
}
|
||||||
|
|
||||||
const hotelTheme = env.HOTEL_BRANDING
|
const hotelTheme = getThemeByHotel(
|
||||||
? getThemeByHotel(hotelPageData.hotel_page_id, hotelData.hotel.hotelType)
|
hotelPageData.hotel_page_id,
|
||||||
: DEFAULT_THEME
|
hotelData.hotel.hotelType
|
||||||
|
)
|
||||||
|
|
||||||
setTheme(hotelTheme)
|
setTheme(hotelTheme)
|
||||||
|
|
||||||
|
|||||||
6
apps/scandic-web/env/server.ts
vendored
6
apps/scandic-web/env/server.ts
vendored
@@ -91,11 +91,6 @@ export const env = createEnv({
|
|||||||
* We currently have the secret in local and test environments.
|
* We currently have the secret in local and test environments.
|
||||||
*/
|
*/
|
||||||
DTMC_ENTRA_ID_SECRET: z.string().optional(),
|
DTMC_ENTRA_ID_SECRET: z.string().optional(),
|
||||||
HOTEL_BRANDING: z
|
|
||||||
.string()
|
|
||||||
.refine((s) => s === "1" || s === "0")
|
|
||||||
.transform((s) => s === "1")
|
|
||||||
.default("0"),
|
|
||||||
CHATBOT_LIVE_LANGS: z
|
CHATBOT_LIVE_LANGS: z
|
||||||
.string()
|
.string()
|
||||||
.optional()
|
.optional()
|
||||||
@@ -164,7 +159,6 @@ export const env = createEnv({
|
|||||||
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,
|
||||||
DTMC_ENTRA_ID_SECRET: process.env.DTMC_ENTRA_ID_SECRET,
|
DTMC_ENTRA_ID_SECRET: process.env.DTMC_ENTRA_ID_SECRET,
|
||||||
HOTEL_BRANDING: process.env.HOTEL_BRANDING,
|
|
||||||
CHATBOT_LIVE_LANGS: process.env.CHATBOT_LIVE_LANGS,
|
CHATBOT_LIVE_LANGS: process.env.CHATBOT_LIVE_LANGS,
|
||||||
NEW_STAYS_ON_MY_PAGES: process.env.NEW_STAYS_ON_MY_PAGES,
|
NEW_STAYS_ON_MY_PAGES: process.env.NEW_STAYS_ON_MY_PAGES,
|
||||||
SEO_INERT: process.env.SEO_INERT,
|
SEO_INERT: process.env.SEO_INERT,
|
||||||
|
|||||||
Reference in New Issue
Block a user