From 9dfd06f95e3c0967fd2e3168dd7f5d183eb4edcb Mon Sep 17 00:00:00 2001 From: dilanua Date: Wed, 28 Sep 2016 15:44:32 +0530 Subject: [PATCH 1/3] Fix for JIRA: https://wso2.org/jira/browse/EMM-1650 --- .../mdm.page.devices/public/js/device-listing.js | 12 ++++++------ 1 file changed, 6 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 a6d271147b..fbc60b3a17 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 @@ -112,7 +112,7 @@ function loadDevices() { user: data.devices[index].enrolmentInfo.owner, status: data.devices[index].enrolmentInfo.status, ownership: data.devices[index].enrolmentInfo.ownership, - deviceType: data.devices[index].type, + type: data.devices[index].type, deviceIdentifier: data.devices[index].deviceIdentifier, name : data.devices[index].name } @@ -133,7 +133,7 @@ function loadDevices() { // possible params - nRow, aData, dataIndex var fnCreatedRow = function (nRow, aData) { $(nRow).attr('data-type', 'selectable'); - $(nRow).attr('data-devicetype', aData["deviceType"]); + $(nRow).attr('data-devicetype', aData["type"]); $(nRow).attr('data-deviceid', aData["deviceIdentifier"]); }; @@ -142,7 +142,7 @@ function loadDevices() { class : 'remove-padding icon-only content-fill viewEnabledIcon', data : null, render: function (data, type, row) { - var deviceType = row.deviceType; + var deviceType = row.type; var deviceIdentifier = row.deviceIdentifier; var url = "#"; if (row.status != 'REMOVED') { @@ -197,9 +197,9 @@ function loadDevices() { }, { className: 'fade-edge remove-padding-top', - data: 'deviceType', - render: function (deviceType) { - return '
' + deviceType + '
'; + data: 'type', + render: function (type) { + return '
' + type + '
'; } }, { From 0a9ba54bb7697a7c9f01253f8f5ec40b64dc97fb Mon Sep 17 00:00:00 2001 From: dilanua Date: Wed, 28 Sep 2016 20:58:07 +0530 Subject: [PATCH 2/3] Improving policy listing UI --- .../app/pages/mdm.page.policies/policies.hbs | 51 +++++++++++-------- 1 file changed, 30 insertions(+), 21 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.policies/policies.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.policies/policies.hbs index 2caad6f1e8..e5d83caef0 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.policies/policies.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.policies/policies.hbs @@ -33,6 +33,7 @@
  • + Policies @@ -41,25 +42,29 @@ {{#zone "navbarActions"}} {{#if permissions.ADD_ADMIN_POLICY}} -
  • - - - - - - Add Policy - -
  • + {{#equal noPolicy false}} +
  • + + + + + + +  Add New Policy + +
  • + {{/equal}} {{/if}} {{#if permissions.CHANGE_POLICY_PRIORITY}} {{#equal noPolicy false}}
  • + - Policy Priority +  Policy Priority
  • {{/equal}} @@ -70,7 +75,7 @@ - Apply Changes To Devices +  Apply Changes To Devices {{/zone}} @@ -82,18 +87,21 @@ {{#equal noPolicy true}}
    @@ -229,6 +237,7 @@ data-display="{{status}}"> + Date: Wed, 28 Sep 2016 21:28:04 +0530 Subject: [PATCH 3/3] Improving device view UI - adding ios specific device details support --- .../app/units/mdm.unit.device.view/view.js | 63 ++++++++++++------- 1 file changed, 40 insertions(+), 23 deletions(-) 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 5373100c95..6ec083d684 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 @@ -74,31 +74,48 @@ function onRequest(context) { viewModel["model"] = filteredDeviceData["initialDeviceInfo"]["DEVICE_MODEL"]; } if (filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]) { - viewModel["BatteryLevel"] = {}; - viewModel["BatteryLevel"]["value"] = filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["BATTERY_LEVEL"]; + if (deviceType == "android") { + viewModel["BatteryLevel"] = {}; + viewModel["BatteryLevel"]["value"] = filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["BATTERY_LEVEL"]; - viewModel["internalMemory"] = {}; - viewModel["internalMemory"]["total"] = Math. - round(filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["INTERNAL_TOTAL_MEMORY"] * 100) / 100; - if (filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["INTERNAL_TOTAL_MEMORY"] != 0) { - viewModel["internalMemory"]["usage"] = Math. - round((filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["INTERNAL_TOTAL_MEMORY"] - - filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["INTERNAL_AVAILABLE_MEMORY"]) - / filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["INTERNAL_TOTAL_MEMORY"] * 10000) / 100; - } else { - viewModel["internalMemory"]["usage"] = 0; - } + viewModel["internalMemory"] = {}; + viewModel["internalMemory"]["total"] = Math. + round(filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["INTERNAL_TOTAL_MEMORY"] * 100) / 100; + if (filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["INTERNAL_TOTAL_MEMORY"] != 0) { + viewModel["internalMemory"]["usage"] = Math. + round((filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["INTERNAL_TOTAL_MEMORY"] - + filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["INTERNAL_AVAILABLE_MEMORY"]) + / filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["INTERNAL_TOTAL_MEMORY"] * 10000) / 100; + } else { + viewModel["internalMemory"]["usage"] = 0; + } + + viewModel["externalMemory"] = {}; + viewModel["externalMemory"]["total"] = Math. + round(filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["EXTERNAL_TOTAL_MEMORY"] * 100) / 100; + if (filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["EXTERNAL_TOTAL_MEMORY"] != 0) { + viewModel["externalMemory"]["usage"] = Math. + round((filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["EXTERNAL_TOTAL_MEMORY"] - + filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["EXTERNAL_AVAILABLE_MEMORY"]) + / filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["EXTERNAL_TOTAL_MEMORY"] * 10000) / 100; + } else { + viewModel["externalMemory"]["usage"] = 0; + } + } else if (deviceType == "ios") { + viewModel["BatteryLevel"] = {}; + viewModel["BatteryLevel"]["value"] = filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["BatteryLevel"]; - viewModel["externalMemory"] = {}; - viewModel["externalMemory"]["total"] = Math. - round(filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["EXTERNAL_TOTAL_MEMORY"] * 100) / 100; - if (filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["EXTERNAL_TOTAL_MEMORY"] != 0) { - viewModel["externalMemory"]["usage"] = Math. - round((filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["EXTERNAL_TOTAL_MEMORY"] - - filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["EXTERNAL_AVAILABLE_MEMORY"]) - / filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["EXTERNAL_TOTAL_MEMORY"] * 10000) / 100; - } else { - viewModel["externalMemory"]["usage"] = 0; + viewModel["internalMemory"] = {}; + viewModel["internalMemory"]["total"] = Math. + round(filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["DeviceCapacity"] * 100) / 100; + if (filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["DeviceCapacity"] != 0) { + viewModel["internalMemory"]["usage"] = Math. + round((filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["DeviceCapacity"] - + filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["AvailableDeviceCapacity"]) + / filteredDeviceData["initialDeviceInfo"]["DEVICE_INFO"]["DeviceCapacity"] * 10000) / 100; + } else { + viewModel["internalMemory"]["usage"] = 0; + } } } }