aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/project-permissions/permissions-header.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/apps/project-permissions/permissions-header.jsx')
-rw-r--r--server/sonar-web/src/main/js/apps/project-permissions/permissions-header.jsx26
1 files changed, 26 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/apps/project-permissions/permissions-header.jsx b/server/sonar-web/src/main/js/apps/project-permissions/permissions-header.jsx
new file mode 100644
index 00000000000..a68cca21fc2
--- /dev/null
+++ b/server/sonar-web/src/main/js/apps/project-permissions/permissions-header.jsx
@@ -0,0 +1,26 @@
+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%' }}>&nbsp;</th>
+ {cells}
+ </tr>
+ </thead>
+ );
+ }
+});