From e0f99eb61a70218c0d93b3dabb039fda8e65e4d8 Mon Sep 17 00:00:00 2001 From: Laurence Maultsby Date: Tue, 25 Apr 2017 10:25:38 -0400 Subject: [PATCH] ProjectManagement: Cancel edit project fix Signed-off-by: Laurence Maultsby --- .../src/dashboard/dashboard.jsx | 2 +- .../src/dashboard/projectMgmtStore.js | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/skyquake/plugins/project_management/src/dashboard/dashboard.jsx b/skyquake/plugins/project_management/src/dashboard/dashboard.jsx index bc67dbf33..02b9384a3 100644 --- a/skyquake/plugins/project_management/src/dashboard/dashboard.jsx +++ b/skyquake/plugins/project_management/src/dashboard/dashboard.jsx @@ -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); diff --git a/skyquake/plugins/project_management/src/dashboard/projectMgmtStore.js b/skyquake/plugins/project_management/src/dashboard/projectMgmtStore.js index 71c10a272..f0a8eebf0 100644 --- a/skyquake/plugins/project_management/src/dashboard/projectMgmtStore.js +++ b/skyquake/plugins/project_management/src/dashboard/projectMgmtStore.js @@ -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({ -- 2.25.1