<commit_before>import React, { PropTypes } from 'react';
import Helmet from 'react-helmet';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import _ from 'lodash';
//
import { Basic, Advanced, Managers, Domain } from 'czechidm-core';
import { ProvisioningOperationManager, ProvisioningArchiveManager } from '../../redux';
import ProvisioningOperationTable from './ProvisioningOperationTable';
import ProvisioningOperationTypeEnum from '../../domain/ProvisioningOperationTypeEnum';
import ProvisioningResultStateEnum from '../../domain/ProvisioningResultStateEnum';
import SchemaAttributeInfo from '../../components/SchemaAttributeInfo';
import EntityInfo from '../../components/EntityInfo';

const manager = new ProvisioningOperationManager();
const archiveManager = new ProvisioningArchiveManager();

class ProvisioningOperations extends Basic.AbstractContent {

  constructor(props, context) {
    super(props, context);
    this.state = {
      detail: {
        show: false,
        entity: null
      },
      retryDialog: {
        show: false,
        bulkActionValue: null,
        ids: []
      }
    };
  }

  getManager() {
    return manager;
  }

  getContentKey() {
    return 'acc:content.provisioningOperations';
  }

  /**
   * Shows retry dialog
   *
   * @return {[type]} [description]
   */
  showRetryDialog(bulkActionValue, ids) {
    this.setState({
      retryDialog: {
        show: true,
        bulkActionValue,
        ids
      }
    });
  }

  onRetry(batch = true) {
    const { retryDialog } = this.state;
    this.closeRetryDialog();
    this.context.store.dispatch(manager.retry(retryDialog.ids, retryDialog.bulkActionValue, batch, () => {
      // clear selected rows and reload
      this.refs.table.getWrappedInstance().clearSelectedRows();
      this.refs.table.getWrappedInstance().reload();
      this.refs.archiveTable.getWrappedInstance().reload();
    }));
  }

  /**
   * Close modal retry dialog
   */
  closeRetryDialog() {
    this.setState({
      retryDialog: {
        show: false,
        bulkActionValue: null,
        ids: []
      }
    });
  }

  /**
   * Shows modal detail with given entity
   */
  showDetail(entity) {
    this.setState({<commit_msg>fix: provisioning operations - reload<commit_after>import React, { PropTypes } from 'react';
import Helmet from 'react-helmet';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import _ from 'lodash';
//
import { Basic, Advanced, Managers, Domain } from 'czechidm-core';
import { ProvisioningOperationManager, ProvisioningArchiveManager } from '../../redux';
import ProvisioningOperationTable from './ProvisioningOperationTable';
import ProvisioningOperationTypeEnum from '../../domain/ProvisioningOperationTypeEnum';
import ProvisioningResultStateEnum from '../../domain/ProvisioningResultStateEnum';
import SchemaAttributeInfo from '../../components/SchemaAttributeInfo';
import EntityInfo from '../../components/EntityInfo';

const manager = new ProvisioningOperationManager();
const archiveManager = new ProvisioningArchiveManager();

class ProvisioningOperations extends Basic.AbstractContent {

  constructor(props, context) {
    super(props, context);
    this.state = {
      detail: {
        show: false,
        entity: null
      },
      retryDialog: {
        show: false,
        bulkActionValue: null,
        ids: []
      }
    };
  }

  getManager() {
    return manager;
  }

  getContentKey() {
    return 'acc:content.provisioningOperations';
  }

  /**
   * Shows retry dialog
   *
   * @return {[type]} [description]
   */
  showRetryDialog(bulkActionValue, ids) {
    this.setState({
      retryDialog: {
        show: true,
        bulkActionValue,
        ids
      }
    });
  }

  onRetry(batch = true) {
    const { retryDialog } = this.state;
    this.closeRetryDialog();
    this.context.store.dispatch(manager.retry(retryDialog.ids, retryDialog.bulkActionValue, batch, () => {
      // clear selected rows and reload
      this.refs.table.clearSelectedRows();
      this.refs.table.reload();
      this.refs.archiveTable.reload();
    }));
  }

  /**
   * Close modal retry dialog
   */
  closeRetryDialog() {
    this.setState({
      retryDialog: {
        show: false,
        bulkActionValue: null,
        ids: []
      }
    });
  }

  /**
   * Shows modal detail with given entity
   */
  showDetail(entity) {
    this.setState({
{'fraction_non_alphanumeric': 0.12655086848635236, 'fraction_numerical': 0.0, 'mean_word_length': 2.9766816143497756, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2280891', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1285, 'n_words': 276}