Fix minor issue in publisher ui lifecycle

feature/appm-store/pbac
Jayasanka 6 years ago
parent fdd9d77a47
commit 756324d883

@ -78,12 +78,11 @@ class ConnectedLifecycleModal extends React.Component {
footer={null} footer={null}
> >
<Title level={4}>{this.props.currentStatus} <Icon type="arrow-right" /> {nextState}</Title> <Title level={4}>{this.props.currentStatus} <Icon type="arrow-right" /> {nextState}</Title>
<p>Reason:</p>
<form onSubmit={this.handleSubmit}> <form onSubmit={this.handleSubmit}>
<Form.Item> <Form.Item>
<label htmlFor="username">username</label> <label htmlFor="username">Reason</label>
<Input placeholder="Basic usage" ref={(input) => this.reason = input}/> <Input placeholder="Enter the reason" ref={(input) => this.reason = input}/>
</Form.Item> </Form.Item>
{/*<Form.Item>*/} {/*<Form.Item>*/}
{/*<TextArea*/} {/*<TextArea*/}

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

Loading…
Cancel
Save