diff --git a/packages/jaeger-ui/package.json b/packages/jaeger-ui/package.json index eec832bb28..7a77eb9f5e 100644 --- a/packages/jaeger-ui/package.json +++ b/packages/jaeger-ui/package.json @@ -27,7 +27,8 @@ "react-app-rewired": "^1.4.0", "react-scripts": "^1.0.11", "react-test-renderer": "^15.6.1", - "sinon": "^3.2.1" + "sinon": "^3.2.1", + "source-map-explorer": "^1.6.0" }, "dependencies": { "@jaegertracing/plexus": "0.0.1-dev.3", @@ -59,7 +60,7 @@ "react-dom": "^16.3.2", "react-ga": "^2.4.1", "react-helmet": "^5.1.3", - "react-icons": "^2.2.7", + "react-icons": "2.2.7", "react-metrics": "^2.3.2", "react-redux": "^5.0.6", "react-router-dom": "^4.1.2", @@ -79,6 +80,7 @@ "u-basscss": "2.0.0" }, "scripts": { + "analyze": "source-map-explorer build/static/js/main.*", "build": "REACT_APP_VSN_STATE=$(../../scripts/get-tracking-version.js) react-app-rewired build", "coverage": "yarn run test -- --coverage", "start:ga-debug": diff --git a/packages/jaeger-ui/src/components/App/Page.js b/packages/jaeger-ui/src/components/App/Page.js index fe18c06f6a..001bc00bc3 100644 --- a/packages/jaeger-ui/src/components/App/Page.js +++ b/packages/jaeger-ui/src/components/App/Page.js @@ -16,20 +16,24 @@ import * as React from 'react'; import { Layout } from 'antd'; +import cx from 'classnames'; import Helmet from 'react-helmet'; import { connect } from 'react-redux'; -import type { Location } from 'react-router-dom'; import { withRouter } from 'react-router-dom'; -import { isEmbed } from '../../utils/embedded'; + import TopNav from './TopNav'; import { trackPageView } from '../../utils/tracking'; +import type { ReduxState } from '../../types'; +import type { EmbeddedState } from '../../types/embedded'; + import './Page.css'; type Props = { + children: React.Node, + embedded: EmbeddedState, pathname: string, search: string, - children: React.Node, }; const { Header, Content } = Layout; @@ -52,16 +56,18 @@ export class PageImpl extends React.Component { } render() { + const { embedded } = this.props; + const contentCls = cx({ 'Page--content': !embedded }); return (
- {!isEmbed(this.props.search) && ( + {!embedded && (
)} - {this.props.children} + {this.props.children}
); @@ -69,9 +75,10 @@ export class PageImpl extends React.Component { } // export for tests -export function mapStateToProps(state: { router: { location: Location } }) { +export function mapStateToProps(state: ReduxState) { + const { embedded } = state; const { pathname, search } = state.router.location; - return { pathname, search }; + return { embedded, pathname, search }; } export default withRouter(connect(mapStateToProps)(PageImpl)); diff --git a/packages/jaeger-ui/src/components/App/TraceIDSearchInput.js b/packages/jaeger-ui/src/components/App/TraceIDSearchInput.js index 1fd546578d..f880c04f88 100644 --- a/packages/jaeger-ui/src/components/App/TraceIDSearchInput.js +++ b/packages/jaeger-ui/src/components/App/TraceIDSearchInput.js @@ -20,7 +20,7 @@ import { withRouter } from 'react-router-dom'; import type { RouterHistory } from 'react-router-dom'; -import prefixUrl from '../../utils/prefix-url'; +import { getUrl } from '../../components/TracePage/url'; import './TraceIDSearchInput.css'; @@ -35,7 +35,7 @@ class TraceIDSearchInput extends React.PureComponent { event.preventDefault(); const value = event.target.elements.idInput.value; if (value) { - this.props.history.push(prefixUrl(`/trace/${value}`)); + this.props.history.push(getUrl(value)); } }; diff --git a/packages/jaeger-ui/src/components/App/index.js b/packages/jaeger-ui/src/components/App/index.js index 1a5ac67ea5..9415322475 100644 --- a/packages/jaeger-ui/src/components/App/index.js +++ b/packages/jaeger-ui/src/components/App/index.js @@ -32,8 +32,9 @@ import JaegerAPI, { DEFAULT_API_ROOT } from '../../api/jaeger'; import configureStore from '../../utils/configure-store'; import prefixUrl from '../../utils/prefix-url'; -import './index.css'; +import '../common/vars.css'; import '../common/utils.css'; +import './index.css'; const history = createHistory(); diff --git a/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ResultItemTitle.js b/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ResultItemTitle.js index 0839c98bc9..b3588b4af4 100644 --- a/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ResultItemTitle.js +++ b/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/ResultItemTitle.js @@ -67,6 +67,7 @@ export default class ResultItemTitle extends React.PureComponent { traceName, disableComparision, } = this.props; + // Use a div when the ResultItemTitle doesn't link to anything let WrapperComponent = 'div'; const wrapperProps: { [string]: string } = { className: 'ResultItemTitle--item ub-flex-auto' }; if (linkTo) { diff --git a/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/index.css b/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/index.css index 65579b78ac..ed61fc1911 100644 --- a/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/index.css +++ b/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/index.css @@ -16,13 +16,15 @@ limitations under the License. .SearchResults--header { border: 1px solid #e6e6e6; - color: rgba(0, 0, 0, 0.85); + color: var(--tx-color-title); margin-bottom: 1.25rem; } .SearchResults--headerOverview { + align-items: center; background-color: #f5f5f5; border-top: 1px solid #e6e6e6; + display: flex; padding: 1rem; } diff --git a/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/index.js b/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/index.js index 4f5f533e2a..cbdb34aef2 100644 --- a/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/index.js +++ b/packages/jaeger-ui/src/components/SearchTracePage/SearchResults/index.js @@ -15,21 +15,25 @@ // limitations under the License. import * as React from 'react'; -import { Select, Button } from 'antd'; +import { Select } from 'antd'; +import { Link } from 'react-router-dom'; import { Field, reduxForm, formValueSelector } from 'redux-form'; import DiffSelection from './DiffSelection'; import * as markers from './index.markers'; import ResultItem from './ResultItem'; import ScatterPlot from './ScatterPlot'; +import { getUrl } from '../url'; import LoadingIndicator from '../../common/LoadingIndicator'; +import NewWindowIcon from '../../common/NewWindowIcon'; +import { getLocation } from '../../TracePage/url'; import * as orderBy from '../../../model/order-by'; import { getPercentageOfDuration } from '../../../utils/date'; -import prefixUrl from '../../../utils/prefix-url'; +import { stripEmbeddedState } from '../../../utils/embedded-url'; import reduxFormFieldAdapter from '../../../utils/redux-form-field-adapter'; -import { VERSION_API } from '../../../utils/embedded'; import type { FetchedTrace } from '../../../types'; +import type { SearchQuery } from '../../../types/search'; import './index.css'; @@ -37,12 +41,13 @@ type SearchResultsProps = { cohortAddTrace: string => void, cohortRemoveTrace: string => void, diffCohort: FetchedTrace[], + disableComparisons: boolean, goToTrace: string => void, - embed?: boolean, - hideGraph?: boolean, + hideGraph: boolean, loading: boolean, - getSearchURL: () => string, maxTraceDuration: number, + queryOfResults: SearchQuery, + showStandaloneLink: boolean, skipMessage?: boolean, traces: TraceSummary[], }; @@ -54,7 +59,7 @@ const Option = Select.Option; */ function SelectSortImpl() { return ( -