From 36bd1c5daf3d61a10f953adf471475f57f12e320 Mon Sep 17 00:00:00 2001 From: GDLMadushanka Date: Tue, 6 Jun 2017 09:44:30 +0530 Subject: [PATCH] Refactoring --- .../devicemgt/app/pages/cdmf.page.devices/devices.js | 4 ---- .../app/pages/cdmf.page.devices/public/js/listing.js | 2 ++ 2 files changed, 2 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 c513053eddc..81f193ca9dd 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 54fd4d7698b..f8649271860 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="}