From 4c54ba434a7e717b9ca231519952eab3f335912c Mon Sep 17 00:00:00 2001 From: Megala Date: Thu, 6 Oct 2016 11:31:45 +0530 Subject: [PATCH 1/3] Fixing EMM-1688 --- .../public/js/policy-create.js | 17 ++++++++++++++++- .../templates/hidden-operations-android.hbs | 2 +- .../mdm.unit.policy.edit/public/js/edit.js | 17 ++++++++++++++++- .../templates/hidden-operations-android.hbs | 2 +- .../templates/hidden-operations-android.hbs | 2 +- .../templates/hidden-operations-android.hbs | 2 +- 6 files changed, 36 insertions(+), 6 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.policy.create/public/js/policy-create.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/public/js/policy-create.js index 6ee4e6d82..ae8c031a8 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/public/js/policy-create.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/public/js/policy-create.js @@ -355,7 +355,22 @@ validateStep["policy-profile"] = function () { }; continueToCheckNextInputs = false; } - + // For the secure wifi types, it is required to have a password + var wifiTypeUIElement = $("#wifi-type"); + var wifiType = wifiTypeUIElement.find("option:selected").val(); + if (wifiTypeUIElement.is("input:checkbox")) { + wifiType = wifiTypeUIElement.is(":checked").toString(); + } + if (wifiType !== "none") { + if (!$("#wifi-password").val()) { + validationStatus = { + "error": true, + "subErrorMsg": "Password is required for the wifi security type " + wifiType + ". Please provide a password to proceed.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } + } // at-last, if the value of continueToCheckNextInputs is still true // this means that no error is found if (continueToCheckNextInputs) { 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.policy.create/public/templates/hidden-operations-android.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/public/templates/hidden-operations-android.hbs index f05d320f9..0756465ed 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/public/templates/hidden-operations-android.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.policy.create/public/templates/hidden-operations-android.hbs @@ -879,7 +879,7 @@