Skip to content

Commit

Permalink
Fix goToTrace (#323) (#324)
Browse files Browse the repository at this point in the history
Signed-off-by: Takuma Igarashi <ig.lhound@gmail.com>
  • Loading branch information
tacigar authored and tiffon committed Feb 7, 2019
1 parent f66f737 commit 5d0e712
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/jaeger-ui/src/components/SearchTracePage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import store from 'store';

import SearchForm from './SearchForm';
import SearchResults, { sortFormSelector } from './SearchResults';
import { isSameQuery } from './url';
import { isSameQuery, getUrl } from './url';
import * as jaegerApiActions from '../../actions/jaeger-api';
import ErrorMessage from '../common/ErrorMessage';
import LoadingIndicator from '../common/LoadingIndicator';
Expand All @@ -33,6 +33,7 @@ import { actions as traceDiffActions } from '../TraceDiff/duck';
import { fetchedState } from '../../constants';
import { sortTraces } from '../../model/search';
import getLastXformCacher from '../../utils/get-last-xform-cacher';
import { stripEmbeddedState } from '../../utils/embedded-url';

import './index.css';
import JaegerLogo from '../../img/jaeger-logo.svg';
Expand Down Expand Up @@ -66,7 +67,8 @@ export class SearchTracePageImpl extends Component {

goToTrace = traceID => {
const { queryOfResults } = this.props;
this.props.history.push(getTraceLocation(traceID, { fromSearch: queryOfResults }));
const searchUrl = getUrl(stripEmbeddedState(queryOfResults));
this.props.history.push(getTraceLocation(traceID, { fromSearch: searchUrl }));
};

render() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('<SearchTracePage>', () => {
expect(historyPush.mock.calls.length).toBe(1);
expect(historyPush.mock.calls[0][0]).toEqual({
pathname: `/trace/${traceID}`,
state: { fromSearch: queryOfResults },
state: { fromSearch: '/search?' },
});
});

Expand Down

0 comments on commit 5d0e712

Please sign in to comment.