Skip to content

Commit 25261f4

Browse files
authored
DISPATCH-2234: Update JavaScript console packages for the 1.19.0 release (#1517)
* Error: A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>. * Error: You cannot render a <Router> inside another <Router>. You should never have more than one in your app. See https://reactrouter.com/docs/en/v6/upgrading/v5, and therein linked https://gist.github.com/mjackson/d54b40a094277b7afdd6b81f51a0393f * BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. * Module not found: Error: Can't resolve 'os' in '/home/jdanek/repos/qpid/qpid-dispatch/console/react/node_modules/rhea/lib' * facebook/create-react-app#11756 * downgraded and filled amqp/rhea#379
1 parent 4c8008b commit 25261f4

File tree

11 files changed

+5076
-5985
lines changed

11 files changed

+5076
-5985
lines changed

console/react/package-lock.json

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

console/react/package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
22
"name": "dispatch-console",
3-
"version": "1.17.0",
3+
"version": "1.19.0",
44
"private": true,
55
"dependencies": {
6-
"@patternfly/patternfly": "^4.125.3",
7-
"@patternfly/react-charts": "^6.15.14",
8-
"@patternfly/react-core": "^4.147.0",
9-
"@patternfly/react-icons": "^4.11.8",
10-
"@patternfly/react-styles": "^4.11.8",
11-
"@patternfly/react-table": "^4.29.37",
12-
"@patternfly/react-topology": "^4.9.42",
6+
"@patternfly/patternfly": "^4.171.1",
7+
"@patternfly/react-charts": "^6.45.15",
8+
"@patternfly/react-core": "^4.192.15",
9+
"@patternfly/react-icons": "^4.43.15",
10+
"@patternfly/react-styles": "^4.42.15",
11+
"@patternfly/react-table": "^4.61.15",
12+
"@patternfly/react-topology": "^4.39.15",
1313
"d3": "^3.5.17",
1414
"d3-queue": "^3.0.7",
15-
"express": "^4.17.1",
15+
"express": "^4.17.2",
1616
"font-awesome": "^4.7.0",
17-
"prop-types": "^15.7.2",
17+
"prop-types": "^15.8.1",
1818
"react": "^17.0.2",
1919
"react-dom": "^17.0.2",
2020
"react-fontawesome": "^1.7.1",
21-
"react-router-dom": "^5.2.0",
22-
"rhea": "^2.0.4",
21+
"react-router-dom": "^6.2.1",
22+
"rhea": "^3.0.0",
2323
"topojson-client": "^3.1.0"
2424
},
2525
"scripts": {
@@ -59,14 +59,14 @@
5959
},
6060
"devDependencies": {
6161
"@react-mock/localstorage": "^0.1.2",
62-
"@testing-library/jest-dom": "^5.14.1",
63-
"@testing-library/react": "^12.0.0",
64-
"@types/jest": "^27.0.1",
65-
"body-parser": "^1.19.0",
66-
"browserslist": "^4.16.8",
62+
"@testing-library/jest-dom": "^5.16.2",
63+
"@testing-library/react": "^12.1.3",
64+
"@types/jest": "^27.4.0",
65+
"body-parser": "^1.19.2",
66+
"browserslist": "^4.19.1",
6767
"jest-axe": "^5.0.1",
68-
"prettier": "^2.3.2",
68+
"prettier": "^2.5.1",
6969
"react-scripts": "^4.0.3",
70-
"typescript": "^4.3.5"
70+
"typescript": "^4.5.5"
7171
}
7272
}

console/react/src/App.js

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ specific language governing permissions and limitations
1717
under the License.
1818
*/
1919

20-
import React, { Component } from "react";
21-
import { HashRouter as Router, Route } from "react-router-dom";
20+
import React from "react";
21+
import { unstable_HistoryRouter as HistoryRouter } from "react-router-dom";
22+
import { createHashHistory } from "history";
2223

