diff --git a/apps/scandic-web/constants/routes/webviews.ts b/apps/scandic-web/constants/routes/webviews.ts index 7f5788bcd..ca2f2c6bd 100644 --- a/apps/scandic-web/constants/routes/webviews.ts +++ b/apps/scandic-web/constants/routes/webviews.ts @@ -52,13 +52,22 @@ const refreshUrl = { sv: `/sv/webview/refresh`, } -const myStay = { - da: `/da/webview/hotelreservation/my-stay`, - de: `/de/webview/hotelreservation/my-stay`, - en: `/en/webview/hotelreservation/my-stay`, - fi: `/fi/webview/hotelreservation/my-stay`, - no: `/no/webview/hotelreservation/my-stay`, - sv: `/sv/webview/hotelreservation/my-stay`, +export const myStay = { + da: "/da/webview/hotelreservation/min-ophold", + de: "/de/webview/hotelreservation/meine-aufenthalte", + en: "/en/webview/hotelreservation/my-stay", + fi: "/fi/webview/hotelreservation/min-vistelma", + no: "/no/webview/hotelreservation/min-ophold", + sv: "/sv/webview/hotelreservation/min-vistelse", +} + +export const preliminaryReceipt = { + da: `${myStay.da}/receipt`, + de: `${myStay.de}/receipt`, + en: `${myStay.en}/receipt`, + fi: `${myStay.fi}/receipt`, + no: `${myStay.no}/receipt`, + sv: `${myStay.sv}/receipt`, } export const webviews = [ @@ -78,6 +87,9 @@ export const myPagesWebviews = [ export const loyaltyPagesWebviews = [...Object.values(programOverview)] -export const myStayWebviews = [...Object.values(myStay)] +export const myStayWebviews = [ + ...Object.values(myStay), + ...Object.values(preliminaryReceipt), +] export const refreshWebviews = [...Object.values(refreshUrl)] diff --git a/apps/scandic-web/next.config.js b/apps/scandic-web/next.config.ts similarity index 86% rename from apps/scandic-web/next.config.js rename to apps/scandic-web/next.config.ts index 6744e6688..837ef9d3e 100644 --- a/apps/scandic-web/next.config.js +++ b/apps/scandic-web/next.config.ts @@ -7,6 +7,10 @@ import { findMyBooking } from "./constants/routes/findMyBooking.js" import { login, logout } from "./constants/routes/handleAuth.js" import { myPages } from "./constants/routes/myPages.js" import { myStay, preliminaryReceipt } from "./constants/routes/myStay.js" +import { + myStay as myStayWebview, + preliminaryReceipt as preliminaryReceiptWebview, +} from "./constants/routes/webviews" const jiti = createJiti(fileURLToPath(import.meta.url)) jiti("./env/server") @@ -75,7 +79,7 @@ const nextConfig = { output: "standalone", - webpack: function (config) { + webpack: function (config: any) { config.module.rules.push( { test: /\.(graphql|gql)/, @@ -369,6 +373,57 @@ const nextConfig = { source: `${preliminaryReceipt.no}`, destination: "/no/hotelreservation/my-stay/receipt", }, + // Webview My stay + { + source: `${myStayWebview.en}`, + destination: "/en/webview/hotelreservation/my-stay", + }, + { + source: `${myStayWebview.sv}`, + destination: "/sv/webview/hotelreservation/my-stay", + }, + { + source: `${myStayWebview.da}`, + destination: "/da/webview/hotelreservation/my-stay", + }, + { + source: `${myStayWebview.de}`, + destination: "/de/webview/hotelreservation/my-stay", + }, + { + source: `${myStayWebview.fi}`, + destination: "/fi/webview/hotelreservation/my-stay", + }, + { + source: `${myStayWebview.no}`, + destination: "/no/webview/hotelreservation/my-stay", + }, + // Webview My stay receipt + { + source: `${preliminaryReceiptWebview.en}`, + destination: "/en/webview/hotelreservation/my-stay/receipt", + }, + { + source: `${preliminaryReceiptWebview.sv}`, + destination: "/sv/webview/hotelreservation/my-stay/receipt", + }, + { + source: `${preliminaryReceiptWebview.da}`, + destination: "/da/webview/hotelreservation/my-stay/receipt", + }, + { + source: `${preliminaryReceiptWebview.de}`, + destination: "/de/webview/hotelreservation/my-stay/receipt", + }, + { + source: `${preliminaryReceiptWebview.fi}`, + destination: "/fi/webview/hotelreservation/my-stay/receipt", + }, + { + source: `${preliminaryReceiptWebview.no}`, + destination: "/no/webview/hotelreservation/my-stay/receipt", + }, + // Sitemap { source: `/sitemap-:id(\\d{1,}).xml`, destination: `/sitemap/:id`, @@ -385,7 +440,7 @@ const nextConfig = { export default Sentry.withSentryConfig(nextConfig, { org: "scandic-hotels", project: "scandic-web", - enabled: process.env.NODE_ENV !== "development", + authToken: process.env.SENTRY_AUTH_TOKEN, // Only print logs for uploading source maps in CI