diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js index f38e2b69fa4..26233a32d81 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/device.js @@ -226,13 +226,14 @@ deviceModule = function () { publicMethods.getDevices = function (userName) { var url = devicemgtProps["httpsURL"] + - devicemgtProps["backendRestEndpoints"]["deviceMgt"] + "/devices/user/" + userName; + devicemgtProps["backendRestEndpoints"]["deviceMgt"] + "/devices"; return serviceInvokers.XMLHttp.get( url, function (responsePayload) { - for (var i = 0; i < responsePayload.length; i++) { - responsePayload[i].thumb = utility.getDeviceThumb(responsePayload[i].type); + var devices = JSON.parse(responsePayload.responseText).devices; + for (var i = 0; i < devices.length; i++) { + devices[i].thumb = utility.getDeviceThumb(devices[i].type); } - return responsePayload; + return devices; }, function (responsePayload) { log.error(responsePayload); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/public/js/policy-list.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/public/js/policy-list.js index f9d8c14c2cf..65445b3929a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/public/js/policy-list.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/public/js/policy-list.js @@ -20,7 +20,10 @@ var sortUpdateBtn = "#sortUpdateBtn"; var sortedIDs; var dataTableSelection = '.DTTT_selected'; -$('#policy-grid').datatables_extended(); +var settings = { + "sorting": false +}; +$('#policy-grid').datatables_extended(settings); $(".icon .text").res_text(0.2); var saveNewPrioritiesButton = "#save-new-priorities-button"; @@ -90,7 +93,7 @@ function showPopup() { function hidePopup() { $(modalPopupContent).html(''); $(modalPopup).modal('hide'); - $('body').removeClass('modal-open').css('padding-right','0px'); + $('body').removeClass('modal-open').css('padding-right', '0px'); $('.modal-backdrop').remove(); } @@ -208,7 +211,7 @@ $(document).ready(function () { }, function () { $("#save-policy-priorities-error-content").find(".message-from-server").html( - "Message From Server : " + data["statusText"]); + "Message From Server : " + data["statusText"]); $(modalPopupContent).html($('#save-policy-priorities-error-content').html()); showPopup(); $("a#save-policy-priorities-error-link").click(function () { @@ -222,7 +225,7 @@ $(document).ready(function () { $(".policy-unpublish-link").click(function () { var policyList = getSelectedPolicies(); var statusList = getSelectedPolicyStates(); - if ( ($.inArray( 'Inactive/Updated', statusList ) > -1) || ($.inArray( 'Inactive', statusList ) > -1) ) { + if (($.inArray('Inactive/Updated', statusList) > -1) || ($.inArray('Inactive', statusList) > -1)) { $(modalPopupContent).html($("#errorPolicyUnPublishSelection").html()); showPopup(); } else { @@ -266,7 +269,7 @@ $(document).ready(function () { $(".policy-publish-link").click(function () { var policyList = getSelectedPolicies(); var statusList = getSelectedPolicyStates(); - if ( ($.inArray( 'Active/Updated', statusList ) > -1) || ($.inArray( 'Active', statusList ) > -1) ) { + if (($.inArray('Active/Updated', statusList) > -1) || ($.inArray('Active', statusList) > -1)) { $(modalPopupContent).html($("#errorPolicyPublishSelection").html()); showPopup(); } else { 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 b27dfbe6983..d5cb812ce26 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 @@ -45,9 +45,9 @@ var isInit = true; * the font icons change the size to respective screen resolution. * */ -$(document).on( 'draw.dt', function () { +$(document).on('draw.dt', function () { $(".icon .text").res_text(0.2); -} ); +}); /* @@ -72,7 +72,7 @@ function showPopup() { function hidePopup() { $(modalPopupContent).html(''); $(modalPopup).modal('hide'); - $('body').removeClass('modal-open').css('padding-right','0px'); + $('body').removeClass('modal-open').css('padding-right', '0px'); $('.modal-backdrop').remove(); } @@ -95,7 +95,7 @@ function loadRoles() { var objects = []; - $(data.roles).each(function( index ) { + $(data.roles).each(function (index) { objects.push( { name: data.roles[index], @@ -182,10 +182,13 @@ function loadRoles() { var options = { "placeholder": "Search By Role Name", - "searchKey" : "filter" + "searchKey": "filter" + }; + var settings = { + "sorting": false }; - $('#role-grid').datatables_extended_serverside_paging(null, '/api/device-mgt/v1.0/roles', dataFilter, columns, fnCreatedRow, null, options); + $('#role-grid').datatables_extended_serverside_paging(settings, '/api/device-mgt/v1.0/roles', dataFilter, columns, fnCreatedRow, null, options); loadingContent.hide(); } 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 4a69e766722..43d6de1a83d 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 @@ -50,9 +50,9 @@ var body = "body"; * the font icons change the size to respective screen resolution. * */ -$(document).on( 'draw.dt', function () { +$(document).on('draw.dt', function () { $(".icon .text").res_text(0.2); -} ); +}); /* * set popup maximum height function. @@ -75,7 +75,7 @@ function showPopup() { function hidePopup() { $(modalPopupContent).html(''); $(modalPopup).modal('hide'); - $('body').removeClass('modal-open').css('padding-right','0px'); + $('body').removeClass('modal-open').css('padding-right', '0px'); $('.modal-backdrop').remove(); } @@ -270,13 +270,14 @@ function loadUsers() { var objects = []; - $(data.users).each( function (index) { + $(data.users).each(function (index) { objects.push({ filter: data.users[index].username, - firstname: data.users[index].firstname ? data.users[index].firstname : "" , + firstname: data.users[index].firstname ? data.users[index].firstname : "", lastname: data.users[index].lastname ? data.users[index].lastname : "", - emailAddress : data.users[index].emailAddress ? data.users[index].emailAddress : "", - DT_RowId : "user-" + data.users[index].username}) + emailAddress: data.users[index].emailAddress ? data.users[index].emailAddress : "", + DT_RowId: "user-" + data.users[index].username + }) }); var json = { @@ -300,7 +301,7 @@ function loadUsers() { class: "remove-padding icon-only content-fill", data: null, render: function (data, type, row, meta) { - return '