From 8def6c1b5c9ad01c23000eaed58ee5511de6e4e5 Mon Sep 17 00:00:00 2001 From: Christel Westerberg Date: Mon, 24 Jun 2024 16:18:32 +0200 Subject: [PATCH 1/3] fix: update urls for webviews --- constants/routes/webviews.ts | 12 ++++++------ i18n/dictionaries/en.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/constants/routes/webviews.ts b/constants/routes/webviews.ts index 2680e6228..66a0b999f 100644 --- a/constants/routes/webviews.ts +++ b/constants/routes/webviews.ts @@ -35,12 +35,12 @@ export const points = { } export const programOverview = { - da: `/da/webview/about-scandic-friends`, - de: `/de/webview/about-scandic-friends`, - en: `/en/webview/about-scandic-friends`, - fi: `/fi/webview/about-scandic-friends`, - no: `/no/webview/om-scandic-friends`, - sv: `/sv/webview/om-scandic-friends`, + da: `/da/webview/scandic-friends`, + de: `/de/webview/scandic-friends`, + en: `/en/webview/scandic-friends`, + fi: `/fi/webview/scandic-friends`, + no: `/no/webview/scandic-friends`, + sv: `/sv/webview/scandic-friends`, } const refreshUrl = { diff --git a/i18n/dictionaries/en.json b/i18n/dictionaries/en.json index 42b4fd967..e0cfd7b2b 100644 --- a/i18n/dictionaries/en.json +++ b/i18n/dictionaries/en.json @@ -39,7 +39,7 @@ "Level": "Level", "Level up to unlock": "Level up to unlock", "Log in": "Log in", - "Log out": "Sign out", + "Log out": "Log out", "Membership cards": "Membership cards", "Membership ID": "Membership ID", "Month": "Month", From 5c0ee8c11148e94c8c5be25b117ff6e0837dcd0e Mon Sep 17 00:00:00 2001 From: Christel Westerberg Date: Mon, 24 Jun 2024 16:35:01 +0200 Subject: [PATCH 2/3] fix: handle rewrites for logout --- next.config.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/next.config.js b/next.config.js index d2de733c9..ac5c68cea 100644 --- a/next.config.js +++ b/next.config.js @@ -1,6 +1,6 @@ import createJiti from "jiti" -import { login } from "./constants/routes/handleAuth.js" +import { login, logout } from "./constants/routes/handleAuth.js" import { myPages } from "./constants/routes/myPages.js" const jiti = createJiti(new URL(import.meta.url).pathname) @@ -70,6 +70,11 @@ const nextConfig = { { source: login.fi, destination: "/fi/login" }, { source: login.no, destination: "/no/login" }, { source: login.sv, destination: "/sv/login" }, + { source: logout.da, destination: "/da/logout" }, + { source: logout.de, destination: "/de/logout" }, + { source: logout.fi, destination: "/fi/logout" }, + { source: logout.no, destination: "/no/logout" }, + { source: logout.sv, destination: "/sv/logout" }, { source: `${myPages.en}/:path*`, destination: `/en/my-pages/:path*`, From 5925eb0770db4aeafb9b7627455973374c06d538 Mon Sep 17 00:00:00 2001 From: Christel Westerberg Date: Mon, 24 Jun 2024 16:49:49 +0200 Subject: [PATCH 3/3] fix: point to english for all content in compare overview --- .../Blocks/DynamicContent/OverviewTable/index.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/components/Loyalty/Blocks/DynamicContent/OverviewTable/index.tsx b/components/Loyalty/Blocks/DynamicContent/OverviewTable/index.tsx index a2e2bbe25..f9295f745 100644 --- a/components/Loyalty/Blocks/DynamicContent/OverviewTable/index.tsx +++ b/components/Loyalty/Blocks/DynamicContent/OverviewTable/index.tsx @@ -30,10 +30,8 @@ import { OverviewTableProps, OverviewTableReducerAction, } from "@/types/components/loyalty/blocks" -import { LangParams } from "@/types/params" import { User } from "@/types/user" - const levelsTranslations = { [Lang.en]: EN, [Lang.sv]: SV, @@ -42,7 +40,6 @@ const levelsTranslations = { [Lang.fi]: FI, [Lang.de]: DE, } - function getTranslatedLevelByTier(tier: membershipLevels, lang: Lang) { return levelsTranslations[lang].levels.find( (level) => level.tier === tier @@ -125,11 +122,11 @@ function reducer(state: any, action: OverviewTableReducerAction) { export default function OverviewTable({ user }: OverviewTableProps) { const intl = useIntl() - const params = useParams() - const levelsData = levelsTranslations[params.lang] + const lang = Lang.en + const levelsData = levelsTranslations[lang] const [selectionState, dispatch] = useReducer( reducer, - { user, lang: params.lang }, + { user, lang }, getInitialState ) @@ -137,7 +134,7 @@ export default function OverviewTable({ user }: OverviewTableProps) { return (key: Key) => { if (typeof key === "number") { dispatch({ - payload: getTranslatedLevelByTier(key, params.lang), + payload: getTranslatedLevelByTier(key, lang), type: actionType, }) }