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 goToTrace #324

Merged
merged 1 commit into from
Feb 7, 2019
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
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