Sha256: 7cfc60f262b7b93a35f4e65e6bd10c3f1229bffb69e5208967db400ea63d3907

Contents?: true

Size: 1.17 KB

Versions: 2

Compression:

Stored size: 1.17 KB

Contents

/** @jsx React.DOM */

var AnnotationsBox = React.createClass({
  render: function() {
    
     if (!this.props.annotations || !this.props.annotations.length>0 ) {
        return <div>
                <span>None</span>   
               </div>;
     }

    // TODO: sort by date (optionally)
    // TODO: table view
   var annotations_list = [];
   this.props.annotations.sort(function(a,b) {
                            return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
                         }).forEach(function(item){
                            var itemname = item.name;
                            var itemvalue = item.value;

                            var dt_key = "annotation_"+itemname+"_key";
                            var dd_key = "annotation_"+itemname+"_value";
                            
                            annotations_list.push(<dt key={dt_key}>{itemname}</dt>);
                            annotations_list.push(<dd key={dd_key}>{itemvalue}</dd>);
                            });


    return <div> 
                <dl className="annotations dl-horizontal">
                    {annotations_list}
                </dl>
           </div>;
  }
 }
);

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
conjur-asset-ui-1.3.2 public/js/views/annotations.js
conjur-asset-ui-1.3.0 public/js/views/annotations.js