From 0df8c8d91cb07085559eafafa61864f1319d03ba Mon Sep 17 00:00:00 2001 From: Farheen99 Date: Tue, 10 Nov 2020 21:13:57 +0530 Subject: [PATCH] Disable publish button for releases with a published app --- .../components/AddNewReleaseForm/index.js | 5 +- .../ApssTable/AppDetailsDrawer/index.js | 16 ++++- .../Release/components/LifeCycle/index.js | 65 ++++++++++++++++--- .../Home/scenes/Apps/scenes/Release/index.js | 1 + 4 files changed, 75 insertions(+), 12 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewRelease/components/AddNewReleaseForm/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewRelease/components/AddNewReleaseForm/index.js index 0ae2d7ae59..6162c4fac0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewRelease/components/AddNewReleaseForm/index.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewRelease/components/AddNewReleaseForm/index.js @@ -127,7 +127,10 @@ class AddNewReleaseFormComponent extends React.Component { description: 'New release was added successfully', }); const uuid = res.data.data.uuid; - this.props.history.push('/publisher/apps/releases/' + uuid); + this.props.history.push({ + pathname: '/publisher/apps/releases/' + uuid, + state: { fullAppDetails: this.props.location.state.fullAppDetails }, + }); } else { this.setState({ loading: false, diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/AppDetailsDrawer/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/AppDetailsDrawer/index.js index 3698c5d840..1a80bc120a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/AppDetailsDrawer/index.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/AppDetailsDrawer/index.js @@ -702,7 +702,14 @@ class AppDetailsDrawer extends React.Component { title="Click to view full details" placement="topRight" > - + Add new release for the application + + ); })} diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/index.js index 7fb6cdb70e..91f05673b2 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/index.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/index.js @@ -232,6 +232,7 @@ class Release extends React.Component { this.changeCurrentLifecycleStatus } lifecycle={lifecycle} + appReleases={this.props.location.state} /> )}