From: Laurence Maultsby Date: Thu, 23 Mar 2017 17:54:43 +0000 (-0400) Subject: Checkbox readonly fix for input.jsx, name click for project,user, role management X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=f75f4282c2694d4ad712ccb12d0a316c40c17fa8;p=osm%2FUI.git Checkbox readonly fix for input.jsx, name click for project,user, role management Signed-off-by: Laurence Maultsby --- diff --git a/skyquake/framework/widgets/form_controls/input.jsx b/skyquake/framework/widgets/form_controls/input.jsx index 4799dc1d6..1563f2912 100644 --- a/skyquake/framework/widgets/form_controls/input.jsx +++ b/skyquake/framework/widgets/form_controls/input.jsx @@ -71,7 +71,7 @@ export default class Input extends Component { } else { displayedValue = value.toString(); } - if( props.readonly && props.type == "checkbox" ) { + if( props.readonly && props.type == "checkbox" && props.checked ) { displayedValue = } let html = ( diff --git a/skyquake/plugins/project_management/src/dashboard/dashboard.jsx b/skyquake/plugins/project_management/src/dashboard/dashboard.jsx index 4cbb1ef83..6b613cc07 100644 --- a/skyquake/plugins/project_management/src/dashboard/dashboard.jsx +++ b/skyquake/plugins/project_management/src/dashboard/dashboard.jsx @@ -259,10 +259,10 @@ class ProjectManagementDashboard extends React.Component { platformRoles.push(
{`${role}: ${u.platformRoles[role]}`}
) } return ( -
this[`project-ref-${k}`] = el} className={`tableRow tableRow--data ${((self.state.activeIndex == k) && self.state.projectOpen) ? 'tableRow--data-active' : ''}`} key={k}> +
this[`project-ref-${k}`] = el} className={`tableRow tableRow--data ${((self.state.activeIndex == k) && self.state.projectOpen) ? 'tableRow--data-active' : ''}`} key={k}>
+ > {u['name']}
@@ -310,9 +310,9 @@ class ProjectManagementDashboard extends React.Component { { state.projectUsers.map((u,i)=> { - let userRoles = u.role.map((r) => { + let userRoles = u.role && u.role.map((r) => { return r.role; - }) + }) || []; return ( {!state.isReadOnly ? { state.roles.map((r,j) => { - return -1)} checked={(userRoles.indexOf(r) > -1)} /> + return -1)} /> }) } diff --git a/skyquake/plugins/project_management/src/dashboard/projectMgmtStore.js b/skyquake/plugins/project_management/src/dashboard/projectMgmtStore.js index d7d76b859..1cb2088f0 100644 --- a/skyquake/plugins/project_management/src/dashboard/projectMgmtStore.js +++ b/skyquake/plugins/project_management/src/dashboard/projectMgmtStore.js @@ -170,6 +170,7 @@ export default class ProjectManagementStore { let selectedRole = self.roles[roleIndex]; let keys = ','; if(checked) { + if(!projectUsers[userIndex].role) projectUsers[userIndex].role = []; projectUsers[userIndex].role.push({ role: self.roles[roleIndex], keys: keys diff --git a/skyquake/plugins/user_management/src/dashboard/dashboard.jsx b/skyquake/plugins/user_management/src/dashboard/dashboard.jsx index 2ff5f4991..0275831a6 100644 --- a/skyquake/plugins/user_management/src/dashboard/dashboard.jsx +++ b/skyquake/plugins/user_management/src/dashboard/dashboard.jsx @@ -233,10 +233,12 @@ class UserManagementDashboard extends React.Component { platformRoles.push(
{`${role}: ${u.platformRoles[role]}`}
) } return ( -
this[`user-ref-${k}`] = el} className={`tableRow tableRow--data ${((self.state.activeIndex == k) && self.state.userOpen) ? 'tableRow--data-active' : ''}`} key={k}> +
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)}>
+ > {u['user-name']}