From d24ba9864314d34cd8129317a5b2ead50b40258b Mon Sep 17 00:00:00 2001 From: dilanua Date: Wed, 7 Sep 2016 16:15:26 +0530 Subject: [PATCH 1/3] Updating activate and deactivate policy endpoints from PUT to POST --- .../device/mgt/jaxrs/service/api/PolicyManagementService.java | 2 +- .../mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java index 1ede29f3e8..da0931e10f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java @@ -374,7 +374,7 @@ public interface PolicyManagementService { required = true) List policyIds); - @PUT + @POST @Path("/deactivate-policy") @ApiOperation( consumes = MediaType.APPLICATION_JSON, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java index 109bb189d4..bb8759e685 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java @@ -254,7 +254,7 @@ public class PolicyManagementServiceImpl implements PolicyManagementService { } } - @PUT + @POST @Path("/activate-policy") @Override public Response activatePolicies(List policyIds) { @@ -286,7 +286,7 @@ public class PolicyManagementServiceImpl implements PolicyManagementService { } } - @PUT + @POST @Path("/deactivate-policy") @Override public Response deactivatePolicies(List policyIds) { From e80daf7709e3db73b6e0b1dd108cca09da1d999a Mon Sep 17 00:00:00 2001 From: thusithakalugamage Date: Thu, 8 Sep 2016 12:29:49 +0530 Subject: [PATCH 2/3] responsive small device view defect fixes --- .../uuf.unit.theme/public/css/theme-wso2.css | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/css/theme-wso2.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/css/theme-wso2.css index 5fe5c2e37d..7d570d33e0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/css/theme-wso2.css +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/uuf-template-app/app/units/uuf.unit.theme/public/css/theme-wso2.css @@ -5398,6 +5398,9 @@ button.close { -moz-border-radius: 0; border-radius: 0; } +.panel-body .message { + margin:0px; +} .message h4 { margin-top: 0; margin-bottom: 5px; @@ -7438,17 +7441,13 @@ ul.sidebar-messages > li { * ======================================================================== */ .body-wrapper { padding: 40px; + margin-bottom:40px; } .body-wrapper a.btn:hover,.body-wrapper a:hover { text-decoration: none; } -@media (max-width: 767px) { - .body-wrapper { - padding: 40px 0px; - } -} .page-header { margin: 0 0 20px; } @@ -7791,9 +7790,16 @@ ul.sidebar-messages > li { background: transparent; font-size: 24px; font-weight: 300; - border-bottom: 1px solid #e4e4e4; - padding-bottom: 10px; - margin-bottom: 20px; +} + +.panel-default > .panel-heading a[data-toggle="collapse"]{ + display:block; + padding:10px; +} +.media.tab-responsive .panel-group .panel-heading + .panel-collapse > .panel-body, +.media.tab-responsive .panel-group .panel-heading + .panel-collapse > .list-group{ + border:none; + border-top:1px solid #ddd; } /* ======================================================================== @@ -8321,7 +8327,6 @@ a.list-group-item:hover { border-style: solid; border-color: #ddd; padding: 20px; - min-height: 300px; } From 2fde165b7c40de81dc3c68a638dd76fa0a144727 Mon Sep 17 00:00:00 2001 From: charitha Date: Thu, 8 Sep 2016 14:46:01 +0530 Subject: [PATCH 3/3] Fix SQL error when could happen due to duplicate enrollments. (cherry picked from commit c75307f) --- .../device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java index 1ecdb88459..44062cffc7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java @@ -763,10 +763,9 @@ public abstract class AbstractDeviceDAOImpl implements DeviceDAO { ResultSet rs = null; try { conn = this.getConnection(); - String sql = "SELECT ID AS ENROLMENT_ID FROM DM_ENROLMENT WHERE DEVICE_ID = (SELECT DISTINCT d.ID " + - "FROM DM_DEVICE d, DM_DEVICE_TYPE t WHERE d.DEVICE_TYPE_ID = t.ID " + - "AND d.DEVICE_IDENTIFICATION = ? AND t.NAME = ? AND d.TENANT_ID = ?) " + - "AND STATUS = ? AND TENANT_ID = ?"; + String sql = "SELECT e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, (SELECT d.ID FROM DM_DEVICE d, DM_DEVICE_TYPE t " + + "WHERE d.DEVICE_TYPE_ID = t.ID AND d.DEVICE_IDENTIFICATION = ? AND t.NAME = ? AND d.TENANT_ID = ?) dtm " + + "WHERE e.DEVICE_ID = dtm.ID AND e.STATUS = ? AND e.TENANT_ID = ?;"; stmt = conn.prepareStatement(sql); stmt.setString(1, deviceId.getId()); stmt.setString(2, deviceId.getType());