|
|
@ -1,5 +1,5 @@
|
|
|
|
import React from "react";
|
|
|
|
import React from "react";
|
|
|
|
import {Modal, Button} from 'antd';
|
|
|
|
import {Modal, Typography} from 'antd';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
|
|
|
|
|
|
|
|
// connecting state.releaseView with the component
|
|
|
|
// connecting state.releaseView with the component
|
|
|
@ -7,17 +7,21 @@ const mapStateToProps = state => {
|
|
|
|
return {releaseView: state.releaseView}
|
|
|
|
return {releaseView: state.releaseView}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Text = Typography;
|
|
|
|
|
|
|
|
|
|
|
|
class ConnectedReleaseModal extends React.Component {
|
|
|
|
class ConnectedReleaseModal extends React.Component {
|
|
|
|
constructor(props) {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
super(props);
|
|
|
|
this.state = {
|
|
|
|
this.state = {
|
|
|
|
visible: false
|
|
|
|
visible: false,
|
|
|
|
|
|
|
|
app: null
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
|
if (nextProps !== this.props) {
|
|
|
|
if (nextProps !== this.props) {
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
visible: nextProps.releaseView.visible
|
|
|
|
visible: nextProps.releaseView.visible,
|
|
|
|
|
|
|
|
app: nextProps.releaseView.app
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -29,37 +33,38 @@ class ConnectedReleaseModal extends React.Component {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
handleOk = (e) => {
|
|
|
|
handleOk = (e) => {
|
|
|
|
console.log(e);
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
visible: false,
|
|
|
|
visible: false,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
handleCancel = (e) => {
|
|
|
|
handleCancel = (e) => {
|
|
|
|
console.log(e);
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
visible: false,
|
|
|
|
visible: false,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
if(this.props.releaseView.app != null){
|
|
|
|
<div>
|
|
|
|
const app = this.props.app;
|
|
|
|
<Button type="primary" onClick={this.showModal}>
|
|
|
|
|
|
|
|
Open Modal
|
|
|
|
return (
|
|
|
|
</Button>
|
|
|
|
<div>
|
|
|
|
<Modal
|
|
|
|
<Modal
|
|
|
|
title={this.props.releaseView.title}
|
|
|
|
title={app.title}
|
|
|
|
visible={this.state.visible}
|
|
|
|
visible={this.state.visible}
|
|
|
|
onOk={this.handleOk}
|
|
|
|
onOk={this.handleOk}
|
|
|
|
onCancel={this.handleCancel}
|
|
|
|
onCancel={this.handleCancel}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<p>Some contents...</p>
|
|
|
|
<p>Some contents...</p>
|
|
|
|
<p>Some contents...</p>
|
|
|
|
<p>Some contents...</p>
|
|
|
|
<p>Some contents...</p>
|
|
|
|
<p>Some contents...</p>
|
|
|
|
</Modal>
|
|
|
|
</Modal>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|