Skip to content

Commit

Permalink
Merge pull request jaegertracing#383 from rubenvp8510/json-load-issue
Browse files Browse the repository at this point in the history
Handle no search query when a JSON file is loaded
Signed-off-by: vvvprabhakar <[email protected]>
  • Loading branch information
everett980 authored May 22, 2019
2 parents e828f0d + 673e059 commit c123e71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type SearchResultsProps = {
hideGraph: boolean,
loading: boolean,
maxTraceDuration: number,
queryOfResults: SearchQuery,
queryOfResults?: SearchQuery,
showStandaloneLink: boolean,
skipMessage?: boolean,
traces: TraceSummary[],
Expand Down Expand Up @@ -84,7 +84,7 @@ export const sortFormSelector = formValueSelector('traceResultsSort');
export default class SearchResults extends React.PureComponent<SearchResultsProps> {
props: SearchResultsProps;

static defaultProps = { skipMessage: false };
static defaultProps = { skipMessage: false, queryOfResults: undefined };

toggleComparison = (traceID: string, remove: boolean) => {
const { cohortAddTrace, cohortRemoveTrace } = this.props;
Expand Down Expand Up @@ -132,7 +132,7 @@ export default class SearchResults extends React.PureComponent<SearchResultsProp
);
}
const cohortIds = new Set(diffCohort.map(datum => datum.id));
const searchUrl = getUrl(stripEmbeddedState(queryOfResults));
const searchUrl = queryOfResults ? getUrl(stripEmbeddedState(queryOfResults)) : getUrl();
return (
<div>
<div>
Expand Down
2 changes: 1 addition & 1 deletion packages/jaeger-ui/src/components/SearchTracePage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class SearchTracePageImpl extends Component {

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

Expand Down

0 comments on commit c123e71

Please sign in to comment.