From f75f4282c2694d4ad712ccb12d0a316c40c17fa8 Mon Sep 17 00:00:00 2001 From: Laurence Maultsby Date: Thu, 23 Mar 2017 13:54:43 -0400 Subject: [PATCH] Checkbox readonly fix for input.jsx, name click for project,user, role management Signed-off-by: Laurence Maultsby --- skyquake/framework/widgets/form_controls/input.jsx | 2 +- .../project_management/src/dashboard/dashboard.jsx | 10 +++++----- .../src/dashboard/projectMgmtStore.js | 1 + .../user_management/src/dashboard/dashboard.jsx | 6 ++++-- 4 files changed, 11 insertions(+), 8 deletions(-) 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']}
-- 2.25.1