From 82447ef865a004d571fffbb422068b6affac5029 Mon Sep 17 00:00:00 2001 From: Ace Date: Wed, 11 Sep 2019 16:18:13 +0530 Subject: [PATCH 1/7] Fixing issues with query-devices --- .../mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index 33cf2ec35b..31c5981c89 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -652,10 +652,13 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { List devices; DeviceList deviceList = new DeviceList(); try { + if(map.getProperties().isEmpty()){ + return Response.status(Response.Status.BAD_REQUEST).entity("No search criteria defined.").build(); + } DeviceManagementProviderService dms = DeviceMgtAPIUtils.getDeviceManagementService(); devices = dms.getDevicesBasedOnProperties(map.getProperties()); if(devices == null || devices.isEmpty()){ - return Response.status(Response.Status.OK).entity("No device found matching query criteria.").build(); + return Response.status(Response.Status.NOT_FOUND).entity("No device found matching query criteria.").build(); } } catch (DeviceManagementException e) { String msg = "Error occurred while searching for devices that matches the provided device properties"; From 27e01e80a83e4080a0e3b4d879869dfc4e54d6d8 Mon Sep 17 00:00:00 2001 From: Jayasanka Weerasinghe Date: Wed, 18 Sep 2019 14:02:50 +0000 Subject: [PATCH 2/7] Fix server starting issue This issue is occurred as a result of having java8 codes in the source. Hence remove and replace the code. --- .../apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js | 3 +-- .../react-app/src/components/apps/list-apps/Filters.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js index 841e9215cb..eb047468f1 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js @@ -92,7 +92,6 @@ class AppDetailsDrawer extends React.Component { componentDidMount() { this.getCategories(); - this.getTags(); } componentDidUpdate(prevProps, prevState, snapshot) { @@ -117,7 +116,7 @@ class AppDetailsDrawer extends React.Component { ).then(res => { if (res.status === 200) { const categories = JSON.parse(res.data.data); - + this.getTags(); const globalCategories = categories.map(category => { return (