From 7431654f253545e065963761e9758aa5b2972b46 Mon Sep 17 00:00:00 2001 From: kamidu Date: Wed, 5 Oct 2016 18:15:11 +0530 Subject: [PATCH] Fix for device view consistancy problems --- .../pages/mdm.page.devices/public/js/device-listing.js | 8 ++++---- .../devicemgt/app/units/mdm.unit.device.view/view.hbs | 2 +- .../devicemgt/app/units/mdm.unit.device.view/view.js | 5 ++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js index fbc60b3a1..5bcc4c3bd 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js @@ -21,9 +21,9 @@ * when a user clicks on the list item * initial mode and with out select mode. */ -function InitiateViewOption(url) { +function InitiateViewOption() { if ($(".select-enable-btn").text() == "Select") { - $(location).attr('href', url); + $(location).attr('href', $(this).data("url")); } } @@ -148,8 +148,8 @@ function loadDevices() { if (row.status != 'REMOVED') { url = "device/" + deviceType + "?id=" + deviceIdentifier; } - return '
' + - '' + + return '
' + + '' + '
' } }, diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.hbs index 5d1470c11..fe0163522 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.hbs @@ -110,7 +110,7 @@ {{/defineZone}}
- Operations {{deviceView.isNotWindows}} + Operations
{{unit "mdm.unit.device.operation-bar" deviceType=deviceView.deviceType ownership=deviceView.ownership}} diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.js index 93276b90a..786b2bbb8 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.js @@ -50,6 +50,10 @@ function onRequest(context) { if (filteredDeviceData["enrolmentInfo"]) { if (filteredDeviceData["enrolmentInfo"]["status"]) { viewModel["status"] = filteredDeviceData["enrolmentInfo"]["status"]; + viewModel.isActive = false ; + if (filteredDeviceData["enrolmentInfo"]["status"]== "ACTIVE") { + viewModel.isActive = true ; + } } if (filteredDeviceData["enrolmentInfo"]["owner"]) { viewModel["owner"] = filteredDeviceData["enrolmentInfo"]["owner"]; @@ -200,6 +204,5 @@ function onRequest(context) { } else { deviceViewData["deviceFound"] = false; } - log.error(stringify(deviceViewData)); return deviceViewData; } \ No newline at end of file