From a00cf8d327f7ba0954001a4b9d8ac8fd7939f6c5 Mon Sep 17 00:00:00 2001 From: Anton Gunnarsson Date: Thu, 23 Oct 2025 11:14:51 +0000 Subject: [PATCH] Merged in fix/sw-3568-sas-terms-and-conditions-link (pull request #3002) feat(SW-3568): Use dependency injected link for SF terms on enter details * Use dependency injected link for sf terms Approved-by: Linus Flood --- apps/partner-sas/constants/bookingFlowConfig.ts | 4 ++++ apps/scandic-web/constants/bookingFlowConfig.ts | 2 ++ .../lib/bookingFlowConfig/bookingFlowConfig.tsx | 1 + .../Details/Multiroom/JoinScandicFriendsCard/index.tsx | 5 +++-- .../Multiroom/PartnerSASJoinScandicFriendsCard/index.tsx | 6 +++--- .../Details/RoomOne/JoinScandicFriendsCard/index.tsx | 5 +++-- .../RoomOne/PartnerSASJoinScandicFriendsCard/index.tsx | 5 +++-- 7 files changed, 19 insertions(+), 9 deletions(-) diff --git a/apps/partner-sas/constants/bookingFlowConfig.ts b/apps/partner-sas/constants/bookingFlowConfig.ts index 6e631636e..fb21881cd 100644 --- a/apps/partner-sas/constants/bookingFlowConfig.ts +++ b/apps/partner-sas/constants/bookingFlowConfig.ts @@ -1,5 +1,6 @@ import { bookingTermsAndConditionsRoutes } from "@scandic-hotels/common/constants/routes/bookingTermsAndConditionsRoutes" import { customerService } from "@scandic-hotels/common/constants/routes/customerService" +import { membershipTermsAndConditions } from "@scandic-hotels/common/constants/routes/membershipTermsAndConditions" import { myStay } from "@scandic-hotels/common/constants/routes/myStay" import { privacyPolicyRoutes } from "@scandic-hotels/common/constants/routes/privacyPolicyRoutes" @@ -16,6 +17,9 @@ export const bookingFlowConfig: BookingFlowConfig = { bookingTermsAndConditions: routeToScandicWeb( bookingTermsAndConditionsRoutes ), + membershipTermsAndConditions: routeToScandicWeb( + membershipTermsAndConditions + ), customerService: routeToScandicWeb(customerService), privacyPolicy: routeToScandicWeb(privacyPolicyRoutes), }, diff --git a/apps/scandic-web/constants/bookingFlowConfig.ts b/apps/scandic-web/constants/bookingFlowConfig.ts index 05c081347..16330ca7d 100644 --- a/apps/scandic-web/constants/bookingFlowConfig.ts +++ b/apps/scandic-web/constants/bookingFlowConfig.ts @@ -1,5 +1,6 @@ import { bookingTermsAndConditionsRoutes } from "@scandic-hotels/common/constants/routes/bookingTermsAndConditionsRoutes" import { customerService } from "@scandic-hotels/common/constants/routes/customerService" +import { membershipTermsAndConditions } from "@scandic-hotels/common/constants/routes/membershipTermsAndConditions" import { myStay } from "@scandic-hotels/common/constants/routes/myStay" import { privacyPolicyRoutes } from "@scandic-hotels/common/constants/routes/privacyPolicyRoutes" @@ -13,6 +14,7 @@ export const bookingFlowConfig: BookingFlowConfig = { myStay, customerService, bookingTermsAndConditions: bookingTermsAndConditionsRoutes, + membershipTermsAndConditions, privacyPolicy: privacyPolicyRoutes, }, } diff --git a/packages/booking-flow/lib/bookingFlowConfig/bookingFlowConfig.tsx b/packages/booking-flow/lib/bookingFlowConfig/bookingFlowConfig.tsx index 9df8097cf..848e0514d 100644 --- a/packages/booking-flow/lib/bookingFlowConfig/bookingFlowConfig.tsx +++ b/packages/booking-flow/lib/bookingFlowConfig/bookingFlowConfig.tsx @@ -15,6 +15,7 @@ export type BookingFlowConfig = { routes: { myStay: LangRoute bookingTermsAndConditions: LangRoute + membershipTermsAndConditions: LangRoute customerService: LangRoute privacyPolicy: LangRoute } diff --git a/packages/booking-flow/lib/components/EnterDetails/Details/Multiroom/JoinScandicFriendsCard/index.tsx b/packages/booking-flow/lib/components/EnterDetails/Details/Multiroom/JoinScandicFriendsCard/index.tsx index 9582e6254..1ea743107 100644 --- a/packages/booking-flow/lib/components/EnterDetails/Details/Multiroom/JoinScandicFriendsCard/index.tsx +++ b/packages/booking-flow/lib/components/EnterDetails/Details/Multiroom/JoinScandicFriendsCard/index.tsx @@ -3,13 +3,13 @@ import { useIntl } from "react-intl" import { CurrencyEnum } from "@scandic-hotels/common/constants/currency" -import { membershipTermsAndConditions } from "@scandic-hotels/common/constants/routes/membershipTermsAndConditions" import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting" import Footnote from "@scandic-hotels/design-system/Footnote" import Checkbox from "@scandic-hotels/design-system/Form/Checkbox" import Link from "@scandic-hotels/design-system/Link" import { Typography } from "@scandic-hotels/design-system/Typography" +import { useBookingFlowConfig } from "../../../../../bookingFlowConfig/bookingFlowConfigContext" import { useRoomContext } from "../../../../../contexts/EnterDetails/RoomContext" import useLang from "../../../../../hooks/useLang" @@ -23,6 +23,7 @@ export default function JoinScandicFriendsCard({ }: JoinScandicFriendsCardProps) { const lang = useLang() const intl = useIntl() + const { routes } = useBookingFlowConfig() const { room, roomNr, @@ -96,7 +97,7 @@ export default function JoinScandicFriendsCard({ textDecoration="underline" size="tiny" target="_blank" - href={membershipTermsAndConditions[lang]} + href={routes.membershipTermsAndConditions[lang]} > {str} diff --git a/packages/booking-flow/lib/components/EnterDetails/Details/Multiroom/PartnerSASJoinScandicFriendsCard/index.tsx b/packages/booking-flow/lib/components/EnterDetails/Details/Multiroom/PartnerSASJoinScandicFriendsCard/index.tsx index 11096e3c7..ddecc3d02 100644 --- a/packages/booking-flow/lib/components/EnterDetails/Details/Multiroom/PartnerSASJoinScandicFriendsCard/index.tsx +++ b/packages/booking-flow/lib/components/EnterDetails/Details/Multiroom/PartnerSASJoinScandicFriendsCard/index.tsx @@ -3,13 +3,13 @@ import { useWatch } from "react-hook-form" import { useIntl } from "react-intl" import { CurrencyEnum } from "@scandic-hotels/common/constants/currency" -import { membershipTermsAndConditions } from "@scandic-hotels/common/constants/routes/membershipTermsAndConditions" import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting" import Footnote from "@scandic-hotels/design-system/Footnote" import Checkbox from "@scandic-hotels/design-system/Form/Checkbox" import Link from "@scandic-hotels/design-system/Link" import { Typography } from "@scandic-hotels/design-system/Typography" +import { useBookingFlowConfig } from "../../../../../bookingFlowConfig/bookingFlowConfigContext" import { useRoomContext } from "../../../../../contexts/EnterDetails/RoomContext" import useLang from "../../../../../hooks/useLang" import { MembershipNumberInput } from "../../RoomOne/Signup/MembershipNumberInput" @@ -26,7 +26,7 @@ export function PartnerSASJoinScandicFriendsCard({ }: Props) { const lang = useLang() const intl = useIntl() - + const { routes } = useBookingFlowConfig() const { room, roomNr, @@ -111,7 +111,7 @@ export function PartnerSASJoinScandicFriendsCard({ textDecoration="underline" size="tiny" target="_blank" - href={membershipTermsAndConditions[lang]} + href={routes.membershipTermsAndConditions[lang]} > {str} diff --git a/packages/booking-flow/lib/components/EnterDetails/Details/RoomOne/JoinScandicFriendsCard/index.tsx b/packages/booking-flow/lib/components/EnterDetails/Details/RoomOne/JoinScandicFriendsCard/index.tsx index 1825448cf..155373010 100644 --- a/packages/booking-flow/lib/components/EnterDetails/Details/RoomOne/JoinScandicFriendsCard/index.tsx +++ b/packages/booking-flow/lib/components/EnterDetails/Details/RoomOne/JoinScandicFriendsCard/index.tsx @@ -2,7 +2,6 @@ import { useIntl } from "react-intl" import { CurrencyEnum } from "@scandic-hotels/common/constants/currency" -import { membershipTermsAndConditions } from "@scandic-hotels/common/constants/routes/membershipTermsAndConditions" import { useLazyPathname } from "@scandic-hotels/common/hooks/useLazyPathname" import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting" import Footnote from "@scandic-hotels/design-system/Footnote" @@ -13,6 +12,7 @@ import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton import { Typography } from "@scandic-hotels/design-system/Typography" import { trackLoginClick } from "@scandic-hotels/tracking/navigation" +import { useBookingFlowConfig } from "../../../../../bookingFlowConfig/bookingFlowConfigContext" import { useRoomContext } from "../../../../../contexts/EnterDetails/RoomContext" import useLang from "../../../../../hooks/useLang" @@ -24,6 +24,7 @@ type Props = { export function JoinScandicFriendsCard({ name = "join" }: Props) { const lang = useLang() const intl = useIntl() + const { routes } = useBookingFlowConfig() const loginPathname = useLazyPathname({ includeSearchParams: true }) const { room, @@ -105,7 +106,7 @@ export function JoinScandicFriendsCard({ name = "join" }: Props) { textDecoration="underline" size="tiny" target="_blank" - href={membershipTermsAndConditions[lang]} + href={routes.membershipTermsAndConditions[lang]} > {str} diff --git a/packages/booking-flow/lib/components/EnterDetails/Details/RoomOne/PartnerSASJoinScandicFriendsCard/index.tsx b/packages/booking-flow/lib/components/EnterDetails/Details/RoomOne/PartnerSASJoinScandicFriendsCard/index.tsx index 84b968a5f..e9243de13 100644 --- a/packages/booking-flow/lib/components/EnterDetails/Details/RoomOne/PartnerSASJoinScandicFriendsCard/index.tsx +++ b/packages/booking-flow/lib/components/EnterDetails/Details/RoomOne/PartnerSASJoinScandicFriendsCard/index.tsx @@ -3,7 +3,6 @@ import { useWatch } from "react-hook-form" import { useIntl } from "react-intl" import { CurrencyEnum } from "@scandic-hotels/common/constants/currency" -import { membershipTermsAndConditions } from "@scandic-hotels/common/constants/routes/membershipTermsAndConditions" import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting" import Footnote from "@scandic-hotels/design-system/Footnote" import Checkbox from "@scandic-hotels/design-system/Form/Checkbox" @@ -11,6 +10,7 @@ import Link from "@scandic-hotels/design-system/Link" import { Typography } from "@scandic-hotels/design-system/Typography" import { trpc } from "@scandic-hotels/trpc/client" +import { useBookingFlowConfig } from "../../../../../bookingFlowConfig/bookingFlowConfigContext" import { useRoomContext } from "../../../../../contexts/EnterDetails/RoomContext" import useLang from "../../../../../hooks/useLang" import { MembershipNumberInput } from "../Signup/MembershipNumberInput" @@ -27,6 +27,7 @@ export function PartnerSASJoinScandicFriendsCard({ }: Props) { const lang = useLang() const intl = useIntl() + const { routes } = useBookingFlowConfig() const { data: euroBonusProfile } = trpc.partner.sas.getEuroBonusProfile.useQuery() @@ -107,7 +108,7 @@ export function PartnerSASJoinScandicFriendsCard({ textDecoration="underline" size="tiny" target="_blank" - href={membershipTermsAndConditions[lang]} + href={routes.membershipTermsAndConditions[lang]} > {str}