From 17e7b92b23cbf36b6852972fcc9d42ac9d7965e5 Mon Sep 17 00:00:00 2001 From: dilanua Date: Mon, 26 Sep 2016 19:52:54 +0530 Subject: [PATCH] FIX for JIRAS: https://wso2.org/jira/browse/EMM-1633 --- .../public/js/operation-bar.js | 23 +++++++++++++++---- .../public/js/device-detail.js | 2 +- 2 files changed, 20 insertions(+), 5 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.operation-bar/public/js/operation-bar.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.operation-bar/public/js/operation-bar.js index 93be0add70..114ffb6014 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.operation-bar/public/js/operation-bar.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.operation-bar/public/js/operation-bar.js @@ -35,6 +35,10 @@ var operations = '.wr-operations', ownershipTypeConstants = { "BYOD": "BYOD", "COPE": "COPE" + }, + operationBarModeConstants = { + "BULK": "BULK_OPERATION_MODE", + "SINGLE": "SINGLE_OPERATION_MODE" }; /* @@ -103,7 +107,7 @@ function getDevicesByTypes(deviceList) { // $(".wr-operations").html(""); //} -function loadOperationBar(deviceType, ownership) { +function loadOperationBar(deviceType, ownership, mode) { var operationBar = $("#operations-bar"); var operationBarSrc = operationBar.attr("src"); @@ -121,9 +125,20 @@ function loadOperationBar(deviceType, ownership) { var j; for (j = 0; j < totalFeatures.length; j++) { if (permissionList[deviceType][i] == totalFeatures[j]["code"]) { - if (deviceType == platformTypeConstants.ANDROID && - totalFeatures[j]["code"] == "DEVICE_UNLOCK") { - if (ownership == ownershipTypeConstants.COPE) { + if (deviceType == platformTypeConstants.ANDROID) { + if (totalFeatures[j]["code"] == "DEVICE_UNLOCK") { + if (ownership == ownershipTypeConstants.COPE) { + permittedOperations.push(totalFeatures[j]); + } + } else if (totalFeatures[j]["code"] == "WIPE_DATA") { + if (mode == operationBarModeConstants.BULK) { + if (ownership == ownershipTypeConstants.COPE) { + permittedOperations.push(totalFeatures[j]); + } + } else { + permittedOperations.push(totalFeatures[j]); + } + } else { permittedOperations.push(totalFeatures[j]); } } else { 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/public/js/device-detail.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/public/js/device-detail.js index fbe1e7b9d3..8204c69f93 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/public/js/device-detail.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/public/js/device-detail.js @@ -292,7 +292,7 @@ var InitiateViewOption = null; $(document).ready(function () { $(".device-detail-body").removeClass("hidden"); $("#loading-content").remove(); - loadOperationBar(deviceType, ownership); + loadOperationBar(deviceType, ownership, operationBarModeConstants.SINGLE); loadOperationsLog(false); loadApplicationsList(); loadPolicyCompliance();