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,