Sha256: 3b193bf45f301e47eb8ceb2d13f50065479257c807c0a37128e571fff6a65267

Contents?: true

Size: 809 Bytes

Versions: 16

Compression:

Stored size: 809 Bytes

Contents

import React from 'react';
import PropTypes from 'prop-types';
import Select from 'foremanReact/components/common/forms/Select';

const ExtSelect= ({
  hidden,
  editable,
  viewText,
  selectValue,
  onChange,
  options,
  additionalData,
}) =>{
  if (hidden) {
    return null;
  }

  if (!editable) {
    return (
     <div>{viewText}</div>
    );
  }

  return (
    <Select
       value={selectValue}
       onChange={e => onChange(e.target.value, additionalData) }
       options={options}
    />
  );
};

ExtSelect.propTypes = {
  hidden: PropTypes.bool.isRequired,
  editable: PropTypes.bool.isRequired,
  viewText: PropTypes.string,
  selectValue: PropTypes.string,
  onChange: PropTypes.func.isRequired,
  options: PropTypes.object,
  additionalData: PropTypes.object,
};

export default ExtSelect;

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
foreman_acd-0.9.7 webpack/components/common/ExtSelect.js
foreman_acd-0.9.5 webpack/components/common/ExtSelect.js
foreman_acd-0.9.4 webpack/components/common/ExtSelect.js
foreman_acd-0.9.3 webpack/components/common/ExtSelect.js
foreman_acd-0.9.2.3 webpack/components/common/ExtSelect.js
foreman_acd-0.9.2.2 webpack/components/common/ExtSelect.js
foreman_acd-0.9.2.1 webpack/components/common/ExtSelect.js
foreman_acd-0.9.2 webpack/components/common/ExtSelect.js
foreman_acd-0.9.1 webpack/components/common/ExtSelect.js
foreman_acd-0.9.0 webpack/components/common/ExtSelect.js
foreman_acd-0.7.0 webpack/components/common/ExtSelect.js
foreman_acd-0.6.0 webpack/components/common/ExtSelect.js
foreman_acd-0.5.0 webpack/components/common/ExtSelect.js
foreman_acd-0.4.0 webpack/components/common/ExtSelect.js
foreman_acd-0.3.0 webpack/components/common/ExtSelect.js
foreman_acd-0.2.1 webpack/components/common/ExtSelect.js