From: Laurence Maultsby Date: Tue, 25 Apr 2017 14:25:38 +0000 (-0400) Subject: ProjectManagement: Cancel edit project fix X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=commitdiff_plain;h=e0f99eb61a70218c0d93b3dabb039fda8e65e4d8;hp=5bfd6c3b0a2d8f3357f95f58dea7bb76ee7dbe28 ProjectManagement: Cancel edit project fix Signed-off-by: Laurence Maultsby --- 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({