From 9f615916d01da80f471278789173c0317c83113a Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Sun, 11 Dec 2016 14:56:31 +0530 Subject: [PATCH] Fixing analyticsEnabled and groupingEnabled not working --- .../devicemgt/app/pages/cdmf.page.devices/devices.js | 4 +++- .../app/pages/cdmf.page.devices/public/js/listing.js | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js index 40d7ee1d6b..1c2d01b26b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js @@ -65,7 +65,9 @@ function onRequest(context) { "type": data[i], "category": deviceType.category, "label": deviceType.label, - "thumb": utility.getDeviceThumb(data[i]) + "thumb": utility.getDeviceThumb(data[i]), + "analyticsEnabled": deviceType.analyticsEnabled, + "groupingEnabled": deviceType.groupingEnabled }); } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js index a340b0e6f2..65c74e886c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js @@ -66,7 +66,7 @@ $(document).ready(function () { $.hasPermission = function (permission) { return permissionSet[permission]; }; - + deviceListing = $("#device-listing"); currentUser = deviceListing.data("current-user"); @@ -246,7 +246,7 @@ function loadDevices(searchType, searchParam) { return true; } // In JS Boolean("false") returns TRUE => http://stackoverflow.com/a/264037/1560536 - return (analyticsEnabled == "true"); + return (groupingEnabled == "true"); } } return true; @@ -351,7 +351,7 @@ function loadDevices(searchType, searchParam) { ''; } - if (!groupName || !groupId) { + if ((!groupName || !groupId) && groupingEnabled(row.deviceType)) { html += '