Schema.jsx 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775
  1. import React, {Component} from 'react';
  2. import {Button, Col, Icon, Modal, Pagination, Row, Spin, Input} from 'antd';
  3. import './index.css';
  4. import {Mutation, Query} from "react-apollo";
  5. import gql from "graphql-tag";
  6. import {
  7. DELETE_PROJECT,
  8. SHOW_SCHEMA,
  9. SHOW_TABLE,
  10. UPDATE_SCHEMA,
  11. UPDATE_SCHEMA_PROJECT_NAME,
  12. SEARCH_SCHEMA,ADD_PROJECT_AND_SCHEMA,
  13. ADD_SCHEMA, SHOW_PROJECT
  14. } from '../../../../gql'
  15. import Table from "./Table";
  16. import {request} from 'graphql-request'
  17. import {getCookie} from "../../../../cookie";
  18. import {idGen} from "../../../../func";
  19. import {graphqlUrl} from "../../../../config";
  20. import {manageUsers} from "../../../../config";
  21. import {FormattedMessage} from 'react-intl';
  22. const confirm = Modal.confirm;
  23. const Search = Input.Search;
  24. class Schema extends Component {
  25. constructor(props) {
  26. super(props);
  27. this.state = {
  28. currentTable: props.location.state === undefined ? '' : props.location.state.create ? 'add' : '',
  29. // default schemaID and schemaName
  30. schemaID: props.location.state === undefined ? props.schemaID : props.location.state.schemaID,
  31. schemaName: props.location.state === undefined ? props.schemaName : props.location.state.schemaName,
  32. projectID: props.location.state === undefined ? props.projectID : props.location.state.projectID,
  33. editSchemaName: '',
  34. allData: '',
  35. data: '',
  36. page: '1',
  37. pageSize: '15',
  38. once: 0
  39. };
  40. }
  41. shouldComponentUpdate(nextProps, nextState) {
  42. return true;
  43. }
  44. switchTable = (table) => {
  45. this.setState({
  46. currentTable: table
  47. })
  48. };
  49. changeEditSchemaName = (e) => {
  50. this.setState({
  51. editSchemaName: e.target.value
  52. })
  53. };
  54. clearEditSchemaName = () => {
  55. this.setState({
  56. editSchemaName: ''
  57. })
  58. };
  59. findColumns = data => this.state.currentTable === '' ? [] : data.find(table => table.name === this.state.currentTable) ? data.find(table => table.name === this.state.currentTable).cols : [];
  60. findRemark = data => this.state.currentTable === '' ? '' : data.find(table => table.name === this.state.currentTable) ? data.find(table => table.name === this.state.currentTable).remark : '';
  61. goBack = () => {
  62. this.setState({
  63. currentTable: ''
  64. })
  65. };
  66. showTablePagination = (page, pageSize, data) => {
  67. // console.log(page);
  68. // console.log(pageSize);
  69. // console.log(data);
  70. // 这个之所以这么麻烦,是因为 'apollo 不能存数据' 而 '分页又得用数据展示',
  71. // 所以展示 table 的时候分了两个,
  72. // 首先进入展示 15个 , 这前 15 个没有任何问题。
  73. // 如果数据多于 15个,在按下第二页的时候 将数据通过 antd 的分页组件的回调函数传入 state,之后 table 的展示由 this.state.data 来接管
  74. // 但是这又引起一个问题,通过 this.state.data 的展示如果进行删除,是不会通过 apollo 的,这也意味着数据库被删除了,而页面还存在
  75. // 于是,在使用 this.state.data 的页面的 deleteTableButton 组件内调用该函数,重新刷新 this.state.data
  76. this.setState({
  77. page,
  78. pageSize,
  79. allData: data,
  80. data: data.slice((page - 1) * pageSize, page * pageSize)
  81. });
  82. };
  83. fetchData = (referenceID) => {
  84. let schemaData;
  85. if (localStorage.getItem('ecommerce') && localStorage.getItem('bills') && localStorage.getItem('subscribe')) {
  86. switch (referenceID) {
  87. case 'ecommerce_schemaID':
  88. schemaData = localStorage.getItem('ecommerce');
  89. break;
  90. case 'bills_schemaID':
  91. schemaData = localStorage.getItem('bills');
  92. break;
  93. case 'subscribe_schemaID':
  94. schemaData = localStorage.getItem('subscribe');
  95. break;
  96. default:
  97. schemaData = ''
  98. }
  99. return Promise.resolve(schemaData);
  100. } else {
  101. return new Promise((resolve, reject) => {
  102. request(graphqlUrl, SEARCH_SCHEMA, {id: referenceID}).then(
  103. data => {
  104. if (data.schema_by_id !== null) {
  105. localStorage.setItem('ecommerce', data.caseSchema.find(obj => obj.schemaName === 'ecommerce').schemaData);
  106. localStorage.setItem('subscribe', data.caseSchema.find(obj => obj.schemaName === 'subscribe').schemaData);
  107. localStorage.setItem('bills', data.caseSchema.find(obj => obj.schemaName === 'bills').schemaData);
  108. resolve(data.schema_by_id.schemaData);
  109. }
  110. }
  111. )
  112. });
  113. }
  114. };
  115. receiveDataFromTable = (data) => {
  116. this.setState({
  117. data
  118. })
  119. };
  120. componentWillReceiveProps(next) {
  121. this.setState({
  122. currentTable: next.location.state === undefined ? '' : next.location.state.create ? 'add' : '',
  123. schemaID: next.schemaID,
  124. schemaName: next.schemaName,
  125. data: '',
  126. once: 0
  127. });
  128. }
  129. render() {
  130. let userID = this.props.userID;
  131. let trialcase = this.props.trialcase;
  132. return (
  133. <Query query={gql(SHOW_TABLE)} variables={{schema_id: this.state.schemaID}}>
  134. {
  135. ({loading, error, data}) => {
  136. if (loading) {
  137. return <Spin style={{marginLeft: 3}}/>
  138. }
  139. if (error) {
  140. return 'error!';
  141. }
  142. let copy;
  143. if (this.props.location.state)
  144. copy = this.props.location.state.copy;
  145. // 找到 copy 一定几率不显示的 问题原因,异步导致的未存先取
  146. if (data.schema_by_id === null && copy !== true) data = [];
  147. else {
  148. let reference = data.schema_by_id ? data.schema_by_id.reference : this.props.location.state.reference;
  149. data = data.schema_by_id ? JSON.parse(data.schema_by_id.schemaData) : [];
  150. if (data.length === 0 && reference !== '' && this.state.once === 0) {
  151. this.fetchData(reference).then((data) => {
  152. // 会执行好多好多次
  153. this.setState({
  154. data: JSON.parse(data),
  155. once: 1
  156. })
  157. });
  158. }
  159. }
  160. return (
  161. <div>
  162. {
  163. this.state.currentTable === '' ?
  164. <div>
  165. {
  166. this.state.editSchemaName ?
  167. <ModifySchemaNameInput
  168. editSchemaName={this.state.editSchemaName}
  169. changeEditSchemaName={this.changeEditSchemaName}
  170. clearEditSchemaName={this.clearEditSchemaName}
  171. schemaID={this.state.schemaID}
  172. userID={userID}
  173. schemaName={this.state.schemaName}
  174. history={this.props.history}
  175. />
  176. :
  177. <div className={'schema'}>
  178. <span className={'schema-name'}>{this.state.schemaName}</span>
  179. {
  180. userID.indexOf(manageUsers) > -1 ?
  181. <Icon style={{marginLeft: 15}}
  182. type="edit"
  183. theme="twoTone"
  184. onClick={
  185. () => {
  186. this.setState({editSchemaName: this.state.schemaName})
  187. }
  188. }
  189. />
  190. :
  191. trialcase ?
  192. ''
  193. :
  194. <Icon style={{marginLeft: 15}}
  195. type="edit"
  196. theme="twoTone"
  197. onClick={
  198. () => {
  199. this.setState({editSchemaName: this.state.schemaName})
  200. }
  201. }
  202. />
  203. }
  204. </div>
  205. }
  206. <div className={'schema-table-list-title'}>
  207. <Row>
  208. <Col span={10}><span
  209. className={'schema-table-title'}><FormattedMessage
  210. id="Name"/></span></Col>
  211. <Col span={10}><span
  212. className={'schema-table-title'}><FormattedMessage id="Remark"/></span></Col>
  213. <Col span={2} offset={2}>
  214. {
  215. userID.indexOf(manageUsers) > -1 ?
  216. <span
  217. className={'schema-table-title'}
  218. onClick={() => {
  219. this.setState({
  220. currentTable: 'add'
  221. })
  222. }}>
  223. <Icon type="plus"/>
  224. </span>
  225. :
  226. trialcase ?
  227. ''
  228. :
  229. <span
  230. className={'schema-table-title'}
  231. onClick={() => {
  232. this.setState({
  233. currentTable: 'add'
  234. })
  235. }}>
  236. <Icon type="plus" style={{color: '#096dd9',cursor: 'pointer'}}/>
  237. </span>
  238. }
  239. </Col>
  240. </Row>
  241. </div>
  242. <div>
  243. {
  244. this.state.data ?
  245. this.state.data.map(table => (
  246. <div key={table.name}
  247. className={'schema-table-list-content'}>
  248. <Row>
  249. <Col
  250. span={10}
  251. onClick={() => this.switchTable(table.name)}
  252. >
  253. <span
  254. className={'schema-table-content name'}>{table.name}</span>
  255. </Col>
  256. <Col span={10}>
  257. <span
  258. className={'schema-table-content'}>{table.remark}</span>
  259. </Col>
  260. <Col span={2} offset={2}>
  261. <span className={'schema-table-content'}>
  262. {
  263. userID.indexOf(manageUsers) > -1 ?
  264. <DeleteTableButton
  265. currentTable={table.name}
  266. schemaData={data}
  267. schemaID={this.state.schemaID}
  268. userID={userID}
  269. showTablePagination={this.showTablePagination}
  270. page={this.state.page}
  271. pageSize={this.state.pageSize}
  272. fetchData={this.fetchData}
  273. location={this.props.location}
  274. />
  275. :
  276. trialcase ?
  277. ''
  278. :
  279. <DeleteTableButton
  280. currentTable={table.name}
  281. schemaData={data}
  282. schemaID={this.state.schemaID}
  283. userID={userID}
  284. showTablePagination={this.showTablePagination}
  285. page={this.state.page}
  286. pageSize={this.state.pageSize}
  287. fetchData={this.fetchData}
  288. location={this.props.location}
  289. />
  290. }
  291. </span>
  292. </Col>
  293. </Row>
  294. </div>
  295. ))
  296. :
  297. data.slice(0, 15).map(table => (
  298. <div key={table.name}
  299. className={'schema-table-list-content'}>
  300. <Row>
  301. <Col
  302. span={10}
  303. onClick={() => this.switchTable(table.name)}
  304. >
  305. <span
  306. className={'schema-table-content name'}>{table.name}</span>
  307. </Col>
  308. <Col span={10}>
  309. <span
  310. className={'schema-table-content'}>{table.remark}</span>
  311. </Col>
  312. <Col span={2} offset={2}>
  313. <span className={'schema-table-content'}>
  314. {
  315. userID.indexOf(manageUsers) > -1 ?
  316. <DeleteTableButton
  317. currentTable={table.name}
  318. schemaData={data}
  319. schemaID={this.state.schemaID}
  320. showTablePagination={this.showTablePagination}
  321. page={this.state.page}
  322. pageSize={this.state.pageSize}
  323. userID={userID}
  324. fetchData={this.fetchData}
  325. location={this.props.location}
  326. />
  327. :
  328. trialcase ?
  329. ''
  330. :
  331. <DeleteTableButton
  332. currentTable={table.name}
  333. schemaData={data}
  334. schemaID={this.state.schemaID}
  335. showTablePagination={this.showTablePagination}
  336. page={this.state.page}
  337. pageSize={this.state.pageSize}
  338. userID={userID}
  339. fetchData={this.fetchData}
  340. location={this.props.location}
  341. />
  342. }
  343. </span>
  344. </Col>
  345. </Row>
  346. </div>
  347. ))
  348. }
  349. </div>
  350. <div className={'schema-bottom'}>
  351. <Row>
  352. <Col span={4}>
  353. {
  354. userID.indexOf(manageUsers) > -1 ?
  355. trialcase ?
  356. <div>
  357. <div style={{display: 'inline-block'}}
  358. className={'delete-schema'}>
  359. <CopySchemaButton
  360. userID={userID}
  361. history={this.props.history}
  362. schemaID={this.state.schemaID}
  363. schemaName={this.state.schemaName}
  364. />
  365. </div>
  366. <div style={{display: 'inline-block'}}
  367. className={'delete-schema'}>
  368. <DeleteProjectButton
  369. userID={userID}
  370. projectID={this.state.projectID}
  371. history={this.props.history}
  372. />
  373. </div>
  374. </div>
  375. :
  376. <div className={'delete-schema'}>
  377. <DeleteProjectButton
  378. userID={userID}
  379. projectID={this.state.projectID}
  380. history={this.props.history}
  381. />
  382. </div>
  383. :
  384. trialcase ?
  385. <div className={'delete-schema'}>
  386. <CopySchemaButton
  387. userID={userID}
  388. history={this.props.history}
  389. schemaID={this.state.schemaID}
  390. schemaName={this.state.schemaName}
  391. />
  392. </div>
  393. :
  394. <div className={'delete-schema'}>
  395. <DeleteProjectButton
  396. userID={userID}
  397. projectID={this.state.projectID}
  398. history={this.props.history}
  399. />
  400. </div>
  401. }
  402. </Col>
  403. <Col span={4} offset={16}>
  404. <div className={'pagination'}>
  405. <Pagination
  406. simple
  407. defaultCurrent={1}
  408. hideOnSinglePage={true}
  409. defaultPageSize={15}
  410. total={data.length}
  411. onChange={(page, pageSize) => {
  412. this.showTablePagination(page, pageSize, data)
  413. }}
  414. />
  415. </div>
  416. </Col>
  417. </Row>
  418. </div>
  419. </div>
  420. :
  421. this.state.currentTable === 'add' ?
  422. <Table
  423. currentTable={''}
  424. schemaData={data}
  425. columns={[]}
  426. remark=''
  427. schemaID={this.state.schemaID}
  428. schemaName={this.state.schemaName}
  429. userID={userID}
  430. goBack={this.goBack}
  431. trialcase={trialcase}
  432. fetchData={this.fetchData}
  433. showTablePagination={this.showTablePagination}
  434. page={this.state.page}
  435. pageSize={this.state.pageSize}
  436. history={this.props.history}
  437. add={'add'}
  438. /> :
  439. <Table
  440. currentTable={this.state.currentTable}
  441. schemaData={data}
  442. columns={this.findColumns(data.length !== 0 ? data : this.state.data)}
  443. remark={this.findRemark(data.length !== 0 ? data : this.state.data)}
  444. schemaID={this.state.schemaID}
  445. schemaName={this.state.schemaName}
  446. userID={userID}
  447. goBack={this.goBack}
  448. trialcase={trialcase}
  449. fetchData={this.fetchData}
  450. showTablePagination={this.showTablePagination}
  451. page={this.state.page}
  452. pageSize={this.state.pageSize}
  453. history={this.props.history}
  454. add={'whatever but not add'}
  455. />
  456. }
  457. </div>
  458. );
  459. }
  460. }
  461. </Query>
  462. )
  463. }
  464. }
  465. export default Schema;
  466. class CopySchemaButton extends Component {
  467. constructor(props) {
  468. super(props);
  469. this.state = {
  470. schemaName: '',
  471. schemaID: '',
  472. };
  473. }
  474. handleOk = (userID, create_project_and_schema) => {
  475. let {history,schemaName,schemaID} = this.props;
  476. let projectName = schemaName + '_' + Math.random().toString().slice(-3) + Math.random().toString().slice(-4);
  477. let schemaId = idGen('schema');
  478. let projectId= idGen('project');
  479. let createdAt = new Date().getTime();
  480. let schemaVarObj = {
  481. schemaId,
  482. schemaName:projectName,
  483. user_id: userID,
  484. schemaCreatedAt: createdAt,
  485. schemaUpdatedAt: '',
  486. // copy的时候直接给 ok,不用检测
  487. schemaState: 'ok',
  488. schemaData: JSON.stringify([]),
  489. reference: schemaID
  490. };
  491. let projectVarObj = {
  492. projectCreatedAt: createdAt,
  493. projectUpdatedAt: '',
  494. database_id: '',
  495. apiGWGroup_id: '',
  496. projectName,
  497. deploy_id: '',
  498. projectId,
  499. projectType: 'graphql',
  500. cloud_id: '',
  501. user_id: userID,
  502. wxConfig_id: '',
  503. schema_id: schemaId
  504. };
  505. create_project_and_schema({
  506. variables: {...schemaVarObj,...projectVarObj},
  507. refetchQueries:[{query: gql(SHOW_PROJECT), variables: {projectType:'graphql',user_id: userID}}]
  508. });
  509. history.push({
  510. pathname: `/graphql-service/my-create/${schemaName}`,
  511. state: {
  512. schemaName,
  513. schemaID:schemaId,
  514. projectID: projectId,
  515. copy: true,
  516. reference: schemaID
  517. }
  518. });
  519. };
  520. render() {
  521. let {userID} = this.props;
  522. // let schemaID = schemaName + '_schemaID';
  523. return (
  524. <div>
  525. <Mutation
  526. mutation={gql(ADD_PROJECT_AND_SCHEMA)}
  527. // refetchQueries={[{query: gql(SHOW_SCHEMA), variables: {user_id: userID}}]}
  528. >
  529. {(create_project_and_schema, {loading, error}) => {
  530. if (loading)
  531. return <Spin style={{marginLeft: 30, marginTop: 10}}/>;
  532. if (error)
  533. return 'error';
  534. return (
  535. <Button
  536. type="primary"
  537. onClick={() => {
  538. this.handleOk(userID, create_project_and_schema);
  539. }}
  540. ><FormattedMessage id="copy"/></Button>
  541. )
  542. }}
  543. </Mutation>
  544. </div>
  545. )
  546. }
  547. }
  548. class DeleteProjectButton extends Component {
  549. constructor(props) {
  550. super(props);
  551. this.state = {
  552. projectID:props.projectID
  553. }
  554. }
  555. showConfirm = (delete_graphql_project, projectID, userID) => {
  556. let _this = this;
  557. confirm({
  558. title: 'Do you want to delete this schema?',
  559. content: 'It cannot be found back!',
  560. onOk() {
  561. delete_graphql_project({variables: {id:projectID, user_id: userID}});
  562. _this.props.history.push({
  563. pathname: '/graphql-service',
  564. });
  565. },
  566. onCancel() {
  567. },
  568. });
  569. };
  570. render() {
  571. let userID = this.props.userID;
  572. let {projectID} = this.state;
  573. return (
  574. <Mutation
  575. mutation={gql(DELETE_PROJECT)}
  576. refetchQueries={[{query: gql(SHOW_PROJECT), variables: {projectType:'graphql',user_id: userID}}]}
  577. >
  578. {(delete_graphql_project, {loading, error}) => {
  579. if (error)
  580. return 'error';
  581. if (loading)
  582. return <Spin style={{marginLeft: 3}}/>;
  583. return (
  584. <Button
  585. type="danger"
  586. onClick={() => {
  587. this.showConfirm(delete_graphql_project, projectID, userID);
  588. }}
  589. >
  590. <FormattedMessage id="delete"/>
  591. </Button>
  592. )
  593. }}
  594. </Mutation>
  595. )
  596. }
  597. }
  598. class DeleteTableButton extends Component {
  599. render() {
  600. let schemaID = this.props.schemaID;
  601. let userID = this.props.userID;
  602. let varobj = {
  603. id: schemaID,
  604. updatedAt: new Date().getTime(),
  605. schemaState: 'updated-delete-table',
  606. };
  607. return (
  608. <Query query={gql(SHOW_TABLE)} variables={{schema_id: schemaID}}>
  609. {
  610. ({loading, error, data}) => {
  611. if (loading)
  612. return <Spin style={{marginLeft: 30, marginTop: 10}}/>;
  613. if (error)
  614. return 'error';
  615. let schemaData = data;
  616. let referenceID = data.schema_by_id ? data.schema_by_id.reference : this.props.location.state.reference;
  617. return (
  618. <Mutation
  619. mutation={gql(UPDATE_SCHEMA)}
  620. refetchQueries={[{query: gql(SHOW_TABLE), variables: {schema_id: schemaID}}]}
  621. >
  622. {(update_schema, {loading, error}) => {
  623. if (loading)
  624. return <Spin style={{marginLeft: 30, marginTop: 10}}/>;
  625. if (error)
  626. return 'error';
  627. // 先 query 再 mutation,然后删除
  628. let schemaCols;
  629. if (schemaData.schema_by_id === null) schemaCols = [];
  630. else schemaCols = JSON.parse(schemaData.schema_by_id.schemaData);
  631. const index = this.props.schemaData.findIndex(obj => obj.name === this.props.currentTable);
  632. if (index === -1) {
  633. // 先取数据,然后删除,然后填充
  634. this.props.fetchData(referenceID).then(value => {
  635. schemaCols = JSON.parse(value);
  636. const index = schemaCols.findIndex(obj => obj.name === this.props.currentTable);
  637. schemaCols.splice(index, 1);
  638. });
  639. } else {
  640. schemaCols.splice(index, 1);
  641. }
  642. return (
  643. <Icon type="delete"
  644. theme="twoTone"
  645. onClick={() => {
  646. update_schema({
  647. variables: {
  648. ...varobj,
  649. schemaData: JSON.stringify(schemaCols)
  650. }
  651. });
  652. this.props.showTablePagination(this.props.page, this.props.pageSize, schemaCols)
  653. }}>
  654. </Icon>
  655. )
  656. }}
  657. </Mutation>
  658. )
  659. }
  660. }
  661. </Query>
  662. )
  663. }
  664. }
  665. class ModifySchemaNameInput extends Component {
  666. constructor(props) {
  667. super(props);
  668. this.state = {}
  669. }
  670. render() {
  671. let userID = this.props.userID;
  672. let schemaName = this.props.schemaName;
  673. console.log('schemaId',this.props.schemaID);
  674. return (
  675. <Mutation mutation={gql(UPDATE_SCHEMA_PROJECT_NAME)}>
  676. {(update_schema_project_name, {loading, error}) => {
  677. if (error)
  678. return 'error';
  679. if (loading)
  680. return <Spin style={{marginLeft: 3}}/>;
  681. return (
  682. <div className={'schema'}>
  683. <FormattedMessage id="Confirm">
  684. {(msg) => (
  685. <Search
  686. value={this.props.editSchemaName}
  687. enterButton={msg}
  688. style={{width: 500}}
  689. size="large"
  690. onChange={this.props.changeEditSchemaName}
  691. onSearch={value => {
  692. update_schema_project_name({
  693. variables: {
  694. id: this.props.schemaID,
  695. schemaName: value,
  696. updateAt: new Date().getTime()
  697. }
  698. }).then((res)=>{
  699. console.log('update_schema_project_name res',res)
  700. });
  701. this.props.history.push({
  702. pathname: `/graphql-service/my-create/${value}`,
  703. state: {
  704. schemaName: value,
  705. schemaID: this.props.schemaID,
  706. }
  707. });
  708. this.props.clearEditSchemaName();
  709. }}
  710. />)}
  711. </FormattedMessage>
  712. </div>
  713. )
  714. }}
  715. </Mutation>
  716. )
  717. }
  718. }