diff --git a/src/dashboard/src/pages/ChainCode/ChainCode.js b/src/dashboard/src/pages/ChainCode/ChainCode.js
index 176665a0..019f3cf6 100644
--- a/src/dashboard/src/pages/ChainCode/ChainCode.js
+++ b/src/dashboard/src/pages/ChainCode/ChainCode.js
@@ -9,8 +9,8 @@ import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import StandardTable from '@/components/StandardTable';
import { Form } from 'antd/lib/index';
import ApproveForm from '@/pages/ChainCode/forms/ApproveForm';
+import CommitForm from './forms/CommitForm';
import styles from './styles.less';
-import InstallForm from './forms/InstallForm';
const FormItem = Form.Item;
@@ -159,6 +159,7 @@ const UploadChainCode = props => {
loadingChainCodes: loading.effects['chainCode/listChainCode'],
uploading: loading.effects['chainCode/uploadChainCode'],
approving: loading.effects['chainCode/approveChainCode'],
+ committing: loading.effects['chainCode/commitChainCode'],
}))
class ChainCode extends PureComponent {
state = {
@@ -166,8 +167,8 @@ class ChainCode extends PureComponent {
formValues: {},
newFile: '',
modalVisible: false,
- installModalVisible: false,
approveModalVisible: false,
+ commitModalVisible: false,
};
componentDidMount() {
@@ -219,21 +220,15 @@ class ChainCode extends PureComponent {
});
};
- handleInstallModalVisible = visible => {
- this.setState({
- installModalVisible: !!visible,
- });
- };
-
handleApproveModalVisible = visible => {
this.setState({
approveModalVisible: !!visible,
});
};
- setOperatedRow = row => {
+ handleCommitModalVisible = visible => {
this.setState({
- operatedRow: row,
+ commitModalVisible: !!visible,
});
};
@@ -254,21 +249,6 @@ class ChainCode extends PureComponent {
});
};
- handleInstall = (values, callback) => {
- const { dispatch } = this.props;
- const { operatedRow } = this.state;
- const { node } = values;
- const formData = new FormData();
- formData.append('peer_uuid', node);
- formData.append('chaincode_package', operatedRow.package_id);
-
- dispatch({
- type: 'chainCode/installChainCode',
- payload: formData,
- callback,
- });
- };
-
onUploadChainCode = () => {
this.handleModalVisible(true);
};
@@ -283,16 +263,15 @@ class ChainCode extends PureComponent {
modalVisible,
newFile,
approveModalVisible,
- installModalVisible,
- operatedRow,
+ commitModalVisible,
} = this.state;
const {
chainCode: { chainCodes, paginations },
loadingChainCodes,
intl,
uploading,
- installing,
approving,
+ committing,
} = this.props;
const formProps = {
@@ -306,15 +285,6 @@ class ChainCode extends PureComponent {
intl,
};
- const installFormProps = {
- installModalVisible,
- handleInstallModalVisible: this.handleInstallModalVisible,
- fetchChainCodes: this.fetchChainCodes,
- installing,
- operatedRow,
- handleInstall: this.handleInstall,
- };
-
const approveFormProps = {
approveModalVisible,
handleApproveModalVisible: this.handleApproveModalVisible,
@@ -324,6 +294,15 @@ class ChainCode extends PureComponent {
intl,
};
+ const commitFormProps = {
+ commitModalVisible,
+ handleCommitModalVisible: this.handleCommitModalVisible,
+ fetchChainCodes: this.fetchChainCodes,
+ committing,
+ selectedRows: [],
+ intl,
+ };
+
const menu = record => (