aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/project-permissions/permissions.jsx
blob: 4ae679f345cce6b8b88113092d7f8682f0166157 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import React from 'react';
import PermissionsHeader from './permissions-header';
import Project from './project';

export default React.createClass({
  propTypes:{
    projects: React.PropTypes.arrayOf(React.PropTypes.object).isRequired,
    permissions: React.PropTypes.arrayOf(React.PropTypes.object).isRequired,
    refresh: React.PropTypes.func.isRequired
  },

  render() {
    let projects = this.props.projects.map(p => {
      return <Project key={p.id} project={p} refresh={this.props.refresh}/>
    });
    return (
        <table id="projects" className="data zebra">
          <PermissionsHeader permissions={this.props.permissions}/>
          <tbody>{projects}</tbody>
        </table>
    );
  }
});