|
|
@ -1,16 +1,23 @@
|
|
|
|
import React from "react";
|
|
|
|
import React from "react";
|
|
|
|
import {Modal, Typography,List, Avatar} from 'antd';
|
|
|
|
import {Modal, Typography,Icon,Input} from 'antd';
|
|
|
|
import {connect} from 'react-redux';
|
|
|
|
import {connect} from 'react-redux';
|
|
|
|
|
|
|
|
import {closeLifecycleModal} from "../../../js/actions";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { TextArea } = Input;
|
|
|
|
|
|
|
|
const { Title } = Typography;
|
|
|
|
|
|
|
|
|
|
|
|
// connecting state.releaseView with the component
|
|
|
|
// connecting state.releaseView with the component
|
|
|
|
const mapStateToProps = state => {
|
|
|
|
const mapStateToProps = state => {
|
|
|
|
console.log(state);
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
nextState: state.lifecycleModal.nextState,
|
|
|
|
nextState: state.lifecycleModal.nextState,
|
|
|
|
visible: state.lifecycleModal.visible
|
|
|
|
visible: state.lifecycleModal.visible
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const mapDispatchToProps = dispatch => ({
|
|
|
|
|
|
|
|
closeLifecycleModal : () => dispatch(closeLifecycleModal())
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const Text = Typography;
|
|
|
|
const Text = Typography;
|
|
|
|
|
|
|
|
|
|
|
|
class ConnectedLifecycleModal extends React.Component {
|
|
|
|
class ConnectedLifecycleModal extends React.Component {
|
|
|
@ -23,7 +30,6 @@ class ConnectedLifecycleModal extends React.Component {
|
|
|
|
|
|
|
|
|
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
|
if (nextProps !== this.props) {
|
|
|
|
if (nextProps !== this.props) {
|
|
|
|
console.log(nextProps);
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
visible: nextProps.visible
|
|
|
|
visible: nextProps.visible
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -46,6 +52,7 @@ class ConnectedLifecycleModal extends React.Component {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
visible: false,
|
|
|
|
visible: false,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
this.props.closeLifecycleModal();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
@ -59,7 +66,9 @@ class ConnectedLifecycleModal extends React.Component {
|
|
|
|
onOk={this.handleOk}
|
|
|
|
onOk={this.handleOk}
|
|
|
|
onCancel={this.handleCancel}
|
|
|
|
onCancel={this.handleCancel}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<p>Some contents...</p>
|
|
|
|
<Title level={4}>{this.props.currentStatus} <Icon type="arrow-right" /> {nextState}</Title>
|
|
|
|
|
|
|
|
<p>Reason:</p>
|
|
|
|
|
|
|
|
<TextArea placeholder="Please enter the reason..." autosize />
|
|
|
|
</Modal>
|
|
|
|
</Modal>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -69,6 +78,6 @@ class ConnectedLifecycleModal extends React.Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const LifecycleModal = connect(mapStateToProps, null)(ConnectedLifecycleModal);
|
|
|
|
const LifecycleModal = connect(mapStateToProps, mapDispatchToProps)(ConnectedLifecycleModal);
|
|
|
|
|
|
|
|
|
|
|
|
export default LifecycleModal;
|
|
|
|
export default LifecycleModal;
|