From: Laurence Maultsby Date: Wed, 12 Apr 2017 18:14:06 +0000 (-0400) Subject: User platform role modification fix X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=a0fefa94b21ae1620756cda0d22d5de90b9bcaa9;p=osm%2FUI.git User platform role modification fix Signed-off-by: Laurence Maultsby --- diff --git a/skyquake/framework/core/modules/api/projectManagementAPI.js b/skyquake/framework/core/modules/api/projectManagementAPI.js index 07e873d23..c00de3240 100644 --- a/skyquake/framework/core/modules/api/projectManagementAPI.js +++ b/skyquake/framework/core/modules/api/projectManagementAPI.js @@ -228,6 +228,7 @@ ProjectManagement.updatePlatform = function(req) { var api_server = req.query['api_server']; var bodyData = req.body; data = bodyData; + data.user = JSON.parse(data.user) var updateTasks = []; var updateUser = rp({ diff --git a/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagement.jsx b/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagement.jsx index 761ce0dbf..de5064bef 100644 --- a/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagement.jsx +++ b/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagement.jsx @@ -94,7 +94,7 @@ class PlatformRoleManagement extends React.Component { this.Store.updatePlatform({ - 'user': platformUsers + 'user': JSON.stringify(platformUsers) } ); } diff --git a/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagementSource.js b/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagementSource.js index 2e1f3c0e8..724312e7f 100644 --- a/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagementSource.js +++ b/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagementSource.js @@ -80,6 +80,7 @@ module.exports = function(Alt) { url: `/platform?api_server=${API_SERVER}`, type: 'PUT', data: project, + dataType: 'json', beforeSend: Utils.addAuthorizationStub, success: function(data, textStatus, jqXHR) { resolve(data); diff --git a/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagementStore.js b/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagementStore.js index 326f13a0f..ef03b9d42 100644 --- a/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagementStore.js +++ b/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagementStore.js @@ -173,7 +173,7 @@ export default class PlatformRoleManagementStore { }) } else { let role = platformUsers[userIndex].role; - platformUsers[userIndex].role.splice(roleIndex, 1) + platformUsers[userIndex].role.splice(_.findIndex(role, function(r) { return r.role == selectedRole; }), 1) } self.setState({platformUsers});