From 673e05962cc4f257174915663f81c622914ae7de Mon Sep 17 00:00:00 2001 From: Ruben Vargas Date: Mon, 20 May 2019 16:13:05 -0500 Subject: [PATCH] Validate when there is no query but a JSON file is loaded Signed-off-by: Ruben Vargas Signed-off-by: vvvprabhakar --- .../src/components/SearchTracePage/SearchResults/index.js | 6 +++--- packages/jaeger-ui/src/components/SearchTracePage/index.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/index.js b/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/index.js index de845093e4..82c6d343cd 100644 --- a/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/index.js +++ b/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/index.js @@ -46,7 +46,7 @@ type SearchResultsProps = { hideGraph: boolean, loading: boolean, maxTraceDuration: number, - queryOfResults: SearchQuery, + queryOfResults?: SearchQuery, showStandaloneLink: boolean, skipMessage?: boolean, traces: TraceSummary[], @@ -84,7 +84,7 @@ export const sortFormSelector = formValueSelector('traceResultsSort'); export default class SearchResults extends React.PureComponent { props: SearchResultsProps; - static defaultProps = { skipMessage: false }; + static defaultProps = { skipMessage: false, queryOfResults: undefined }; toggleComparison = (traceID: string, remove: boolean) => { const { cohortAddTrace, cohortRemoveTrace } = this.props; @@ -132,7 +132,7 @@ export default class SearchResults extends React.PureComponent datum.id)); - const searchUrl = getUrl(stripEmbeddedState(queryOfResults)); + const searchUrl = queryOfResults ? getUrl(stripEmbeddedState(queryOfResults)) : getUrl(); return (
diff --git a/packages/jaeger-ui/src/components/SearchTracePage/index.js b/packages/jaeger-ui/src/components/SearchTracePage/index.js index 3b73ed8cf7..8eb384c7af 100644 --- a/packages/jaeger-ui/src/components/SearchTracePage/index.js +++ b/packages/jaeger-ui/src/components/SearchTracePage/index.js @@ -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 })); };