Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix browser back button not working correctly #110

Merged
merged 2 commits into from
Oct 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
});