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 e8a99b80e4..de213aebb5 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 @@ -426,7 +426,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 291e71d40f..dbea0923c2 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 @@ -174,7 +174,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"]: @@ -439,7 +440,8 @@ var androidOperationModule = function () { payload = { "operation": { "type": operationData["type"], - "openvpn_config": operationData["openvpn_config"] + "openvpn_config": operationData["openvpn_config"], + "packageName": operationData["packageName"] } }; break; @@ -1251,4 +1253,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 f00f61f306..f5b6fc4f44 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 7a65d49f21..4d8d7a21e7 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 @@ -1357,6 +1357,62 @@ + + + +