From e3428c8ccd73bad241925b6be3dd1eca64d439bf Mon Sep 17 00:00:00 2001 From: Joe Farro Date: Fri, 27 Oct 2017 03:09:18 -0400 Subject: [PATCH 1/2] Fix #94 browser back button not working Signed-off-by: Joe Farro Signed-off-by: vvvprabhakar --- src/components/App/Page.js | 5 +++-- src/components/SearchTracePage/TraceSearchForm.js | 2 +- src/components/SearchTracePage/index.js | 2 +- src/utils/configure-store.js | 2 +- src/utils/configure-store.test.js | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/App/Page.js b/src/components/App/Page.js index ef09fca9ed..d07a53565c 100644 --- a/src/components/App/Page.js +++ b/src/components/App/Page.js @@ -18,6 +18,7 @@ import * as React from 'react'; import Helmet from 'react-helmet'; import { connect } from 'react-redux'; import type { Location } from 'react-router-dom'; +import { withRouter } from 'react-router-dom'; import TopNav from './TopNav'; import type { Config } from '../../types/config'; @@ -64,8 +65,8 @@ class Page extends React.Component { function mapStateToProps(state, ownProps) { const { config } = state; - const { location } = state.routing; + const { location } = state.router; return { ...ownProps, config, location }; } -export default connect(mapStateToProps)(Page); +export default withRouter(connect(mapStateToProps)(Page)); diff --git a/src/components/SearchTracePage/TraceSearchForm.js b/src/components/SearchTracePage/TraceSearchForm.js index 7f59a5dea6..202e4af578 100644 --- a/src/components/SearchTracePage/TraceSearchForm.js +++ b/src/components/SearchTracePage/TraceSearchForm.js @@ -213,7 +213,7 @@ const mapStateToProps = state => { minDuration, lookback, traceID: traceIDParams, - } = queryString.parse(state.routing.location.search); + } = queryString.parse(state.router.location.search); const nowInMicroseconds = moment().valueOf() * 1000; const today = formatDate(nowInMicroseconds); diff --git a/src/components/SearchTracePage/index.js b/src/components/SearchTracePage/index.js index b55dc1cf1e..5ba3d124df 100644 --- a/src/components/SearchTracePage/index.js +++ b/src/components/SearchTracePage/index.js @@ -200,7 +200,7 @@ const stateServicesXformer = getLastXformCacher(stateServices => { }); function mapStateToProps(state) { - const query = queryString.parse(state.routing.location.search); + const query = queryString.parse(state.router.location.search); const isHomepage = !Object.keys(query).length; const { traces, maxDuration, loading, traceError } = stateTraceXformer(state.trace); const { services, serviceError } = stateServicesXformer(state.services); diff --git a/src/utils/configure-store.js b/src/utils/configure-store.js index 703dc0d908..c722e817c1 100644 --- a/src/utils/configure-store.js +++ b/src/utils/configure-store.js @@ -25,7 +25,7 @@ export default function configureStore(history) { combineReducers({ ...jaegerReducers, traceTimeline: traceTimelineViewReducer, - routing: routerReducer, + router: routerReducer, }), compose( applyMiddleware( diff --git a/src/utils/configure-store.test.js b/src/utils/configure-store.test.js index 5fe0012dda..de4fcf1ef9 100644 --- a/src/utils/configure-store.test.js +++ b/src/utils/configure-store.test.js @@ -24,7 +24,7 @@ it('configureStore() should return the redux store', () => { expect(typeof store.subscribe === 'function').toBeTruthy(); expect(typeof store.replaceReducer === 'function').toBeTruthy(); - expect({}.hasOwnProperty.call(store.getState(), 'routing')).toBeTruthy(); + expect({}.hasOwnProperty.call(store.getState(), 'router')).toBeTruthy(); expect({}.hasOwnProperty.call(store.getState(), 'trace')).toBeTruthy(); expect({}.hasOwnProperty.call(store.getState(), 'form')).toBeTruthy(); }); From b41a5b5527d7e231efcf37710d4648ef372fd610 Mon Sep 17 00:00:00 2001 From: Joe Farro Date: Fri, 27 Oct 2017 03:14:39 -0400 Subject: [PATCH 2/2] Add #110 to changelog Signed-off-by: Joe Farro Signed-off-by: vvvprabhakar --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b80e91f8ea..7a3bd55db1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ -# Changes +# Changes merged into master + + +### [#110](https://github.com/jaegertracing/jaeger-ui/pull/110) Fix browser back button not working correctly + +Fix bug causing browser back button to not work correctly. Fixes [#94](https://github.com/jaegertracing/jaeger-ui/issues/94). ### [#107](https://github.com/jaegertracing/jaeger-ui/pull/107) Embed UI config