Sha256: 6526c389f3fe8584781e9cb77ea585aa658fa8a04ed8be4da74b6d39c8fab320

Contents?: true

Size: 942 Bytes

Versions: 7

Compression:

Stored size: 942 Bytes

Contents

/** @jsx React.DOM */

var NamespaceFilter = React.createClass({
  render: function() {
    return(
      <div className="namespaceList">
        <h2>Namespace filter:</h2>
        { this.transferPropsTo(<NamespaceList />) }
      </div>
    );
  }
});

var NamespaceListItem = React.createClass({
  render: function() {
    return (
      <option value={this.props.id}>{this.props.id}</option>
    );
  }
});

var NamespaceList = React.createClass({
  handleChange: function(e) {
    var value = e.target.options[e.target.selectedIndex].value;
    updateNamespace(value);
  },
  render: function() {
    var namespaces = this.props.namespaces.map(function (namespace) {
      return <NamespaceListItem id={namespace}/>;
    }).sort();
    return (
      <div>
        <select onChange={this.handleChange} value={this.props.currentNamespace}>
          <option value="" />
          {namespaces}
        </select>
      </div>
    );
  }
});

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
conjur-asset-ui-1.4.2 public/js/views/namespaces.js
conjur-asset-ui-1.3.2 public/js/views/namespaces.js
conjur-asset-ui-1.3.1 public/js/views/namespaces.js
conjur-asset-ui-1.3.0 public/js/views/namespaces.js
conjur-asset-ui-api-1.2.0 public/js/views/namespaces.js
conjur-asset-ui-api-1.1.1 public/js/views/namespaces.js
conjur-asset-ui-api-1.1.0 public/js/views/namespaces.js