ProjectManagement: Cancel edit project fix
authorLaurence Maultsby <laurence.maultsby@riftio.com>
Tue, 25 Apr 2017 14:25:38 +0000 (10:25 -0400)
committerLaurence Maultsby <laurence.maultsby@riftio.com>
Tue, 25 Apr 2017 14:25:38 +0000 (10:25 -0400)
Signed-off-by: Laurence Maultsby <laurence.maultsby@riftio.com>
skyquake/plugins/project_management/src/dashboard/dashboard.jsx
skyquake/plugins/project_management/src/dashboard/projectMgmtStore.js

index bc67dbf..02b9384 100644 (file)
@@ -76,7 +76,7 @@ class ProjectManagementDashboard extends React.Component {
         this.actions.handleAddProject();
     }
     viewProject = (un, index) => {
-        this.actions.viewProject(un, index);
+        this.actions.viewProject(un, index, true);
     }
     editProject = () => {
         this.actions.editProject(false);
index 71c10a2..f0a8eeb 100644 (file)
@@ -58,9 +58,11 @@ export default class ProjectManagementStore {
             projectRoles
         });
     }
-    viewProject(data) {
+    viewProject() {
+        let data = arguments[0];
         let project = data[0];
         let projectIndex = data[1];
+        let isReadOnly = data[2];
 
         let ProjectData = {
             'name': project['name'],
@@ -71,14 +73,15 @@ export default class ProjectManagementStore {
             activeIndex: projectIndex,
             projectOpen: true,
             isEdit: true,
-            isReadOnly: true
+            isReadOnly: isReadOnly
         }, ProjectData);
         this.setState(state)
     }
-    editProject(isEdit) {
-        this.setState({
-            isReadOnly: isEdit
-        })
+    editProject(isReadOnly) {
+        this.viewProject([this.projects[this.activeIndex], this.activeIndex, isReadOnly]);
+        // this.setState({
+        //     isReadOnly: isEdit
+        // })
     }
     handleCloseProjectPanel() {
         this.setState({