<commit_before>import React from 'react';
import styled from 'react-emotion';
import {Flex} from 'grid-emotion';

import {Panel} from 'app/components/panels';
import {getParams} from 'app/views/organizationEvents/utils';
import {t} from 'app/locale';
import AsyncView from 'app/views/asyncView';
import EventsChart from 'app/views/organizationEvents/eventsChart';
import EventsTable from 'app/views/organizationEvents/eventsTable';
import Pagination from 'app/components/pagination';
import SentryTypes from 'app/sentryTypes';
import withOrganization from 'app/utils/withOrganization';
import PreviewFeature from 'app/components/previewFeature';

class OrganizationEvents extends AsyncView {
  static propTypes = {
    organization: SentryTypes.Organization,
  };

  constructor(props) {
    super(props);
    this.projectsMap = new Map(
      props.organization.projects.map(project => [project.id, project])
    );
  }

  getEndpoints() {
    const {organization, location} = this.props;
    let {statsPeriod, ...query} = location.query;

    return [
      [
        'events',
        `/organizations/${organization.slug}/events/`,
        {
          query: getParams({
            period: statsPeriod,
            ...query,
          }),
        },
      ],
    ];
  }

  getTitle() {
    return `${this.props.organization.slug} Events`;
  }

  renderBody() {
    const {organization} = this.props;
    const {loading, events, eventsPageLinks} = this.state;

    return (
      <React.Fragment>
        <Flex align="center" justify="space-between" mb={2}>
          <HeaderTitle>{t('Events')}</HeaderTitle>
          {this.renderSearchInput({})}
        </Flex>

        <PreviewFeature type="info" />

        <Panel>
          <EventsChart organization={organization} />
        </Panel>

        <EventsTable loading={loading} events={events} organization={organization} />

        <Pagination pageLinks={eventsPageLinks} />
      </React.Fragment>
    );
  }
}

const HeaderTitle = styled('h4')`
  margin: 0;
`;

export default withOrganization(OrganizationEvents);
export {OrganizationEvents};<commit_msg>fix(ui): Increase event search debounce time<commit_after>import React from 'react';
import styled from 'react-emotion';
import {Flex} from 'grid-emotion';

import {Panel} from 'app/components/panels';
import {getParams} from 'app/views/organizationEvents/utils';
import {t} from 'app/locale';
import AsyncView from 'app/views/asyncView';
import EventsChart from 'app/views/organizationEvents/eventsChart';
import EventsTable from 'app/views/organizationEvents/eventsTable';
import Pagination from 'app/components/pagination';
import SentryTypes from 'app/sentryTypes';
import withOrganization from 'app/utils/withOrganization';
import PreviewFeature from 'app/components/previewFeature';

class OrganizationEvents extends AsyncView {
  static propTypes = {
    organization: SentryTypes.Organization,
  };

  constructor(props) {
    super(props);
    this.projectsMap = new Map(
      props.organization.projects.map(project => [project.id, project])
    );
  }

  getEndpoints() {
    const {organization, location} = this.props;
    let {statsPeriod, ...query} = location.query;

    return [
      [
        'events',
        `/organizations/${organization.slug}/events/`,
        {
          query: getParams({
            period: statsPeriod,
            ...query,
          }),
        },
      ],
    ];
  }

  getTitle() {
    return `${this.props.organization.slug} Events`;
  }

  renderBody() {
    const {organization} = this.props;
    const {loading, events, eventsPageLinks} = this.state;

    return (
      <React.Fragment>
        <Flex align="center" justify="space-between" mb={2}>
          <HeaderTitle>{t('Events')}</HeaderTitle>
          {this.renderSearchInput({debounceWait: 1000})}
        </Flex>

        <PreviewFeature type="info" />

        <Panel>
          <EventsChart organization={organization} />
        </Panel>

        <EventsTable loading={loading} events={events} organization={organization} />

        <Pagination pageLinks={eventsPageLinks} />
      </React.Fragment>
    );
  }
}

const HeaderTitle = styled('h4')`
  margin: 0;
`;

export default withOrganization(OrganizationEvents);
export {OrganizationEvents};
{'fraction_non_alphanumeric': 0.13267928054192946, 'fraction_numerical': 0.00233590282644242, 'mean_word_length': 3.2270483711747286, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2014515', 'n_tokens_mistral': 1245, 'n_tokens_neox': 1204, 'n_words': 265}