<commit_before>import React from 'react';
import { defineMessages, injectIntl } from 'react-intl';
import { Button } from '@blueprintjs/core';
import c from 'classnames';

import { Summary } from 'components/common';
import CollectionInfo from 'components/Collection/CollectionInfo';
import CollectionStatus from 'components/Collection/CollectionStatus';
import CollectionHeading from 'components/Collection/CollectionHeading';
import CollectionManageMenu from 'components/Collection/CollectionManageMenu';

import './InvestigationHeading.scss';

const messages = defineMessages({
  metadataHide : {
    id: 'collection.info.hide-metadata',
    defaultMessage: 'Less',
  },
  metadataShow : {
    id: 'collection.info.show-metadata',
    defaultMessage: 'More',
  },
});

class InvestigationHeading extends React.Component {
  constructor(props) {
    super(props);

    this.state = { showMetadata: false };
  }

  toggleMetadata = () => {
    this.setState(({ showMetadata }) => ({ showMetadata: !showMetadata }));
  }

  render() {
    const {
      collection, activeMode, intl, minimal
    } = this.props;
    const { showMetadata } = this.state;

    return (
      <div className={c('InvestigationHeading', {'metadata-shown': showMetadata, minimal })}>
        <div className="InvestigationHeading__inner-container">
          <CollectionHeading collection={collection} link={!!activeMode} showCategory={!minimal} categoryLink={true} />
          {!!activeMode && (
            <div className="InvestigationHeading__metadata">
              {collection.summary && (
                <Summary text={collection.summary} />
              )}
              <CollectionStatus collection={collection} showCancel={collection.writeable} />
              <div className="InvestigationHeading__divider" />
              <div className="InvestigationHeading__metadata__inner-container">
                <CollectionInfo collection={collection} />
                <div className="InvestigationHeading__actions">
                  <CollectionManageMenu collection={collection} view="semi-collapsed" buttonProps={{ className: 'bp3-minimal' }}/>
                </div>
              </div>
            </div>
          )}
        </div>
        {!!activeMode && (
          <Button
            onClick={this.toggleMetadata}
            minimal
            small
            fill
            className="InvestigationHeading__metadata-toggle"
            rightIcon={showMetadata ? 'chevron-up' : 'chevron-down'}
          />
        )}
      </div>
    );
  }
}

export default injectIntl(InvestigationHeading);<commit_msg>Removed collection manage menu from investigation sidebar<commit_after>import React from 'react';
import { defineMessages, injectIntl } from 'react-intl';
import { Button } from '@blueprintjs/core';
import c from 'classnames';

import { Summary } from 'components/common';
import CollectionInfo from 'components/Collection/CollectionInfo';
import CollectionStatus from 'components/Collection/CollectionStatus';
import CollectionHeading from 'components/Collection/CollectionHeading';

import './InvestigationHeading.scss';

const messages = defineMessages({
  metadataHide : {
    id: 'collection.info.hide-metadata',
    defaultMessage: 'Less',
  },
  metadataShow : {
    id: 'collection.info.show-metadata',
    defaultMessage: 'More',
  },
});

class InvestigationHeading extends React.Component {
  constructor(props) {
    super(props);

    this.state = { showMetadata: false };
  }

  toggleMetadata = () => {
    this.setState(({ showMetadata }) => ({ showMetadata: !showMetadata }));
  }

  render() {
    const {
      collection, activeMode, intl, minimal
    } = this.props;
    const { showMetadata } = this.state;

    return (
      <div className={c('InvestigationHeading', {'metadata-shown': showMetadata, minimal })}>
        <div className="InvestigationHeading__inner-container">
          <CollectionHeading collection={collection} link={!!activeMode} showCategory={!minimal} categoryLink={true} />
          {!!activeMode && (
            <div className="InvestigationHeading__metadata">
              {collection.summary && (
                <Summary text={collection.summary} />
              )}
              <CollectionStatus collection={collection} showCancel={collection.writeable} />
              <div className="InvestigationHeading__divider" />
              <div className="InvestigationHeading__metadata__inner-container">
                <CollectionInfo collection={collection} />
              </div>
            </div>
          )}
        </div>
        {!!activeMode && (
          <Button
            onClick={this.toggleMetadata}
            minimal
            small
            fill
            className="InvestigationHeading__metadata-toggle"
            rightIcon={showMetadata ? 'chevron-up' : 'chevron-down'}
          />
        )}
      </div>
    );
  }
}

export default injectIntl(InvestigationHeading);
{'fraction_non_alphanumeric': 0.12160257700825448, 'fraction_numerical': 0.00020132876988121604, 'mean_word_length': 2.8541505042668733, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 38, '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': '6537878', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1251, 'n_words': 252}