X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Fproject_management%2Fsrc%2Fdashboard%2Fdashboard.jsx;h=66c3f4873496d7cb08b01ededabf7e2f16792a85;hp=f8018d5e32ff0cba1225f5ac2bc1c01501c2705b;hb=fd7cbe8c26487430f96511d5c3277d1c1f641e74;hpb=407555cd9dac9e0dd9889da18082ae275a0a44fd diff --git a/skyquake/plugins/project_management/src/dashboard/dashboard.jsx b/skyquake/plugins/project_management/src/dashboard/dashboard.jsx index f8018d5e3..66c3f4873 100644 --- a/skyquake/plugins/project_management/src/dashboard/dashboard.jsx +++ b/skyquake/plugins/project_management/src/dashboard/dashboard.jsx @@ -132,6 +132,7 @@ class ProjectManagementDashboard extends React.Component { }); } cleanUsers(projectUsers, projectName) { + let self = this; let cleanUsers = []; //Remove null values from role projectUsers.map((u) => { @@ -140,7 +141,7 @@ class ProjectManagementDashboard extends React.Component { u.role && u.role.map((r,i) => { let role = {}; //you may add a user without a role or a keys, but if one is present then the other must be as well. - if(r.role ) { + if(r.role) { delete r.keys; // r.keys = projectName; switch(ROLES.PROJECT.TYPE[r.role]) { @@ -150,8 +151,11 @@ class ProjectManagementDashboard extends React.Component { } }); u.role = cleanRoles; - u["rw-project-mano:mano-role"] = cleanManoRoles - cleanUsers.push(u); + u["rw-project-mano:mano-role"] = u["rw-project-mano:mano-role"] || []; + u["rw-project-mano:mano-role"] = u["rw-project-mano:mano-role"].concat(cleanManoRoles); + if (u['user-name'] != self.context.userProfile.userId) { + cleanUsers.push(u); + } }); return cleanUsers; } @@ -389,7 +393,8 @@ class ProjectManagementDashboard extends React.Component { } // onClick={this.Store.update.bind(null, Account)} ProjectManagementDashboard.contextTypes = { - router: React.PropTypes.object + router: React.PropTypes.object, + userProfile: React.PropTypes.object }; ProjectManagementDashboard.defaultProps = {