diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/public/js/view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/public/js/view.js index cf9a711f420..5e3b17092d6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/public/js/view.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/public/js/view.js @@ -28,6 +28,7 @@ var displayPolicy = function (policyPayloadObj) { $("#policy-assignment").text(policyPayloadObj.deviceGroups); $("#policy-action").text(policyPayloadObj.compliance.toUpperCase()); $("#policy-description").text(policyPayloadObj["description"]); + $("#policy-type").text(policyPayloadObj.policyType); var policyStatus = "Active"; if (policyPayloadObj["active"] === true && policyPayloadObj["updated"] === true) { policyStatus = ' Active/Updated'; @@ -68,6 +69,20 @@ var displayPolicy = function (policyPayloadObj) { $("#policy-roles").text(policyPayloadObj.roles.toString().split(",").join(", ")); } + if ("GENERAL" === policyPayloadObj.policyType && + policyPayloadObj.correctiveActions && policyPayloadObj.correctiveActions.length > 0) { + policyPayloadObj.correctiveActions.forEach(function (correctiveAction) { + if ("POLICY" === correctiveAction.actionType) { + $("#corrective-action-type-policy-id").html(correctiveAction.policyId); + return true; + } + }); + $("#policy-corrective-actions-list").removeClass("hidden"); + } else { + $("#policy-corrective-actions-list").addClass("hidden"); + } + + var policyId = policyPayloadObj["id"]; var deviceType = policy["platform"]; var policyOperations = $("#policy-operations"); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/view.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/view.hbs index 5fb0aed14fc..8ac41acee8f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/view.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/view.hbs @@ -34,7 +34,7 @@ Action upon non-compliance - + Status @@ -46,9 +46,32 @@ Assigned Roles + + Policy Type + + {{/defineZone}} +
Description