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 c513053edd..81f193ca9d 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 @@ -86,12 +86,8 @@ function onRequest(context) { var serverUrl = mdmProps["httpsURL"]; var portalUrl = mdmProps["portalURL"]; var userDomain = context.user.domain; - //var userName = context.user.username; - viewModel.serverUrl = serverUrl; viewModel.portalUrl = portalUrl; viewModel.userDomain = userDomain; - //viewModel.userName = userName; - return viewModel; } 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 54fd4d7698..f864927186 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 @@ -224,6 +224,7 @@ function loadDevices(searchType, searchParam) { return true; } + // Read "analyticsView" from config.json and return value if exists function getAnalyticsView(type) { var deviceTypes = deviceListing.data("deviceTypes"); for (var i = 0; i < deviceTypes.length; i++) { @@ -347,6 +348,7 @@ function loadDevices(searchType, searchParam) { if (analyticsEnabled(row.deviceType)) { + // redirecting to respective analytics view depending on device configs switch (getAnalyticsView(deviceType)) { case "DAS" : { statURL =portalUrl + "/portal/t/"+ userDomain+ "/dashboards/android-iot/battery?owner=" +currentUser+"&deviceId=";break;} default : {statURL=context+ "/device/" + row.deviceType +"/analytics?deviceId="}