From 1b74cf9a03f86ced548f05e4306ce2e3121c1ef4 Mon Sep 17 00:00:00 2001 From: prathabanKavin Date: Fri, 7 Jun 2024 21:57:21 +0530 Subject: [PATCH 1/2] Fix devices of a group not loading (cherry picked from commit b0362c58256ed0a3a1c6d8a7d9d456e9190a3c91) --- .../mgt/core/dao/impl/device/GenericDeviceDAOImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java index efe07d1335..d1ea236645 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java @@ -646,8 +646,7 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl { } @Override - public List searchDevicesInGroup(PaginationRequest request, int tenantId) - throws DeviceManagementDAOException { + public List searchDevicesInGroup(PaginationRequest request, int tenantId) throws DeviceManagementDAOException { List devices = null; int groupId = request.getGroupId(); String deviceType = request.getDeviceType(); @@ -687,6 +686,7 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl { "gd.DESCRIPTION, " + "gd.NAME, " + "gd.DEVICE_IDENTIFICATION, " + + "gd.LAST_UPDATED_TIMESTAMP " + "FROM " + "(SELECT d.ID AS DEVICE_ID, " + "d.DESCRIPTION, " + @@ -708,10 +708,10 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl { sql = sql + " WHERE 1 = 1"; //Add query for last updated timestamp if (since != null) { - sql = sql + " AND d.LAST_UPDATED_TIMESTAMP > ?"; + sql = sql + " AND gd.LAST_UPDATED_TIMESTAMP > ?"; isSinceProvided = true; } - sql = sql + " ) d1 WHERE d1.DEVICE_ID = e.DEVICE_ID AND TENANT_ID = ? "; + sql = sql + " ) d1 WHERE d1.DEVICE_ID = e.DEVICE_ID AND e.TENANT_ID = ? "; //Add the query for device-type if (deviceType != null && !deviceType.isEmpty()) { sql = sql + " AND e.DEVICE_TYPE = ?"; -- 2.36.3 From e3e0e6de3d4394d3017d19ebe10c52bdd1611fc5 Mon Sep 17 00:00:00 2001 From: prathabanKavin Date: Tue, 18 Jun 2024 08:51:05 +0530 Subject: [PATCH 2/2] Change subscriptionType format --- .../mgt/core/impl/SubscriptionManagerImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/SubscriptionManagerImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/SubscriptionManagerImpl.java index 401534e1d9..aeebeb2c50 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/SubscriptionManagerImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/SubscriptionManagerImpl.java @@ -2634,23 +2634,23 @@ public class SubscriptionManagerImpl implements SubscriptionManager { List subscriptionCounts = new ArrayList<>(); subscriptionCounts.add(new CategorizedSubscriptionCountsDTO( - "ALL", + "All", subscriptionDAO.getAllSubscriptionCount(appReleaseId, tenantId), subscriptionDAO.getAllUnsubscriptionCount(appReleaseId, tenantId))); subscriptionCounts.add(new CategorizedSubscriptionCountsDTO( - "DEVICE", + "Device", subscriptionDAO.getDeviceSubscriptionCount(appReleaseId, tenantId), subscriptionDAO.getDeviceUnsubscriptionCount(appReleaseId, tenantId))); subscriptionCounts.add(new CategorizedSubscriptionCountsDTO( - "GROUP", + "Group", subscriptionDAO.getGroupSubscriptionCount(appReleaseId, tenantId), subscriptionDAO.getGroupUnsubscriptionCount(appReleaseId, tenantId))); subscriptionCounts.add(new CategorizedSubscriptionCountsDTO( - "ROLE", + "Role", subscriptionDAO.getRoleSubscriptionCount(appReleaseId, tenantId), subscriptionDAO.getRoleUnsubscriptionCount(appReleaseId, tenantId))); subscriptionCounts.add(new CategorizedSubscriptionCountsDTO( - "USER", + "User", subscriptionDAO.getUserSubscriptionCount(appReleaseId, tenantId), subscriptionDAO.getUserUnsubscriptionCount(appReleaseId, tenantId))); -- 2.36.3