From d2cdb388b0e0102862e7a847ac425a778ccb2d68 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Thu, 15 Sep 2016 19:49:25 +0530 Subject: [PATCH] Added edit COSU policy configurations --- .../public/js/operation-mod.js | 25 +- .../templates/hidden-operations-android.hbs | 152 ++++++----- .../mdm.unit.policy.edit/public/js/edit.js | 18 ++ .../templates/hidden-operations-android.hbs | 255 ++++++++++++++++++ 4 files changed, 374 insertions(+), 76 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.device.operation-mod/public/js/operation-mod.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-mod/public/js/operation-mod.js index a7002bb7f..a41270d32 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-mod/public/js/operation-mod.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-mod/public/js/operation-mod.js @@ -851,6 +851,18 @@ var operationModule = function () { "restrictedApplications": operationPayload["restricted-applications"] }; break; + case androidOperationConstants["SYSTEM_UPDATE_POLICY_CODE"]: + payload = { + "cosuSystemUpdateType": operationPayload["type"], + "cosuWindowStartTime": operationPayload["startTime"], + "cosuWindowEndTime": operationPayload["endTime"] + }; + break; + case androidOperationConstants["KIOSK_APPS_CODE"]: + payload = { + "cosuWhitelistedApplications": operationPayload["whitelistedApplications"] + }; + break; } return payload; }; @@ -1290,6 +1302,7 @@ var operationModule = function () { function () { var operationDataObj = $(this); var key = operationDataObj.data("key"); + var validValue = true; var value; if (operationDataObj.is(":text") || operationDataObj.is("textarea") || operationDataObj.is(":password") || operationDataObj.is(":hidden")) { @@ -1297,7 +1310,9 @@ var operationModule = function () { } else if (operationDataObj.is(":checkbox")) { value = operationDataObj.is(":checked"); } else if (operationDataObj.is(":radio") && operationDataObj.is(":checked")) { - value = operationDataObj.val(); + value = operationDataObj.val(); + } else if (operationDataObj.is(":radio") && !(operationDataObj.is(":checked"))) { + validValue = false; } else if (operationDataObj.is("select")) { value = operationDataObj.find("option:selected").attr("value"); } else if (operationDataObj.hasClass("grouped-array-input")) { @@ -1392,7 +1407,9 @@ var operationModule = function () { }); } } - operationData[key] = value; + if (validValue) { + operationData[key] = value; + } } ); @@ -1447,6 +1464,10 @@ var operationModule = function () { operationDataObj.val(value); } else if (operationDataObj.is(":checkbox")) { operationDataObj.prop("checked", value); + } else if (operationDataObj.is(":radio")) { + if (operationDataObj.val() == uiPayload[key]) { + operationDataObj.attr("checked", true); + } } else if (operationDataObj.is("select")) { operationDataObj.val(value); /* trigger a change of value, so that if slidable panes exist, 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 66ee188cf..bb87139e7 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 @@ -3,8 +3,10 @@ - Passcode Policy - + + Passcode Policy + @@ -22,9 +24,11 @@ Encryption Settings - + - + @@ -70,7 +74,8 @@ Applications Restrictions - + @@ -90,17 +95,18 @@ +
+
+ This configuration can be used to set a passcode policy to an Android Device. + Once this configuration profile is installed on a device, corresponding users will not be + able + to modify these settings on their devices. +
-
- This configuration can be used to set a passcode policy to an Android Device. - Once this configuration profile is installed on a device, corresponding users will not be - able - to modify these settings on their devices. -
-
+ @@ -244,17 +250,17 @@ +
+
+ This configurations can be used to restrict certain settings on an Android device. + Once this configuration profile is installed on a device, corresponding users will not be + able + to modify these settings on their devices. +
-
- This configurations can be used to restrict certain settings on an Android device. - Once this configuration profile is installed on a device, corresponding users will not be - able - to modify these settings on their devices. -
-
@@ -651,7 +657,7 @@
@@ -683,18 +689,18 @@ +
+
+ This configuration can be used to encrypt data on an Android device, when the device is + locked and + make it readable when the passcode is entered. Once this configuration profile is installed + on a device, + corresponding users will not be able to modify these settings on their devices. +
-
- This configuration can be used to encrypt data on an Android device, when the device is - locked and - make it readable when the passcode is entered. Once this configuration profile is installed - on a device, - corresponding users will not be able to modify these settings on their devices. -
-
@@ -729,17 +735,17 @@ +
+
+ This configurations can be used to configure Wi-Fi access on an Android device. + Once this configuration profile is installed on a device, corresponding users will not be + able + to modify these settings on their devices. +
-
- This configurations can be used to configure Wi-Fi access on an Android device. - Once this configuration profile is installed on a device, corresponding users will not be - able - to modify these settings on their devices. -
-
Please note that * sign represents required fields of data.

@@ -859,7 +865,7 @@ + onchange="base64EncodeFile(this, document.getElementById('wifi-cacert'), document.getElementById('wifi-cacert-name'))"/> +
+
+ This configuration can be used to create a black list or white list of applications. +
-
- This configuration can be used to create a black list or white list of applications. -
-
+ @@ -999,17 +1006,17 @@ +
+
+ This configurations can be used to configure VPN settings on an Android device. + Once this configuration profile is installed on a device, corresponding users will not be + able + to modify these settings on their devices. +
-
- This configurations can be used to configure VPN settings on an Android device. - Once this configuration profile is installed on a device, corresponding users will not be - able - to modify these settings on their devices. -
-
Please note that * sign represents required fields of data.

@@ -1181,15 +1188,16 @@ +
+
+ The configurations below can be applied to the devices where the agent is running in Android + Work-Profile. +
-
- The configurations below can be applied to the devices where the agent is running in Android - Work-Profile. -
-
+ @@ -1274,7 +1282,7 @@
-
- -
\ No newline at end of file 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.edit/public/js/edit.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.edit/public/js/edit.js index d347446a3..9b5370de6 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.edit/public/js/edit.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.edit/public/js/edit.js @@ -2219,6 +2219,24 @@ var slideDownPaneAgainstValueSet = function (selectElement, paneID, valueSet) { ); } }; + +var slideDownPaneAgainstValueSetForRadioButtons = function (selectElement, paneID, valueSet) { + var selectedValueOnChange = selectElement.value; + + var i, slideDownVotes = 0; + for (i = 0; i < valueSet.length; i++) { + if (selectedValueOnChange == valueSet[i]) { + slideDownVotes++; + } + } + + var paneSelector = "#" + paneID; + if(slideDownVotes > 0) { + $(paneSelector).removeClass("hidden"); + } else { + $(paneSelector).addClass("hidden"); + } +}; // End of HTML embedded invoke methods 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.edit/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.edit/public/templates/hidden-operations-android.hbs index 987a24deb..4ba3839b0 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.edit/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.edit/public/templates/hidden-operations-android.hbs @@ -57,6 +57,17 @@ + + + + + +   COSU Configuration + + + + + @@ -1286,5 +1297,249 @@
+ + +
+ +
+ +
+ + + +
+ +
+
+ + + +
+
+ + +
+
+
+ + + +
+ +
+ + + +
+ +
+ + + + + + + + + + + + + + +
No:Application Name/DescriptionPackage Name
+ No entries added yet. +
+ + + + + + + + + + +
+
+ +
+
+ +
+ \ No newline at end of file