|
|
@@ -1,6 +1,6 @@
|
|
|
import React, {Component} from 'react';
|
|
|
-import { withRouter } from "react-router-dom";
|
|
|
-import {Modal,Row, Col, Input, Icon, Button, Spin} from 'antd';
|
|
|
+import {withRouter} from "react-router-dom";
|
|
|
+import {Modal, Row, Col, Input, Icon, Button, Spin} from 'antd';
|
|
|
|
|
|
import {Mutation, Query} from "react-apollo";
|
|
|
import gql from "graphql-tag";
|
|
|
@@ -9,6 +9,7 @@ import {SHOW_SCHEMA, ADD_SCHEMA} from '../../../../gql'
|
|
|
import './index.css';
|
|
|
import {getCookie} from "../../../../cookie";
|
|
|
import {idGen} from "../../../../func";
|
|
|
+import {FormattedMessage} from 'react-intl';
|
|
|
|
|
|
class Create extends Component {
|
|
|
constructor(props) {
|
|
|
@@ -66,9 +67,9 @@ class Create extends Component {
|
|
|
this.props.switchSidebar(schemaName);
|
|
|
this.props.history.push({
|
|
|
pathname: `/graphql-service/my-create/${schemaName}`,
|
|
|
- state:{
|
|
|
+ state: {
|
|
|
schemaName,
|
|
|
- schemaID:varobj.id,
|
|
|
+ schemaID: varobj.id,
|
|
|
create: true
|
|
|
}
|
|
|
});
|
|
|
@@ -91,31 +92,45 @@ class Create extends Component {
|
|
|
if (error)
|
|
|
return 'error';
|
|
|
return (
|
|
|
- <Modal title="Create Graphql Service"
|
|
|
- centered
|
|
|
- visible={visible}
|
|
|
- onOk={() => this.handleOk(userID, create_schema)}
|
|
|
- confirmLoading={confirmLoading}
|
|
|
- onCancel={() => {this.props.hideModal();}}
|
|
|
- >
|
|
|
- <div>
|
|
|
- <p>schema name</p>
|
|
|
- <Input
|
|
|
- className='add-input'
|
|
|
- placeholder="input schema_name"
|
|
|
- onChange={e => {
|
|
|
- e.persist();
|
|
|
- this.setState({
|
|
|
- schemaName: e.target.value,
|
|
|
- });
|
|
|
- if(userID === '' || undefined) {
|
|
|
- this.redirectToLogin();
|
|
|
- this.props.hideModal();
|
|
|
- }
|
|
|
- }}
|
|
|
- />
|
|
|
- </div>
|
|
|
- </Modal>
|
|
|
+ <FormattedMessage id="Create Graphql Service">
|
|
|
+ {(msg) => (
|
|
|
+ <Modal title={msg}
|
|
|
+ centered
|
|
|
+ visible={visible}
|
|
|
+ onOk={() => this.handleOk(userID, create_schema)}
|
|
|
+ confirmLoading={confirmLoading}
|
|
|
+ onCancel={() => {
|
|
|
+ this.props.hideModal();
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <p><FormattedMessage id="schema name"/></p>
|
|
|
+ <FormattedMessage id="input schema_name">
|
|
|
+ {(msg) => (
|
|
|
+ <Input
|
|
|
+ className='add-input'
|
|
|
+ placeholder={msg}
|
|
|
+ onChange={e => {
|
|
|
+ e.persist();
|
|
|
+ this.setState({
|
|
|
+ schemaName: e.target.value,
|
|
|
+ });
|
|
|
+ if (userID === '' || undefined) {
|
|
|
+ this.redirectToLogin();
|
|
|
+ this.props.hideModal();
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ </FormattedMessage>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </Modal>
|
|
|
+ )}
|
|
|
+ </FormattedMessage>
|
|
|
+
|
|
|
)
|
|
|
}}
|
|
|
</Mutation>
|