<commit_before>import React from 'react';
import Relay from 'react-relay';
import PropTypes from 'prop-types';

import Octicon from '../views/octicon';

class UserMentionTooltip extends React.Component {
  static propTypes = {
    repositoryOwner: PropTypes.shape({
      login: PropTypes.string.isRequired,
      avatarURL: PropTypes.string.isRequired,
      repositories: PropTypes.shape({
        totalCount: PropTypes.number.isRequired,
      }).isRequired,

      // Users
      email: PropTypes.string,
      company: PropTypes.string,

      // Organizations
      members: PropTypes.shape({
        totalCount: PropTypes.number.isRequired,
      }),
    }).isRequired,
  }

  render() {
    const owner = this.props.repositoryOwner;
    const {login, email, company, repositories, members} = owner;
    return (
      <div className="github-UserMentionTooltip">
        <div className="github-UserMentionTooltip-avatar">
          <img src={owner.avatarURL} />
        </div>
        <div className="github-UserMentionTooltip-info">
          <div className="github-UserMentionTooltip-info-username">
            <Octicon icon="mention" /><strong>{login}</strong>
          </div>
          {company && <div><Octicon icon="briefcase" /><span>{company}</span></div>}
          {email && <div><Octicon icon="globe" /><span>{email}</span></div>}
          {members && <div><Octicon icon="organization" /><span>{members.totalCount} members</span></div>}
          <div><Octicon icon="repo" /><span>{repositories.totalCount} repositories</span></div>
        </div>
        <div style={{clear: 'both'}} />
      </div>
    );
  }
}

export default Relay.createContainer(UserMentionTooltip, {
  fragments: {
    repositoryOwner: () => Relay.QL`
      fragment on RepositoryOwner {
        login avatarURL repositories { totalCount }
        ... on User { company email }
        ... on Organization { members { totalCount } }
      }
    `,
  },
});<commit_msg>Don't show email addresses in user mention tooltips<commit_after>import React from 'react';
import Relay from 'react-relay';
import PropTypes from 'prop-types';

import Octicon from '../views/octicon';

class UserMentionTooltip extends React.Component {
  static propTypes = {
    repositoryOwner: PropTypes.shape({
      login: PropTypes.string.isRequired,
      avatarURL: PropTypes.string.isRequired,
      repositories: PropTypes.shape({
        totalCount: PropTypes.number.isRequired,
      }).isRequired,

      // Users
      company: PropTypes.string,

      // Organizations
      members: PropTypes.shape({
        totalCount: PropTypes.number.isRequired,
      }),
    }).isRequired,
  }

  render() {
    const owner = this.props.repositoryOwner;
    const {login, company, repositories, members} = owner;
    return (
      <div className="github-UserMentionTooltip">
        <div className="github-UserMentionTooltip-avatar">
          <img src={owner.avatarURL} />
        </div>
        <div className="github-UserMentionTooltip-info">
          <div className="github-UserMentionTooltip-info-username">
            <Octicon icon="mention" /><strong>{login}</strong>
          </div>
          {company && <div><Octicon icon="briefcase" /><span>{company}</span></div>}
          {members && <div><Octicon icon="organization" /><span>{members.totalCount} members</span></div>}
          <div><Octicon icon="repo" /><span>{repositories.totalCount} repositories</span></div>
        </div>
        <div style={{clear: 'both'}} />
      </div>
    );
  }
}

export default Relay.createContainer(UserMentionTooltip, {
  fragments: {
    repositoryOwner: () => Relay.QL`
      fragment on RepositoryOwner {
        login avatarURL repositories { totalCount }
        ... on User { company }
        ... on Organization { members { totalCount } }
      }
    `,
  },
});
{'fraction_non_alphanumeric': 0.14337756960707781, 'fraction_numerical': 0.0, 'mean_word_length': 2.817279046673287, 'pattern_counts': {'":': 0, '<': 64, '<?xml version=': 0, '>': 66, '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': '5556224', 'n_tokens_mistral': 1093, 'n_tokens_neox': 1089, 'n_words': 227}