|
|
@@ -35,7 +35,7 @@ class APIPathCardRender extends Component {
|
|
|
if(props.path !== '' && props.path !== null) {
|
|
|
let {apiGWName, apiGWDesc, requestMethod} = props.path;
|
|
|
this.state = {
|
|
|
- configs: ['apiGWName', 'apiGWDesc'],
|
|
|
+ configs: ['apiGWDesc'],
|
|
|
showOK: false,
|
|
|
apiGWName,
|
|
|
apiGWDesc,
|
|
|
@@ -43,7 +43,7 @@ class APIPathCardRender extends Component {
|
|
|
}
|
|
|
} else {
|
|
|
this.state = {
|
|
|
- configs: ['apiGWName', 'apiGWDesc'],
|
|
|
+ configs: ['apiGWDesc'],
|
|
|
showOK: false,
|
|
|
apiGWName: props.defalutName,
|
|
|
apiGWDesc: '',
|
|
|
@@ -95,7 +95,7 @@ class APIPathCardRender extends Component {
|
|
|
createdAt: new Date().getTime(),
|
|
|
updatedAt: ''
|
|
|
};
|
|
|
- if (path === '') {
|
|
|
+ if (path === '' || path === null) {
|
|
|
if (deployID !== '' && groupID !== '' && deployID !== null && groupID !== null) {
|
|
|
request(graphqlUrl, ADD_APIGWPATH, varObj).then(
|
|
|
data => {
|
|
|
@@ -167,30 +167,24 @@ class APIPathCardRender extends Component {
|
|
|
|
|
|
return (
|
|
|
<div>
|
|
|
- <Collapse bordered={false}>
|
|
|
- <Panel header={<FormattedMessage id="Want more options?"/>} style={customPanelStyle}>
|
|
|
- {
|
|
|
- this.state.configs.map(config => (
|
|
|
- <div key={config} style={{marginBottom: 10}}>
|
|
|
+ <div key={'apiGWName'} style={{marginBottom: 10}}>
|
|
|
<span className='vice-title'>
|
|
|
{
|
|
|
- youMustFill[config]?
|
|
|
+ youMustFill['apiGWName']?
|
|
|
<span style={{color: 'red', display: 'inline', marginRight: 10}}>*</span>
|
|
|
:
|
|
|
''
|
|
|
}
|
|
|
- <FormattedMessage id={valueToKey[config]}/>
|
|
|
+ <FormattedMessage id={valueToKey['apiGWName']}/>
|
|
|
|
|
|
- <Tooltip placement="top" title={toolTipTitle[config]}>
|
|
|
+ <Tooltip placement="top" title={toolTipTitle['apiGWName']}>
|
|
|
<Icon type="question-circle"/>
|
|
|
</Tooltip>
|
|
|
</span>
|
|
|
- <Input value={this.state[config]} style={{width: 200}}
|
|
|
- onChange={this.switchConfig(config)}/>
|
|
|
- </div>
|
|
|
- ))
|
|
|
- }
|
|
|
- <div style={{marginBottom: 10}}>
|
|
|
+ <Input value={this.state.apiGWName} style={{width: 200}}
|
|
|
+ onChange={this.switchConfig('apiGWName')}/>
|
|
|
+ </div>
|
|
|
+ <div style={{marginBottom: 10}}>
|
|
|
<span className='vice-title'>
|
|
|
{
|
|
|
youMustFill['requestMethod']?
|
|
|
@@ -204,18 +198,45 @@ class APIPathCardRender extends Component {
|
|
|
<Icon type="question-circle"/>
|
|
|
</Tooltip>
|
|
|
</span>
|
|
|
- <Radio.Group onChange={this.switchConfig('requestMethod')}
|
|
|
- defaultValue={this.state.requestMethod}
|
|
|
- buttonStyle="solid">
|
|
|
- <Radio.Button value="GET">get</Radio.Button>
|
|
|
- <Radio.Button value="POST">post</Radio.Button>
|
|
|
- </Radio.Group>
|
|
|
- </div>
|
|
|
+ <Radio.Group onChange={this.switchConfig('requestMethod')}
|
|
|
+ defaultValue={this.state.requestMethod}
|
|
|
+ buttonStyle="solid">
|
|
|
+ <Radio.Button value="GET">get</Radio.Button>
|
|
|
+ <Radio.Button value="POST">post</Radio.Button>
|
|
|
+ </Radio.Group>
|
|
|
+ </div>
|
|
|
+ <Collapse bordered={false}>
|
|
|
+ <Panel header={<FormattedMessage id="Want more options?"/>} style={customPanelStyle}>
|
|
|
+ {
|
|
|
+ this.state.configs.map(config => (
|
|
|
+ <div key={config} style={{marginBottom: 10}}>
|
|
|
+ <span className='vice-title'>
|
|
|
+ {
|
|
|
+ youMustFill[config]?
|
|
|
+ <span style={{color: 'red', display: 'inline', marginRight: 10}}>*</span>
|
|
|
+ :
|
|
|
+ ''
|
|
|
+ }
|
|
|
+ <FormattedMessage id={valueToKey[config]}/>
|
|
|
+
|
|
|
+ <Tooltip placement="top" title={toolTipTitle[config]}>
|
|
|
+ <Icon type="question-circle"/>
|
|
|
+ </Tooltip>
|
|
|
+ </span>
|
|
|
+ <Input value={this.state[config]} style={{width: 200}}
|
|
|
+ onChange={this.switchConfig(config)}/>
|
|
|
+ </div>
|
|
|
+ ))
|
|
|
+ }
|
|
|
+
|
|
|
</Panel>
|
|
|
</Collapse>
|
|
|
{
|
|
|
manageUsers.includes(this.props.userID) ?
|
|
|
<div>
|
|
|
+ <Button onClick={()=>{
|
|
|
+ this.props.stepByStep(1)
|
|
|
+ }}><FormattedMessage id="previous-step"/></Button>
|
|
|
<Button onClick={()=>{
|
|
|
const id = idGen('path');
|
|
|
this.ok(id, this.props.userID, this.props.projectID, this.props.groupID, this.props.deployID, this.props.path);
|
|
|
@@ -232,6 +253,9 @@ class APIPathCardRender extends Component {
|
|
|
''
|
|
|
:
|
|
|
<div>
|
|
|
+ <Button onClick={()=>{
|
|
|
+ this.props.stepByStep(1)
|
|
|
+ }}><FormattedMessage id="previous-step"/></Button>
|
|
|
<Button onClick={()=>{
|
|
|
const id = idGen('path');
|
|
|
this.ok(id, this.props.userID, this.props.projectID, this.props.groupID, this.props.deployID, this.props.path);
|