Sha256: 1d96d8b45507774fc32978d9402a294dc4c7f6ede510049c3d51a3e93f4a04c0
Contents?: true
Size: 1.88 KB
Versions: 1
Compression:
Stored size: 1.88 KB
Contents
var React = require('react'); var OwnedResourcesBox = require('./owned_resources_box'); var OwnedResourcesSummary = React.createClass({ displayName: 'OwnedResourcesSummary', render() { var expand = ''; if (this.props.length > 0) { expand = ( <span> <br/> <span> <a onClick={this.props.handler}>Show all »</a> </span> </span> ); } var message = ''; if (this.props.length === 0) { message = 'none'; } else { message = '' + this.props.length + ' things'; } return ( <div> <span> {message} </span> {expand} </div> ); } }); export default React.createClass({ displayName: 'OwnedResources', getInitialState() { return { expanded: false }; }, toggle(e) { e.preventDefault(); this.setState({expanded: !this.state.expanded}); }, render() { var content = null; if (this.state.expanded || this.props.tabview) { content = ( <OwnedResourcesBox resources={this.props.owned} handler={this.toggle} tabview={this.props.tabview} /> ); } else { content = ( <OwnedResourcesSummary length={this.props.owned.length} handler={this.toggle} /> ); } var ownedheader = this.props.tabview ? '': (<h3>Owned assets</h3>); return ( <section className="owned row"> {ownedheader} <div id="ownedDetails" className="col-xs-6"> {content} </div> </section> ); } });
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
conjur-asset-ui-1.6.0 | app/src/components/owned_resources/owned_resources.js |