From 0790c0ed7f2698114068f1661e0b3a627f69c232 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Fri, 9 Sep 2016 19:26:02 +0530 Subject: [PATCH 01/38] Fixing dashboard user count issue --- .../app/pages/mdm.page.dashboard/public/js/dashboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/public/js/dashboard.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/public/js/dashboard.js index 740ec8f20..66f554c21 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/public/js/dashboard.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.dashboard/public/js/dashboard.js @@ -53,7 +53,7 @@ $(document).ready(function () { updateStats("/api/device-mgt/v1.0/policies?offset=0&limit=1", "#policy-count"); } if ($("#user-count").data("user-count")) { - updateStats("/api/device-mgt/v1.0/users?offset=0&limit=1", "#user-count"); + updateStats("/api/device-mgt/v1.0/users/count", "#user-count"); } if ($("#role-count").data("role-count")) { updateStats("/api/device-mgt/v1.0/roles?offset=0&limit=1", "#role-count"); From 5438a421de343873a2e8425948028c93463302a0 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Thu, 15 Sep 2016 07:33:00 +0530 Subject: [PATCH 02/38] Fixing Permissions are not published for Windows through WebApp Lifecycle Listener --- .../api/services/ConfigurationMgtService.java | 6 +++-- .../DeviceManagementAdminService.java | 15 ++++++++++++- .../api/services/DeviceManagementService.java | 22 ++++++++++++++----- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/ConfigurationMgtService.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/ConfigurationMgtService.java index aa84ad75b..b5428ba07 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/ConfigurationMgtService.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/ConfigurationMgtService.java @@ -18,6 +18,7 @@ package org.wso2.carbon.device.mgt.mobile.windows.api.services; +import io.swagger.annotations.Api; import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.apimgt.annotations.api.Permission; import org.wso2.carbon.apimgt.annotations.api.Scope; @@ -35,11 +36,12 @@ import javax.ws.rs.*; @API(name = "Windows Configuration Management", version = "1.0.0", context = "api/device-mgt/windows/v1.0/services/configuration", tags = {"windows"}) - +@Api(value = "Windows Configuration Management", + description = "This carries all the resources related to Windows configurations management functionalities") @WebService +@Path("services/configuration") @Produces({"application/json", "application/xml"}) @Consumes({"application/json", "application/xml"}) -@Path("services/configuration") public interface ConfigurationMgtService { /** diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementAdminService.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementAdminService.java index 4d96f8acd..c53d91417 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementAdminService.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementAdminService.java @@ -18,10 +18,17 @@ package org.wso2.carbon.device.mgt.mobile.windows.api.services; +import io.swagger.annotations.Api; +import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.apimgt.annotations.api.Permission; import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDeviceEnrolmentException; -import javax.ws.rs.*; +import javax.jws.WebService; +import javax.ws.rs.Consumes; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; @@ -29,6 +36,12 @@ import java.util.List; /** * Interface for Admin operations persisting. This interface accepts operations added via UI. */ +@Api(value = "Windows Device Management Administrative Service", + description = "Device management related admin APIs.") +@API(name = "Windows Device Management Administrative Service", version = "1.0.0", + context = "api/device-mgt/windows/v1.0/admin/devices", + tags = {"devicemgt_windows"}) +@WebService @Path("/admin/devices") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementService.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementService.java index 2559fc25d..5f0f84421 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementService.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementService.java @@ -18,20 +18,31 @@ package org.wso2.carbon.device.mgt.mobile.windows.api.services; +import io.swagger.annotations.Api; +import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsConfigurationException; import org.wso2.carbon.device.mgt.mobile.windows.api.common.util.Message; import javax.jws.WebService; -import javax.ws.rs.*; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import java.util.List; /** - * Windows Device Management REST-API implementation. - * All end points supports JSON, XMl with content negotiation. + * Windows Device Management REST-API implementation. All end points supports JSON, XMl with content negotiation. */ +@Api(value = "Windows Device Management", + description = "This carries all the resources related to Windows device management functionalities") +@API(name = "Windows Device Management", version = "1.0.0", + context = "api/device-mgt/windows/v1.0/devices", + tags = {"devicemgt_windows"}) @WebService @Path("/devices") @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) @@ -61,14 +72,15 @@ public interface DeviceManagementService { /** * Update Windows device details of given device id. * - * @param deviceId Device Id. - * @param device Device details to be updated. + * @param deviceId Device Id. + * @param device Device details to be updated. * @return Returns the message whether device update or not. * @throws WindowsConfigurationException occurred while updating the Device Info. */ @PUT @Path("{id}") Message updateDevice(@PathParam("id") String deviceId, Device device) throws WindowsConfigurationException; + /** * Fetch the Licence agreement for specific windows platform. * From 9b2f73acfbe5dc97b8e8b0c158074df75773d41e Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Thu, 15 Sep 2016 08:04:58 +0530 Subject: [PATCH 03/38] Fixing EMM-1557: Notifications anchor points to a wrong URL of the device. --- .../public/templates/notifications.hbs | 8 ++++---- 1 file changed, 4 insertions(+), 4 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.ui.navbar.nav-menu/public/templates/notifications.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs index 82edfc498..3d9a571b4 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs @@ -2,11 +2,11 @@
  • - - Device Type : {{deviceIdentifier.type}} + Device Type : {{deviceType}}

    {{description}}

    From 9f258df1d22abf0eb984790e52287a27e3d2d550 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Thu, 15 Sep 2016 08:34:00 +0530 Subject: [PATCH 04/38] Fixing EMM-1551: Notifications are flooded on side pane. --- .../units/mdm.unit.ui.navbar.nav-menu/public/js/nav-menu.js | 3 ++- 1 file changed, 2 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.ui.navbar.nav-menu/public/js/nav-menu.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/js/nav-menu.js index d80f6c6d5..13c43e5da 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/js/nav-menu.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/js/nav-menu.js @@ -117,7 +117,7 @@ function loadNewNotifications() { var currentUser = notifications.data("currentUser"); $.template("notification-listing", notifications.attr("src"), function (template) { - var serviceURL = emmAdminBasePath + "/notifications?status=NEW"; + var serviceURL = emmAdminBasePath + "/notifications?offset=0&limit=5&status=NEW"; invokerUtil.get( serviceURL, // on success @@ -128,6 +128,7 @@ function loadNewNotifications() { if (responsePayload["notifications"]) { if (responsePayload.count > 0) { viewModel["notifications"] = responsePayload["notifications"]; + viewModel["appContext"] = context; $(messageSideBar).html(template(viewModel)); } else { $(messageSideBar).html(''); From b576e23d97deff07f9c2f14d32b9e47e85f8bc4e Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Thu, 15 Sep 2016 08:34:18 +0530 Subject: [PATCH 05/38] Improvements to notifications side pane --- .../public/templates/notifications.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 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.ui.navbar.nav-menu/public/templates/notifications.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs index 3d9a571b4..91205c376 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs @@ -2,11 +2,11 @@
  • - - Device Type : {{deviceType}} + {{deviceType}}

    {{description}}

    From c9ec2bea0167d27eb0b919c1473b556e0ab441f3 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Thu, 15 Sep 2016 08:53:16 +0530 Subject: [PATCH 06/38] Fixing EMM-1552: Policy Create view Allingment issue in final step --- .../devicemgt/app/units/mdm.unit.policy.create/create.hbs | 1 + 1 file changed, 1 insertion(+) 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/create.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/create.hbs index a3ba6759b..5d5c13a91 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/create.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/create.hbs @@ -86,6 +86,7 @@
    +
    From 6ad54b5f019fd561446e7ba2d082b44f6c221777 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Thu, 15 Sep 2016 09:18:21 +0530 Subject: [PATCH 07/38] Fixing EMM-1351: Issue in components refresh function in device detail page --- .../app/units/mdm.unit.device.view/view.hbs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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.view/view.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.hbs index 8345741ac..862ef44fd 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.view/view.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.hbs @@ -219,7 +219,7 @@
  • + + + -
    - + +
    - + -
    - + +
    - + -
    -
    - + - -
    -
    - -
    + +
    +
    + +
    +
    + - - -
    - + +
    -
    - + +
    -
    +
    -
    - - -
    +
    + + +
    -
    +
    -
    - + +
    -
    - + +
    -
    - +
    -
    - +
    -
    - +
    -
    - + +
    -
    - + +
    -
    - +
    -
    - +
    -
    -Incoming Mail Settings : -
    +
    + Incoming Mail Settings : +
    -
    - + +
    -
    - +
    -
    - + +
    -
    - + +
    -
    - + +
    -
    - + +
    -
    -Outgoing Mail Settings : -
    +
    + Outgoing Mail Settings : +
    -
    - + +
    -
    - +
    -
    - + +
    -
    - + +
    -
    - + +
    -
    - +
    -
    - + +
    -
    -
    -
    - - - -
    -
    - -
    - - +
    + -
    -
    - + - -
    -
    - -
    +
    +
    + - - -
    - + +
    -
    - + +
    -
    - +
    -
    - + +
    -
    - + +
    -
    -
    -
    -
    -
    - + - -
    -
    - -
    +
    +
    + - - -
    - + +
    -
    - + +
    -
    - +
    -
    - + +
    -
    - + +
    -
    - + +
    -
    - + +
    -
    -
    -
    - - - -
    -
    - -
    - - +
    + -
    -
    - - - -
    -
    - -
    - - +
    + -
    -
    -
    - + - -
    -
    - -
    +
    +
    + - - -
    - + +
    -
    - + +
    -
    - + +
    -
    - + +
    -
    -
    -
    -
    -
    - + - -
    -
    - -
    + +
    +
    + +
    - + -Restrictions on Device Functionality : -
    -
    -
      -
    • -
      - +
      +
    • +
    +
    - - - -
    - -
    -
    -
    - -
    +
    + +
    \ 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/templates/hidden-operations-windows.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-windows.hbs index 16f244845..8f7528f1a 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-windows.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-windows.hbs @@ -78,16 +78,15 @@ -
    -
    - This configuration can be used to set a passcode policy to an Windows 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 Windows Device. + Once this configuration profile is installed on a device, corresponding users will not be able + to modify these settings on their devices. +
    - +
    @@ -221,15 +220,15 @@ -
    -
    - This configuration can be used to restrict the usage of camera on an Windows device together with all the applications using the camera. - 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 restrict the usage of camera on an Windows device together with all the applications using the camera. + Once this configuration profile is installed on a device, corresponding users will not be able + to modify these settings on their devices. +
    +
    @@ -262,15 +261,15 @@ -
    -
    - This configuration can be used to encrypt data on an Windows 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 Windows 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. +
    +
    @@ -303,14 +302,13 @@ -
    -
    - 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. +
    - +
    From 0160bf5feebbd55148355b8e28864c3bd57ca2d5 Mon Sep 17 00:00:00 2001 From: kamidu Date: Thu, 15 Sep 2016 19:26:48 +0530 Subject: [PATCH 11/38] Fix for EMM-1546 --- .../app/pages/mdm.page.devices/public/js/device-listing.js | 4 +++- 1 file changed, 3 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/pages/mdm.page.devices/public/js/device-listing.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js index 98b2ab00d..03cdd769e 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/mdm.page.devices/public/js/device-listing.js @@ -76,8 +76,10 @@ function loadDevices() { return {}; } - var fnCreatedRow = function (nRow) { + var fnCreatedRow = function (nRow, aData, dataIndex) { $(nRow).attr('data-type', 'selectable'); + $(nRow).attr('data-deviceid', aData.deviceIdentifier); + $(nRow).attr('data-devicetype', aData.deviceType); }; From d2cdb388b0e0102862e7a847ac425a778ccb2d68 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Thu, 15 Sep 2016 19:49:25 +0530 Subject: [PATCH 12/38] 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. -
    @@ -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 From a717c7effbd82bd2c7bf361cbe6c91a2c4fe6fd8 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Fri, 16 Sep 2016 09:38:34 +0530 Subject: [PATCH 13/38] Adding deviceName into notifications --- .../public/templates/notifications.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 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.ui.navbar.nav-menu/public/templates/notifications.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs index 91205c376..783fc8157 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/public/templates/notifications.hbs @@ -5,8 +5,8 @@ - {{deviceType}} + class="new-notification text-capitalize" data-click-event="remove-form"> + {{deviceType}} {{deviceName}}

    {{description}}

    From ac6d0eda8496e8e506872ec8a730fa799927c0af Mon Sep 17 00:00:00 2001 From: dilanua Date: Sat, 17 Sep 2016 16:02:27 +0530 Subject: [PATCH 14/38] Adding COSU Policy Configs - Android EMM UI --- .../public/js/operation-mod.js | 60 ++- .../templates/hidden-operations-android.hbs | 358 +++++++----------- 2 files changed, 163 insertions(+), 255 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 a41270d32..53d5d614b 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,18 +851,6 @@ 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; }; @@ -1028,13 +1016,21 @@ var operationModule = function () { break; case androidOperationConstants["SYSTEM_UPDATE_POLICY_CODE"]: operationType = operationTypeConstants["PROFILE"]; - payload = { - "operation": { - "type": operationData["cosuSystemUpdateType"], - "startTime": operationData["cosuWindowStartTime"], - "endTime": operationData["cosuWindowEndTime"] - } - }; + if (operationData["cosuSystemUpdatePolicyType"] != "window") { + payload = { + "operation": { + "type": operationData["cosuSystemUpdatePolicyType"] + } + }; + } else { + payload = { + "operation": { + "type": operationData["cosuSystemUpdatePolicyType"], + "startTime": operationData["cosuSystemUpdatePolicyWindowStartTime"], + "endTime": operationData["cosuSystemUpdatePolicyWindowEndTime"] + } + }; + } break; case androidOperationConstants["KIOSK_APPS_CODE"]: operationType = operationTypeConstants["PROFILE"]; @@ -1302,19 +1298,20 @@ 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")) { + operationDataObj.is(":password") || operationDataObj.is("input[type=hidden]")) { value = operationDataObj.val(); + operationData[key] = value; } else if (operationDataObj.is(":checkbox")) { value = operationDataObj.is(":checked"); + operationData[key] = value; } else if (operationDataObj.is(":radio") && operationDataObj.is(":checked")) { value = operationDataObj.val(); - } else if (operationDataObj.is(":radio") && !(operationDataObj.is(":checked"))) { - validValue = false; + operationData[key] = value; } else if (operationDataObj.is("select")) { value = operationDataObj.find("option:selected").attr("value"); + operationData[key] = value; } else if (operationDataObj.hasClass("grouped-array-input")) { value = []; var childInput; @@ -1323,7 +1320,7 @@ var operationModule = function () { $(".child-input", this).each(function () { childInput = $(this); if (childInput.is(":text") || childInput.is("textarea") || childInput.is(":password") - || childInput.is(":hidden")) { + || childInput.is("input[type=hidden]")) { childInputValue = childInput.val(); } else if (childInput.is(":checkbox")) { childInputValue = childInput.is(":checked"); @@ -1350,7 +1347,7 @@ var operationModule = function () { $(".child-input", this).each(function () { childInput = $(this); if (childInput.is(":text") || childInput.is("textarea") || childInput.is(":password") - || childInput.is(":hidden")) { + || childInput.is("input[type=hidden]")) { childInputValue = childInput.val(); } else if (childInput.is(":checkbox")) { childInputValue = childInput.is(":checked"); @@ -1382,7 +1379,7 @@ var operationModule = function () { childInput = $(this); childInputKey = childInput.data("child-key"); if (childInput.is(":text") || childInput.is("textarea") || childInput.is(":password") - || childInput.is(":hidden")) { + || childInput.is("input[type=hidden]")) { childInputValue = childInput.val(); } else if (childInput.is(":checkbox")) { childInputValue = childInput.is(":checked"); @@ -1406,8 +1403,6 @@ var operationModule = function () { } }); } - } - if (validValue) { operationData[key] = value; } } @@ -1460,7 +1455,8 @@ var operationModule = function () { // populating input value according to the type of input if (operationDataObj.is(":text") || operationDataObj.is("textarea") || - operationDataObj.is(":password")) { + operationDataObj.is(":password") || + operationDataObj.is("input[type=hidden]")) { operationDataObj.val(value); } else if (operationDataObj.is(":checkbox")) { operationDataObj.prop("checked", value); @@ -1490,9 +1486,9 @@ var operationModule = function () { var childInputValue = value[childInputIndex]; // populating extracted value in the UI according to the input type if (childInput.is(":text") || - childInput.is(":hidden") || childInput.is("textarea") || childInput.is(":password") || + childInput.is("input[type=hidden]") || childInput.is("select")) { childInput.val(childInputValue); } else if (childInput.is(":checkbox")) { @@ -1538,9 +1534,9 @@ var operationModule = function () { } // populating extracted value in the UI according to the input type if (childInput.is(":text") || - childInput.is(":hidden") || childInput.is("textarea") || childInput.is(":password") || + childInput.is("input[type=hidden]") || childInput.is("select")) { childInput.val(childInputValue); } else if (childInput.is(":checkbox")) { @@ -1567,9 +1563,9 @@ var operationModule = function () { var childInputValue = multiColumnKeyValuePair[childInputKey]; // populating extracted value in the UI according to the input type if (childInput.is(":text") || - childInput.is(":hidden") || childInput.is("textarea") || childInput.is(":password") || + childInput.is("input[type=hidden]") || childInput.is("select")) { childInput.val(childInputValue); } else if (childInput.is(":checkbox")) { 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 bb87139e7..df226cafd 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,28 +57,35 @@ - - - - - -   COSU Configuration - - - - - - - - - + + + + Applications Restrictions + + + + +   System Update Policy (COSU) + + + + + + + + + Whitelist Apps (COSU) + + + +
    @@ -886,6 +893,7 @@
    +
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - -
    - -
    -