<commit_before>import PropTypes from 'prop-types'
import React from 'react'
import {Button} from 'tocco-ui'
import {FormattedMessage} from 'react-intl'
import uuid from 'uuid/v4'

import {StyledAdvancedSearch} from './StyledAdvancedSearch'

const AdvancedSearch = props =>
  <StyledAdvancedSearch>
    <props.ListApp
      id={`advancedSearch-${uuid()}`}
      entityName={props.entityName}
      formName={props.formName}
      listFormDefinition={props.listFormDefinition}
      limit={15}
      showSearchForm={true}
      onSelectChange={selection => { props.onSelectionChange(selection) }}
      selection={props.selection}
      emitAction={props.emitAction}
      selectionStyle={props.multi ? 'multi' : 'single'}
      selectOnRowClick={true}
      disableSelectionController={true}
      showActions={false}
    />
    <div className="advanced-search-button-wrapper">
      <Button look="raised" onClick={props.onOkClick}>
        <FormattedMessage id="client.common.ok"/>
      </Button>
    </div>
  </StyledAdvancedSearch>

AdvancedSearch.propTypes = {
  ListApp: PropTypes.func.isRequired,
  entityName: PropTypes.string.isRequired,
  formName: PropTypes.string.isRequired,
  listFormDefinition: PropTypes.shape({
    children: PropTypes.arrayOf(PropTypes.object)
  }),
  emitAction: PropTypes.func.isRequired,
  selection: PropTypes.array,
  field: PropTypes.string,
  onSelectionChange: PropTypes.func,
  onOkClick: PropTypes.func,
  appId: PropTypes.string,
  showSearchForm: PropTypes.bool,
  multi: PropTypes.bool
}

export default AdvancedSearch<commit_msg>refactor(app-extensions): refactor props<commit_after>import PropTypes from 'prop-types'
import React from 'react'
import {Button} from 'tocco-ui'
import {FormattedMessage} from 'react-intl'
import uuid from 'uuid/v4'

import {StyledAdvancedSearch} from './StyledAdvancedSearch'

const AdvancedSearch = ({
  entityName,
  formName,
  listFormDefinition,
  onSelectionChange,
  selection,
  emitAction,
  multi,
  onOkClick,
  ListApp
}) => (
  <StyledAdvancedSearch>
    <ListApp
      id={`advancedSearch-${uuid()}`}
      entityName={entityName}
      formName={formName}
      listFormDefinition={listFormDefinition}
      limit={15}
      showSearchForm={true}
      onSelectChange={selection => {
        onSelectionChange(selection)
      }}
      selection={selection}
      emitAction={emitAction}
      selectionStyle={multi ? 'multi' : 'single'}
      selectOnRowClick={true}
      disableSelectionController={true}
      showActions={false}
    />
    <div className="advanced-search-button-wrapper">
      <Button look="raised" onClick={onOkClick}>
        <FormattedMessage id="client.common.ok"/>
      </Button>
    </div>
  </StyledAdvancedSearch>
)

AdvancedSearch.propTypes = {
  ListApp: PropTypes.func.isRequired,
  entityName: PropTypes.string.isRequired,
  formName: PropTypes.string.isRequired,
  listFormDefinition: PropTypes.shape({
    children: PropTypes.arrayOf(PropTypes.object)
  }),
  emitAction: PropTypes.func.isRequired,
  selection: PropTypes.array,
  field: PropTypes.string,
  onSelectionChange: PropTypes.func,
  onOkClick: PropTypes.func,
  appId: PropTypes.string,
  showSearchForm: PropTypes.bool,
  multi: PropTypes.bool
}

export default AdvancedSearch
{'fraction_non_alphanumeric': 0.11770100886579028, 'fraction_numerical': 0.0018343014368694588, 'mean_word_length': 4.2352, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, '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': '2016073', 'n_tokens_mistral': 978, 'n_tokens_neox': 981, 'n_words': 179}