in src/components/GlobalHeader/ImportModal.js [122:187]
render() {
let { handleCancel, form, config, file, namespaces } = this.props;
let { currentNamespaceId } = this.state;
const { getFieldDecorator } = form;
const formItemLayout = {
labelCol: {
sm: { span: 7 },
},
wrapperCol: {
sm: { span: 17 },
},
};
if (config) {
config = JSON.parse(config);
}
return (
<Modal
width={520}
centered
title={getIntlContent("SHENYU.COMMON.IMPORT")}
visible
okText={getIntlContent("SHENYU.COMMON.SURE")}
cancelText={getIntlContent("SHENYU.COMMON.CALCEL")}
onOk={this.handleSubmit}
onCancel={handleCancel}
>
<Form onSubmit={this.handleSubmit} className="login-form">
<FormItem
{...formItemLayout}
label={getIntlContent("SHENYU.SYSTEM.NAMESPACE")}
>
{getFieldDecorator("namespace", {
rules: [
{
required: true,
},
],
initialValue: currentNamespaceId,
valuePropName: "namespace",
})(
<NamespaceSelector
onChange={this.handleNamespacesValueChange}
currentNamespaceId={currentNamespaceId}
namespaces={namespaces}
/>,
)}
</FormItem>
<FormItem
{...formItemLayout}
label={getIntlContent("SHENYU.COMMON.IMPORT")}
>
{getFieldDecorator("file", {
rules: [
{
required: true,
},
],
initialValue: file,
valuePropName: "file",
})(<ChooseFile />)}
</FormItem>
</Form>
</Modal>
);
}