Allow enable/disable on create. Enabled=>Status header
authorLaurence Maultsby <laurence.maultsby@riftio.com>
Tue, 9 May 2017 14:23:33 +0000 (10:23 -0400)
committerLaurence Maultsby <laurence.maultsby@riftio.com>
Tue, 9 May 2017 14:23:33 +0000 (10:23 -0400)
Signed-off-by: Laurence Maultsby <laurence.maultsby@riftio.com>
skyquake/framework/widgets/form_controls/input.jsx
skyquake/plugins/user_management/src/dashboard/dashboard.jsx
skyquake/plugins/user_management/src/dashboard/userMgmt.scss
skyquake/plugins/user_management/src/dashboard/userMgmtStore.js

index d605614..9b5e685 100644 (file)
@@ -74,6 +74,11 @@ export default class Input extends Component {
         if( props.readonly && props.type == "checkbox" && props.checked ) {
             displayedValue = <img src={CircleSVG} />
         }
+
+        if( props.readonly && props.type == "radiogroup" && props.readonlydisplay ) {
+            displayedValue = props.readonlydisplay
+        }
+
         let html = (
             <label className={className} style={props.style}>
               <span> { label } {isRequired}</span>
index 0377a54..30ee04d 100644 (file)
@@ -114,12 +114,12 @@ class UserManagementDashboard extends React.Component {
                     disabled: [null]
                 }
             }
-            this.Store.createUser({
-                'user-name': this.state['user-name'],
-                'user-domain': this.state['user-domain'],
-                'password': this.state['new-password']
-                // 'confirm-password': this.state['confirm-password']
-            });
+            this.Store.createUser(_.merge({
+                            'user-name': this.state['user-name'],
+                            'user-domain': this.state['user-domain'],
+                            'password': this.state['new-password']
+                            // 'confirm-password': this.state['confirm-password']
+                        }, isDisabled));
         }
     }
     updateUser = (e) => {
@@ -298,10 +298,12 @@ class UserManagementDashboard extends React.Component {
                                 <Input
                                     type="radiogroup"
                                     onChange={this.disableChange}
-                                    label="Disabled"
+                                    label="STATUS"
                                     value={this.state.disabled}
-                                    options={["TRUE","FALSE"]}
-                                    readonly={state.isReadOnly} />
+                                    options={[{label: "DISABLED", value: "TRUE"},{label: "ENABLED", value: "FALSE"}]}
+                                    readonly={state.isReadOnly}
+                                    readonlydisplay={this.state.disabled == "TRUE" ? "DISABLED" : "ENABLED"}
+                                    />
                             </FormSection>
                             <FormSection title="PLATFORM ROLES" style={{display:'none'}}>
                                 <Input label="Super Admin" onChange={this.platformChange.bind(null, 'super_admin')} checked={state.platformRoles.super_admin} type="checkbox" />
index a332c55..f503b05 100644 (file)
             color:white;
         }
         .activeUser, &-active{
-            background: #00acee;
+            background: #00acee !important;
         }
     }
 
index ada7067..9654b4a 100644 (file)
@@ -122,7 +122,7 @@ export default class UserManagementStore {
     resetUser() {
         let username = '';
         let domain = 'system';
-        let disabled = false;
+        let disabled = "FALSE";
         let platformRoles = {
             super_admin: false,
             platform_admin: false,