<commit_before>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import EntityTypeHeader from '../entity-editor/EntityTypeHeader';

export default class DatasetHeader extends Component {
  getActionButtions() {
    const settings = {
      buttonText: <FormattedMessage id="settings" />,
      onClick: this.props.onShowDatasetSettings,
      customClass: 'notImplemented',
    };

    const transform = {
      buttonText: <FormattedMessage id="transform" />,
      customClass: this.props.isLockedFromTransformations
        ? 'disabled'
        : 'clickable',
      onOptionSelected: (item) => {
        this.props.onClickTransformMenuItem(item);
      },
      subActions: [
        {
          label: <FormattedMessage id="bulk_row_editor" />,
          value: 'bulk-row-editor',
          customClass: 'notImplemented',
        },
        {
          label: <FormattedMessage id="bulk_column_editor" />,
          value: 'bulk-column-editor',
          customClass: 'notImplemented',
        },
        {
          label: <FormattedMessage id="combine_columns" />,
          value: 'combineColumns',
        },
        {
          label: <FormattedMessage id="extract_multiple" />,
          value: 'extractMultiple',
        },
        {
          label: <FormattedMessage id="split_column" />,
          value: 'splitColumn',
        },
        {
          label: <FormattedMessage id="derive_column" />,
          value: 'deriveColumn',
          subMenu: [
            {
              label: <FormattedMessage id="derive_column_category" />,
              value: 'deriveColumnCategory',
            },
            {
              label: <FormattedMessage id="derive_column_javascript" />,
              value: 'deriveColumnJavascript',
            },
          ],
        },
        {
          label: <FormattedMessage id="merge_datasets" />,
          value: 'mergeDatasets',
        },
        {
          label: <FormattedMessage id="generate_geopoints" />,
          value: 'generateGeopoints',
        },
        {
          label: <FormattedMessage id="reverse_geocode" />,
          value: 'reverseGeocode',
        },
      ],
    };

    const transformationLog = {
      icon: <i className="fa fa-list-ol" aria-hidden="true" />,
      onClick: this.props.onToggleTransformationLog,
    };

    const visualise = {
      buttonText: <FormattedMessage id="visualise" />,
      onClick: this.props.onNavigateToVisualise,
      props: {
        'data-test-id': 'visualise'
      }
    };

    const result = [settings, transform, transformationLog, visualise];

    return result;
  }

  render() {
    const {
      onChangeTitle,
      onBeginEditTitle,
      isUnsavedChanges,
      savingFailed,
      timeToNextSave,
      history,
      onSaveDataset,
    } = this.props;

    let saveStatusId = ({
      false: 'all_changes_saved',
      true: 'unsaved_changes',
    })[isUnsavedChanges] || null;<commit_msg>[#2706] - fix lint<commit_after>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import EntityTypeHeader from '../entity-editor/EntityTypeHeader';

export default class DatasetHeader extends Component {
  getActionButtions() {
    const settings = {
      buttonText: <FormattedMessage id="settings" />,
      onClick: this.props.onShowDatasetSettings,
      customClass: 'notImplemented',
    };

    const transform = {
      buttonText: <FormattedMessage id="transform" />,
      customClass: this.props.isLockedFromTransformations
        ? 'disabled'
        : 'clickable',
      onOptionSelected: (item) => {
        this.props.onClickTransformMenuItem(item);
      },
      subActions: [
        {
          label: <FormattedMessage id="bulk_row_editor" />,
          value: 'bulk-row-editor',
          customClass: 'notImplemented',
        },
        {
          label: <FormattedMessage id="bulk_column_editor" />,
          value: 'bulk-column-editor',
          customClass: 'notImplemented',
        },
        {
          label: <FormattedMessage id="combine_columns" />,
          value: 'combineColumns',
        },
        {
          label: <FormattedMessage id="extract_multiple" />,
          value: 'extractMultiple',
        },
        {
          label: <FormattedMessage id="split_column" />,
          value: 'splitColumn',
        },
        {
          label: <FormattedMessage id="derive_column" />,
          value: 'deriveColumn',
          subMenu: [
            {
              label: <FormattedMessage id="derive_column_category" />,
              value: 'deriveColumnCategory',
            },
            {
              label: <FormattedMessage id="derive_column_javascript" />,
              value: 'deriveColumnJavascript',
            },
          ],
        },
        {
          label: <FormattedMessage id="merge_datasets" />,
          value: 'mergeDatasets',
        },
        {
          label: <FormattedMessage id="generate_geopoints" />,
          value: 'generateGeopoints',
        },
        {
          label: <FormattedMessage id="reverse_geocode" />,
          value: 'reverseGeocode',
        },
      ],
    };

    const transformationLog = {
      icon: <i className="fa fa-list-ol" aria-hidden="true" />,
      onClick: this.props.onToggleTransformationLog,
    };

    const visualise = {
      buttonText: <FormattedMessage id="visualise" />,
      onClick: this.props.onNavigateToVisualise,
      props: {
        'data-test-id': 'visualise',
      },
    };

    const result = [settings, transform, transformationLog, visualise];

    return result;
  }

  render() {
    const {
      onChangeTitle,
      onBeginEditTitle,
      isUnsavedChanges,
      savingFailed,
      timeToNextSave,
      history,
      onSaveDataset,
    } = this.props;

    let saveStatusId = ({
      false: 'all_changes_saved',
      true: 'unsaved_changes',
    })[isUnsavedChanges] || null;
{'fraction_non_alphanumeric': 0.1209101478159774, 'fraction_numerical': 0.0006643414715163594, 'mean_word_length': 2.0615149974580578, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 35, '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': '2643211', 'n_tokens_mistral': 1703, 'n_tokens_neox': 1708, 'n_words': 303}