Sha256: eee65476c4daac6e2d7e9d06b91b3b8ac278c8f1e4e97eb024e68f2ccb8b17b6

Contents?: true

Size: 1.16 KB

Versions: 3

Compression:

Stored size: 1.16 KB

Contents

/** @jsx React.DOM */

var GenericListItem = React.createClass({
  render: function() {
    var recordUrl = "/ui/" + this.props.data.kind + "/" + encodeURIComponent(this.props.data.record.identifier);
    return (
      <tr>
        <td className="id">
          <a href={recordUrl}>
            {this.props.data.record.identifier}
          </a>
        </td>
        <td className="ownerId">
          <RoleLink id={this.props.data.record.ownerid || this.props.data.record.owner} />
        </td>
      </tr>
    );
  }
});

var GenericList = React.createClass({
  render: function() {
    var rows = this.props.data.members.map(function (o) {
      var componentName = _.str.capitalize(this.props.data.kind.substring(0, this.props.data.kind.length-1)) + "ListItem";
      var itemKind = window[componentName] || GenericListItem;
      return itemKind({data: {kind: this.props.data.kind, record: o}});
    }.bind(this));
    return (
      <table className={this.props.data.kind + "List"}>
        <thead>
          <tr>
            <th>Id</th>
            <th>Owner</th>
          </tr>
        </thead>
        <tbody>
        {rows}
        </tbody>
      </table>
    );
  }
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
conjur-asset-ui-api-1.2.0 public/js/views/generic.js
conjur-asset-ui-api-1.1.1 public/js/views/generic.js
conjur-asset-ui-api-1.1.0 public/js/views/generic.js