From 139bc99cc706ec6f5ae9a0eb51f64a1966fae08d Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Fri, 23 Jun 2017 16:37:08 +0530 Subject: [PATCH 1/3] Adding error logs when unexpected error from gateway --- .../devicemgt/app/modules/business-controllers/device.js | 4 ++++ .../resources/jaggeryapps/devicemgt/app/modules/constants.js | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) 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 3181fc7a62d..0300b99e183 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 @@ -259,6 +259,10 @@ deviceModule = function () { } return serviceInvokers.XMLHttp.get( url, function (responsePayload) { + if(!responsePayload["responseText"]){ + log.error("Error while fetching device count. API `" + url + "` returns HTTP: " + responsePayload["status"]); + throw constants["ERRORS"]["UNKNOWN_ERROR"]; + } return parse(responsePayload["responseText"])["count"]; }, function (responsePayload) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/constants.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/constants.js index 56d03a6ce9f..f499da1c999 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/constants.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/constants.js @@ -47,7 +47,8 @@ var LANGUAGE_US = "en_US"; var VENDOR_APPLE = "Apple"; var ERRORS = { - "USER_NOT_FOUND": "USER_NOT_FOUND" + "USER_NOT_FOUND": "USER_NOT_FOUND", + "UNKNOWN_ERROR": "Unknown Error" }; var USER_STORES_NOISY_CHAR = "\""; From bfbaf00e34700483cf4d2f3326938e79d84dea0e Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Fri, 23 Jun 2017 16:37:22 +0530 Subject: [PATCH 2/3] Fixing android geo fencing ui --- .../app/units/cdmf.unit.device.view/public/css/main.css | 1 + .../app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs | 3 +-- .../app/units/cdmf.unit.geo-dashboard/public/js/app.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/css/main.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/css/main.css index e4891d63b7c..8d8bee65d48 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/css/main.css +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/css/main.css @@ -40,6 +40,7 @@ .app-info h4{ margin-bottom: 0px; + overflow-wrap: break-word; } .application i{ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs index c1121ba4f5a..b199f30e9c9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs @@ -691,8 +691,7 @@ initializeGeoLocation() }); {{#if showGeoFencingTools}} - var locationItems = geoLocationLink.closest('li'); - var geoToolsMenu = $("