diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java index 7c1fe8e407c..f51ebfd9282 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java @@ -345,11 +345,11 @@ public class PolicyManagementServiceImpl implements PolicyManagementService { public Response updatePolicyPriorities(List priorityUpdatedPolicies) { PolicyManagerService policyManagementService = DeviceMgtAPIUtils.getPolicyManagementService(); List policiesToUpdate = new ArrayList<>(priorityUpdatedPolicies.size()); - int i; - for (i = 0; i < priorityUpdatedPolicies.size(); i++) { + + for (PriorityUpdatedPolicyWrapper priorityUpdatedPolicy : priorityUpdatedPolicies) { Policy policyObj = new Policy(); - policyObj.setId(priorityUpdatedPolicies.get(i).getId()); - policyObj.setPriorityId(priorityUpdatedPolicies.get(i).getPriority()); + policyObj.setId(priorityUpdatedPolicy.getId()); + policyObj.setPriorityId(priorityUpdatedPolicy.getPriority()); policiesToUpdate.add(policyObj); } boolean policiesUpdated; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/operation.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/operation.js index 666b1b571d0..3451c66cb34 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/operation.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/operation.js @@ -86,6 +86,14 @@ var operationModule = function () { var iconIdentifier = operations[op].operation; if (features && features[iconIdentifier]) { var icon = features[iconIdentifier].icon; + var isCloud = devicemgtProps["isCloud"]; + //TODO: remove isCloud check once able to verify features from the device agent + var isDisabled = features[iconIdentifier].isDisabled; + if (isDisabled && isCloud) { + operations[op]["isDisabled"] = isDisabled; + } else { + operations[op]["isDisabled"] = false; + } if (icon) { operations[op]["iconFont"] = icon; } else if (iconPath) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-common.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-common.css index 1fa92bf5497..82a5f918595 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-common.css +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.theme/public/css/custom-common.css @@ -265,4 +265,9 @@ header .username { .add-padding-top-3x { padding-top: 15px !important; -} \ No newline at end of file +} + +.op-disabled, .op-disabled i, .op-disabled span { + cursor: not-allowed; ++ color: #d2d2d2; +}