Skip to content

Commit

Permalink
[Deps]: Upgraded react-router-dom
Browse files Browse the repository at this point in the history
Signed-off-by: YASH PANDEY <[email protected]>
  • Loading branch information
yashpandey06 committed Jan 7, 2025
1 parent c9ccd8b commit 23f3396
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 63 deletions.
5 changes: 2 additions & 3 deletions packages/jaeger-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@types/object-hash": "^3.0.2",
"@types/react": "^18.3.11",
"@types/react-helmet": "^6.1.5",
"@types/react-router-dom": "^5.1.0",
"@types/react-router-dom": "^5.3.3",
"@types/react-window": "^1.8.0",
"@types/redux-actions": "2.2.1",
"@types/redux-form": "^8.3.10",
Expand Down Expand Up @@ -77,8 +77,7 @@
"react-is": "^18.2.0",
"react-json-view-lite": "2.0.1",
"react-redux": "^8.1.2",
"react-router-dom": "5.3.4",
"react-router-dom-v5-compat": "^6.24.0",
"react-router-dom": "7.1.1",
"react-vis": "1.11.12",
"react-vis-force": "^0.3.1",
"react-window": "^1.8.10",
Expand Down
72 changes: 17 additions & 55 deletions packages/jaeger-ui/src/components/App/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,29 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { Route, Redirect, Switch, Router } from 'react-router-dom';

import { Routes, Route, Navigate } from 'react-router-dom';
import { ConfigProvider } from 'antd';
import { defaultTheme } from '@ant-design/compatible';
import NotFound from './NotFound';
import Page from './Page';
import DependencyGraph from '../DependencyGraph';
import { ROUTE_PATH as dependenciesPath } from '../DependencyGraph/url';
import DeepDependencies from '../DeepDependencies';
import { ROUTE_PATH as deepDependenciesPath } from '../DeepDependencies/url';
import QualityMetrics from '../QualityMetrics';
import { ROUTE_PATH as qualityMetricsPath } from '../QualityMetrics/url';
import SearchTracePage from '../SearchTracePage';
import { ROUTE_PATH as searchPath } from '../SearchTracePage/url';
import TraceDiff from '../TraceDiff';
import { ROUTE_PATH as traceDiffPath } from '../TraceDiff/url';
import TracePage from '../TracePage';
import { ROUTE_PATH as tracePath } from '../TracePage/url';
import MonitorATMPage from '../Monitor';
import { ROUTE_PATH as monitorATMPath } from '../Monitor/url';
import JaegerAPI, { DEFAULT_API_ROOT } from '../../api/jaeger';
import processScripts from '../../utils/config/process-scripts';
import prefixUrl from '../../utils/prefix-url';
import { store } from '../../utils/configure-store';

import '../common/vars.css';
import '../common/utils.css';
import 'antd/dist/reset.css';
import './index.css';
import { history, store } from '../../utils/configure-store';
import { HistoryProvider } from '../../utils/useHistory';

const jaegerTheme = {
token: {
Expand Down Expand Up @@ -88,49 +78,21 @@ export default class JaegerUIApp extends Component {
return (
<ConfigProvider theme={jaegerTheme}>
<Provider store={store}>
<HistoryProvider history={history}>
<Router history={history}>
<Page>
<Switch>
<Route path={searchPath}>
<SearchTracePage />
</Route>
<Route path={traceDiffPath}>
<TraceDiff />
</Route>
<Route path={tracePath}>
<TracePage />
</Route>
<Route path={dependenciesPath}>
<DependencyGraph />
</Route>
<Route path={deepDependenciesPath}>
<DeepDependencies />
</Route>
<Route path={qualityMetricsPath}>
<QualityMetrics />
</Route>
<Route path={monitorATMPath}>
<MonitorATMPage />
</Route>

<Route exact path="/">
<Redirect to={searchPath} />
</Route>
<Route exact path={prefixUrl()}>
<Redirect to={searchPath} />
</Route>
<Route exact path={prefixUrl('/')}>
<Redirect to={searchPath} />
</Route>

<Route>
<NotFound />
</Route>
</Switch>
</Page>
</Router>
</HistoryProvider>
<Page>
<Routes>
<Route path="/search" element={<SearchTracePage />} />
<Route path="/tracediff" element={<TraceDiff />} />
<Route path="/trace" element={<TracePage />} />
<Route path="/dependencies" element={<DependencyGraph />} />
<Route path="/deep-dependencies" element={<DeepDependencies />} />
<Route path="/quality-metrics" element={<QualityMetrics />} />
<Route path="/monitor-atm" element={<MonitorATMPage />} />
<Route path="/" element={<Navigate to="/search" replace />} />
<Route path={prefixUrl()} element={<Navigate to="/search" replace />} />
<Route path={prefixUrl('/')} element={<Navigate to="/search" replace />} />
<Route path="*" element={<NotFound />} />
</Routes>
</Page>
</Provider>
</ConfigProvider>
);
Expand Down
5 changes: 0 additions & 5 deletions packages/jaeger-ui/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import './site-prefix';

import React from 'react';
import { BrowserRouter } from 'react-router-dom';
import { CompatRouter } from 'react-router-dom-v5-compat';
import { createRoot } from 'react-dom/client';

import JaegerUIApp from './components/App';
Expand All @@ -42,18 +41,14 @@ if (typeof trackingContext === 'object' && trackingContext !== null) {
trackingContext.context(() => {
root.render(
<BrowserRouter>
<CompatRouter>
<JaegerUIApp />
</CompatRouter>
</BrowserRouter>
);
});
} else {
root.render(
<BrowserRouter>
<CompatRouter>
<JaegerUIApp />
</CompatRouter>
</BrowserRouter>
);
}

0 comments on commit 23f3396

Please sign in to comment.