<commit_before>import PropTypes from '../../prop_types';
import mergeWith from 'lodash/mergeWith';
import isArray from 'lodash/isArray';
import $ from 'jquery';

export default {
  propTypes: {
    actionButtons: PropTypes.object,
    rowHref: PropTypes.string,
    haveShowAction: PropTypes.bool,

    createActionButton: PropTypes.object,
    showActionButton: PropTypes.object,
    editActionButton: PropTypes.object,
    destroyActionButton: PropTypes.object
  },

  getDefaultProps () {
    return {
      actionButtons: {},
      rowHref: null,
      haveShowAction: false,
      createActionButton: {},
      showActionButton: {},
      editActionButton: {},
      destroyActionButton: {}
    };
  },

  getRowHref () {
    var rowHref = this.props.rowHref;
    var haveShowAction = this.props.haveShowAction;
    if(!haveShowAction || (!!rowHref && typeof rowHref == "string")) {
      return rowHref;
    }

    return this.getRestActionUrl('show');
  },

  getActionButtons: function() {
    return mergeWith(this.getDefaultActionButtonsObject(), this.props.actionButtons, this.mergeActionButtons);
  },

  mergeActionButtons (defaultObject, propsObject) {
    var propsActionButtons = this.props.actionButtons;
    var propsExtend = propsActionButtons.extend;
    var extendActionButtons = (typeof(propsExtend) == "boolean") ? propsExtend : false;

    if(extendActionButtons && isArray(propsObject) && isArray(defaultObject)) {
      return propsObject.concat(defaultObject);
    } else {<commit_msg>Corrigido erro de bind<commit_after>import PropTypes from '../../prop_types';
import mergeWith from 'lodash/mergeWith';
import isArray from 'lodash/isArray';
import $ from 'jquery';

export default {
  propTypes: {
    actionButtons: PropTypes.object,
    rowHref: PropTypes.string,
    haveShowAction: PropTypes.bool,

    createActionButton: PropTypes.object,
    showActionButton: PropTypes.object,
    editActionButton: PropTypes.object,
    destroyActionButton: PropTypes.object
  },

  getDefaultProps () {
    return {
      actionButtons: {},
      rowHref: null,
      haveShowAction: false,
      createActionButton: {},
      showActionButton: {},
      editActionButton: {},
      destroyActionButton: {}
    };
  },

  getRowHref () {
    var rowHref = this.props.rowHref;
    var haveShowAction = this.props.haveShowAction;
    if(!haveShowAction || (!!rowHref && typeof rowHref == "string")) {
      return rowHref;
    }

    return this.getRestActionUrl('show');
  },

  getActionButtons: function() {
    return mergeWith(this.getDefaultActionButtonsObject(), this.props.actionButtons, this.mergeActionButtons.bind(this));
  },

  mergeActionButtons (defaultObject, propsObject) {
    var propsActionButtons = this.props.actionButtons;
    var propsExtend = propsActionButtons.extend;
    var extendActionButtons = (typeof(propsExtend) == "boolean") ? propsExtend : false;

    if(extendActionButtons && isArray(propsObject) && isArray(defaultObject)) {
      return propsObject.concat(defaultObject);
    } else {
{'fraction_non_alphanumeric': 0.11530880420499343, 'fraction_numerical': 0.0, 'mean_word_length': 3.8564593301435406, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '238575', 'n_tokens_mistral': 873, 'n_tokens_neox': 900, 'n_words': 175}