From 8178a3cd8ff1359d49d386dd0e2620e6c81ae30e Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Sat, 19 Oct 2019 12:18:53 +0530 Subject: [PATCH] Message to display when a selected corrective policy is changed to general or deleted --- .../public/templates/policy-corrective-action.hbs | 11 +++++++++++ .../cdmf.unit.policy.edit/public/js/policy-edit.js | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.corrective-action/public/templates/policy-corrective-action.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.corrective-action/public/templates/policy-corrective-action.hbs index fa3da3680d..6bd184a0c1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.corrective-action/public/templates/policy-corrective-action.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.corrective-action/public/templates/policy-corrective-action.hbs @@ -20,5 +20,16 @@ Once this is supported for other device type the below condition can be removed.
+ {{/equal}} \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js index 061b02b0c4..9ae9afc208 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js @@ -305,7 +305,11 @@ stepForwardFrom["policy-profile"] = function () { currentlyEffected.correctiveActions.length > 0) { currentlyEffected.correctiveActions.forEach(function (correctiveAction) { if ("POLICY" === correctiveAction.actionType) { - $("#corrective-policy-input").val(correctiveAction.policyId); + if ($("#corrective-policy-input option[value=" + correctiveAction.policyId + "]").length > 0) { + $("#corrective-policy-input").val(correctiveAction.policyId); + } else { + $("#corrective-action-policy-id-missing-msg").removeClass("hidden"); + } // returned from for each since currently only supported corrective action type is // POLICY. return true;