From f649418aabc858fac1d7e20b5b0ffcc1c7ee6e5b Mon Sep 17 00:00:00 2001 From: ebb-tide Date: Wed, 4 Apr 2018 12:03:47 -0700 Subject: [PATCH 1/2] Add @types/react-router to dev dependencies --- ui/package.json | 1 + ui/yarn.lock | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/ui/package.json b/ui/package.json index 19a8274f8..7f7d463e2 100644 --- a/ui/package.json +++ b/ui/package.json @@ -40,6 +40,7 @@ "@types/node": "^9.4.6", "@types/prop-types": "^15.5.2", "@types/react": "^16.0.38", + "@types/react-router": "^4.0.23", "autoprefixer": "^6.3.1", "babel-core": "^6.5.1", "babel-eslint": "6.1.2", diff --git a/ui/yarn.lock b/ui/yarn.lock index cb262a2d7..2ce233554 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -41,6 +41,10 @@ "@types/cheerio" "*" "@types/react" "*" +"@types/history@*": + version "4.6.2" + resolved "https://registry.yarnpkg.com/@types/history/-/history-4.6.2.tgz#12cfaba693ba20f114ed5765467ff25fdf67ddb0" + "@types/jest@^22.1.4": version "22.2.0" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-22.2.0.tgz#55ce83139f7ad1b48b414c3927746614c6963c0f" @@ -57,6 +61,13 @@ version "15.5.2" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.5.2.tgz#3c6b8dceb2906cc87fe4358e809f9d20c8d59be1" +"@types/react-router@^4.0.23": + version "4.0.23" + resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-4.0.23.tgz#d0509dcbdb1c686aed8f3d5cb186f42e5fbe7c2a" + dependencies: + "@types/history" "*" + "@types/react" "*" + "@types/react@*", "@types/react@^16.0.38": version "16.0.40" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.0.40.tgz#caabc2296886f40b67f6fc80f0f3464476461df9" From debfee3e4ee8c756614b183709ffcf45ccdade53 Mon Sep 17 00:00:00 2001 From: Andrew Watkins Date: Wed, 4 Apr 2018 14:21:06 -0700 Subject: [PATCH 2/2] Update react-router types version --- ui/package.json | 2 +- ui/src/CheckSources.tsx | 9 +++++++-- .../data_explorer/containers/DataExplorerPage.tsx | 3 +-- ui/tsconfig.json | 3 ++- ui/yarn.lock | 14 +++++++------- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/ui/package.json b/ui/package.json index 7f7d463e2..46b603580 100644 --- a/ui/package.json +++ b/ui/package.json @@ -40,7 +40,7 @@ "@types/node": "^9.4.6", "@types/prop-types": "^15.5.2", "@types/react": "^16.0.38", - "@types/react-router": "^4.0.23", + "@types/react-router": "3", "autoprefixer": "^6.3.1", "babel-core": "^6.5.1", "babel-eslint": "6.1.2", diff --git a/ui/src/CheckSources.tsx b/ui/src/CheckSources.tsx index a0289076d..67083c15d 100644 --- a/ui/src/CheckSources.tsx +++ b/ui/src/CheckSources.tsx @@ -1,6 +1,7 @@ import React, {ReactElement, Component} from 'react' import PropTypes from 'prop-types' -import {withRouter, Params, Router, Location} from 'react-router' +import {withRouter, InjectedRouter} from 'react-router' +import {Location} from 'history' import {connect} from 'react-redux' import {bindActionCreators} from 'redux' @@ -32,12 +33,16 @@ interface State { isFetching: boolean } +interface Params { + sourceID: string +} + interface Props { getSources: () => void sources: Source[] children: ReactElement params: Params - router: Router + router: InjectedRouter location: Location auth: Auth notify: () => void diff --git a/ui/src/data_explorer/containers/DataExplorerPage.tsx b/ui/src/data_explorer/containers/DataExplorerPage.tsx index de6bfd0fd..a4a422478 100644 --- a/ui/src/data_explorer/containers/DataExplorerPage.tsx +++ b/ui/src/data_explorer/containers/DataExplorerPage.tsx @@ -1,5 +1,4 @@ import React, {PureComponent} from 'react' -import {withRouter} from 'react-router' import DataExplorer from './DataExplorer' import {Source} from 'src/types' @@ -18,4 +17,4 @@ class DataExplorerPage extends PureComponent { } } -export default withRouter(DataExplorerPage) +export default DataExplorerPage diff --git a/ui/tsconfig.json b/ui/tsconfig.json index f5cb170d8..c585ab2e3 100644 --- a/ui/tsconfig.json +++ b/ui/tsconfig.json @@ -7,7 +7,8 @@ "enzyme", "react", "prop-types", - "jest" + "jest", + "react-router" ], "target": "es6", "module": "es2015", diff --git a/ui/yarn.lock b/ui/yarn.lock index 2ce233554..dfbdf9154 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -41,9 +41,9 @@ "@types/cheerio" "*" "@types/react" "*" -"@types/history@*": - version "4.6.2" - resolved "https://registry.yarnpkg.com/@types/history/-/history-4.6.2.tgz#12cfaba693ba20f114ed5765467ff25fdf67ddb0" +"@types/history@^3": + version "3.2.2" + resolved "https://registry.yarnpkg.com/@types/history/-/history-3.2.2.tgz#b6affa240cb10b5f841c6443d8a24d7f3fc8bb0c" "@types/jest@^22.1.4": version "22.2.0" @@ -61,11 +61,11 @@ version "15.5.2" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.5.2.tgz#3c6b8dceb2906cc87fe4358e809f9d20c8d59be1" -"@types/react-router@^4.0.23": - version "4.0.23" - resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-4.0.23.tgz#d0509dcbdb1c686aed8f3d5cb186f42e5fbe7c2a" +"@types/react-router@3": + version "3.0.15" + resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-3.0.15.tgz#b55b0dc5ad8f6fa66b609f0efc390b191381d082" dependencies: - "@types/history" "*" + "@types/history" "^3" "@types/react" "*" "@types/react@*", "@types/react@^16.0.38":