diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/permission-templates/permissions-header.js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/permission-templates/permissions-header.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/apps/permission-templates/permissions-header.js b/server/sonar-web/src/main/js/apps/permission-templates/permissions-header.js new file mode 100644 index 00000000000..7768f9ec414 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/permission-templates/permissions-header.js @@ -0,0 +1,27 @@ +import React from 'react'; + +export default React.createClass({ + propTypes: { + permissions: React.PropTypes.arrayOf(React.PropTypes.object).isRequired + }, + + render() { + let cellWidth = (80 / this.props.permissions.length) + '%'; + let cells = this.props.permissions.map(p => { + return ( + <th key={p.key} style={{ width: cellWidth }}> + {p.name}<br/><span className="small">{p.description}</span> + </th> + ); + }); + return ( + <thead> + <tr> + <th style={{ width: '20%' }}> </th> + {cells} + <th className="thin"> </th> + </tr> + </thead> + ); + } +}); |