diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/CorrectiveAction.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/CorrectiveAction.java index dece7db618..6ebe74e17c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/CorrectiveAction.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/policy/mgt/CorrectiveAction.java @@ -55,6 +55,8 @@ public class CorrectiveAction implements Serializable { ) private List operations; + private int featureId; + public String getActionType() { return actionType; } @@ -78,4 +80,12 @@ public class CorrectiveAction implements Serializable { public void setOperations(List operations) { this.operations = operations; } + + public int getFeatureId() { + return featureId; + } + + public void setFeatureId(int featureId) { + this.featureId = featureId; + } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/ProfileOperation.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/ProfileOperation.java index b89233f967..21d41f3aed 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/ProfileOperation.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/ProfileOperation.java @@ -23,7 +23,7 @@ import java.util.ArrayList; import java.util.List; public class ProfileOperation extends ConfigOperation implements Serializable { - private List correctiveActionIds = new ArrayList<>(); + private List correctiveActionIds; public Type getType() { return Type.PROFILE; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.hbs index c67f099c5b..54e89548f5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.hbs @@ -9,7 +9,7 @@
- diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/js/policy-create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/js/policy-create.js index e4adef0e38..f3cc76c3c7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/js/policy-create.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/js/policy-create.js @@ -222,28 +222,6 @@ stepForwardFrom["policy-profile"] = function () { policy["profile"] = generatePolicyProfile(); } - // add policy correction action page - var policyCorrectiveActionTemplateSrc = - "/public/cdmf.unit.policy.corrective-action/templates/policy-corrective-action.hbs"; - var policyCorrectiveActionScriptSrc = - "/public/cdmf.unit.policy.corrective-action/js/policy-corrective-action.js"; - var policyCorrectiveActionTemplateCacheKey = "policy-corrective-action"; - - $.template(policyCorrectiveActionTemplateCacheKey, context + policyCorrectiveActionTemplateSrc, - function (template) { - var content = template( - { - "deviceType": policy["platform"], - "correctivePolicies": $("#logged-in-user").data("corrective-policies") - } - ); - $("#select-general-policy-type").html(content); - var script = document.createElement('script'); - script.type = 'text/javascript'; - script.src = context + policyCorrectiveActionScriptSrc; - document.head.append(script); - }); - // updating next-page wizard title with selected platform $("#policy-type-page-wizard-title").text("ADD " + policy["platform"] + " POLICY"); }; @@ -261,28 +239,6 @@ stepBackFrom["policy-profile"] = function () { } }; - -/** - * Forward action of policy type page. - */ -stepForwardFrom["policy-type"] = function () { - policy["type"] = $("input[name=policy-type-radio-btn]:checked").val(); - var correctiveActionList = []; - if (policy.type === "GENERAL") { - var selectedCorrectivePolicyId = $("#corrective-policy-input").val(); - if (selectedCorrectivePolicyId && selectedCorrectivePolicyId !== "none") { - var correctiveAction = { - "actionType": "POLICY", - "policyId": selectedCorrectivePolicyId - }; - correctiveActionList.push(correctiveAction); - } - } - policy["correctiveActionList"] = correctiveActionList; - //updating next-page wizard title with selected platform - $("#policy-criteria-page-wizard-title").text("ADD " + policy["platform"] + " POLICY"); -}; - /** * Forward action of policy criteria page. */ @@ -483,8 +439,7 @@ var savePolicy = function (policy, isActive, serviceURL) { "compliance": policy["selectedNonCompliantAction"], "ownershipType": null, "active": isActive, - "policyType": policy["type"], - "correctiveActions": policy["correctiveActionList"], + "policyType": "GENERAL", "profile": { "profileName": policy["policyName"], "deviceType": policy["platform"], @@ -639,6 +594,7 @@ $(document).ready(function () { } }); + //todo $('input[type=radio][name=policy-type-radio-btn]').change(function() { if ($(this).val() === "CORRECTIVE") { $("#select-general-policy-type").addClass("hidden"); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.hbs index f471497415..672fc524f3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.hbs @@ -1,38 +1,30 @@ {{#zone "content"}} {{#if isAuthorized }} + data-tenant-id="{{@user.tenantId}}" data-iscloud="{{isCloud}}" data-storeapps="{{storeApps}}">