<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import FontAwesomeIcon from 'fm3/components/FontAwesomeIcon';
import 'react-tag-autocomplete/example/styles.css';

import Button from 'react-bootstrap/lib/Button';
import Thumbnail from 'react-bootstrap/lib/Thumbnail';
import * as FmPropTypes from 'fm3/propTypes';
import GalleryEditForm from 'fm3/components/GalleryEditForm';


export default class GalleryUploadItem extends React.Component {
  static propTypes = {
    id: PropTypes.number.isRequired,
    filename: PropTypes.string,
    url: PropTypes.string,
    model: FmPropTypes.galleryPictureModel.isRequired,
    allTags: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,
    error: PropTypes.string,
    onRemove: PropTypes.func.isRequired,
    onPositionPick: PropTypes.func.isRequired,
    onModelChange: PropTypes.func.isRequired,
    disabled: PropTypes.bool,
  }

  handleRemove = () => {
    this.props.onRemove(this.props.id);
  }

  handlePositionPick = () => {
    this.props.onPositionPick(this.props.id);
  }

  handleModelChange = (model) => {
    this.props.onModelChange(this.props.id, model);
  }

  render() {
    const { id, filename, url, disabled, model, allTags, error } = this.props;
    return (
      <Thumbnail key={id} src={url || require('fm3/images/spinnerbar.gif')} alt={filename}>
        <fieldset disabled={disabled}>
          <GalleryEditForm
            {...{ model, allTags, error }}
            onPositionPick={this.handlePositionPick}
            onModelChange={this.handleModelChange}
          />
          {' '}
          <Button onClick={this.handleRemove} bsStyle="danger"><FontAwesomeIcon icon="times" />Odstrániť</Button>
        </fieldset>
      </Thumbnail>
    );
  }
}
<commit_msg>disabled picking picture position when disabled<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import FontAwesomeIcon from 'fm3/components/FontAwesomeIcon';
import 'react-tag-autocomplete/example/styles.css';

import Button from 'react-bootstrap/lib/Button';
import Thumbnail from 'react-bootstrap/lib/Thumbnail';
import * as FmPropTypes from 'fm3/propTypes';
import GalleryEditForm from 'fm3/components/GalleryEditForm';


export default class GalleryUploadItem extends React.Component {
  static propTypes = {
    id: PropTypes.number.isRequired,
    filename: PropTypes.string,
    url: PropTypes.string,
    model: FmPropTypes.galleryPictureModel.isRequired,
    allTags: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,
    error: PropTypes.string,
    onRemove: PropTypes.func.isRequired,
    onPositionPick: PropTypes.func.isRequired,
    onModelChange: PropTypes.func.isRequired,
    disabled: PropTypes.bool,
  }

  handleRemove = () => {
    this.props.onRemove(this.props.id);
  }

  handlePositionPick = () => {
    this.props.onPositionPick(this.props.id);
  }

  handleModelChange = (model) => {
    this.props.onModelChange(this.props.id, model);
  }

  render() {
    const { id, filename, url, disabled, model, allTags, error } = this.props;
    return (
      <Thumbnail key={id} src={url || require('fm3/images/spinnerbar.gif')} alt={filename}>
        <fieldset disabled={disabled}>
          <GalleryEditForm
            {...{ model, allTags, error }}
            onPositionPick={disabled ? null : this.handlePositionPick}
            onModelChange={this.handleModelChange}
          />
          {' '}
          <Button onClick={this.handleRemove} bsStyle="danger"><FontAwesomeIcon icon="times" />Odstrániť</Button>
        </fieldset>
      </Thumbnail>
    );
  }
}

{'fraction_non_alphanumeric': 0.12534664448141986, 'fraction_numerical': 0.0022185246810870773, 'mean_word_length': 3.5774111675126905, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 25, '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': '1063215', 'n_tokens_mistral': 1104, 'n_tokens_neox': 1085, 'n_words': 203}