From f32caf1833aaa1e4e8f3a3635bb15f832f9f4b24 Mon Sep 17 00:00:00 2001 From: kamidu Date: Tue, 4 Oct 2016 13:20:09 +0530 Subject: [PATCH] UI fixes in 2.2.0-beta --- .../cdmf.page.roles/public/js/role-listing.js | 6 +-- .../cdmf.page.users/public/js/listing.js | 42 +++++++++++++------ .../public/js/dataTables.extended.js | 1 + 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/public/js/role-listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/public/js/role-listing.js index 602dbc0544..b27dfbe698 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/public/js/role-listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.roles/public/js/role-listing.js @@ -83,7 +83,7 @@ function hidePopup() { * initial mode and with out select mode. */ function InitiateViewOption() { - $(location).attr('href', $(this).data("url")); + // $(location).attr('href', $(this).data("url")); } function loadRoles() { @@ -124,8 +124,8 @@ function loadRoles() { class: "remove-padding icon-only content-fill", data: null, defaultContent: "
" + - "" + - "
" + "" + + "" }, { class: "fade-edge", 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 8baf1b32e5..c21b515cd0 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 @@ -266,7 +266,7 @@ function loadUsers() { "recordsFiltered": data.count, "data": objects }; - console.log(json); + return JSON.stringify(json); }; @@ -281,9 +281,11 @@ function loadUsers() { { class: "remove-padding icon-only content-fill", data: null, - defaultContent: '
' + - '' + - '
' + render: function (data, type, row, meta) { + return '
' + + '' + + '
'; + } }, { class: "fade-edge", @@ -318,7 +320,7 @@ function loadUsers() { class: "text-right content-fill text-left-on-grid-view no-wrap", data: null, render: function (data, type, row, meta) { - return '  ' + ' ' + @@ -328,8 +330,9 @@ function loadUsers() { '' + - '' + - ''; + + var resetPasswordbtn = '' + @@ -340,8 +343,9 @@ function loadUsers() { '' + - '' + - ''; + + var removebtn = '' + @@ -353,6 +357,19 @@ function loadUsers() { '  Remove' + '' + ''; + + var returnbtnSet = ''; + if($("#can-edit").length > 0) { + returnbtnSet = returnbtnSet + editbtn; + } + if($("#can-reset-password").length > 0) { + returnbtnSet = returnbtnSet + resetPasswordbtn; + } + if($("#can-remove").length > 0) { + returnbtnSet = returnbtnSet + removebtn; + } + + return returnbtnSet; } } @@ -365,14 +382,15 @@ function loadUsers() { $('#user-grid').datatables_extended_serverside_paging(null, '/api/device-mgt/v1.0/users', dataFilter, columns, fnCreatedRow, null, options); $(loadingContentView).hide(); + } $(document).ready(function () { loadUsers(); - $(".viewEnabledIcon").click(function () { - InitiateViewOption(); - }); if (!$("#can-invite").val()) { $("#invite-user-button").remove(); } + $(".viewEnabledIcon").click(function () { + InitiateViewOption(); + }); }); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.js index bc14c19c2a..812acca6f7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.data-tables-extended/public/js/dataTables.extended.js @@ -25,6 +25,7 @@ $.fn.datatables_extended = function(settings){ // EMM related function if (InitiateViewOption) { + $(".viewEnabledIcon").unbind("click"); $(".viewEnabledIcon").bind("click", InitiateViewOption); } //--- End of EMM related codes