From bca9d9cf04b3068c870c4fd45ca6cfc2fb79034d Mon Sep 17 00:00:00 2001 From: Laurence Maultsby Date: Wed, 8 Mar 2017 22:10:19 -0500 Subject: [PATCH] User Management: Styling pass Signed-off-by: Laurence Maultsby --- .../widgets/form_controls/formControls.scss | 18 ++- .../framework/widgets/form_controls/input.jsx | 31 ++++- .../widgets/form_controls/selectOption.jsx | 19 ++- .../src/dashboard/dashboard.jsx | 118 ++++++++++++------ .../src/dashboard/userMgmt.scss | 17 ++- .../src/dashboard/userMgmtActions.js | 1 + .../src/dashboard/userMgmtStore.js | 34 +++-- 7 files changed, 183 insertions(+), 55 deletions(-) diff --git a/skyquake/framework/widgets/form_controls/formControls.scss b/skyquake/framework/widgets/form_controls/formControls.scss index fcc08def8..54d69a8bf 100644 --- a/skyquake/framework/widgets/form_controls/formControls.scss +++ b/skyquake/framework/widgets/form_controls/formControls.scss @@ -32,7 +32,7 @@ color:$darker-gray; text-transform:uppercase; } - input, .readonly, textarea { + input, textarea { height: 35px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.39), 0 -1px 1px #ffffff, 0 1px 0 #ffffff; font-size: 1rem; @@ -49,6 +49,7 @@ .readonly { line-height: 35px; box-shadow:none; + background:none !important; } textarea { -ms-flex-align: stretch; @@ -78,4 +79,19 @@ } } +.sqCheckBox { + display:-ms-flexbox; + display:flex; + label { + display:-ms-flexbox; + display:flex; + -ms-flex-align: center; + align-items: center; + input { + box-shadow: none; + height: auto; + margin: 0 0.25rem; + } + } +} diff --git a/skyquake/framework/widgets/form_controls/input.jsx b/skyquake/framework/widgets/form_controls/input.jsx index b7582424b..370afccd9 100644 --- a/skyquake/framework/widgets/form_controls/input.jsx +++ b/skyquake/framework/widgets/form_controls/input.jsx @@ -59,14 +59,23 @@ export default class Input extends Component { onChange={props.onChange} /> break; + case 'radiogroup': + inputType = buildRadioButtons(this.props); + break; default: inputType = ; } + let displayedValue; + if(value === null) { + displayedValue = null; + } else { + displayedValue = value.toString(); + } let html = ( @@ -76,8 +85,26 @@ export default class Input extends Component { } -function buildDropDown() { +function buildRadioButtons(props) { + let className = 'sqCheckBox'; + if (props.className) { + className = `${className} ${props.className}`; + } + return( +
+ { + props.options.map((o,i) => { + return ( + + ) + }) + } +
+ ) } Input.defaultProps = { diff --git a/skyquake/framework/widgets/form_controls/selectOption.jsx b/skyquake/framework/widgets/form_controls/selectOption.jsx index 81a386065..21d4a0a4d 100644 --- a/skyquake/framework/widgets/form_controls/selectOption.jsx +++ b/skyquake/framework/widgets/form_controls/selectOption.jsx @@ -47,11 +47,19 @@ export default class SelectOption extends React.Component { html = ( ); return html; @@ -67,6 +75,7 @@ SelectOption.defaultProps = { console.log(e.target.value) console.dir(e) }, + readonly: false, /** * Selected or default value ​ diff --git a/skyquake/plugins/user-management/src/dashboard/dashboard.jsx b/skyquake/plugins/user-management/src/dashboard/dashboard.jsx index fdac58b40..df28d2178 100644 --- a/skyquake/plugins/user-management/src/dashboard/dashboard.jsx +++ b/skyquake/plugins/user-management/src/dashboard/dashboard.jsx @@ -72,6 +72,12 @@ class UserManagementDashboard extends React.Component { viewUser = (un, index) => { this.actions.viewUser(un, index); } + editUser = () => { + this.actions.editUser(false); + } + cancelEditUser = () => { + this.actions.editUser(true) + } closePanel = () => { this.actions.handleCloseUserPanel(); } @@ -118,11 +124,60 @@ class UserManagementDashboard extends React.Component { this.actions.handleHideColumns(e); console.log('transition end') } + disableChange = (e) => { + let value = e.target.value; + value = value.toUpperCase(); + if (value=="TRUE") { + value = true; + } else { + value = false; + } + console.log(value) + } render() { let self = this; let html; let props = this.props; let state = this.state; + let passwordSectionHTML = null; + let formButtonsHTML = ( + +