From e67feefee587ca55a703d595d490dd54148180e3 Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Tue, 18 Jun 2019 13:15:41 +0530 Subject: [PATCH 1/8] Make banner uploading as optional. --- .../mgt/core/impl/ApplicationManagerImpl.java | 6 ------ .../application/mgt/core/util/APIUtil.java | 5 ++++- .../ApplicationManagementPublisherAPI.java | 18 ++++++----------- ...ApplicationManagementPublisherAPIImpl.java | 20 ++++++++----------- .../impl/ApplicationManagementAPIImpl.java | 4 ---- .../dbscripts/cdm/application-mgt/h2.sql | 2 +- 6 files changed, 19 insertions(+), 36 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/ApplicationManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java index 3bd1708a74f..77190def2fb 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java @@ -2559,12 +2559,6 @@ public class ApplicationManagerImpl implements ApplicationManager { log.error(msg); throw new RequestValidatingException(msg); } - //todo remove this check, because banner is not mandatory to have - if (bannerFile == null) { - String msg = "Banner file is not found with the application release creating request."; - log.error(msg); - throw new RequestValidatingException(msg); - } if (attachmentList == null || attachmentList.isEmpty()) { String msg = "Screenshots are not found with the application release creating request."; log.error(msg); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/APIUtil.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/APIUtil.java index d53fb5d2d8a..2458db3a307 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/APIUtil.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/APIUtil.java @@ -355,7 +355,10 @@ public class APIUtil { applicationRelease.setSupportedOsVersions(applicationReleaseDTO.getSupportedOsVersions()); applicationRelease.setRating(applicationReleaseDTO.getRating()); applicationRelease.setIconPath(basePath + applicationReleaseDTO.getIconName()); - applicationRelease.setBannerPath(basePath + applicationReleaseDTO.getBannerName()); + + if (!StringUtils.isEmpty(applicationReleaseDTO.getBannerName())){ + applicationRelease.setBannerPath(basePath + applicationReleaseDTO.getBannerName()); + } if (urlValidator.isValid(applicationReleaseDTO.getInstallerName())){ applicationRelease diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java index 5efd2bec44c..e2b50661e22 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java @@ -320,8 +320,7 @@ public interface ApplicationManagementPublisherAPI { @Multipart(value = "icon") Attachment iconFile, @ApiParam( name = "banner", - value = "Banner of the uploading application", - required = true) + value = "Banner of the uploading application") @Multipart(value = "banner") Attachment bannerFile, @ApiParam( name = "screenshot1", @@ -385,8 +384,7 @@ public interface ApplicationManagementPublisherAPI { @Multipart(value = "icon") Attachment iconFile, @ApiParam( name = "banner", - value = "Banner of the uploading web app", - required = true) + value = "Banner of the uploading web app") @Multipart(value = "banner") Attachment bannerFile, @ApiParam( name = "screenshot1", @@ -450,8 +448,7 @@ public interface ApplicationManagementPublisherAPI { @Multipart(value = "icon") Attachment iconFile, @ApiParam( name = "banner", - value = "Banner of the uploading public app", - required = true) + value = "Banner of the uploading public app") @Multipart(value = "banner") Attachment bannerFile, @ApiParam( name = "screenshot1", @@ -523,8 +520,7 @@ public interface ApplicationManagementPublisherAPI { @Multipart(value = "icon") Attachment iconFile, @ApiParam( name = "banner", - value = "Banner of the uploading application", - required = true) + value = "Banner of the uploading application") @Multipart(value = "banner") Attachment bannerFile, @ApiParam( name = "screenshot1", @@ -635,8 +631,7 @@ public interface ApplicationManagementPublisherAPI { @Multipart(value = "icon") Attachment iconFile, @ApiParam( name = "banner", - value = "Banner of the uploading application", - required = true) + value = "Banner of the uploading application") @Multipart(value = "banner") Attachment bannerFile, @ApiParam( name = "screenshot1", @@ -776,8 +771,7 @@ public interface ApplicationManagementPublisherAPI { @Multipart(value = "icon") Attachment iconFile, @ApiParam( name = "banner", - value = "banner file of the application release.", - required = true) + value = "banner file of the application release.") @Multipart(value = "banner") Attachment bannerFile, @ApiParam( name = "screenshot1", diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java index a9c639b2ad5..e5e6745dff3 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java @@ -46,9 +46,9 @@ import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.TreeMap; import javax.activation.DataHandler; import javax.validation.Valid; import javax.ws.rs.Consumes; @@ -85,10 +85,6 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem return Response.status(Response.Status.BAD_REQUEST).entity(msg).build(); } ApplicationList applications = applicationManager.getApplications(filter); - if (applications.getApplications().isEmpty()) { - return Response.status(Response.Status.OK) - .entity("Couldn't find any application for the requested query.").build(); - } return Response.status(Response.Status.OK).entity(applications).build(); } catch (BadRequestException e) { String msg = "Incompatible request payload is found. Please try with valid request payload."; @@ -175,7 +171,7 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem @Multipart("application") ApplicationWrapper applicationWrapper, @Multipart("binaryFile") Attachment binaryFile, @Multipart("icon") Attachment iconFile, - @Multipart("banner") Attachment bannerFile, + @Multipart(value = "banner", required = false) Attachment bannerFile, @Multipart("screenshot1") Attachment screenshot1, @Multipart("screenshot2") Attachment screenshot2, @Multipart("screenshot3") Attachment screenshot3) { @@ -214,7 +210,7 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem public Response createWebApp( @Multipart("webapp") WebAppWrapper webAppWrapper, @Multipart("icon") Attachment iconFile, - @Multipart("banner") Attachment bannerFile, + @Multipart(value = "banner", required = false) Attachment bannerFile, @Multipart("screenshot1") Attachment screenshot1, @Multipart("screenshot2") Attachment screenshot2, @Multipart("screenshot3") Attachment screenshot3) { @@ -252,7 +248,7 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem public Response createPubApp( @Multipart("public-app") PublicAppWrapper publicAppWrapper, @Multipart("icon") Attachment iconFile, - @Multipart("banner") Attachment bannerFile, + @Multipart(value = "banner", required = false) Attachment bannerFile, @Multipart("screenshot1") Attachment screenshot1, @Multipart("screenshot2") Attachment screenshot2, @Multipart("screenshot3") Attachment screenshot3) { @@ -292,7 +288,7 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem @Multipart("applicationRelease") ApplicationReleaseWrapper applicationReleaseWrapper, @Multipart("binaryFile") Attachment binaryFile, @Multipart("icon") Attachment iconFile, - @Multipart("banner") Attachment bannerFile, + @Multipart(value = "banner", required = false) Attachment bannerFile, @Multipart("screenshot1") Attachment screenshot1, @Multipart("screenshot2") Attachment screenshot2, @Multipart("screenshot3") Attachment screenshot3) { @@ -331,7 +327,7 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem public Response updateApplicationImageArtifacts( @PathParam("uuid") String applicationReleaseUuid, @Multipart("icon") Attachment iconFile, - @Multipart("banner") Attachment bannerFile, + @Multipart(value = "banner", required = false) Attachment bannerFile, @Multipart("screenshot1") Attachment screenshot1, @Multipart("screenshot2") Attachment screenshot2, @Multipart("screenshot3") Attachment screenshot3) { @@ -436,7 +432,7 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem @Multipart("applicationRelease") ApplicationReleaseWrapper applicationReleaseWrapper, @Multipart("binaryFile") Attachment binaryFile, @Multipart("icon") Attachment iconFile, - @Multipart("banner") Attachment bannerFile, + @Multipart(value = "banner", required = false) Attachment bannerFile, @Multipart("screenshot1") Attachment screenshot1, @Multipart("screenshot2") Attachment screenshot2, @Multipart("screenshot3") Attachment screenshot3) { @@ -825,7 +821,7 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem } if (attachmentList != null) { - Map scrrenshotData = new HashMap<>(); + Map scrrenshotData = new TreeMap<>(); for (Attachment sc : attachmentList) { dataHandler = sc.getDataHandler(); String screenshotrFileName = dataHandler.getName(); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java index accda96f57f..754bd7a3521 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java @@ -60,10 +60,6 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { } filter.setAppReleaseState(applicationManager.getInstallableLifecycleState()); ApplicationList applications = applicationManager.getApplications(filter); - if (applications.getApplications().isEmpty()) { - return Response.status(Response.Status.OK) - .entity("Couldn't find any application for the requested query.").build(); - } return Response.status(Response.Status.OK).entity(applications).build(); } catch (BadRequestException e) { String msg = e.getMessage(); diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql index 180aa9fcd9a..c2d8157505f 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql @@ -29,7 +29,7 @@ CREATE TABLE IF NOT EXISTS AP_APP_RELEASE( APP_PRICE DECIMAL(6, 2) NULL DEFAULT NULL, INSTALLER_LOCATION VARCHAR(100) NOT NULL, ICON_LOCATION VARCHAR(100) NOT NULL, - BANNER_LOCATION VARCHAR(100) NOT NULL, + BANNER_LOCATION VARCHAR(100) NULL DEFAULT NULL, SC_1_LOCATION VARCHAR(100) NOT NULL, SC_2_LOCATION VARCHAR(100) NULL DEFAULT NULL, SC_3_LOCATION VARCHAR(100) NULL DEFAULT NULL, From ebc72069f9ff572f8aa52bba63999ded7a8b8665 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Wed, 19 Jun 2019 14:42:45 +0530 Subject: [PATCH 2/8] Change api requests in publisher --- .../react-app/package.json | 5 +- .../react-app/public/conf/config.json | 7 +- .../apps/detailed-rating/DetailedRating.js | 14 +- .../apps/list-apps/AppDetailsDrawer.js | 2 +- .../components/apps/list-apps/AppsTable.js | 4 +- .../components/apps/release/ReleaseView.js | 33 ++++- .../apps/release/review/Reviews.css | 16 +++ .../components/apps/release/review/Reviews.js | 134 ++++++++++++++++++ .../apps/release/review/SingleReview.js | 46 ++++++ .../manage/categories/ManageCategories.js | 8 +- .../manage/categories/ManageTags.js | 8 +- .../react-app/src/js/actions/index.js | 8 +- .../pages/dashboard/apps/release/Release.js | 19 ++- .../apps/release/install/UserInstall.js | 16 +-- .../pages/dashboard/apps/release/Release.js | 10 -- 15 files changed, 271 insertions(+), 59 deletions(-) create mode 100644 components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.css create mode 100644 components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.js create mode 100644 components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/SingleReview.js diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json index 92328d98bba..be4c3bbe853 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json @@ -21,13 +21,14 @@ "react-d3-graph": "^2.0.2", "react-dom": "^16.8.4", "react-highlight-words": "^0.16.0", + "react-infinite-scroller": "^1.2.4", "react-router": "latest", "react-router-config": "^5.0.0", "react-router-dom": "latest", "react-scripts": "2.1.8", + "react-star-ratings": "^2.3.0", "redux-thunk": "^2.3.0", - "storm-react-diagrams": "^5.2.1", - "react-star-ratings": "^2.3.0" + "storm-react-diagrams": "^5.2.1" }, "devDependencies": { "@babel/core": "^7.0.0", diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/public/conf/config.json b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/public/conf/config.json index 902c2cdd469..cbcb56cb63c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/public/conf/config.json +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/public/conf/config.json @@ -7,7 +7,12 @@ "protocol": "https", "hostname": "localhost", "httpsPort": "9443", - "invokerUri": "/ui-request-handler/invoke/application-mgt-publisher/v1.0", + "invoker": { + "uri": "/ui-request-handler/invoke", + "publisher": "/application-mgt-publisher/v1.0", + "store": "/application-mgt-store/v1.0", + "admin" : "" + }, "loginUri": "/ui-request-handler/login", "platform": "publisher" }, diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/detailed-rating/DetailedRating.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/detailed-rating/DetailedRating.js index 19766fa499e..65dddd9e68a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/detailed-rating/DetailedRating.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/detailed-rating/DetailedRating.js @@ -18,25 +18,27 @@ class DetailedRating extends React.Component{ } componentDidMount() { - this.getData(this.props.uuid); + const {type,uuid} = this.props; + this.getData(type,uuid); } componentDidUpdate(prevProps, prevState) { if (prevProps.uuid !== this.props.uuid) { - this.getData(this.props.uuid); + const {type,uuid} = this.props; + this.getData(type,uuid); } } - getData = (uuid)=>{ - const request = "method=get&content-type=application/json&payload={}&api-endpoint=/application-mgt-store/v1.0/reviews/"+uuid+"/rating"; + getData = (type, uuid)=>{ return axios.get( - config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/reviews/"+uuid+"/rating", + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.store+"/reviews/"+uuid+"/"+type+"-rating", { headers: { 'X-Platform': config.serverConfig.platform } }).then(res => { if (res.status === 200) { let detailedRating = res.data.data; + console.log(type,uuid); this.setState({ detailedRating }) @@ -46,6 +48,8 @@ class DetailedRating extends React.Component{ if (error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/publisher/login'; } + + console.log(error); }); }; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer.js index c25164f7a06..df3550bee80 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer.js @@ -85,7 +85,7 @@ class AppDetailsDrawer extends React.Component { /> - + ); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppsTable.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppsTable.js index 57a369965f6..3e04a6bde30 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppsTable.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppsTable.js @@ -113,9 +113,9 @@ class AppsTable extends React.Component { const data = { }; - console.log(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/applications?"+encodedExtraParams); + console.log(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher+"/applications?"+encodedExtraParams); axios.post( - config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/applications?"+encodedExtraParams, + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher+"/applications?"+encodedExtraParams, data, { headers: { 'X-Platform': config.serverConfig.platform } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/ReleaseView.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/ReleaseView.js index 4fb34364a38..fa26482f0de 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/ReleaseView.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/ReleaseView.js @@ -1,13 +1,20 @@ import React from "react"; -import {Divider, Row, Col, Typography, Button} from "antd"; +import {Divider, Row, Col, Typography, Button, Drawer} from "antd"; +import StarRatings from "react-star-ratings"; +import Reviews from "./review/Reviews"; import "../../../App.css"; import config from "../../../../public/conf/config.json"; +import DetailedRating from "../detailed-rating/DetailedRating"; const {Title, Text, Paragraph} = Typography; class ReleaseView extends React.Component { render() { - const release = this.props.release; + const app = this.props.app; + const release = (app !== null) ? app.applicationReleases[0] : null; + if(release == null){ + return null; + } return (
@@ -16,8 +23,16 @@ class ReleaseView extends React.Component { icon - App Name - {release.version}
+ {app.name} + Version : {release.version}

+
@@ -28,7 +43,7 @@ class ReleaseView extends React.Component { icon="shop" disabled={release.currentStatus !== "PUBLISHED"} onClick={() => { - window.open("https://"+ config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+"/store/apps/"+release.uuid) + window.open("https://"+ config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+"/store/"+app.deviceType+"/apps/"+release.uuid) }}> Open in store @@ -50,6 +65,14 @@ class ReleaseView extends React.Component { {release.description} + + REVIEWS + + + + + +
); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.css new file mode 100644 index 00000000000..8678c638919 --- /dev/null +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.css @@ -0,0 +1,16 @@ +.demo-infinite-container { + overflow: auto; + padding: 8px 24px; +} +.demo-loading-container { + position: absolute; + bottom: 40px; + width: 100%; + text-align: center; +} + +.demo-loading { + position: absolute; + bottom: -40px; + left: 50%; +} \ No newline at end of file diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.js new file mode 100644 index 00000000000..2d173c771c0 --- /dev/null +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.js @@ -0,0 +1,134 @@ +import React from "react"; +import {List, message, Avatar, Spin, Button} from 'antd'; +import "./Reviews.css"; + +import InfiniteScroll from 'react-infinite-scroller'; +import SingleReview from "./SingleReview"; +import axios from "axios"; +import config from "../../../../../public/conf/config.json"; + +const limit = 5; + +class Reviews extends React.Component { + state = { + data: [], + loading: false, + hasMore: false, + loadMore: false + }; + + + componentDidMount() { + this.fetchData(0, limit, res => { + this.setState({ + data: res, + }); + }); + } + + fetchData = (offset, limit, callback) => { + + const {uuid} = this.props; + + axios.get( + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.store+"/reviews/app/"+uuid, + { + headers: {'X-Platform': config.serverConfig.platform} + }).then(res => { + if (res.status === 200) { + let reviews = res.data.data.data; + callback(reviews); + } + + }).catch(function (error) { + if (error.response.status === 401) { + window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/store/login'; + } else { + message.warning('Something went wrong'); + + } + }); + }; + + handleInfiniteOnLoad = (count) => { + const offset = count * limit; + let data = this.state.data; + this.setState({ + loading: true, + }); + if (data.length > 149) { + this.setState({ + hasMore: false, + loading: false, + }); + return; + } + this.fetchData(offset, limit, res => { + if (res.length > 0) { + data = data.concat(res); + this.setState({ + data, + loading: false, + }); + } else { + this.setState({ + hasMore: false, + loading: false + }); + } + }); + }; + + enableLoading = () => { + this.setState({ + hasMore: true, + loadMore: true + }); + }; + + render() { + const review = { + id: 2, + content: "Btw, it was clear to me that I can cancel the 1 year subscription before the free trial week and so I did. Dont understand the negative reviews about that. It has a good collection of excercises, meditations etc. You just answer 5 questions and you get challenges assigned to you. I would have liked something even more personalized. I didnt like the interface. It is a bit messy and difficult to follow your tasks. So, I didnt want to do a full-year subscription. There could be more options.", + rootParentI: -1, + immediateParentId: -1, + createdAt: "Fri, 24 May 2019 17:27:22 IST", + modifiedAt: "Fri, 24 May 2019 17:27:22 IST", + rating: 4, + replies: [] + }; + // console.log(this.state.loadMore); + // console.log(this.state.data.length); + return ( +
+ + ( + + + + )} + > + {this.state.loading && this.state.hasMore && ( +
+ +
+ )} +
+
+ {!this.state.loadMore && (this.state.data.length >= limit) && (
+ +
)} +
+ ); + } +} + +export default Reviews; \ No newline at end of file diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/SingleReview.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/SingleReview.js new file mode 100644 index 00000000000..3834b3ff2e3 --- /dev/null +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/SingleReview.js @@ -0,0 +1,46 @@ +import React from "react"; +import {Avatar} from "antd"; +import {List,Typography} from "antd"; +import StarRatings from "react-star-ratings"; + +const {Text, Paragraph} = Typography; +const colorList = ['#f0932b','#badc58','#6ab04c','#eb4d4b','#0abde3', '#9b59b6','#3498db','#22a6b3']; + +class SingleReview extends React.Component { + + render() { + const review = this.props.review; + const randomColor = colorList[Math.floor(Math.random() * (colorList.length))]; + const avatarLetter = review.username.charAt(0).toUpperCase(); + const content = ( +
+ + {review.createdAt}
+ {review.content} +
+ ); + + return ( +
+ + {avatarLetter} + + } + title={review.username} + description={content} + /> +
+ ); + } +} + +export default SingleReview; \ No newline at end of file diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageCategories.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageCategories.js index 204c76460d0..e27fc497eb3 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageCategories.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageCategories.js @@ -21,7 +21,7 @@ class ManageCategories extends React.Component { componentDidMount() { axios.get( - config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/applications/categories", + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher+"/applications/categories", { headers: { 'X-Platform': config.serverConfig.platform } }).then(res => { @@ -58,7 +58,7 @@ class ManageCategories extends React.Component { loading: true }); axios.delete( - config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/admin/applications/categories/"+id, + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher+"/admin/applications/categories/"+id, { headers: { 'X-Platform': config.serverConfig.platform } } @@ -200,7 +200,7 @@ class ManageCategories extends React.Component { const data = tempElements.map(category => category.categoryName); axios.post( - config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/admin/applications/categories", + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher+"/admin/applications/categories", data, { headers: { 'X-Platform': config.serverConfig.platform } @@ -266,7 +266,7 @@ class ManageCategories extends React.Component { }); axios.put( - config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/admin/applications/categories/rename?from="+currentlyEditingId+"&to="+editingValue, + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher+"/admin/applications/categories/rename?from="+currentlyEditingId+"&to="+editingValue, {}, { headers: { 'X-Platform': config.serverConfig.platform } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageTags.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageTags.js index 7c10934b710..5e1cc407faf 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageTags.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageTags.js @@ -21,7 +21,7 @@ class ManageTags extends React.Component { componentDidMount() { axios.get( - config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/applications/tags", + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher+"/applications/tags", { headers: { 'X-Platform': config.serverConfig.platform } }).then(res => { @@ -60,7 +60,7 @@ class ManageTags extends React.Component { }); axios.delete( - config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/admin/applications/tags/"+id, + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher+"/admin/applications/tags/"+id, { headers: {'X-Platform': config.serverConfig.platform} }).then(res => { @@ -200,7 +200,7 @@ class ManageTags extends React.Component { const data = tempElements.map(tag => tag.tagName); - axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/applications/tags", + axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher+"/applications/tags", data, { headers: { 'X-Platform': config.serverConfig.platform } @@ -265,7 +265,7 @@ class ManageTags extends React.Component { }); axios.put( - config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/applications/tags/rename?from="+currentlyEditingId+"&to="+editingValue, + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher+"/applications/tags/rename?from="+currentlyEditingId+"&to="+editingValue, {}, { headers: { 'X-Platform': config.serverConfig.platform } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/js/actions/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/js/actions/index.js index b26e84c2093..79690cc148e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/js/actions/index.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/js/actions/index.js @@ -6,7 +6,7 @@ export const getApps = () => dispatch => { const request = "method=post&content-type=application/json&payload={}&api-endpoint=/application-mgt-publisher/v1.0/applications"; - return axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri, request + return axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher, request ).then(res => { if (res.status === 200) { let apps = []; @@ -29,7 +29,7 @@ export const getRelease = (uuid) => dispatch => { const request = "method=get&content-type=application/json&payload={}&api-endpoint=/application-mgt-publisher/v1.0/applications/release/" + uuid; - return axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri, request + return axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher, request ).then(res => { if (res.status === 200) { let release = res.data.data; @@ -73,7 +73,7 @@ export const closeLifecycleModal = () => dispatch => { export const getLifecycle = () => dispatch => { const request = "method=get&content-type=application/json&payload={}&api-endpoint=/application-mgt-publisher/v1.0/applications/lifecycle-config"; - return axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri, request + return axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher, request ).then(res => { if (res.status === 200) { let lifecycle = res.data.data; @@ -97,7 +97,7 @@ export const updateLifecycleState = (uuid, nextState, reason) => dispatch => { const request = "method=post&content-type=application/json&payload=" + JSON.stringify(payload) + "&api-endpoint=/application-mgt-publisher/v1.0/applications/life-cycle/" + uuid; - return axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri, request + return axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher, request ).then(res => { if (res.status === 201) { let release = res.data.data; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/release/Release.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/release/Release.js index dc19a967d6a..61df8634977 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/release/Release.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/release/Release.js @@ -30,7 +30,7 @@ class Release extends React.Component { constructor(props) { super(props); this.routes = props.routes; - this.state={ + this.state = { loading: true, app: null, uuid: null @@ -49,17 +49,18 @@ class Release extends React.Component { } } - fetchData = (uuid)=>{ + fetchData = (uuid) => { //send request to the invoker axios.get( - config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/applications/release/"+uuid, + config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.store + "/applications/" + uuid, { - headers: { 'X-Platform': config.serverConfig.platform } + headers: {'X-Platform': config.serverConfig.platform} } ).then(res => { if (res.status === 200) { let app = res.data.data; + console.log(app); this.setState({ app: app, loading: false, @@ -82,12 +83,11 @@ class Release extends React.Component { render() { const {app} = this.state; - const release = app; - if (release == null) { + if (app == null) { return (
- No Releases Found + No Apps Found
); } @@ -95,14 +95,11 @@ class Release extends React.Component { //todo remove uppercase return (
-
- + diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/UserInstall.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/UserInstall.js index 74d12b048a2..9730b70a071 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/UserInstall.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/UserInstall.js @@ -29,16 +29,12 @@ class UserInstall extends React.Component { this.setState({data: [], fetching: true}); - const parameters = { - method: "get", - 'content-type': "application/json", - payload: "{}", - 'api-endpoint': "/device-mgt/v1.0/users/search?username=" + value - }; - - const request = Object.keys(parameters).map(key => key + '=' + parameters[key]).join('&'); - console.log(request); - axios.post(config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri, request + //send request to the invoker + axios.get( + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/device-mgt/v1.0/users/search?username=" + value, + { + headers: { 'X-Platform': config.serverConfig.platform } + } ).then(res => { if (res.status === 200) { if (fetchId !== this.lastFetchId) { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/apps/release/Release.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/apps/release/Release.js index 51c8897d6be..e317c8ef416 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/apps/release/Release.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/apps/release/Release.js @@ -37,16 +37,6 @@ class Release extends React.Component { } fetchData = (uuid)=>{ - const parameters = { - method: "get", - 'content-type': "application/json", - payload: "{}", - 'api-endpoint': "/application-mgt-store/v1.0/applications/" + uuid - }; - - //url-encode parameters - const request = Object.keys(parameters).map(key => key + '=' + parameters[key]).join('&'); - //send request to the invoker axios.get( config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/applications/"+uuid, From 9638081be81d1efdd0e7c0fe9853af6b7beab951 Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Wed, 19 Jun 2019 14:38:34 +0530 Subject: [PATCH 3/8] Fix review add DAO issue --- .../application/mgt/core/dao/impl/review/ReviewDAOImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/ReviewDAOImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/ReviewDAOImpl.java index e1864ecfbb5..df6bf926279 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/ReviewDAOImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/ReviewDAOImpl.java @@ -110,7 +110,7 @@ public class ReviewDAOImpl extends AbstractDAOImpl implements ReviewDAO { try { conn = this.getDBConnection(); StringJoiner joiner = new StringJoiner(",", - "SELECT rv.ID FROM AP_APP_REVIEW " + "WHERE rv.AP_APP_RELEASE_ID IN (", + "SELECT rv.ID FROM AP_APP_REVIEW rv " + "WHERE rv.AP_APP_RELEASE_ID IN (", ") AND rv.USERNAME = ? AND rv.TENANT_ID = ?"); appReleaseIds.stream().map(ignored -> "?").forEach(joiner::add); String query = joiner.toString(); From 937c0868c0bf1c918cbca8190ddbc41113703d3f Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Wed, 19 Jun 2019 19:49:41 +0530 Subject: [PATCH 4/8] Improve app getting functionality in APPM publisher --- .../common/services/ApplicationManager.java | 2 +- .../application/mgt/core/dao/ReviewDAO.java | 2 +- .../core/dao/impl/review/ReviewDAOImpl.java | 3 +- .../mgt/core/impl/ApplicationManagerImpl.java | 45 ++++++++++--------- .../mgt/core/impl/ReviewManagerImpl.java | 3 +- .../ApplicationManagementPublisherAPI.java | 2 +- ...ApplicationManagementPublisherAPIImpl.java | 9 ++-- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationManager.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationManager.java index 3bbf1762f22..90f65a44a55 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationManager.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationManager.java @@ -122,7 +122,7 @@ public interface ApplicationManager { * @return the Application Release identified by the UUID * @throws ApplicationManagementException Application Management Exception. */ - ApplicationRelease getApplicationReleaseByUUID(String uuid) throws ApplicationManagementException; + Application getApplicationByUuid(String uuid) throws ApplicationManagementException; /** * To get the ApplicationDTO for given application relase UUID. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ReviewDAO.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ReviewDAO.java index 2a508b8e314..b7d099423e3 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ReviewDAO.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ReviewDAO.java @@ -90,7 +90,7 @@ import java.util.List; * @return {@link List}List of all reviews for the application release * @throws ReviewManagementDAOException Review management DAO exception **/ - List getAllActiveReleaseReviews(int releaseId, PaginationRequest request, int tenantId) + List getAllReleaseReviews(int releaseId, PaginationRequest request, int tenantId) throws ReviewManagementDAOException; List getAllActiveAppReviews(List releaseIds, PaginationRequest request, int tenantId) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/ReviewDAOImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/ReviewDAOImpl.java index df6bf926279..b57486690a8 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/ReviewDAOImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/ReviewDAOImpl.java @@ -258,7 +258,7 @@ public class ReviewDAOImpl extends AbstractDAOImpl implements ReviewDAO { @Override - public List getAllActiveReleaseReviews(int releaseId, PaginationRequest request, int tenantId) + public List getAllReleaseReviews(int releaseId, PaginationRequest request, int tenantId) throws ReviewManagementDAOException { if (log.isDebugEnabled()) { @@ -283,7 +283,6 @@ public class ReviewDAOImpl extends AbstractDAOImpl implements ReviewDAO { + "AP_APP_REVIEW.AP_APP_RELEASE_ID = AP_APP_RELEASE.ID " + "WHERE AP_APP_REVIEW.AP_APP_RELEASE_ID = ? AND " + "AP_APP_REVIEW.ROOT_PARENT_ID = ? AND " - + "AP_APP_REVIEW.ACTIVE_REVIEW = true AND " + "AP_APP_REVIEW.TENANT_ID = ? " + "LIMIT ? OFFSET ?"; try (PreparedStatement statement = conn.prepareStatement(sql)) { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java index 77190def2fb..dab6fdf57f2 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java @@ -896,49 +896,50 @@ public class ApplicationManagerImpl implements ApplicationManager { } @Override - public ApplicationRelease getApplicationReleaseByUUID(String uuid) throws ApplicationManagementException{ + public Application getApplicationByUuid(String uuid) throws ApplicationManagementException{ int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); String userName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); - boolean isVisibleAppRelease = false; + boolean isVisibleApp = false; + try { ConnectionManagerUtil.openDBConnection(); - ApplicationReleaseDTO applicationReleaseDTO = applicationReleaseDAO.getReleaseByUUID(uuid, tenantId); - if (applicationReleaseDTO == null) { - String msg = "Couldn't find an application release for the UUID: " + uuid; + ApplicationDTO applicationDTO = applicationDAO.getApplicationByUUID(uuid, tenantId); + + if (applicationDTO == null) { + String msg = "Couldn't found an application for application release UUID: " + uuid; log.error(msg); throw new NotFoundException(msg); } - if (applicationReleaseDTO.getCurrentState().equals(lifecycleStateManager.getEndState())) { - return null; - } - List unrestrictedRoles = this.visibilityDAO.getUnrestrictedRolesByUUID(uuid, tenantId); + List tags = this.applicationDAO.getAppTags(applicationDTO.getId(), tenantId); + List categories = this.applicationDAO.getAppCategories(applicationDTO.getId(), tenantId); + applicationDTO.setTags(tags); + applicationDTO.setAppCategories(categories); + + List unrestrictedRoles = this.visibilityDAO.getUnrestrictedRoles(applicationDTO.getId(), tenantId); if (!unrestrictedRoles.isEmpty()) { if (hasUserRole(unrestrictedRoles, userName)) { - isVisibleAppRelease = true; + isVisibleApp = true; } } else { - isVisibleAppRelease = true; + isVisibleApp = true; } - if (!isVisibleAppRelease) { - String msg = "You are trying to access release of visibility restricted application. You don't have " - + "required roles to view this application,"; + if (!isVisibleApp) { + String msg = "You are trying to access visibility restricted application. You don't have required " + + "roles to view this application,"; log.error(msg); throw new ForbiddenException(msg); } - return APIUtil.releaseDtoToRelease(applicationReleaseDTO); - } catch (LifecycleManagementException e) { - String msg = "Error occurred when getting the end state of the application lifecycle flow"; - log.error(msg); - throw new ApplicationManagementException(msg, e); + return APIUtil.appDtoToAppResponse(applicationDTO); } catch (UserStoreException e) { - String msg = "User-store exception while getting application with the application release UUID: " + uuid; + String msg = "User-store exception occurred while getting application for application release UUID " + uuid; log.error(msg); throw new ApplicationManagementException(msg, e); } catch (ApplicationManagementDAOException e) { - //todo - throw new ApplicationManagementException(""); + String msg = "Error occurred while getting dta which are related to Application."; + log.error(msg); + throw new ApplicationManagementException(msg); } finally { ConnectionManagerUtil.closeDBConnection(); } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ReviewManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ReviewManagerImpl.java index b550f6a64e7..b31479c4ed0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ReviewManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ReviewManagerImpl.java @@ -289,6 +289,7 @@ public class ReviewManagerImpl implements ReviewManager { log.error(msg); throw new ReviewManagementException(msg); } + uuid = reviewDTO.getReleaseUuid(); } else if (updatingReview.getRating() > 0 && updatingReview.getRating() != reviewDTO.getRating()) { Runnable task = () -> ReviewManagerImpl.this .calculateRating(updatingReview.getRating(), reviewDTO.getRating(), uuid, tenantId); @@ -353,7 +354,7 @@ public class ReviewManagerImpl implements ReviewManager { log.error(msg); throw new NotFoundException(msg); } - return getReviewTree(this.reviewDAO.getAllActiveReleaseReviews(releaseDTO.getId(), request, tenantId)); + return getReviewTree(this.reviewDAO.getAllReleaseReviews(releaseDTO.getId(), request, tenantId)); } catch (ReviewManagementDAOException e) { throw new ReviewManagementException("Error occured while getting all reviews for application uuid: " + uuid, e); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java index e2b50661e22..99355e5c960 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java @@ -217,7 +217,7 @@ public interface ApplicationManagementPublisherAPI { message = "Internal Server Error. \n Error occurred while getting relevant application release.", response = ErrorResponse.class) }) - Response getApplicationRelease( + Response getApplicationByUUID( @ApiParam( name = "uuid", value = "application release uuid", diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java index e5e6745dff3..d0d091df032 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java @@ -135,18 +135,17 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem @GET @Consumes("application/json") @Path("/release/{uuid}") - public Response getApplicationRelease( + public Response getApplicationByUUID( @PathParam("uuid") String uuid) { ApplicationManager applicationManager = APIUtil.getApplicationManager(); try { - //todo return application - ApplicationRelease applicationRelease = applicationManager.getApplicationReleaseByUUID(uuid); - if (applicationRelease == null){ + Application application = applicationManager.getApplicationByUuid(uuid); + if (application == null){ String msg = "Application release is in the end state of the application lifecycle flow."; log.error(msg); return Response.status(Response.Status.OK).entity(msg).build(); } - return Response.status(Response.Status.OK).entity(applicationRelease).build(); + return Response.status(Response.Status.OK).entity(application).build(); } catch (NotFoundException e) { String msg = "Application Release with UUID: " + uuid + " is not found"; log.error(msg, e); From ac817c61f72bce15fc437f7b0c4ee135de179f26 Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Wed, 19 Jun 2019 19:55:11 +0530 Subject: [PATCH 5/8] Fix minor issue in review management --- .../device/application/mgt/core/impl/ReviewManagerImpl.java | 1 - 1 file changed, 1 deletion(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ReviewManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ReviewManagerImpl.java index b31479c4ed0..6b605ef9dec 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ReviewManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ReviewManagerImpl.java @@ -289,7 +289,6 @@ public class ReviewManagerImpl implements ReviewManager { log.error(msg); throw new ReviewManagementException(msg); } - uuid = reviewDTO.getReleaseUuid(); } else if (updatingReview.getRating() > 0 && updatingReview.getRating() != reviewDTO.getRating()) { Runnable task = () -> ReviewManagerImpl.this .calculateRating(updatingReview.getRating(), reviewDTO.getRating(), uuid, tenantId); From ef224a75dcadecd64b67423dedd8910f196d0815 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Wed, 19 Jun 2019 23:05:55 +0530 Subject: [PATCH 6/8] Fix remaining api calls in APPM UI --- .../react-app/src/App.js | 1 - .../apps/detailed-rating/DetailedRating.js | 6 +---- .../apps/list-apps/AppDetailsDrawer.js | 1 - .../components/apps/list-apps/AppsTable.js | 4 +--- .../src/components/apps/list-apps/ListApps.js | 3 +-- .../components/apps/release/LifecycleModal.js | 2 -- .../components/apps/release/ReleaseView.js | 2 +- .../components/apps/release/review/Reviews.js | 4 ++-- .../apps/release/temp/LifeCycleGraph.js | 2 +- .../manage/categories/ManageCategories.js | 1 - .../manage/categories/ManageTags.js | 1 - .../pages/dashboard/add-new-app/AddNewApp.js | 1 - .../src/pages/dashboard/add-new-app/Step3.js | 1 - .../src/pages/dashboard/apps/Apps-old.js | 2 +- .../pages/dashboard/apps/release/Release.js | 3 +-- .../react-app/public/conf/config.json | 6 +++++ .../react-app/src/components/apps/AppList.js | 6 +++-- .../components/apps/release/DetailedRating.js | 23 ++++++++++--------- .../components/apps/release/ReleaseView.js | 13 ++++++----- .../apps/release/install/AppInstallModal.js | 2 +- .../apps/release/install/DeviceInstall.js | 7 +++--- .../apps/release/install/GroupInstall.js | 8 ++----- .../apps/release/install/RoleInstall.js | 8 ++----- .../apps/release/install/UserInstall.js | 5 +--- .../apps/release/review/AddReview.js | 8 +++++-- .../components/apps/release/review/Reviews.js | 11 ++++++--- .../src/pages/dashboard/Dashboard.js | 2 -- .../pages/dashboard/apps/release/Release.js | 7 ++---- 28 files changed, 63 insertions(+), 77 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.js index 9c532989fac..2f6d2d164ff 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.js @@ -15,7 +15,6 @@ class App extends React.Component { } render() { - console.log(this.routes); return (
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/detailed-rating/DetailedRating.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/detailed-rating/DetailedRating.js index 65dddd9e68a..9742266cf3a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/detailed-rating/DetailedRating.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/detailed-rating/DetailedRating.js @@ -30,6 +30,7 @@ class DetailedRating extends React.Component{ } getData = (type, uuid)=>{ + console.log(); return axios.get( config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.store+"/reviews/"+uuid+"/"+type+"-rating", @@ -38,7 +39,6 @@ class DetailedRating extends React.Component{ }).then(res => { if (res.status === 200) { let detailedRating = res.data.data; - console.log(type,uuid); this.setState({ detailedRating }) @@ -48,15 +48,12 @@ class DetailedRating extends React.Component{ if (error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/publisher/login'; } - - console.log(error); }); }; render() { const detailedRating = this.state.detailedRating; - console.log(detailedRating); if(detailedRating ==null){ return null; @@ -81,7 +78,6 @@ class DetailedRating extends React.Component{ } } - console.log(ratingBarPercentages); return ( diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer.js index df3550bee80..094db7aae96 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer.js @@ -12,7 +12,6 @@ class AppDetailsDrawer extends React.Component { if (app == null) { return null; } - console.log(app); return (
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppsTable.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppsTable.js index 3e04a6bde30..d99cccd8f74 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppsTable.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppsTable.js @@ -113,8 +113,7 @@ class AppsTable extends React.Component { const data = { }; - console.log(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher+"/applications?"+encodedExtraParams); - axios.post( + axios.post( config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher+"/applications?"+encodedExtraParams, data, { @@ -152,7 +151,6 @@ class AppsTable extends React.Component { }; render() { - console.log("rendered"); return ( { - console.log(app); this.setState({ isDrawerVisible: true, selectedApp: app @@ -56,7 +55,7 @@ class ConnectedListApps extends React.Component { console.log(value)} + // onSearch={value => console.log(value)} style={{width: 200}} /> diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/LifecycleModal.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/LifecycleModal.js index 646cbd9aea3..df239546e3e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/LifecycleModal.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/LifecycleModal.js @@ -62,8 +62,6 @@ class ConnectedLifecycleModal extends React.Component { handleSubmit = event => { this.setState({ loading: true }); event.preventDefault(); - console.log(this.reason); - console.log("uuid", this.props.uuid); this.props.updateLifecycleState(this.props.uuid, this.props.nextState, this.reason.state.value) }; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/ReleaseView.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/ReleaseView.js index fa26482f0de..5764b8ce9aa 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/ReleaseView.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/ReleaseView.js @@ -72,7 +72,7 @@ class ReleaseView extends React.Component { - + ); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.js index 2d173c771c0..db2b69c52df 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.js @@ -28,10 +28,10 @@ class Reviews extends React.Component { fetchData = (offset, limit, callback) => { - const {uuid} = this.props; + const {uuid, type} = this.props; axios.get( - config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.store+"/reviews/app/"+uuid, + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.store+"/reviews/"+type+"/"+uuid, { headers: {'X-Platform': config.serverConfig.platform} }).then(res => { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/temp/LifeCycleGraph.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/temp/LifeCycleGraph.js index fc25a9b306b..0301d8c8efc 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/temp/LifeCycleGraph.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/temp/LifeCycleGraph.js @@ -92,7 +92,7 @@ function connectNodes(nodeFrom, nodeTo) { } function f() { - console.log(1); + // console.log(1); } export default LifeCycleGraph; \ No newline at end of file diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageCategories.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageCategories.js index e27fc497eb3..072ad720c58 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageCategories.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageCategories.js @@ -241,7 +241,6 @@ class ManageCategories extends React.Component { saveInputRef = input => (this.input = input); closeEditModal = e => { - console.log(e); this.setState({ isEditModalVisible: false, currentlyEditingId: null diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageTags.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageTags.js index 5e1cc407faf..c5251527070 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageTags.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageTags.js @@ -240,7 +240,6 @@ class ManageTags extends React.Component { saveInputRef = input => (this.input = input); closeEditModal = e => { - console.log(e); this.setState({ isEditModalVisible: false, currentlyEditingId: null diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewApp.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewApp.js index 3965c506c63..b20456d2a7c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewApp.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewApp.js @@ -98,7 +98,6 @@ class EditableTagGroup extends React.Component { handleClose = (removedTag) => { const tags = this.state.tags.filter(tag => tag !== removedTag); - console.log(tags); this.setState({tags}); } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/Step3.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/Step3.js index 6ddba9f8e21..e9339ed0a5a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/Step3.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/Step3.js @@ -2,7 +2,6 @@ import React from "react" class Step3 extends React.Component { render() { - console.log("hhhoohh"); return (

tttoooeeee

); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/Apps-old.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/Apps-old.js index e24f40a6eae..4a740f73e31 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/Apps-old.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/Apps-old.js @@ -41,7 +41,7 @@ class Apps extends React.Component {
console.log(value)} + // onSearch={value => console.log(value)} style={{ width: 200}} /> diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/release/Release.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/release/Release.js index 61df8634977..a9a18c6e4aa 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/release/Release.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/release/Release.js @@ -53,14 +53,13 @@ class Release extends React.Component { //send request to the invoker axios.get( - config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.store + "/applications/" + uuid, + config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/release/"+ uuid, { headers: {'X-Platform': config.serverConfig.platform} } ).then(res => { if (res.status === 200) { let app = res.data.data; - console.log(app); this.setState({ app: app, loading: false, diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/public/conf/config.json b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/public/conf/config.json index 706fe7cbd7c..642b3fdf38c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/public/conf/config.json +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/public/conf/config.json @@ -8,6 +8,12 @@ "hostname": "localhost", "httpsPort": "9443", "invokerUri": "/ui-request-handler/invoke/application-mgt-store/v1.0", + "invoker": { + "uri": "/ui-request-handler/invoke", + "publisher": "/application-mgt-publisher/v1.0", + "store": "/application-mgt-store/v1.0", + "admin" : "" + }, "loginUri": "/ui-request-handler/login", "platform": "store" }, diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppList.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppList.js index d04af62794b..5bfbea3572b 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppList.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/AppList.js @@ -37,9 +37,11 @@ class AppList extends React.Component { payload.deviceType= deviceType; } + console.log("b",config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.store+"/applications/"); + //send request to the invoker axios.post( - config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/applications/", + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.store+"/applications/", payload, { headers: { 'X-Platform': config.serverConfig.platform } @@ -54,7 +56,7 @@ class AppList extends React.Component { }) } - }).catch((error) => { + }).catch((error) => { console.log(error.response); if (error.hasOwnProperty("response") && error.response.status === 401) { //todo display a popup with error message.error('You are not logged in'); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/DetailedRating.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/DetailedRating.js index f8dc026b8e7..6b054fbf34b 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/DetailedRating.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/DetailedRating.js @@ -1,12 +1,13 @@ import React from "react"; import {Row, Typography, Icon} from "antd"; import StarRatings from "react-star-ratings"; -import axios from "axios"; import "./DetailedRating.css"; import config from "../../../../public/conf/config.json"; +import axios from "axios"; const { Text } = Typography; + class DetailedRating extends React.Component{ constructor(props){ @@ -17,20 +18,24 @@ class DetailedRating extends React.Component{ } componentDidMount() { - this.getData(this.props.uuid); + const {type,uuid} = this.props; + this.getData(type,uuid); } componentDidUpdate(prevProps, prevState) { if (prevProps.uuid !== this.props.uuid) { - this.getData(this.props.uuid); + const {type,uuid} = this.props; + this.getData(type,uuid); } } - getData = (uuid)=>{ - const request = "method=get&content-type=application/json&payload={}&api-endpoint=/application-mgt-store/v1.0/reviews/"+uuid+"/rating"; + getData = (type, uuid)=>{ - return axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri, request - ).then(res => { + return axios.get( + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.store+"/reviews/"+uuid+"/"+type+"-rating", + { + headers: { 'X-Platform': config.serverConfig.platform } + }).then(res => { if (res.status === 200) { let detailedRating = res.data.data; this.setState({ @@ -48,8 +53,6 @@ class DetailedRating extends React.Component{ render() { const detailedRating = this.state.detailedRating; - console.log(detailedRating); - if(detailedRating ==null){ return null; } @@ -73,8 +76,6 @@ class DetailedRating extends React.Component{ } } - console.log(ratingBarPercentages); - return (
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/ReleaseView.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/ReleaseView.js index ea96028b805..e52ddff1928 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/ReleaseView.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/ReleaseView.js @@ -21,14 +21,14 @@ class ReleaseView extends React.Component { } } - installApp = (type,payload) => { + installApp = (type, payload) => { const {uuid} = this.props.release; const parameters = { method: "post", 'content-type': "application/json", payload: JSON.stringify(payload), - 'api-endpoint': "/application-mgt-store/v1.0/subscription/install/" + uuid + "/"+type+"/install" + 'api-endpoint': "/application-mgt-store/v1.0/subscription/install/" + uuid + "/" + type + "/install" }; const request = Object.keys(parameters).map(key => key + '=' + parameters[key]).join('&'); @@ -36,7 +36,7 @@ class ReleaseView extends React.Component { loading: true, }); - axios.post(config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri, request + axios.post(config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.store, request ).then(res => { if (res.status === 201) { this.setState({ @@ -60,8 +60,9 @@ class ReleaseView extends React.Component { } }).catch((error) => { + console.log(error); if (error.response.status === 401) { - window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/store/login'; + window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/store/login'; } else { this.setState({ loading: false, @@ -133,13 +134,13 @@ class ReleaseView extends React.Component { REVIEWS
- + - + ); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/AppInstallModal.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/AppInstallModal.js index 990eea393e8..4567bceb218 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/AppInstallModal.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/AppInstallModal.js @@ -21,7 +21,7 @@ class AppInstallModal extends React.Component{ onCancel={this.props.onClose} footer={null} > - {console.log("changed");}}> + diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceInstall.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceInstall.js index c1c7a5f2e53..4f4b7be7fee 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceInstall.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/DeviceInstall.js @@ -95,7 +95,7 @@ class DeviceInstall extends React.Component { rowSelection = { onChange: (selectedRowKeys, selectedRows) => { - console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows); + // console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows); this.setState({ selectedRows: selectedRows }) @@ -138,11 +138,10 @@ class DeviceInstall extends React.Component { const request = Object.keys(parameters).map(key => key + '=' + parameters[key]).join('&'); //send request to the invoker - axios.post(config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri, request + axios.post(config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.store, request ).then(res => { if (res.status === 200) { const pagination = {...this.state.pagination}; - console.log(res.data.data.devices); this.setState({ loading: false, data: res.data.data.devices, @@ -151,7 +150,7 @@ class DeviceInstall extends React.Component { } - }).catch((error) => { + }).catch((error) => { console.log(error); if (error.hasOwnProperty("status") && error.response.status === 401) { //todo display a popop with error message.error('You are not logged in'); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/GroupInstall.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/GroupInstall.js index 535fefec220..82e2de759cb 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/GroupInstall.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/GroupInstall.js @@ -35,9 +35,7 @@ class GroupInstall extends React.Component { 'api-endpoint': "/device-mgt/v1.0/admin/groups?name=" + value }; - const request = Object.keys(parameters).map(key => key + '=' + parameters[key]).join('&'); - console.log(request); - axios.post(config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri, request + axios.post(config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.store, request ).then(res => { if (res.status === 200) { if (fetchId !== this.lastFetchId) { @@ -45,8 +43,6 @@ class GroupInstall extends React.Component { return; } - console.log(res.data.data); - const data = res.data.data.deviceGroups.map(group => ({ text: group.name, value: group.name, @@ -55,7 +51,7 @@ class GroupInstall extends React.Component { this.setState({data, fetching: false}); } - }).catch((error) => { + }).catch((error) => { console.log(error); if (error.hasOwnProperty("status") && error.response.status === 401) { message.error('You are not logged in'); window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/store/login'; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/RoleInstall.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/RoleInstall.js index b9af20857c9..3f058e0825a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/RoleInstall.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/RoleInstall.js @@ -35,9 +35,7 @@ class RoleInstall extends React.Component { 'api-endpoint': "/device-mgt/v1.0/roles?filter=" + value }; - const request = Object.keys(parameters).map(key => key + '=' + parameters[key]).join('&'); - console.log(request); - axios.post(config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri, request + axios.post(config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.store, request ).then(res => { if (res.status === 200) { if (fetchId !== this.lastFetchId) { @@ -45,8 +43,6 @@ class RoleInstall extends React.Component { return; } - console.log(res.data.data); - const data = res.data.data.roles.map(role => ({ text: role, value: role, @@ -55,7 +51,7 @@ class RoleInstall extends React.Component { this.setState({data, fetching: false}); } - }).catch((error) => { + }).catch((error) => { console.log(error); if (error.hasOwnProperty("status") && error.response.status === 401) { message.error('You are not logged in'); window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/store/login'; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/UserInstall.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/UserInstall.js index 9730b70a071..57d87492424 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/UserInstall.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/install/UserInstall.js @@ -23,7 +23,6 @@ class UserInstall extends React.Component { }; fetchUser = value => { - console.log('fetching user', value); this.lastFetchId += 1; const fetchId = this.lastFetchId; this.setState({data: [], fetching: true}); @@ -31,7 +30,7 @@ class UserInstall extends React.Component { //send request to the invoker axios.get( - config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/device-mgt/v1.0/users/search?username=" + value, + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.store+"/device-mgt/v1.0/users/search?username=" + value, { headers: { 'X-Platform': config.serverConfig.platform } } @@ -42,8 +41,6 @@ class UserInstall extends React.Component { return; } - console.log(res.data.data); - const data = res.data.data.users.map(user => ({ text: user.username, value: user.username, diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/review/AddReview.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/review/AddReview.js index 41f2a1b067c..ea6368457e6 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/review/AddReview.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/review/AddReview.js @@ -54,8 +54,12 @@ class AddReview extends React.Component { const request = "method=post&content-type=application/json&payload="+JSON.stringify(payload)+"&api-endpoint=/application-mgt-store/v1.0/reviews/"+uuid; - axios.post(config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri, request - ).then(res => { + axios.post( + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.store+"/reviews/"+uuid, + payload, + { + headers: { 'X-Platform': config.serverConfig.platform } + }).then(res => { if (res.status === 201) { this.setState({ loading: false, diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/review/Reviews.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/review/Reviews.js index dadce12a044..db2b69c52df 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/review/Reviews.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/apps/release/review/Reviews.js @@ -27,9 +27,14 @@ class Reviews extends React.Component { } fetchData = (offset, limit, callback) => { - const request = "method=get&content-type=application/json&payload={}&api-endpoint=/application-mgt-store/v1.0/reviews/" + this.props.uuid + "?offset=" + offset + "%26limit=" + limit; - axios.post(config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri, request - ).then(res => { + + const {uuid, type} = this.props; + + axios.get( + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.store+"/reviews/"+type+"/"+uuid, + { + headers: {'X-Platform': config.serverConfig.platform} + }).then(res => { if (res.status === 200) { let reviews = res.data.data.data; callback(reviews); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/Dashboard.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/Dashboard.js index 458adf8d942..2a2a1dd0ff4 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/Dashboard.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/Dashboard.js @@ -19,7 +19,6 @@ class Dashboard extends React.Component { } changeSelectedMenuItem = (key) =>{ - console.log("called", key); this.setState({ selectedKeys: [key] }) @@ -27,7 +26,6 @@ class Dashboard extends React.Component { render() { const {selectedKeys} = this.state; - console.log(selectedKeys); return (
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/apps/release/Release.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/apps/release/Release.js index e317c8ef416..2882d19b155 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/apps/release/Release.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/apps/release/Release.js @@ -28,7 +28,6 @@ class Release extends React.Component { } componentDidUpdate(prevProps, prevState, snapshot) { - console.log(prevState); if (prevState.uuid !== this.state.uuid) { const {uuid,deviceType} = this.props.match.params; this.fetchData(uuid); @@ -39,7 +38,7 @@ class Release extends React.Component { fetchData = (uuid)=>{ //send request to the invoker axios.get( - config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/applications/"+uuid, + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.store+"/applications/"+uuid, { headers: { 'X-Platform': config.serverConfig.platform } } @@ -47,8 +46,6 @@ class Release extends React.Component { if (res.status === 200) { let app = res.data.data; - console.log(app); - this.setState({ app: app, loading: false, @@ -56,7 +53,7 @@ class Release extends React.Component { }) } - }).catch((error) => { + }).catch((error) => { console.log(error); if (error.hasOwnProperty("response") && error.response.status === 401) { //todo display a popop with error message.error('You are not logged in'); From 8a36baff9f0944625b75a9b6426254ff1e3273ba Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Thu, 20 Jun 2019 11:19:55 +0530 Subject: [PATCH 7/8] Fix invalid package name --- .../application/mgt/core/dao/impl/review/ReviewDAOImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/ReviewDAOImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/ReviewDAOImpl.java index 25dba0771ef..73659390cc8 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/ReviewDAOImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/ReviewDAOImpl.java @@ -16,7 +16,7 @@ * under the License. * */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.Review; +package org.wso2.carbon.device.application.mgt.core.dao.impl.review; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; From 1d2ecc5b45e98c9ed52aa03e3bb3e597d0ca463b Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Thu, 20 Jun 2019 11:52:32 +0530 Subject: [PATCH 8/8] Remove dummy review --- .../src/components/apps/release/review/Reviews.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.js index db2b69c52df..b4ace63734d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.js @@ -87,18 +87,6 @@ class Reviews extends React.Component { }; render() { - const review = { - id: 2, - content: "Btw, it was clear to me that I can cancel the 1 year subscription before the free trial week and so I did. Dont understand the negative reviews about that. It has a good collection of excercises, meditations etc. You just answer 5 questions and you get challenges assigned to you. I would have liked something even more personalized. I didnt like the interface. It is a bit messy and difficult to follow your tasks. So, I didnt want to do a full-year subscription. There could be more options.", - rootParentI: -1, - immediateParentId: -1, - createdAt: "Fri, 24 May 2019 17:27:22 IST", - modifiedAt: "Fri, 24 May 2019 17:27:22 IST", - rating: 4, - replies: [] - }; - // console.log(this.state.loadMore); - // console.log(this.state.data.length); return (