Skip to content

Commit

Permalink
Merge pull request #110 from jaegertracing/issue-94-browser-back-button
Browse files Browse the repository at this point in the history
Fix browser back button not working correctly
  • Loading branch information
tiffon committed Oct 27, 2017
2 parents 01fd7f4 + df3104a commit 899c8e7
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/components/App/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -64,8 +65,8 @@ class Page extends React.Component<PageProps> {

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));
2 changes: 1 addition & 1 deletion src/components/SearchTracePage/TraceSearchForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchTracePage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/configure-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function configureStore(history) {
combineReducers({
...jaegerReducers,
traceTimeline: traceTimelineViewReducer,
routing: routerReducer,
router: routerReducer,
}),
compose(
applyMiddleware(
Expand Down
2 changes: 1 addition & 1 deletion src/utils/configure-store.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

0 comments on commit 899c8e7

Please sign in to comment.