diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/public/js/bottomJs.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/public/js/bottomJs.js
index 013402bf84..93f7817db9 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/public/js/bottomJs.js
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.role.create/public/js/bottomJs.js
@@ -99,12 +99,9 @@ function formatRepo (user) {
var markup = '
' +
'
' +
'
' +
- '
User : ' + user.username + '
';
- if (user.name) {
- markup += '
' + user.name + '
';
- }
- if (user.emailAddress) {
- markup += '
' + user.emailAddress + '
';
+ '
' + user.username + '
';
+ if (user.name || user.name != undefined) {
+ markup += '
( ' + user.name + ' )
';
}
markup += '
';
return markup;
@@ -140,8 +137,9 @@ $(document).ready(function () {
var user = {};
user.id = value.username;
user.username = value.username;
- user.name = value.firstname + " " + value.lastname;
- user.emailAddress = value.emailAddress;
+ if(value.firstname && value.lastname) {
+ user.name = value.firstname + " " + value.lastname;
+ }
newData.push(user);
});
return {
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 c6ce0978ac..13192b0cda 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
@@ -234,13 +234,8 @@ $(document).ready(function () {
addUserAPI,
addUserFormData,
function (data, textStatus, jqXHR) {
- if (jqXHR.status == 201) {
+ if (jqXHR.status == 200) {
// Clearing user input fields.
- $("input#username").val("");
- $("input#firstname").val("");
- $("input#lastname").val("");
- $("input#email").val("");
- $("select#roles").select2("val", "");
// Refreshing with success message
$("#user-create-form").addClass("hidden");
$("#user-created-msg").removeClass("hidden");