From 3257054474b7a2c791dc4e7396404056a78b74ee Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Mon, 20 Oct 2025 10:43:08 +0000 Subject: [PATCH] feat(BOOK-462): Hiding chatbot on german hotels with Dialogshift widget Approved-by: Linus Flood --- .../components/ChatbotScript/constants.ts | 12 ++++++++++++ apps/scandic-web/components/ChatbotScript/utils.ts | 11 +++++++++++ 2 files changed, 23 insertions(+) diff --git a/apps/scandic-web/components/ChatbotScript/constants.ts b/apps/scandic-web/components/ChatbotScript/constants.ts index 17f2f5abe..366081b45 100644 --- a/apps/scandic-web/components/ChatbotScript/constants.ts +++ b/apps/scandic-web/components/ChatbotScript/constants.ts @@ -15,4 +15,16 @@ export const CHATBOT_SHOW_ROUTES = { export const CHATBOT_HIDE_CONDITIONS = { searchParams: [{ key: "view", value: "map" }], + routes: { + [Lang.en]: [ + "/hotels/scandic-berlin-potsdamer-platz", + "/hotels/scandic-berlin-kurfurstendamm", + "/hotels/scandic-hamburg-emporio", + ], + [Lang.sv]: [], + [Lang.no]: [], + [Lang.fi]: [], + [Lang.da]: [], + [Lang.de]: [], + }, } as const diff --git a/apps/scandic-web/components/ChatbotScript/utils.ts b/apps/scandic-web/components/ChatbotScript/utils.ts index 2fb484fa5..0e191e531 100644 --- a/apps/scandic-web/components/ChatbotScript/utils.ts +++ b/apps/scandic-web/components/ChatbotScript/utils.ts @@ -26,6 +26,17 @@ export function shouldShowChatbot( return false } + const isOnHideRoute = CHATBOT_HIDE_CONDITIONS.routes[lang].some((route) => { + const fullRoute = removeTrailingSlash( + removeMultipleSlashes(`/${lang}${route}`) + ) + return cleanPathname === fullRoute + }) + + if (isOnHideRoute) { + return false + } + if (searchParams) { const shouldHideOnSearchParams = CHATBOT_HIDE_CONDITIONS.searchParams.some( ({ key, value }) => {