|
@@ -4,8 +4,7 @@ import * as ReactRouter from 'react-router';
|
|
|
import styled from '@emotion/styled';
|
|
|
|
|
|
import {t} from 'app/locale';
|
|
|
-import {Organization} from 'app/types';
|
|
|
-import withOrganization from 'app/utils/withOrganization';
|
|
|
+import {Organization, Project} from 'app/types';
|
|
|
import FeatureBadge from 'app/components/featureBadge';
|
|
|
import SentryDocumentTitle from 'app/components/sentryDocumentTitle';
|
|
|
import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader';
|
|
@@ -16,10 +15,13 @@ import EventView from 'app/utils/discover/eventView';
|
|
|
import space from 'app/styles/space';
|
|
|
import Button from 'app/components/button';
|
|
|
import ButtonBar from 'app/components/buttonBar';
|
|
|
+import withOrganization from 'app/utils/withOrganization';
|
|
|
+import withProjects from 'app/utils/withProjects';
|
|
|
|
|
|
import {generatePerformanceEventView, DEFAULT_STATS_PERIOD} from './data';
|
|
|
import Table from './table';
|
|
|
import Charts from './charts/index';
|
|
|
+import Onboarding from './onboarding';
|
|
|
|
|
|
enum FilterViews {
|
|
|
ALL_TRANSACTIONS = 'ALL_TRANSACTIONS',
|
|
@@ -32,6 +34,8 @@ type Props = {
|
|
|
organization: Organization;
|
|
|
location: Location;
|
|
|
router: ReactRouter.InjectedRouter;
|
|
|
+ projects: Project[];
|
|
|
+ loadingProjects: boolean;
|
|
|
};
|
|
|
|
|
|
type State = {
|
|
@@ -108,9 +112,16 @@ class PerformanceLanding extends React.Component<Props, State> {
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
- const {organization, location, router} = this.props;
|
|
|
+ const {organization, location, router, projects} = this.props;
|
|
|
const {eventView} = this.state;
|
|
|
|
|
|
+ const noFirstEvent =
|
|
|
+ projects.filter(
|
|
|
+ p =>
|
|
|
+ eventView.project.includes(parseInt(p.id, 10)) &&
|
|
|
+ p.firstTransactionEvent === false
|
|
|
+ ).length === eventView.project.length;
|
|
|
+
|
|
|
return (
|
|
|
<SentryDocumentTitle title={t('Performance')} objSlug={organization.slug}>
|
|
|
<GlobalSelectionHeader
|
|
@@ -129,23 +140,30 @@ class PerformanceLanding extends React.Component<Props, State> {
|
|
|
<div>
|
|
|
{t('Performance')} <FeatureBadge type="beta" />
|
|
|
</div>
|
|
|
- <div>{this.renderHeaderButtons()}</div>
|
|
|
+ {!noFirstEvent && <div>{this.renderHeaderButtons()}</div>}
|
|
|
</StyledPageHeader>
|
|
|
{this.renderError()}
|
|
|
- <Charts
|
|
|
- eventView={eventView}
|
|
|
- organization={organization}
|
|
|
- location={location}
|
|
|
- router={router}
|
|
|
- keyTransactions={this.state.currentView === 'KEY_TRANSACTIONS'}
|
|
|
- />
|
|
|
- <Table
|
|
|
- eventView={eventView}
|
|
|
- organization={organization}
|
|
|
- location={location}
|
|
|
- setError={this.setError}
|
|
|
- keyTransactions={this.state.currentView === 'KEY_TRANSACTIONS'}
|
|
|
- />
|
|
|
+ {noFirstEvent ? (
|
|
|
+ <Onboarding />
|
|
|
+ ) : (
|
|
|
+ <React.Fragment>
|
|
|
+ <Charts
|
|
|
+ eventView={eventView}
|
|
|
+ organization={organization}
|
|
|
+ location={location}
|
|
|
+ router={router}
|
|
|
+ keyTransactions={this.state.currentView === 'KEY_TRANSACTIONS'}
|
|
|
+ />
|
|
|
+ <Table
|
|
|
+ eventView={eventView}
|
|
|
+ projects={projects}
|
|
|
+ organization={organization}
|
|
|
+ location={location}
|
|
|
+ setError={this.setError}
|
|
|
+ keyTransactions={this.state.currentView === 'KEY_TRANSACTIONS'}
|
|
|
+ />
|
|
|
+ </React.Fragment>
|
|
|
+ )}
|
|
|
</LightWeightNoProjectMessage>
|
|
|
</PageContent>
|
|
|
</GlobalSelectionHeader>
|
|
@@ -164,4 +182,4 @@ export const StyledPageHeader = styled('div')`
|
|
|
margin-bottom: ${space(1)};
|
|
|
`;
|
|
|
|
|
|
-export default withOrganization(PerformanceLanding);
|
|
|
+export default withOrganization(withProjects(PerformanceLanding));
|