From 30c01a600048feaf45d2ce119f12484035a71784 Mon Sep 17 00:00:00 2001 From: Anton Gunnarsson Date: Tue, 1 Apr 2025 07:55:46 +0000 Subject: [PATCH] Merged in feat/feature-flag-sas-point-transfer (pull request #1686) Add feature flag for SAS point transfer * Add feature flag for specifically SAS point transfer Approved-by: Linus Flood --- apps/scandic-web/.env.local.example | 7 +++++++ .../Blocks/DynamicContent/SAS/TransferPoints/index.tsx | 2 +- apps/scandic-web/env/server.ts | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/apps/scandic-web/.env.local.example b/apps/scandic-web/.env.local.example index 651408b1e..722d38bc1 100644 --- a/apps/scandic-web/.env.local.example +++ b/apps/scandic-web/.env.local.example @@ -62,3 +62,10 @@ SHOW_SITE_WIDE_ALERT="false" SHOW_SIGNUP_FLOW="true" USE_NEW_REWARD_MODEL="true" + +SAS="1" +SAS_POINT_TRANSFER_ENABLED="true" +SAS_API_ENDPOINT="" +SAS_AUTH_ENDPOINT="" +SAS_OCP_APIM="" +SAS_AUTH_CLIENTID="" \ No newline at end of file diff --git a/apps/scandic-web/components/Blocks/DynamicContent/SAS/TransferPoints/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/SAS/TransferPoints/index.tsx index e240c7a30..21cd4b5ab 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/SAS/TransferPoints/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/SAS/TransferPoints/index.tsx @@ -23,7 +23,7 @@ export default async function SASTransferPoints({ subtitle, link, }: Props) { - if (!env.SAS_ENABLED) { + if (!env.SAS_ENABLED || !env.SAS_POINT_TRANSFER_ENABLED) { return null } diff --git a/apps/scandic-web/env/server.ts b/apps/scandic-web/env/server.ts index b9bbc298b..130a3c467 100644 --- a/apps/scandic-web/env/server.ts +++ b/apps/scandic-web/env/server.ts @@ -161,6 +161,13 @@ export const env = createEnv({ .refine((s) => s === "1" || s === "0") .transform((s) => s === "1") .default("0"), + SAS_POINT_TRANSFER_ENABLED: z + .string() + // only allow "true" or "false" + .refine((s) => s === "true" || s === "false") + // transform to boolean + .transform((s) => s === "true") + .default("false"), CACHE_TIME_HOTELDATA: z .number() @@ -275,6 +282,7 @@ export const env = createEnv({ SAS_OCP_APIM: process.env.SAS_OCP_APIM, SAS_AUTH_CLIENTID: process.env.SAS_AUTH_CLIENTID, SAS_ENABLED: process.env.SAS, + SAS_POINT_TRANSFER_ENABLED: process.env.SAS_POINT_TRANSFER_ENABLED, CACHE_TIME_HOTELDATA: process.env.CACHE_TIME_HOTELDATA, CACHE_TIME_HOTELS: process.env.CACHE_TIME_HOTELS,