From 0642cc10d733267e87886f695149f3ebb38bf2b5 Mon Sep 17 00:00:00 2001 From: Megala Date: Wed, 5 Oct 2016 10:52:40 +0530 Subject: [PATCH] Reformatting code --- .../mgt/jaxrs/service/api/UserManagementService.java | 1 - .../devicemgt/app/modules/business-controllers/user.js | 4 ++-- .../app/pages/cdmf.page.user.edit/public/js/bottomJs.js | 2 +- .../app/pages/cdmf.page.users/public/js/listing.js | 8 +++----- .../cdmf.unit.ui.header.user-menu/public/js/user-menu.js | 2 -- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java index c8d528dd3e1..1a5e3440efc 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java @@ -135,7 +135,6 @@ public interface UserManagementService { " fetching the requested user.", response = ErrorResponse.class) }) - @Permission(name = "View Users", permission = "/device-mgt/users/view") Response getUser( @ApiParam( diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js index 299c39ebc64..b229ab8ef87 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js @@ -180,7 +180,7 @@ var userModule = function () { var domain; if (username.indexOf('/') > 0) { domain = username.substr(0, username.indexOf('/')); - username = username.substr(username.indexOf('/')+1); + username = username.substr(username.indexOf('/') + 1); } try { utility.startTenantFlow(carbonUser); @@ -210,7 +210,7 @@ var userModule = function () { var domain; if (username.indexOf('/') > 0) { domain = username.substr(0, username.indexOf('/')); - username = username.substr(username.indexOf('/')+1); + username = username.substr(username.indexOf('/') + 1); } try { utility.startTenantFlow(carbonUser); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.edit/public/js/bottomJs.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.edit/public/js/bottomJs.js index a39472b01a3..00357909e6a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.edit/public/js/bottomJs.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.user.edit/public/js/bottomJs.js @@ -236,7 +236,7 @@ $(document).ready(function () { } addUserFormData.roles = roles; username = username.substr(username.indexOf('/') + 1); - var addUserAPI = deviceMgtBasePath + "/users/" + username + "?domain="+domain; + var addUserAPI = deviceMgtBasePath + "/users/" + username + "?domain=" + domain; invokerUtil.put( addUserAPI, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js index 8dcc450f80e..91783daadb2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js @@ -165,14 +165,12 @@ function resetPassword(username) { var domain; if (username.indexOf('/') > 0) { domain = username.substr(0, username.indexOf('/')); - username = username.substr(username.indexOf('/')+1); + username = username.substr(username.indexOf('/') + 1); } - var resetPasswordServiceURL = apiBasePath + "/admin/users/"+ username +"/credentials"; - + var resetPasswordServiceURL = apiBasePath + "/admin/users/" + username + "/credentials"; if (domain) { resetPasswordServiceURL += '?domain=' + domain; } - invokerUtil.post( resetPasswordServiceURL, resetPasswordFormData, @@ -209,7 +207,7 @@ function removeUser(username) { var domain; if (username.indexOf('/') > 0) { domain = username.substr(0, username.indexOf('/')); - username = username.substr(username.indexOf('/')+1); + username = username.substr(username.indexOf('/') + 1); } var removeUserAPI = apiBasePath + "/users/" + username; if (domain) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/public/js/user-menu.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/public/js/user-menu.js index 3d103689eeb..420abf5d83f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/public/js/user-menu.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.user-menu/public/js/user-menu.js @@ -66,9 +66,7 @@ $(document).ready(function () { var changePasswordFormData = {}; changePasswordFormData["oldPassword"] = unescape((currentPassword)); changePasswordFormData["newPassword"] = unescape((newPassword)); - var changePasswordAPI = "/api/device-mgt/v1.0/users/credentials"; - invokerUtil.put( changePasswordAPI, changePasswordFormData,