Sha256: cf1a74947fcab792ee2f7969354955d875c5280e417ac96d92a8de1a27f75e67

Contents?: true

Size: 1.31 KB

Versions: 2

Compression:

Stored size: 1.31 KB

Contents

import React from 'react';
import PropTypes from 'prop-types';
import ExtSelect from '../../common/ExtSelect';
import RailsData from '../../common/RailsData';

const AppDefinitionSelector = ({
  label,
  hidden,
  editable,
  viewText,
  selectValue,
  onChange,
  options,
  additionalData,
}) => (
  <div className="form-group">
    <label className="col-md-2 control-label">{label}</label>
    <div className="col-md-4">
      <ExtSelect
        hidden={hidden}
        editable={editable}
        viewText={viewText}
        selectValue={selectValue}
        onChange={onChange}
        options={options}
        additionalData={additionalData}
      />
      <RailsData
        key="app_instance_id"
        view="app_instance"
        parameter="app_definition_id"
        value={selectValue}
      />
    </div>
  </div>
);

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

AppDefinitionSelector.defaultProps = {
  hidden: false,
  viewText: undefined,
  selectValue: undefined,
  options: undefined,
  additionalData: undefined,
};

export default AppDefinitionSelector;

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_acd-0.11.0 webpack/components/ApplicationInstance/components/AppDefinitionSelector.js
foreman_acd-0.10.0 webpack/components/ApplicationInstance/components/AppDefinitionSelector.js