projects
/
osm
/
UI.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Close button on view user in user management dashboard" into projects
[osm/UI.git]
/
skyquake
/
plugins
/
project_management
/
src
/
dashboard
/
dashboard.jsx
diff --git
a/skyquake/plugins/project_management/src/dashboard/dashboard.jsx
b/skyquake/plugins/project_management/src/dashboard/dashboard.jsx
index
e9847e5
..
c0adc7a
100644
(file)
--- 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) {
});
}
cleanUsers(projectUsers, projectName) {
+ let self = this;
let cleanUsers = [];
//Remove null values from role
projectUsers.map((u) => {
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.
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]) {
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.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;
}
});
return cleanUsers;
}
@@
-307,7
+311,7
@@
class ProjectManagementDashboard extends React.Component {
</FormSection>
<FormSection title="USER ROLES" className="userTable">
</FormSection>
<FormSection title="USER ROLES" className="userTable">
- <table>
+ <table
className="projectTable"
>
<thead>
<tr>
{!state.isReadOnly ? <td></td> : null}
<thead>
<tr>
{!state.isReadOnly ? <td></td> : null}
@@
-322,9
+326,13
@@
class ProjectManagementDashboard extends React.Component {
<tbody>
{
state.projectUsers.map((u,i)=> {
<tbody>
{
state.projectUsers.map((u,i)=> {
- let userRoles = u.role && u.role.map((r) => {
- return r.role;
- }) || [];
+ let userRoles = []
+ u.role && u.role.map((r) => {
+ userRoles.push(r.role);
+ });
+ u["rw-project-mano:mano-role"] && u["rw-project-mano:mano-role"].map((r) => {
+ userRoles.push(r.role);
+ });
return (
<tr key={i}>
{!state.isReadOnly ? <td><span
return (
<tr key={i}>
{!state.isReadOnly ? <td><span
@@
-385,7
+393,8
@@
class ProjectManagementDashboard extends React.Component {
}
// onClick={this.Store.update.bind(null, Account)}
ProjectManagementDashboard.contextTypes = {
}
// onClick={this.Store.update.bind(null, Account)}
ProjectManagementDashboard.contextTypes = {
- router: React.PropTypes.object
+ router: React.PropTypes.object,
+ userProfile: React.PropTypes.object
};
ProjectManagementDashboard.defaultProps = {
};
ProjectManagementDashboard.defaultProps = {