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 775ddd756..e4bd32974 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 @@ -210,6 +210,7 @@ var androidOperationModule = function () { payload["kioskBackgroundImage"] = deviceGlobalConfigurations["kioskBackgroundImage"]; payload["kioskLogoImage"] = deviceGlobalConfigurations["kioskLogoImage"]; payload["kioskAppName"] = deviceGlobalConfigurations["kioskAppName"]; + payload["isSingleModeApp"] = deviceGlobalConfigurations["isSingleModeApp"]; payload["isIdleGraphicsEnabled"] = deviceGlobalConfigurations["isIdleGraphicsEnabled"]; payload["idleTimeout"] = deviceGlobalConfigurations["idleTimeout"]; payload["isMultiUserDevice"] = deviceGlobalConfigurations["isMultiUserDevice"]; @@ -501,6 +502,20 @@ var androidOperationModule = function () { if (operationData["kioskAppName"]) { deviceGlobalConfigurations["kioskAppName"] = operationData["kioskAppName"]; } + deviceGlobalConfigurations["isSingleModeApp"] = operationData["isSingleModeApp"]; + if (deviceGlobalConfigurations["isSingleModeApp"] === true) { + var selectedSingleModeAppElement = "div#install-app-enrollment .child-input"; + if ($(selectedSingleModeAppElement + "[data-child-key='type']").val() === "Web Clip") { + var webClipApp = { + "identity": $(selectedSingleModeAppElement + "[data-child-key='packageName']").val(), + "title": $(selectedSingleModeAppElement + "[data-child-key='appName']").val() + }; + deviceGlobalConfigurations["singleModeApp"] = JSON.stringify(webClipApp); + } else { + deviceGlobalConfigurations["singleModeApp"] + = $(selectedSingleModeAppElement + "[data-child-key='packageName']").val(); + } + } deviceGlobalConfigurations["isIdleGraphicsEnabled"] = operationData["isIdleGraphicsEnabled"]; if (operationData["idleTimeout"]) { deviceGlobalConfigurations["idleTimeout"] = operationData["idleTimeout"]; 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 bf162be35..f00f61f30 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 @@ -365,6 +365,22 @@ var validatePolicyProfile = function () { } } + if (continueToCheckNextInputs) { + var isSingleAppMode = $("input#cosu-global-config-is-single-application-mode").is(":checked"); + if (isSingleAppMode === true) { + var enrollmentAppInstallAppList = "div#install-app-enrollment .child-input"; + if ($(enrollmentAppInstallAppList).length === 0) { + validationStatus = { + "error": true, + "subErrorMsg": "No application has been selected in Enrollment Application Install " + + "config to run on Single Application Mode.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } + } + } + if (continueToCheckNextInputs) { var isMultiUser = $("input#cosu-global-config-is-multi-user-device").is(":checked"); if (isMultiUser === true) { @@ -778,7 +794,7 @@ var validatePolicyProfile = function () { //If enrollment app install configured operation = androidOperationConstants["ENROLLMENT_APP_INSTALL"]; var enrollmentAppInstallAppList = "div#install-app-enrollment .child-input"; - if($(enrollmentAppInstallAppList).length == 0) { + if($(enrollmentAppInstallAppList).length === 0) { validationStatus = { "error": true, "subErrorMsg": "Applications are not selected to be installed during device enrollment.", 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 4aa64554c..2d0318501 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 @@ -1722,6 +1722,26 @@ class="form-control operationDataKeys" data-key="kioskAppName" maxlength="100" placeholder="Name to appear on the agent"/> +