From 5cb19c34499ca6b4b32aad1e29c4a93828458fc7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Aug 2024 16:52:58 +0200 Subject: [PATCH] Upgrade `react-router-dom` to the latest version (#31851) Signed-off-by: Erik Jan de Wit Signed-off-by: Jon Koops Co-authored-by: Erik Jan de Wit Co-authored-by: Jon Koops --- js/apps/account-ui/package.json | 2 +- js/apps/admin-ui/package.json | 2 +- .../context/realm-context/RealmContext.tsx | 13 +++--- pnpm-lock.yaml | 42 +++++++++---------- 4 files changed, 28 insertions(+), 31 deletions(-) diff --git a/js/apps/account-ui/package.json b/js/apps/account-ui/package.json index 9a663e5d86..65f4879bbb 100644 --- a/js/apps/account-ui/package.json +++ b/js/apps/account-ui/package.json @@ -37,7 +37,7 @@ "react-dom": "^18.3.1", "react-hook-form": "^7.52.2", "react-i18next": "^15.0.1", - "react-router-dom": "^6.24.1" + "react-router-dom": "^6.26.0" }, "devDependencies": { "@keycloak/keycloak-admin-client": "workspace:*", diff --git a/js/apps/admin-ui/package.json b/js/apps/admin-ui/package.json index c3303b4d15..d984d04fe7 100644 --- a/js/apps/admin-ui/package.json +++ b/js/apps/admin-ui/package.json @@ -100,7 +100,7 @@ "react-dropzone": "^14.2.3", "react-hook-form": "^7.52.2", "react-i18next": "^15.0.1", - "react-router-dom": "^6.24.1", + "react-router-dom": "^6.26.0", "reactflow": "^11.11.4", "use-react-router-breadcrumbs": "^4.0.1" }, diff --git a/js/apps/admin-ui/src/context/realm-context/RealmContext.tsx b/js/apps/admin-ui/src/context/realm-context/RealmContext.tsx index d8a3119ffb..2ccfad3222 100644 --- a/js/apps/admin-ui/src/context/realm-context/RealmContext.tsx +++ b/js/apps/admin-ui/src/context/realm-context/RealmContext.tsx @@ -4,7 +4,7 @@ import { useEnvironment, useRequiredContext, } from "@keycloak/keycloak-ui-shared"; -import { PropsWithChildren, useEffect, useMemo, useState } from "react"; +import { PropsWithChildren, useEffect, useState } from "react"; import { useMatch } from "react-router-dom"; import { useAdminClient } from "../../admin-client"; import { DashboardRouteWithRealm } from "../../dashboard/routes/Dashboard"; @@ -35,18 +35,15 @@ export const RealmContextProvider = ({ children }: PropsWithChildren) => { end: false, }); - const realmParam = routeMatch?.params.realm; - const realm = useMemo( - () => decodeURIComponent(realmParam ?? environment.realm), - [realmParam], - ); + const realm = routeMatch?.params.realm ?? environment.realm; // Configure admin client to use selected realm when it changes. useEffect(() => { (async () => { adminClient.setConfig({ realmName: realm }); - await i18n.loadNamespaces(realm); - i18n.setDefaultNamespace(realm); + const namespace = encodeURIComponent(realm); + await i18n.loadNamespaces(namespace); + i18n.setDefaultNamespace(namespace); })(); }, [realm]); useFetch( diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 95123df9df..04abdba02c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -111,8 +111,8 @@ importers: specifier: ^15.0.1 version: 15.0.1(i18next@23.12.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react-router-dom: - specifier: ^6.24.1 - version: 6.24.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^6.26.0 + version: 6.26.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) devDependencies: '@keycloak/keycloak-admin-client': specifier: workspace:* @@ -220,14 +220,14 @@ importers: specifier: ^15.0.1 version: 15.0.1(i18next@23.12.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react-router-dom: - specifier: ^6.24.1 - version: 6.24.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^6.26.0 + version: 6.26.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) reactflow: specifier: ^11.11.4 version: 11.11.4(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) use-react-router-breadcrumbs: specifier: ^4.0.1 - version: 4.0.1(react-router-dom@6.24.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) + version: 4.0.1(react-router-dom@6.26.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) devDependencies: '@4tw/cypress-drag-drop': specifier: ^2.2.5 @@ -1270,8 +1270,8 @@ packages: react: '>=17' react-dom: '>=17' - '@remix-run/router@1.17.1': - resolution: {integrity: sha512-mCOMec4BKd6BRGBZeSnGiIgwsbLGp3yhVqAD8H+PxiRNEHgDpZb8J1TnrSDlg97t0ySKMQJTHCWBCmBpSmkF6Q==} + '@remix-run/router@1.19.0': + resolution: {integrity: sha512-zDICCLKEwbVYTS6TjYaWtHXxkdoUvD/QXvyVZjGCsWz5vyH7aFeONlPffPdW+Y/t6KT0MgXb2Mfjun9YpWN1dA==} engines: {node: '>=14.0.0'} '@rollup/plugin-commonjs@26.0.1': @@ -4181,15 +4181,15 @@ packages: react-is@17.0.2: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} - react-router-dom@6.24.1: - resolution: {integrity: sha512-U19KtXqooqw967Vw0Qcn5cOvrX5Ejo9ORmOtJMzYWtCT4/WOfFLIZGGsVLxcd9UkBO0mSTZtXqhZBsWlHr7+Sg==} + react-router-dom@6.26.0: + resolution: {integrity: sha512-RRGUIiDtLrkX3uYcFiCIxKFWMcWQGMojpYZfcstc63A1+sSnVgILGIm9gNUA6na3Fm1QuPGSBQH2EMbAZOnMsQ==} engines: {node: '>=14.0.0'} peerDependencies: react: '>=16.8' react-dom: '>=16.8' - react-router@6.24.1: - resolution: {integrity: sha512-PTXFXGK2pyXpHzVo3rR9H7ip4lSPZZc0bHG5CARmj65fTT6qG7sTngmb6lcYu1gf3y/8KxORoy9yn59pGpCnpg==} + react-router@6.26.0: + resolution: {integrity: sha512-wVQq0/iFYd3iZ9H2l3N3k4PL8EEHcb0XlU2Na8nEwmiXgIUElEH6gaJDtUQxJ+JFzmIXaQjfdpcGWaM6IoQGxg==} engines: {node: '>=14.0.0'} peerDependencies: react: '>=16.8' @@ -5668,9 +5668,9 @@ snapshots: react-dropzone: 14.2.3(react@18.3.1) react-hook-form: 7.52.2(react@18.3.1) react-i18next: 15.0.1(i18next@23.12.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react-router-dom: 6.24.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react-router-dom: 6.26.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) reactflow: 11.11.4(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - use-react-router-breadcrumbs: 4.0.1(react-router-dom@6.24.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) + use-react-router-breadcrumbs: 4.0.1(react-router-dom@6.26.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) transitivePeerDependencies: - '@types/react' - encoding @@ -5942,7 +5942,7 @@ snapshots: - '@types/react' - immer - '@remix-run/router@1.17.1': {} + '@remix-run/router@1.19.0': {} '@rollup/plugin-commonjs@26.0.1(rollup@4.20.0)': dependencies: @@ -9063,16 +9063,16 @@ snapshots: react-is@17.0.2: {} - react-router-dom@6.24.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + react-router-dom@6.26.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@remix-run/router': 1.17.1 + '@remix-run/router': 1.19.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - react-router: 6.24.1(react@18.3.1) + react-router: 6.26.0(react@18.3.1) - react-router@6.24.1(react@18.3.1): + react-router@6.26.0(react@18.3.1): dependencies: - '@remix-run/router': 1.17.1 + '@remix-run/router': 1.19.0 react: 18.3.1 react@18.3.1: @@ -9756,10 +9756,10 @@ snapshots: url-template@3.1.1: {} - use-react-router-breadcrumbs@4.0.1(react-router-dom@6.24.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1): + use-react-router-breadcrumbs@4.0.1(react-router-dom@6.26.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1): dependencies: react: 18.3.1 - react-router-dom: 6.24.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react-router-dom: 6.26.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) use-sync-external-store@1.2.0(react@18.3.1): dependencies: