Nav re-order. Profile page
authorLaurence Maultsby <laurence.maultsby@riftio.com>
Mon, 10 Apr 2017 13:10:22 +0000 (09:10 -0400)
committerLaurence Maultsby <laurence.maultsby@riftio.com>
Mon, 10 Apr 2017 13:10:22 +0000 (09:10 -0400)
Signed-off-by: Laurence Maultsby <laurence.maultsby@riftio.com>
skyquake/framework/core/modules/api/userManagementAPI.js
skyquake/framework/widgets/skyquake_nav/skyquakeNav.scss
skyquake/plugins/accounts/config.json
skyquake/plugins/config/config.json
skyquake/plugins/logging/config.json
skyquake/plugins/project_management/config.json
skyquake/plugins/user_management/config.json
skyquake/plugins/user_management/src/dashboard/userMgmt.scss
skyquake/plugins/user_management/src/userProfile/userProfile.jsx

index c6260df..b0b8ad5 100644 (file)
@@ -107,6 +107,8 @@ UserManagement.getUserInfo = function(req, userId, domain) {
 
                         }
                     },
+                    //id/key values for each project
+                    projectId:[],
                     project: {
                         /**
                          *  [projectId] : {
@@ -123,6 +125,7 @@ UserManagement.getUserInfo = function(req, userId, domain) {
                 var userProjects = [];
                 projects && projects.map(function(p, i) {
                     var users = p['project-config'] && p['project-config'].user;
+                    userData.projectId.push(p.name);
                     users && users.map(function(u) {
                         if(u['user-name'] == id) {
                             userData.project[p.name] = {
index c31dd7a..6d2e581 100644 (file)
                 justify-content: flex-end;
         }
         .app {
+            display: -ms-flexbox;
+            display: block;
             position:relative;
             margin: auto 0.5rem;
+            min-width: 140px;
             h2 {
                 font-size:0.75rem;
                 border-right: 1px solid black;
                 display: -ms-flexbox;
                 display: flex;
+                -ms-flex-pack: start;
+                -ms-flex-pack: start;
+                justify-content: flex-start;
                 -ms-flex-align: center;
-                    align-items: center;
+                align-items: center;
                 .oi {
                     padding-right: 0.5rem;
                 }
@@ -40,6 +46,9 @@
                 display:none;
                 z-index:2;
                 width: 100%;
+                li {
+                    text-align:left;
+                }
             }
             &:first-child{
                 h2 {
@@ -77,7 +86,7 @@
             padding:0.5rem 1rem;
             text-decoration:none;
             text-transform:uppercase;
-            text-align:center;
+            text-align:left;
             color:white;
         }
         &:before {
             align-items:center;
             padding-left: 1rem;
             text-transform:uppercase;
-            text-align: center;
+            text-align: left;
             border-left:1px solid white;
             .projectSelect {
                 padding: 0 0.5rem;
index 81bb702..7bea692 100644 (file)
@@ -2,7 +2,7 @@
     "root": "public",
     "name": "Accounts",
     "dashboard": "./account/accountsDashboard.jsx",
-    "order": 1,
+    "order": 3,
     "priority":1,
     "routes": [
     {
index 6fd9f43..a861d72 100644 (file)
@@ -4,6 +4,7 @@
     "dashboard": "./dashboard/dashboard.jsx",
     "order": 1,
     "priority":1,
+    "admin_link": true,
     "routes": [
     {
         "label": "Configuration Dashboard",
index 7c43dc0..bd6a017 100644 (file)
@@ -2,7 +2,7 @@
     "root": "public",
     "name": "Logging",
     "dashboard": "./loggingGeneral.jsx",
-    "order": 101,
+    "order": 1,
     "priority":2,
     "admin_link": true,
     "routes": [
index b78e3b2..642fb90 100644 (file)
@@ -3,7 +3,8 @@
     "name": "Project Management",
     "dashboard": "./dashboard/dashboard.jsx",
     "order": 1,
-    "priority":1,
+    "priority":2,
+    "admin_link": true,
     "routes": [
     {
         "label": "Project Management Dashboard",
index 42e3f18..0366214 100644 (file)
@@ -4,6 +4,7 @@
     "dashboard": "./dashboard/dashboard.jsx",
     "order": 1,
     "priority":1,
+    "admin_link": true,
     "allow": ["rw-rbac-platform:super-admin", "rw-rbac-platform:platform-admin", "rw-rbac-platform:platform-oper"],
     "routes": [
     {
index da31abf..4e935ea 100644 (file)
             background: #00acee;
         }
     }
+
+
+    .userProfile {
+        &-table {
+            thead{
+                font-weight:bold;
+            }
+            font-size: 1rem;
+            tr {
+                td {
+                    vertical-align:top;
+                }
+            }
+        }
+    }
 }
 
 .addInput, .removeInput {
         text-transform: uppercase;
     }
 }
+
index 67d5515..d7cb600 100644 (file)
@@ -38,7 +38,6 @@ class UserProfileDashboard extends React.Component {
     }
     componentWillMount() {
         this.Store.listen(this.updateState);
-        this.Store.getUsers();
     }
     componentWillUnmount() {
         this.Store.unlisten(this.updateState);
@@ -173,6 +172,7 @@ class UserProfileDashboard extends React.Component {
     render() {
 
         let self = this;
+        const User = this.context.userProfile || {};
         let html;
         let props = this.props;
         let state = this.state;
@@ -182,74 +182,62 @@ class UserProfileDashboard extends React.Component {
                 <Button label="EDIT" type="submit" onClick={this.editUser} />
             </ButtonGroup>
         );
-        const User = this.context.userProfile || {};
-            passwordSectionHTML = (
-                                        (
-                                            <FormSection title="PASSWORD CHANGE">
-                                                <Input label="NEW PASSWORD" type="password" value={state['new-password']}  onChange={this.updateInput.bind(null, 'new-password')}/>
-                                                <Input label="REPEAT NEW PASSWORD" type="password"  value={state['confirm-password']}  onChange={this.updateInput.bind(null, 'confirm-password')}/>
-                                            </FormSection>
-                                        )
-                                    );
-            formButtonsHTML = (
-
-
-                                    <ButtonGroup className="buttonGroup">
-                                        <Button label="Update" type="submit" onClick={this.updateUser} />
-                                    </ButtonGroup>
-
-
-                            )
+        passwordSectionHTML = (
+            (
+                <FormSection title="PASSWORD CHANGE">
+                    <Input label="NEW PASSWORD" type="password" value={state['new-password']}  onChange={this.updateInput.bind(null, 'new-password')}/>
+                    <Input label="REPEAT NEW PASSWORD" type="password"  value={state['confirm-password']}  onChange={this.updateInput.bind(null, 'confirm-password')}/>
+                </FormSection>
+            )
+        );
+        formButtonsHTML = (
+                <ButtonGroup className="buttonGroup">
+                    <Button label="Update" type="submit" onClick={this.updateUser} />
+                </ButtonGroup>
+        )
 
         html = (
             <PanelWrapper column>
                 <PanelWrapper className={`row userManagement ${!this.state.userOpen ? 'userList-open' : ''}`} style={{'flexDirection': 'row'}} >
                     <PanelWrapper ref={(div) => { this.UserList = div}} className={`column userList expanded hideColumns`}>
                         <Panel title={User.userId} style={{marginBottom: 0}} no-corners>
-                            <table>
-                                <thead>
-                                    <tr>
-                                        <td>User Name</td>
+                            <FormSection title="USER INFO">
+                                <table className="userProfile-table">
+                                    <thead>
+                                        <tr>
+                                            <td>Project</td>
+                                            <td>Role</td>
+                                        </tr>
+                                    </thead>
+                                    <tbody>
                                         {
-                                            state.roles.map((r,i) => {
-                                                return <td key={i}>{r}</td>
+                                            User.data && User.data.projectId && User.data.projectId.map((p,i)=> {
+                                                let project = User.data.project[p];
+                                                let projectConfig = project && project.data['project-config'];
+                                                let userRoles = [];
+                                                return (
+                                                    <tr key={i}>
+                                                        <td>
+                                                            {p}
+                                                        </td>
+                                                        <td>
+                                                            {
+                                                                project && Object.keys(project.role).map(function(k) {
+                                                                    return <div>{k}</div>
+                                                                })
+                                                            }
+                                                        </td>
+                                                    </tr>
+                                                )
                                             })
                                         }
-                                    </tr>
-                                </thead>
-                                <tbody>
-                                    {
-                                        User.projects && User.projects.map((p,i)=> {
-                                            let projectConfig = p['project-config'];
-                                            let userRoles = [];
-                                            if(projectConfig && projectConfig.user) {
-                                                projectConfig.user.map((u) => {
-                                                    if(u['user-name'] == User.userId) {
-                                                        userRoles = u.role && u.role.map((r) => {
-                                                            return r.role;
-                                                        })
-                                                    }
-                                                })
-                                            }
-                                            return (
-                                                <tr key={i}>
-                                                    <td>
-                                                        {p.name}
-                                                    </td>
-                                                    {
-                                                        state.roles.map((r,j) => {
-                                                            return <td key={j}><Input readonly={state.isReadOnly} type="checkbox" checked={(userRoles.indexOf(r) > -1)} /></td>
-                                                        })
-                                                    }
-                                                </tr>
-                                            )
-                                        })
-                                    }
-                                </tbody>
-                            </table>
+                                    </tbody>
+                                </table>
+                            </FormSection>
                             {passwordSectionHTML}
+
                         </Panel>
-                        {formButtonsHTML}
+                         {formButtonsHTML}
                     </PanelWrapper>
 
                 </PanelWrapper>