From 756324d883f90a94004993142ac291bcb5bed3fc Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Thu, 16 May 2019 14:16:36 +0530 Subject: [PATCH] Fix minor issue in publisher ui lifecycle --- .../src/components/apps/release/LifecycleModal.js | 5 ++--- .../react-app/src/js/actions/index.js | 13 ++++++++++--- 2 files changed, 12 insertions(+), 6 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 e19510bad6..26db61287c 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 @@ -78,12 +78,11 @@ class ConnectedLifecycleModal extends React.Component { footer={null} > {this.props.currentStatus} <Icon type="arrow-right" /> {nextState} -

Reason:

- + - this.reason = input}/> + this.reason = input}/> {/**/} {/* dispatch => { return axios.post('https://' + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri, request ).then(res => { if (res.status === 200) { - let release = res.data.data; - dispatch({type: ActionTypes.UPDATE_LIFECYCLE_STATE, payload: release}); + 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 + }); + } } }).catch(function (error) { if (error.response.status === 401) { window.location.href = 'https://localhost:9443/publisher/login'; } else if (error.response.status === 500) { + alert("error"); dispatch({ type: ActionTypes.CLOSE_LIFECYCLE_MODAL }); - alert("error"); } });