From 14db806fb0f57662cf77a5e59a4834d3c00d2330 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Wed, 22 May 2019 10:02:27 +0530 Subject: [PATCH 1/6] Fix lifecycle not updating issue --- .../components/apps/release/LifecycleModal.js | 3 ++- .../react-app/src/js/actions/index.js | 19 ++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) 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 26db61287c..646cbd9aea 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 @@ -33,7 +33,8 @@ class ConnectedLifecycleModal extends React.Component { componentWillReceiveProps(nextProps) { if (nextProps !== this.props) { this.setState({ - visible: nextProps.visible + visible: nextProps.visible, + loading: false }) } } 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 d327475721..42bfd2c3a9 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 @@ -96,20 +96,17 @@ 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; - console.log(request); return axios.post('https://' + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri, request ).then(res => { - if (res.status === 200) { - if(res.data.data.hasOwnProperty("release")) { - let release = res.data.data; - dispatch({type: ActionTypes.UPDATE_LIFECYCLE_STATE, payload: release}); - }else{ - alert("error"); - dispatch({ - type: ActionTypes.CLOSE_LIFECYCLE_MODAL - }); - } + if (res.status === 201) { + let release = res.data.data; + dispatch({type: ActionTypes.UPDATE_LIFECYCLE_STATE, payload: release}); + }else { + alert("error"); + dispatch({ + type: ActionTypes.CLOSE_LIFECYCLE_MODAL + }); } }).catch(function (error) { From 753a3478489be989cd90e8b8e949360a9f9950b9 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Wed, 22 May 2019 14:04:13 +0530 Subject: [PATCH 2/6] Display screenshots and icon --- .../react-app/src/App.css | 45 +++++------- .../components/apps/release/ReleaseView.js | 19 +++-- .../src/pages/dashboard/Dashboard.js | 71 ++++++++++--------- 3 files changed, 69 insertions(+), 66 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css index 4fea44459f..8b397c1780 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css @@ -1,37 +1,28 @@ -.App { - text-align: center; +.ant-upload.ant-upload-drag { + height: 170px; } -.App-logo { - animation: App-logo-spin infinite 20s linear; - height: 40vmin; - pointer-events: none; +.release .release-icon{ + margin-right: 15px; } -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; +.release .release-icon img{ + width: 100%; + border-radius: 100%; } - -.App-link { - color: #61dafb; +.release .release-screenshot img{ + width: 100%; + border-radius: 15px; + padding: 5px; } -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } +.logo { + width: 120px; + height: 31px; + margin: 16px 0 16px 20px; + float: left; } -.ant-upload.ant-upload-drag { - height: 170px; +.logo img{ + height: 35px; } \ 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/ReleaseView.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/ReleaseView.js index 8e0953c9c3..f54a00ce08 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,17 +1,18 @@ import React from "react"; import {Avatar, Row, Col, Typography} from "antd"; +import "../../../App.css"; const {Title, Text} = Typography; class ReleaseView extends React.Component { render() { const release = this.props.release; + console.log(release); return ( -
+
- - + + App Name @@ -21,8 +22,14 @@ class ReleaseView extends React.Component {
- - + + + + + + + +
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js index ea9d762d9b..1528c2d873 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js @@ -3,12 +3,11 @@ import {Layout, Menu, Icon} from 'antd'; const {Header, Content, Footer} = Layout; -import styles from './Dashboard.less'; import Logo from "../../../public/images/logo.svg"; import {Link, NavLink} from "react-router-dom"; import RouteWithSubRoutes from "../../components/RouteWithSubRoutes" -import { Switch, Redirect } from 'react-router' - +import {Switch, Redirect} from 'react-router' +import "../../App.css"; class Dashboard extends React.Component { constructor(props) { @@ -20,36 +19,42 @@ class Dashboard extends React.Component { render() { return ( - -
-
- -
- - Apps - Apps - Add New App - -
- - - - {this.state.routes.map((route) => ( - - ))} - - - - -
- ©2019 entgra.io -
-
+
+ +
+
+ +
+ + Apps + Apps + Add New + App + +
+
+ + + + + {this.state.routes.map((route) => ( + + ))} + + + + +
+ ©2019 entgra.io +
+
+
); } } From cdca1900cf3ac1a1a129e3ddc1ae883c26ded352 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Wed, 22 May 2019 14:09:18 +0530 Subject: [PATCH 3/6] Add headers with viewport meta tag --- .../react-app/src/index.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.html b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.html index 98499e9ecf..33ea810110 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.html +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.html @@ -1 +1,8 @@ -
\ No newline at end of file + + + + + Entgra App Publisher + +
+ \ No newline at end of file From c99d5723171c1b5c3ccfdac2153c5abb4a69c266 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Wed, 22 May 2019 16:06:14 +0530 Subject: [PATCH 4/6] Make layout responsive --- .../react-app/src/App.css | 13 ++++++++++++- .../src/components/apps/release/ReleaseView.js | 10 +++++----- .../src/pages/dashboard/apps/release/Release.js | 11 +++++------ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css index 8b397c1780..85651a6dea 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css @@ -19,10 +19,21 @@ .logo { width: 120px; height: 31px; - margin: 16px 0 16px 20px; + margin: 0 0 16px 20px; float: left; } .logo img{ height: 35px; +} + +.main-container{ + background: #f0f2f5; + min-height: 780px +} + +@media only screen and (min-width: 768px) { + .main-container{ + padding: 24px; + } } \ 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/ReleaseView.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/ReleaseView.js index f54a00ce08..b39809417e 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 @@ -11,10 +11,10 @@ class ReleaseView extends React.Component { return (
- + - + App Name {release.version}
{release.description} @@ -22,13 +22,13 @@ class ReleaseView extends React.Component {

- + - + - + 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 ebf96e42f1..69e268939b 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 @@ -1,4 +1,5 @@ import React from "react"; +import '../../../../App.css'; import {PageHeader, Typography, Input, Button, Row, Col, Avatar, Card} from "antd"; import {connect} from "react-redux"; import ReleaseView from "../../../../components/apps/release/ReleaseView"; @@ -62,17 +63,15 @@ class ConnectedRelease extends React.Component { -
+
- + - - - - + + From 64747a8c2695e76f144b3c7744d805389ff89ce3 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Wed, 22 May 2019 17:44:55 +0530 Subject: [PATCH 5/6] Make layout responsive --- .../react-app/src/App.css | 5 +++++ .../components/apps/release/ReleaseView.js | 19 ++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css index 85651a6dea..adbde74ba5 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css @@ -10,6 +10,11 @@ width: 100%; border-radius: 100%; } + +.release .release-title{ + margin-left: 15px; +} + .release .release-screenshot img{ width: 100%; border-radius: 15px; 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 b39809417e..b334683818 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,5 +1,5 @@ import React from "react"; -import {Avatar, Row, Col, Typography} from "antd"; +import {Avatar, Row, Col, Typography, Button} from "antd"; import "../../../App.css"; const {Title, Text} = Typography; @@ -11,13 +11,22 @@ class ReleaseView extends React.Component { return (
- - + + icon - + App Name {release.version}
- {release.description} + {release.description}
+ + +
+ + + + +
+

From e59ed1d80783772ab7cea0c1256b7487465c13ba Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Wed, 22 May 2019 18:15:11 +0530 Subject: [PATCH 6/6] Load screenshots from array --- .../src/components/apps/release/ReleaseView.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) 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 b334683818..412589062b 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 @@ -31,15 +31,13 @@ class ReleaseView extends React.Component {
- - - - - - - - - + {release.screenshots.map((screenshotUrl)=>{ + return ( + + + + ) + })}
);