X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=skyquake%2Fplugins%2Fproject_management%2Fsrc%2Fdashboard%2Fdashboard.jsx;h=f1fca657c4f9ac0bdc58a6ae949577438caf2369;hb=b584e4b139ec4a30a97ea42ff54c76753731d707;hp=4cbb1ef838ec4baffc121c5879a824a4ab8910bb;hpb=de8cda680ce17b1555789bf2f4d3145c0d4d4849;p=osm%2FUI.git
diff --git a/skyquake/plugins/project_management/src/dashboard/dashboard.jsx b/skyquake/plugins/project_management/src/dashboard/dashboard.jsx
index 4cbb1ef83..f1fca657c 100644
--- a/skyquake/plugins/project_management/src/dashboard/dashboard.jsx
+++ b/skyquake/plugins/project_management/src/dashboard/dashboard.jsx
@@ -7,6 +7,7 @@ import ReactDOM from 'react-dom';
import AppHeader from 'widgets/header/header.jsx';
import ProjectManagementStore from './projectMgmtStore.js';
import SkyquakeComponent from 'widgets/skyquake_container/skyquakeComponent.jsx';
+import SkyquakeRBAC from 'widgets/skyquake_rbac/skyquakeRBAC.jsx';
import 'style/layout.scss';
import './projectMgmt.scss';
import {Panel, PanelWrapper} from 'widgets/panel/panel';
@@ -20,6 +21,10 @@ import 'widgets/form_controls/formControls.scss';
import imgAdd from '../../node_modules/open-iconic/svg/plus.svg'
import imgRemove from '../../node_modules/open-iconic/svg/trash.svg'
+import ROLES from 'utils/roleConstants.js';
+const PROJECT_ROLES = ROLES.PROJECT;
+const PLATFORM = ROLES.PLATFORM;
+
class ProjectManagementDashboard extends React.Component {
constructor(props) {
super(props);
@@ -94,11 +99,13 @@ class ProjectManagementDashboard extends React.Component {
let self = this;
e.preventDefault();
e.stopPropagation();
+ let projectName = self.state['name'];
let projectUsers = self.state.projectUsers;
- let cleanUsers = this.cleanUsers(projectUsers);
+ let cleanUsers = this.cleanUsers(projectUsers, projectName);
+
this.Store.createProject({
- 'name': self.state['name'],
+ 'name': projectName,
'description': self.state.description,
'project-config' : {
'user': cleanUsers
@@ -109,18 +116,20 @@ class ProjectManagementDashboard extends React.Component {
let self = this;
e.preventDefault();
e.stopPropagation();
+ let projectName = self.state['name'];
let projectUsers = self.state.projectUsers;
- let cleanUsers = this.cleanUsers(projectUsers);
+ let cleanUsers = this.cleanUsers(projectUsers, projectName);
+
this.Store.updateProject(_.merge({
- 'name': self.state['name'],
+ 'name': projectName,
'description': self.state.description,
'project-config' : {
'user': cleanUsers
}
}));
}
- cleanUsers(projectUsers) {
+ cleanUsers(projectUsers, projectName) {
let cleanUsers = [];
//Remove null values from role
projectUsers.map((u) => {
@@ -128,8 +137,10 @@ 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 || ( !r || ((r.role || r['keys']) && (!r.role || !r['keys'])))) {
+ if(!r.role ) {
} else {
+ delete r.keys;
+ // r.keys = projectName;
cleanRoles.push(r)
}
});
@@ -206,9 +217,9 @@ class ProjectManagementDashboard extends React.Component {
let state = this.state;
let passwordSectionHTML = null;
let formButtonsHTML = (
-