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