From d0ef3beec045b3d29398aa6c1cc896939b6505ac Mon Sep 17 00:00:00 2001 From: lasantha Date: Fri, 16 Jul 2021 15:25:15 +0530 Subject: [PATCH 1/3] Improve App subscribing flow --- .../mgt/core/impl/SubscriptionManagerImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java index 8219dbb4e7..0aad9bc7c2 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java @@ -848,16 +848,16 @@ public class SubscriptionManagerImpl implements SubscriptionManager { } } - subscriptionDAO.addDeviceSubscription(username, subInsertingDeviceIds, subType, - Operation.Status.PENDING.toString(), applicationReleaseId, tenantId); if (!subUpdatingDeviceIds.isEmpty()) { subscriptionDAO.updateDeviceSubscription(username, subUpdatingDeviceIds, action, subType, Operation.Status.PENDING.toString(), applicationReleaseId, tenantId); } - subUpdatingDeviceIds.addAll(subInsertingDeviceIds); - if (!subUpdatingDeviceIds.isEmpty()) { + + if (!subInsertingDeviceIds.isEmpty()) { + subscriptionDAO.addDeviceSubscription(username, subInsertingDeviceIds, subType, + Operation.Status.PENDING.toString(), applicationReleaseId, tenantId); List deviceSubIds = new ArrayList<>( - subscriptionDAO.getDeviceSubIds(subUpdatingDeviceIds, applicationReleaseId, tenantId)); + subscriptionDAO.getDeviceSubIds(subInsertingDeviceIds, applicationReleaseId, tenantId)); subscriptionDAO.addOperationMapping(operationId, deviceSubIds, tenantId); } } From eb13d1b70dfc5c1c79bc86c8c36877f28d2e5204 Mon Sep 17 00:00:00 2001 From: Dharmakeerthi Lasantha Date: Mon, 19 Jul 2021 10:18:32 +0000 Subject: [PATCH 2/3] Revert "Merge branch 'master' into 'master'" This reverts merge request !785 --- .../mgt/core/impl/SubscriptionManagerImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java index 0aad9bc7c2..8219dbb4e7 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java @@ -848,16 +848,16 @@ public class SubscriptionManagerImpl implements SubscriptionManager { } } + subscriptionDAO.addDeviceSubscription(username, subInsertingDeviceIds, subType, + Operation.Status.PENDING.toString(), applicationReleaseId, tenantId); if (!subUpdatingDeviceIds.isEmpty()) { subscriptionDAO.updateDeviceSubscription(username, subUpdatingDeviceIds, action, subType, Operation.Status.PENDING.toString(), applicationReleaseId, tenantId); } - - if (!subInsertingDeviceIds.isEmpty()) { - subscriptionDAO.addDeviceSubscription(username, subInsertingDeviceIds, subType, - Operation.Status.PENDING.toString(), applicationReleaseId, tenantId); + subUpdatingDeviceIds.addAll(subInsertingDeviceIds); + if (!subUpdatingDeviceIds.isEmpty()) { List deviceSubIds = new ArrayList<>( - subscriptionDAO.getDeviceSubIds(subInsertingDeviceIds, applicationReleaseId, tenantId)); + subscriptionDAO.getDeviceSubIds(subUpdatingDeviceIds, applicationReleaseId, tenantId)); subscriptionDAO.addOperationMapping(operationId, deviceSubIds, tenantId); } } From 5d23d1d6f651dc6b41b0d7b6364fdef4fec4f4aa Mon Sep 17 00:00:00 2001 From: navodzoysa Date: Wed, 21 Jul 2021 21:34:42 +0530 Subject: [PATCH 3/3] Fix date range shown in reverse in MDM Reports --- .../device/mgt/core/report/mgt/ReportManagementServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/report/mgt/ReportManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/report/mgt/ReportManagementServiceImpl.java index 533b1cb1bc..7d2ff24875 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/report/mgt/ReportManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/report/mgt/ReportManagementServiceImpl.java @@ -315,7 +315,7 @@ public class ReportManagementServiceImpl implements ReportManagementService { } //Map date blocks and counts resultObject.addProperty( - dateFormat.format(endDate) + " - " + dateFormat.format(previousDate), sum); + dateFormat.format(previousDate) + " - " + dateFormat.format(endDate), sum); endDate = previousDate; }