diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js index c6e811fae..56fc63621 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar/public/js/operation-bar.js @@ -418,7 +418,8 @@ var generatePayload = function (operationCode, operationData, deviceList) { payload = { "operation": { "type": operationData["type"], - "openvpn_config": operationData["openvpn_config"] + "openvpn_config": operationData["openvpn_config"], + "packageName": operationData["packageName"] } }; break; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js index fe820ecc3..866e7efd1 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js @@ -167,7 +167,8 @@ var androidOperationModule = function () { case androidOperationConstants["VPN_OPERATION_CODE"]: payload = { "type": operationPayload["type"], - "openvpn_config": operationPayload["openvpn_config"] + "openvpn_config": operationPayload["openvpn_config"], + "packageName": operationPayload["packageName"] }; break; case androidOperationConstants["APPLICATION_OPERATION_CODE"]: @@ -425,7 +426,8 @@ var androidOperationModule = function () { payload = { "operation": { "type": operationData["type"], - "openvpn_config": operationData["openvpn_config"] + "openvpn_config": operationData["openvpn_config"], + "packageName": operationData["packageName"] } }; break; @@ -1213,4 +1215,4 @@ var androidOperationModule = function () { }; return publicMethods; -}(); \ No newline at end of file +}(); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/js/android-policy-edit.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/js/android-policy-edit.js index f00f61f30..f5b6fc4f4 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/js/android-policy-edit.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/js/android-policy-edit.js @@ -590,14 +590,34 @@ var validatePolicyProfile = function () { // initializing continueToCheckNextInputs to true continueToCheckNextInputs = true; - var openvpnConfig = $("#openvpn-config").val(); - if (!openvpnConfig || openvpnConfig === '') { - validationStatus = { - "error": true, - "subErrorMsg": "ovpn config required. You cannot proceed.", - "erroneousFeature": operation - }; - continueToCheckNextInputs = false; + let openVpnConfigEnabled = document.getElementById('vpn-body').classList.contains('in'); + if (openVpnConfigEnabled) { + var openvpnConfig = $("textarea#openvpn-config").val(); + if (!openvpnConfig || openvpnConfig === '') { + validationStatus = { + "error": true, + "subErrorMsg": "ovpn config file is required. You cannot proceed.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } + } + + if (validationStatus) { + validationStatusArray.push(validationStatus); + } + + let alwaysOnVpnEnabled = document.getElementById('always-on-vpn-body').classList.contains('in'); + if (alwaysOnVpnEnabled) { + var alwaysOnConfig = $("input#vpn-client-app").val(); + if (!alwaysOnConfig || alwaysOnConfig === '') { + validationStatus = { + "error": true, + "subErrorMsg": "Add a valid package name for the VPN client", + "erroneousFeature": "always-on-vpn" + }; + continueToCheckNextInputs = false; + } } // at-last, if the value of continueToCheckNextInputs is still true @@ -1317,4 +1337,4 @@ $(document).ready(function () { $(this).removeClass("child-input"); }); }); -}); \ No newline at end of file +}); diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs index c2e2cb227..d8b15d0d6 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs @@ -1246,6 +1246,62 @@ + + + +