|
@@ -5,6 +5,7 @@ import pick from 'lodash/pick';
|
|
|
|
|
|
import {Client} from 'sentry/api';
|
|
|
import EmptyStateWarning from 'sentry/components/emptyStateWarning';
|
|
|
+import EnvironmentPageFilter from 'sentry/components/environmentPageFilter';
|
|
|
import EventsTable from 'sentry/components/eventsTable/eventsTable';
|
|
|
import * as Layout from 'sentry/components/layouts/thirds';
|
|
|
import LoadingError from 'sentry/components/loadingError';
|
|
@@ -14,14 +15,16 @@ import {Panel, PanelBody} from 'sentry/components/panels';
|
|
|
import SearchBar from 'sentry/components/searchBar';
|
|
|
import {t} from 'sentry/locale';
|
|
|
import space from 'sentry/styles/space';
|
|
|
-import {Group} from 'sentry/types';
|
|
|
+import {Group, Organization} from 'sentry/types';
|
|
|
import {Event} from 'sentry/types/event';
|
|
|
import parseApiError from 'sentry/utils/parseApiError';
|
|
|
import withApi from 'sentry/utils/withApi';
|
|
|
+import withOrganization from 'sentry/utils/withOrganization';
|
|
|
|
|
|
type Props = {
|
|
|
api: Client;
|
|
|
group: Group;
|
|
|
+ organization: Organization;
|
|
|
} & RouteComponentProps<{groupId: string; orgId: string}, {}>;
|
|
|
|
|
|
type State = {
|
|
@@ -156,16 +159,22 @@ class GroupEvents extends React.Component<Props, State> {
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
+ const hasPageFilters =
|
|
|
+ this.props.organization.features.includes('selection-filters-v2');
|
|
|
+
|
|
|
return (
|
|
|
<Layout.Body>
|
|
|
<Layout.Main fullWidth>
|
|
|
<Wrapper>
|
|
|
- <SearchBar
|
|
|
- defaultQuery=""
|
|
|
- placeholder={t('Search events by id, message, or tags')}
|
|
|
- query={this.state.query}
|
|
|
- onSearch={this.handleSearch}
|
|
|
- />
|
|
|
+ <FilterSection hasPageFilters={hasPageFilters}>
|
|
|
+ {hasPageFilters && <EnvironmentPageFilter />}
|
|
|
+ <SearchBar
|
|
|
+ defaultQuery=""
|
|
|
+ placeholder={t('Search events by id, message, or tags')}
|
|
|
+ query={this.state.query}
|
|
|
+ onSearch={this.handleSearch}
|
|
|
+ />
|
|
|
+ </FilterSection>
|
|
|
|
|
|
<Panel className="event-list">
|
|
|
<PanelBody>{this.renderBody()}</PanelBody>
|
|
@@ -178,6 +187,12 @@ class GroupEvents extends React.Component<Props, State> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const FilterSection = styled('div')<{hasPageFilters?: boolean}>`
|
|
|
+ display: grid;
|
|
|
+ gap: ${space(1)};
|
|
|
+ grid-template-columns: ${p => (p.hasPageFilters ? 'max-content 1fr' : '1fr')};
|
|
|
+`;
|
|
|
+
|
|
|
const Wrapper = styled('div')`
|
|
|
display: grid;
|
|
|
gap: ${space(2)};
|
|
@@ -185,4 +200,4 @@ const Wrapper = styled('div')`
|
|
|
|
|
|
export {GroupEvents};
|
|
|
|
|
|
-export default withApi(GroupEvents);
|
|
|
+export default withOrganization(withApi(GroupEvents));
|