});
}
cleanUsers(projectUsers, projectName) {
+ let self = this;
let cleanUsers = [];
//Remove null values from role
projectUsers.map((u) => {
u.role && u.role.map((r,i) => {
let role = {};
//you may add a user without a role or a keys, but if one is present then the other must be as well.
- if(r.role ) {
+ if(r.role) {
delete r.keys;
// r.keys = projectName;
switch(ROLES.PROJECT.TYPE[r.role]) {
}
});
u.role = cleanRoles;
- u["rw-project-mano:mano-role"] = cleanManoRoles
- cleanUsers.push(u);
+ u["rw-project-mano:mano-role"] = u["rw-project-mano:mano-role"] || [];
+ u["rw-project-mano:mano-role"] = u["rw-project-mano:mano-role"].concat(cleanManoRoles);
+ if (u['user-name'] != self.context.userProfile.userId) {
+ cleanUsers.push(u);
+ }
});
return cleanUsers;
}
</FormSection>
<FormSection title="USER ROLES" className="userTable">
- <table>
+ <table className="projectTable">
<thead>
<tr>
{!state.isReadOnly ? <td></td> : null}
<tbody>
{
state.projectUsers.map((u,i)=> {
- let userRoles = u.role && u.role.map((r) => {
- return r.role;
- }) || [];
+ let userRoles = []
+ u.role && u.role.map((r) => {
+ userRoles.push(r.role);
+ });
+ u["rw-project-mano:mano-role"] && u["rw-project-mano:mano-role"].map((r) => {
+ userRoles.push(r.role);
+ });
return (
<tr key={i}>
{!state.isReadOnly ? <td><span
}
// onClick={this.Store.update.bind(null, Account)}
ProjectManagementDashboard.contextTypes = {
- router: React.PropTypes.object
+ router: React.PropTypes.object,
+ userProfile: React.PropTypes.object
};
ProjectManagementDashboard.defaultProps = {