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 99f7d8055c..dcf97a2204 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 @@ -35,6 +35,10 @@ class ReleaseView extends React.Component { } } + componentDidMount() { + console.log("mounted: Release view"); + } + render() { const {app, release} = this.props; const config = this.props.context; 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 e1fbfbfc70..18624ffbfa 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 @@ -17,7 +17,7 @@ */ import React from "react"; -import {Divider, Row, Col, Typography, Button, Rate, notification} from "antd"; +import {Divider, Row, Col, Typography, Button, Dropdown, notification, Menu, Icon} from "antd"; import "../../../App.css"; import ImgViewer from "../../apps/release/images/ImgViewer"; import StarRatings from "react-star-ratings"; @@ -42,7 +42,7 @@ class ReleaseView extends React.Component { } } - appOperation = (type, payload, operation, timestamp=null) => { + appOperation = (type, payload, operation, timestamp = null) => { const config = this.props.context; const release = this.props.app.applicationReleases[0]; const {uuid} = release; @@ -50,9 +50,9 @@ class ReleaseView extends React.Component { this.setState({ loading: true, }); - let url = window.location.origin+ config.serverConfig.invoker.uri + + let url = window.location.origin + config.serverConfig.invoker.uri + config.serverConfig.invoker.store + "/subscription/" + uuid + "/" + type + "/" + operation; - if(timestamp!= null){ + if (timestamp != null) { url += `?timestamp=${timestamp}`; } axios.post( @@ -81,18 +81,11 @@ class ReleaseView extends React.Component { message: "There was a problem", duration: 0, description: - "Error occurred while "+operation+"ing app", + "Error occurred while " + operation + "ing app", }); } }).catch((error) => { - handleApiError(error,"Error occurred while "+operation+"ing the app."); - }); - }; - - - showAppInstallModal = () => { - this.setState({ - appInstallModalVisible: true + handleApiError(error, "Error occurred while " + operation + "ing the app."); }); }; @@ -103,37 +96,50 @@ class ReleaseView extends React.Component { }); }; - showAppUninstallModal = () => { - this.setState({ - appUninstallModalVisible: true - }); + handleSubscribeClick = (e) => { + if (e.key === "install") { + this.setState({ + appInstallModalVisible: true // display app install modal + }) + } else if (e.key === "uninstall") { + this.setState({ + appUninstallModalVisible: true // display app uninstall modal + }) + } }; render() { - const {app,deviceType} = this.props; + const {app, deviceType} = this.props; const release = app.applicationReleases[0]; let metaData = []; - try{ + try { metaData = JSON.parse(release.metaData); - }catch (e) { + } catch (e) { } + const menu = ( +
+ ); + return (