|
|
@ -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,27 +33,25 @@ 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() {
|
|
|
|
|
|
|
|
if(this.props.releaseView.app != null){
|
|
|
|
|
|
|
|
const app = this.props.app;
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<Button type="primary" onClick={this.showModal}>
|
|
|
|
|
|
|
|
Open Modal
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<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}
|
|
|
@ -60,6 +62,9 @@ class ConnectedReleaseModal extends React.Component {
|
|
|
|
</Modal>
|
|
|
|
</Modal>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|