<commit_before>import { default as React, Component } from 'react';
import { render } from 'react-dom';
import { Modal } from 'react-bootstrap';
import { ImportContainer } from './ImportContainer';

export class ImportModal extends Component {
  constructor(props) {
    super(props);
    this.state = {
      showModal: false,
      profile: false
    };
    this.close = this.close.bind(this);
  }
  close() {
    this.internalClose = true;
    this.setState({ showModal: false });
  }
  open() {
    if(!this.state.profile) {
      this.setState({ showModal: true });
    }
  }
  subscribe() {
    authOperation.login();
  }
  render() {
    return (
      <div>
        <a title="Add new import" className="btn btn-yellow importBtn" href="javascript:void;" onClick={() => this.open()}>
          Import new data
        </a>
        <Modal className="modal-yellow" id="importModal" 
          enforceFocus={false}
          show={this.state.showModal} 
          onHide={() => this.close()}>
          <Modal.Header closeButton>
            <Modal.Title>Import</Modal.Title>
          </Modal.Header>
          <Modal.Body>
             <ImportContainer 
                key={1}
                selectedType={this.props.selectedType}
                mappings={this.props.mappings} 
                getMapping={this.props.getMapping}
                close={this.close}
                ></ImportContainer>
          </Modal.Body>
          <Modal.Footer>  
          </Modal.Footer>
        </Modal>
      </div>
    )
  }
}<commit_msg>Do not close import modal when clicking outside.<commit_after>import { default as React, Component } from 'react';
import { render } from 'react-dom';
import { Modal } from 'react-bootstrap';
import { ImportContainer } from './ImportContainer';

export class ImportModal extends Component {
  constructor(props) {
    super(props);
    this.state = {
      showModal: false,
      profile: false
    };
    this.close = this.close.bind(this);
  }
  close() {
    this.internalClose = true;
    this.setState({ showModal: false });
  }
  open() {
    if(!this.state.profile) {
      this.setState({ showModal: true });
    }
  }
  subscribe() {
    authOperation.login();
  }
  render() {
    return (
      <div>
        <a title="Add new import" className="btn btn-yellow importBtn" href="javascript:void;" onClick={() => this.open()}>
          Import new data
        </a>
        <Modal backdrop="static" className="modal-yellow" id="importModal" 
          enforceFocus={false}
          show={this.state.showModal} 
          onHide={() => this.close()}>
          <Modal.Header closeButton>
            <Modal.Title>Import</Modal.Title>
          </Modal.Header>
          <Modal.Body>
             <ImportContainer 
                key={1}
                selectedType={this.props.selectedType}
                mappings={this.props.mappings} 
                getMapping={this.props.getMapping}
                close={this.close}
                ></ImportContainer>
          </Modal.Body>
          <Modal.Footer>  
          </Modal.Footer>
        </Modal>
      </div>
    )
  }
}
{'fraction_non_alphanumeric': 0.13870246085011187, 'fraction_numerical': 0.0006391818472355385, 'mean_word_length': 2.0038387715930903, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 39, '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': '7382251', 'n_tokens_mistral': 903, 'n_tokens_neox': 882, 'n_words': 182}