From b0ec89938e6e84c467afc48c28f7c1ebe681b518 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Wed, 14 Sep 2016 13:24:31 +0530 Subject: [PATCH] Added COSU policy configurations --- .../public/js/operation-mod.js | 24 +- .../public/js/policy-create.js | 18 ++ .../templates/hidden-operations-android.hbs | 254 ++++++++++++++++++ 3 files changed, 295 insertions(+), 1 deletion(-) 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 f47bbd9976..a7002bb7f7 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 @@ -80,7 +80,9 @@ var operationModule = function () { "AUTO_TIME" : "AUTO_TIME", "SET_SCREEN_CAPTURE_DISABLED" : "SET_SCREEN_CAPTURE_DISABLED", "SET_STATUS_BAR_DISABLED" : "SET_STATUS_BAR_DISABLED", - "APPLICATION_OPERATION_CODE":"APP-RESTRICTION" + "APPLICATION_OPERATION_CODE":"APP-RESTRICTION", + "SYSTEM_UPDATE_POLICY_CODE": "SYSTEM_UPDATE_POLICY", + "KIOSK_APPS_CODE": "KIOSK_APPS" }; // Constants to define Windows Operation Constants @@ -1012,6 +1014,24 @@ var operationModule = function () { } }; break; + case androidOperationConstants["SYSTEM_UPDATE_POLICY_CODE"]: + operationType = operationTypeConstants["PROFILE"]; + payload = { + "operation": { + "type": operationData["cosuSystemUpdateType"], + "startTime": operationData["cosuWindowStartTime"], + "endTime": operationData["cosuWindowEndTime"] + } + }; + break; + case androidOperationConstants["KIOSK_APPS_CODE"]: + operationType = operationTypeConstants["PROFILE"]; + payload = { + "operation": { + "whitelistedApplications": operationData["cosuWhitelistedApplications"] + } + }; + break; default: // If the operation is neither of above, it is a command operation operationType = operationTypeConstants["COMMAND"]; @@ -1276,6 +1296,8 @@ var operationModule = function () { value = operationDataObj.val(); } else if (operationDataObj.is(":checkbox")) { value = operationDataObj.is(":checked"); + } else if (operationDataObj.is(":radio") && operationDataObj.is(":checked")) { + value = operationDataObj.val(); } else if (operationDataObj.is("select")) { value = operationDataObj.find("option:selected").attr("value"); } else if (operationDataObj.hasClass("grouped-array-input")) { 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 be9a56826d..655acfc1d7 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 @@ -2441,6 +2441,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.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 9eb9fac829..bc5c26c46e 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 @@ -57,6 +57,17 @@ + + + + + +   COSU Configuration + + + + + @@ -1268,6 +1279,249 @@ + +
+ +
+ +
+ + + +
+ +
+
+ + + +
+
+ + +
+
+
+ + + +
+ +
+ + + +
+ +
+ + + + + + + + + + + + + + +
No:Application Name/DescriptionPackage Name
+ No entries added yet. +
+ + + + + + + + + + +
+
+ +
+
+ +
+ \ No newline at end of file