From 68a5415e0b4fe37ff713d07d4d89718f095ca0ff Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Tue, 23 Jan 2018 15:19:03 +0530 Subject: [PATCH] Fixing https://github.com/wso2/product-iots/issues/1623 --- .../cdmf.unit.geo-dashboard/geo-dashboard.hbs | 36 +++++++++---------- .../cdmf.unit.geo-dashboard/geo-dashboard.js | 2 +- .../public/js/geo_fencing.js | 4 +-- .../public/js/geo_remote.js | 8 ++--- 4 files changed, 23 insertions(+), 27 deletions(-) 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 49f4e02bade..151a91e9fd6 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 @@ -576,8 +576,8 @@
- - + + Name of the selected area(e.g. colombo)
@@ -589,9 +589,8 @@
-
@@ -607,8 +606,8 @@
- - + + Name of the selected area(e.g. colombo)
@@ -620,9 +619,8 @@
-
@@ -639,8 +637,8 @@
- - + + Name of the selected area(e.g. colombo) @@ -658,9 +656,8 @@
-
@@ -676,8 +673,8 @@
- - + + Name of the selected area(e.g. colombo)
@@ -689,9 +686,8 @@
-
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.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.js index 4094fc89dc4..f18b1172595 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.js @@ -60,6 +60,6 @@ function onRequest(context) { } else { viewModel.lastLocation = stringify({}); } - viewModel.geoServicesEnabled = devicemgtProps.serverConfig.operationAnalyticsConfiguration.isEnabled; + viewModel.geoServicesEnabled = devicemgtProps.serverConfig.geoLocationConfiguration.isEnabled; return viewModel; } \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_fencing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_fencing.js index 8457e973e5f..5996dbcac35 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_fencing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_fencing.js @@ -271,8 +271,8 @@ function createPopup(layer,id) { return; } - popupTemplate.find('#exportGeoJson').attr('leaflet_id', layer._leaflet_id); - popupTemplate.find('#editGeoJson').attr('leaflet_id', layer._leaflet_id); + popupTemplate.find('.exportGeoJson').attr('leaflet_id', layer._leaflet_id); + popupTemplate.find('.editGeoJson').attr('leaflet_id', layer._leaflet_id); layer.bindPopup(popupTemplate.html(), {closeOnClick: false, closeButton: false}).openPopup(); // transparent the layer .leaflet-popup-content-wrapper diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_remote.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_remote.js index 04a94dd62fb..e5894ceee10 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_remote.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_remote.js @@ -233,7 +233,7 @@ function setWithinAlert(leafletId) { * (look in get_alerts for .replace() method) * */ var selectedAreaGeoJson = JSON.stringify(map._layers[leafletId].toGeoJSON().geometry).replace(/"/g, "'"); - var areaName = $("#areaName").val(); + var areaName = $("#withinAlertAreaName").val(); var queryName = areaName; @@ -292,7 +292,7 @@ function setExitAlert(leafletId) { * (look in get_alerts for .replace() method) * */ var selectedAreaGeoJson = JSON.stringify(map._layers[leafletId].toGeoJSON().geometry).replace(/"/g, "'"); - var areaName = $("#areaName").val(); + var areaName = $("#exitAlertAreaName").val(); var queryName = areaName; @@ -357,7 +357,7 @@ function setStationeryAlert(leafletId) { var selectedProcessedAreaGeoJson = JSON.stringify(selectedAreaGeoJson).replace(/"/g, "'"); - var stationeryName = $("#areaName").val(); + var stationeryName = $("#stationaryAlertAreaName").val(); var queryName = stationeryName; var fluctuationRadius = $("#fRadius").val(); var time = $("#time").val(); @@ -477,7 +477,7 @@ function setTrafficAlert(leafletId) { var selectedProcessedAreaGeoJson = JSON.stringify(selectedAreaGeoJson).replace(/"/g, "'"); - var areaName = $("#areaName").val(); + var areaName = $("#trafficAlertAreaName").val(); var queryName = areaName; //var time = $("#time").val();