|
@@ -1,31 +1,55 @@
|
|
|
-import {Component} from 'react';
|
|
|
+import React, {Component} from 'react';
|
|
|
import DocumentTitle from 'react-document-title';
|
|
|
|
|
|
import NoProjectMessage from 'app/components/noProjectMessage';
|
|
|
import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader';
|
|
|
-import {Organization} from 'app/types';
|
|
|
+import GroupStore from 'app/stores/groupStore';
|
|
|
+import {Organization, Project} from 'app/types';
|
|
|
+import {callIfFunction} from 'app/utils/callIfFunction';
|
|
|
import withOrganization from 'app/utils/withOrganization';
|
|
|
+import SampleEventAlert from 'app/views/organizationGroupDetails/sampleEventAlert';
|
|
|
|
|
|
type Props = {
|
|
|
organization: Organization;
|
|
|
+ projects: Project[];
|
|
|
};
|
|
|
|
|
|
-class IssueListContainer extends Component<Props> {
|
|
|
- getTitle() {
|
|
|
- return `Issues - ${this.props.organization.slug} - Sentry`;
|
|
|
- }
|
|
|
+type State = {
|
|
|
+ showSampleEventBanner: boolean;
|
|
|
+};
|
|
|
+class IssueListContainer extends Component<Props, State> {
|
|
|
+ state: State = {
|
|
|
+ showSampleEventBanner: false,
|
|
|
+ };
|
|
|
|
|
|
+ listener = GroupStore.listen(() => this.onGroupChange(), undefined);
|
|
|
render() {
|
|
|
const {organization, children} = this.props;
|
|
|
-
|
|
|
return (
|
|
|
<DocumentTitle title={this.getTitle()}>
|
|
|
- <GlobalSelectionHeader>
|
|
|
- <NoProjectMessage organization={organization}>{children}</NoProjectMessage>
|
|
|
- </GlobalSelectionHeader>
|
|
|
+ <React.Fragment>
|
|
|
+ {this.state.showSampleEventBanner && <SampleEventAlert />}
|
|
|
+ <GlobalSelectionHeader>
|
|
|
+ <NoProjectMessage organization={organization}>{children}</NoProjectMessage>
|
|
|
+ </GlobalSelectionHeader>
|
|
|
+ </React.Fragment>
|
|
|
</DocumentTitle>
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+ onGroupChange() {
|
|
|
+ this.setState({
|
|
|
+ showSampleEventBanner: GroupStore.getAllItemIds().length === 1,
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ componentWillUnmount() {
|
|
|
+ callIfFunction(this.listener);
|
|
|
+ }
|
|
|
+
|
|
|
+ getTitle() {
|
|
|
+ return `Issues - ${this.props.organization.slug} - Sentry`;
|
|
|
+ }
|
|
|
}
|
|
|
export default withOrganization(IssueListContainer);
|
|
|
export {IssueListContainer};
|