2324
import "@patternfly/patternfly/patternfly.css";
2425
import "@patternfly/patternfly/patternfly-addons.css";
@@ -28,26 +29,22 @@ import "@patternfly/patternfly/components/Nav/nav.css";
2829
import { QDRService } from "./common/qdrService";
2930
import "./App.css";
3031
import PageLayout from "./overview/dashboard/layout";
31-
class App extends Component {
32-
state = {};
33-
34-
render() {
35-
// service is passed in to make testing easier
36-
const service = new QDRService();
37-
// also, a router is used here to provide PageLayout with a history property
38-
return (
39-
<Router>
40-
<div className="App pf-m-redhat-font">
41-
<Route
42-
path="/"
43-
render={props => (
44-
<PageLayout service={service} {...props} config={this.props.config} />
45-
)}
46-
/>
47-
</div>
48-
</Router>
49-
);
50-
}
32+
33+
function App(props) {
34+
35+
// service is passed in to make testing easier
36+
const service = new QDRService();
37+
38+
// also, a router is used here to provide PageLayout with a history property
39+
const history = createHashHistory({ window });
40+
41+
return (
42+
<HistoryRouter history={history}>
43+
<div className="App pf-m-redhat-font">
44+
<PageLayout service={service} {...props} history={history} config={props.config}/>
45+
</div>
46+
</HistoryRouter>
47+
);
5148
}
5249

5350
export default App;

console/react/src/details/createTablePage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import {
4343

4444
import { cellWidth } from "@patternfly/react-table";
4545
import { Card, CardBody } from "@patternfly/react-core";
46-
import { Redirect } from "react-router-dom";
46+
import { Navigate } from "react-router-dom";
4747
import { dataMap as detailsDataMap, defaultData } from "./entityData";
4848

4949
class CreateTablePage extends React.Component {
@@ -263,7 +263,7 @@ class CreateTablePage extends React.Component {
263263
render() {
264264
if (this.state.redirect) {
265265
return (
266-
<Redirect
266+
<Navigate
267267
to={{
268268
pathname: this.state.redirectPath,
269269
state: this.state.redirectState

console/react/src/details/detailsTablePage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import {
3737
TableVariant
3838
} from "@patternfly/react-table";
3939
import { Card, CardBody } from "@patternfly/react-core";
40-
import { Redirect } from "react-router-dom";
40+
import { Navigate } from "react-router-dom";
4141
import { dataMap } from "../overview/entityData";
4242
import { dataMap as detailsDataMap, defaultData } from "./entityData";
4343
import Updated from "../common/updated";
@@ -171,7 +171,7 @@ class DetailsTablePage extends React.Component {
171171
render() {
172172
if (this.state.redirect) {
173173
return (
174-
<Redirect
174+
<Navigate
175175
to={{
176176
pathname: this.state.redirectPath,
177177
state: this.state.redirectState

console/react/src/details/entityListTable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
TableVariant
2828
} from "@patternfly/react-table";
2929
import { Button, Pagination } from "@patternfly/react-core";
30-
import { Redirect } from "react-router-dom";
30+
import { Navigate } from "react-router-dom";
3131
import TableToolbar from "../common/tableToolbar";
3232
import { dataMap, defaultData } from "./entityData";
3333
import EmptyTable from "./emptyTablePage";
@@ -402,7 +402,7 @@ class EntityListTable extends React.Component {
402402

403403
if (this.state.redirect) {
404404
return (
405-
<Redirect
405+
<Navigate
406406
to={{
407407
pathname: this.dataSource.detailPath || "/details",
408408
state: this.state.redirectState

console/react/src/details/updateTablePage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import {
4343

4444
import { cellWidth } from "@patternfly/react-table";
4545
import { Card, CardBody } from "@patternfly/react-core";
46-
import { Redirect } from "react-router-dom";
46+
import { Navigate } from "react-router-dom";
4747
import { dataMap as detailsDataMap, defaultData } from "./entityData";
4848
import { utils } from "../common/amqp/utilities";
4949

@@ -270,7 +270,7 @@ class UpdateTablePage extends React.Component {
270270
render() {
271271
if (this.state.redirect) {
272272
return (
273-
<Redirect
273+
<Navigate
274274
to={{
275275
pathname: this.state.redirectPath,
276276
state: this.state.redirectState

0 commit comments

Comments
 (0)