} else {
displayedValue = value.toString();
}
- if( props.readonly && props.type == "checkbox" ) {
+ if( props.readonly && props.type == "checkbox" && props.checked ) {
displayedValue = <img src={CircleSVG} />
}
let html = (
platformRoles.push(<div>{`${role}: ${u.platformRoles[role]}`}</div>)
}
return (
- <div ref={(el) => this[`project-ref-${k}`] = el} className={`tableRow tableRow--data ${((self.state.activeIndex == k) && self.state.projectOpen) ? 'tableRow--data-active' : ''}`} key={k}>
+ <div onClick={self.viewProject.bind(null, u, k)} ref={(el) => this[`project-ref-${k}`] = el} className={`tableRow tableRow--data ${((self.state.activeIndex == k) && self.state.projectOpen) ? 'tableRow--data-active' : ''}`} key={k}>
<div
className={`projectName projectName-header ${((self.state.activeIndex == k) && self.state.projectOpen) ? 'activeProject' : ''}`}
- onClick={self.viewProject.bind(null, u, k)}>
+ >
{u['name']}
</div>
<div>
<tbody>
{
state.projectUsers.map((u,i)=> {
- let userRoles = u.role.map((r) => {
+ let userRoles = u.role && u.role.map((r) => {
return r.role;
- })
+ }) || [];
return (
<tr key={i}>
{!state.isReadOnly ? <td><span
</td>
{
state.roles.map((r,j) => {
- return <td key={j}><Input readonly={state.isReadOnly} type="checkbox" onChange={self.toggleUserRoleInProject.bind(self, i, j)} value={(userRoles.indexOf(r) > -1)} checked={(userRoles.indexOf(r) > -1)} /></td>
+ return <td key={j}><Input readonly={state.isReadOnly} type="checkbox" onChange={self.toggleUserRoleInProject.bind(self, i, j)} checked={(userRoles.indexOf(r) > -1)} /></td>
})
}
</tr>
platformRoles.push(<div>{`${role}: ${u.platformRoles[role]}`}</div>)
}
return (
- <div ref={(el) => this[`user-ref-${k}`] = el} className={`tableRow tableRow--data ${((self.state.activeIndex == k) && self.state.userOpen) ? 'tableRow--data-active' : ''}`} key={k}>
+ <div ref={(el) => this[`user-ref-${k}`] = el} className={`tableRow tableRow--data ${((self.state.activeIndex == k) && self.state.userOpen) ? 'tableRow--data-active' : ''}`}
+ key={k}
+ onClick={self.viewUser.bind(null, u, k)}>
<div
className={`userName userName-header ${((self.state.activeIndex == k) && self.state.userOpen) ? 'activeUser' : ''}`}
- onClick={self.viewUser.bind(null, u, k)}>
+ >
{u['user-name']}
</div>
<div>