Skip to content

Commit 38b1932

Browse files
committed
Merge branch 'bump-react-router' of https://github.com/mrCherry97/busola into bump-react-router
2 parents 0a1d1d9 + 59d286e commit 38b1932

File tree

75 files changed

+382
-306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+382
-306
lines changed

cypress/support/component.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import React from 'react';
33
import { mount } from 'cypress/react18';
44
import { ThemeProvider } from '@ui5/webcomponents-react';
5-
import { MemoryRouter } from 'react-router-dom';
5+
import { MemoryRouter } from 'react-router';
66
import { RecoilRoot } from 'recoil';
77

88
import i18n from 'i18next';

package-lock.json

Lines changed: 70 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"react": "^18.3.1",
105105
"react-dom": "^18.3.1",
106106
"react-i18next": "^15.4.1",
107-
"react-router-dom": "^6.3.0",
107+
"react-router": "^7.4.0",
108108
"react-syntax-highlighter": "^15.6.1",
109109
"react-tippy": "^1.4.0",
110110
"recoil": "^0.7.7",

src/command-pallette/CommandPalletteUI/handlers/clusterResourceHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
Result,
2121
} from '../types';
2222
import { K8sResource } from 'types';
23-
import { matchPath } from 'react-router-dom';
23+
import { matchPath } from 'react-router';
2424

2525
function getAutocompleteEntries({
2626
tokens,

src/command-pallette/CommandPalletteUI/useSearchResults.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { clusterState } from 'state/clusterAtom';
1414
import { availableNodesSelector } from 'state/navigation/availableNodesSelector';
1515
import { CommandPaletteContext, HelpEntries, Result } from './types';
1616
import { useClustersInfo } from 'state/utils/getClustersInfo';
17-
import { useNavigate, To } from 'react-router-dom';
17+
import { useNavigate, To } from 'react-router';
1818
import { showYamlUploadDialogState } from 'state/showYamlUploadDialogAtom';
1919

2020
type useSearchResultsProps = {

src/components/App/App.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect } from 'react';
2-
import { Navigate, Route, Routes } from 'react-router-dom';
2+
import { Navigate, Route, Routes } from 'react-router';
33
import { useTranslation } from 'react-i18next';
44
import { useRecoilValue, useSetRecoilState } from 'recoil';
55

@@ -121,10 +121,9 @@ export default function App() {
121121
path="cluster/:currentClusterName"
122122
element={<Navigate to="overview" />}
123123
/>
124-
<Route
125-
path="cluster/:currentClusterName/*"
126-
element={<ClusterRoutes />}
127-
/>
124+
<Route path="cluster/:currentClusterName">
125+
<Route path="*" element={<ClusterRoutes />} />
126+
</Route>
128127
{makeGardenerLoginRoute()}
129128
</Routes>
130129
<Preferences />

src/components/App/ClusterRoutes.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import { useEffect, useState } from 'react';
2-
import { Route, Routes, useSearchParams } from 'react-router-dom';
2+
import {
3+
Route,
4+
Routes,
5+
useSearchParams,
6+
useNavigate,
7+
useParams,
8+
} from 'react-router';
39
import { useTranslation } from 'react-i18next';
410
import { useRecoilValue, useRecoilState, useSetRecoilState } from 'recoil';
5-
import { useNavigate, useParams } from 'react-router-dom';
611

712
import { WithTitle } from 'shared/hooks/useWindowTitle';
813
import { ClusterOverview } from 'components/Clusters/views/ClusterOverview/ClusterOverview';
@@ -91,7 +96,9 @@ export default function ClusterRoutes() {
9196
{extensibilityRoutes}
9297
{resourceRoutes}
9398
{otherRoutes}
94-
<Route path="namespaces/:namespaceId/*" element={<NamespaceRoutes />} />
99+
<Route path="namespaces/:namespaceId">
100+
<Route path="*" element={<NamespaceRoutes />} />
101+
</Route>
95102
</Routes>
96103
);
97104
}

src/components/App/ExtensibilityRoutes.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { Suspense } from 'react';
22
import pluralize from 'pluralize';
33
import i18next from 'i18next';
4-
import { Route, useParams } from 'react-router-dom';
4+
import { Route, useParams } from 'react-router';
55
import { useRecoilValue } from 'recoil';
66
import { FlexibleColumnLayout } from '@ui5/webcomponents-react';
77
import { useTranslation } from 'react-i18next';
@@ -145,7 +145,6 @@ export const createExtensibilityRoutes = (extension, language, ...props) => {
145145
<React.Fragment key={urlPath}>
146146
<Route
147147
path={`${urlPath}/:resourceName?`}
148-
exact
149148
element={
150149
<Suspense fallback={<Spinner />}>
151150
<ColumnWrapper

src/components/App/IncorrectPath.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Button, MessageBox, Text } from '@ui5/webcomponents-react';
22
import { useTranslation } from 'react-i18next';
3-
import { useMatch, useNavigate } from 'react-router-dom';
3+
import { useMatch, useNavigate } from 'react-router';
44
import { useRecoilValue } from 'recoil';
55
import { extensionsState } from 'state/navigation/extensionsAtom';
66

src/components/App/NamespaceRoutes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useState } from 'react';
2-
import { Routes, Route, useParams } from 'react-router-dom';
2+
import { Routes, Route, useParams } from 'react-router';
33
import { useRecoilValue } from 'recoil';
44
import { useTranslation } from 'react-i18next';
55

0 commit comments

Comments
 (0)