From: Laurence Maultsby Date: Tue, 25 Apr 2017 17:19:32 +0000 (-0400) Subject: UserManagment now displays users after arriving through user profile page X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=commitdiff_plain;h=85a7a30702d8aad61f8e88709da411371caeb765 UserManagment now displays users after arriving through user profile page Signed-off-by: Laurence Maultsby --- diff --git a/skyquake/plugins/user_management/src/userProfile/userProfileActions.js b/skyquake/plugins/user_management/src/userProfile/userProfileActions.js index a0a34d9b3..128b5976a 100644 --- a/skyquake/plugins/user_management/src/userProfile/userProfileActions.js +++ b/skyquake/plugins/user_management/src/userProfile/userProfileActions.js @@ -11,15 +11,10 @@ module.exports = function(Alt) { 'editUser', 'handleCloseUserPanel', 'handleHideColumns', - 'getUsersSuccess', 'getUsersNotification', 'handleDisabledChange', 'handlePlatformRoleUpdate', - 'handleAddUser', - 'handleCreateUser', 'handleUpdateUser', - 'updateUserSuccess', - 'createUserSuccess', - 'deleteUserSuccess' + 'updateUserSuccess' ); } diff --git a/skyquake/plugins/user_management/src/userProfile/userProfileSource.js b/skyquake/plugins/user_management/src/userProfile/userProfileSource.js index 267387a4d..aaf10d7d2 100644 --- a/skyquake/plugins/user_management/src/userProfile/userProfileSource.js +++ b/skyquake/plugins/user_management/src/userProfile/userProfileSource.js @@ -17,34 +17,6 @@ if (DEV_MODE) { module.exports = function(Alt) { return { - getUsers: { - remote: function() { - return new Promise(function(resolve, reject) { - $.ajax({ - url: `/user?api_server=${API_SERVER}`, - type: 'GET', - beforeSend: Utils.addAuthorizationStub, - success: function(data, textStatus, jqXHR) { - resolve(data.user); - } - }).fail(function(xhr){ - //Authentication and the handling of fail states should be wrapped up into a connection class. - Utils.checkAuthentication(xhr.status); - let msg = xhr.responseText; - if(xhr.errorMessage) { - msg = xhr.errorMessage - } - reject(msg); - }); - }); - }, - interceptResponse: interceptResponse({ - 'error': 'There was an error retrieving the resource orchestrator information.' - }), - success: Alt.actions.global.getUsersSuccess, - loading: Alt.actions.global.showScreenLoader, - error: Alt.actions.global.showNotification - }, updateUser: { remote: function(state, user) { return new Promise(function(resolve, reject) { @@ -74,35 +46,6 @@ module.exports = function(Alt) { loading: Alt.actions.global.showScreenLoader, error: Alt.actions.global.showNotification }, - deleteUser: { - remote: function(state, user) { - return new Promise(function(resolve, reject) { - $.ajax({ - url: `/user/${user['user-name']}/${user['user-domain']}?api_server=${API_SERVER}`, - type: 'DELETE', - data: user, - beforeSend: Utils.addAuthorizationStub, - success: function(data, textStatus, jqXHR) { - resolve(data); - } - }).fail(function(xhr){ - //Authentication and the handling of fail states should be wrapped up into a connection class. - Utils.checkAuthentication(xhr.status); - let msg = xhr.responseText; - if(xhr.errorMessage) { - msg = xhr.errorMessage - } - reject(msg); - }); - }); - }, - interceptResponse: interceptResponse({ - 'error': 'There was an error deleting the user.' - }), - success: Alt.actions.global.deleteUserSuccess, - loading: Alt.actions.global.showScreenLoader, - error: Alt.actions.global.showNotification - }, createUser: { remote: function(state, user) { diff --git a/skyquake/plugins/user_management/src/userProfile/userProfileStore.js b/skyquake/plugins/user_management/src/userProfile/userProfileStore.js index 8febbd194..b8a721b8d 100644 --- a/skyquake/plugins/user_management/src/userProfile/userProfileStore.js +++ b/skyquake/plugins/user_management/src/userProfile/userProfileStore.js @@ -167,11 +167,6 @@ export default class UserProfileStore { handleUpdateUser() { } - - getUsersSuccess(users) { - this.alt.actions.global.hideScreenLoader.defer(); - this.setState({users}); - } updateUserSuccess() { this.alt.actions.global.hideScreenLoader.defer(); let users = this.users || [];