Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev

This commit is contained in:
zwjamnsss 2017-10-12 10:37:42 +08:00
commit daf431613e
7 changed files with 30 additions and 31 deletions

View File

@ -59,23 +59,12 @@ Footer.defaultProps = {
},
{
title: '相关站点',
iconType: 'link',
title: '团队',
iconType: 'team',
linkList: [
{
itemTitle: 'YApi',
itemLink: 'https://github.com/YMFE/yapi'
},
{
itemTitle: 'YMFE',
itemLink: 'http://ued.qunar.com/ymfe/about'
},
{
itemTitle: 'UED',
itemLink: 'http://ued.qunar.com/'
},{
itemTitle: '去哪儿网',
itemLink: 'http://www.qunar.com/'
}
]
@ -87,15 +76,21 @@ Footer.defaultProps = {
{
itemTitle: 'qq群644642474',
itemLink: 'javascript:'
},{
itemTitle: 'Github Issues',
itemLink: 'https://github.com/YMFE/yapi/issues'
},{
itemTitle: 'Github Pull Requests',
itemLink: 'https://github.com/YMFE/yapi/pulls'
}
]
},
{
title: 'Copyright © 2017 YApi',
title: 'Copyright © 2017 YMFE',
linkList: [
{
itemTitle: '版本: '+packageJson.version,
itemLink: 'javascript:'
itemTitle: '版本: ' + packageJson.version,
itemLink: 'https://yapi.ymfe.org//'
}
]
}

View File

@ -240,7 +240,7 @@ class MemberList extends Component {
userinfo = [...ownerinfo,...devinfo,...guestinfo];
return (
<div className="m-panel">
<Modal
{this.state.visible?<Modal
title="添加成员"
visible={this.state.visible}
onOk={this.handleOk}
@ -262,7 +262,7 @@ class MemberList extends Component {
</Select>
</Col>
</Row>
</Modal>
</Modal>:""}
<Table columns={columns} dataSource={userinfo} pagination={false} locale={{emptyText: <ErrMsg type="noMemberInGroup"/>}} />
</div>
);

View File

@ -226,7 +226,7 @@ class InterfaceEditForm extends Component {
data: that.state.res_body,
onChange: function (d) {
if (d.format === true) {
mockPreview.editor.setValue(d.mockText)
mockPreview.setValue(d.mockText)
}
that.setState({
res_body: d.text,
@ -269,6 +269,7 @@ class InterfaceEditForm extends Component {
}
handleJsonType = (key) => {
key = key || 'tpl';
this.setState({
jsonType: key

View File

@ -254,7 +254,7 @@ class InterfaceMenu extends Component {
const searchBox = <div className="interface-filter">
<Input onChange={this.onFilter} value={this.state.filter} placeholder="搜索接口" />
<Button type="primary" onClick={() => this.changeModal('add_cat_modal_visible', true)} className="btn-filter" >添加分类</Button>
<Modal
{this.state.visible?<Modal
title="添加接口"
visible={this.state.visible}
onCancel={() => this.changeModal('visible', false)}
@ -262,9 +262,9 @@ class InterfaceMenu extends Component {
className="addcatmodal"
>
<AddInterfaceForm catdata={this.props.curProject.cat} catid={this.state.curCatid} onCancel={() => this.changeModal('visible', false)} onSubmit={this.handleAddInterface} />
</Modal>
</Modal>:""}
<Modal
{this.state.add_cat_modal_visible?<Modal
title="添加分类"
visible={this.state.add_cat_modal_visible}
onCancel={() => this.changeModal('add_cat_modal_visible', false)}
@ -272,9 +272,9 @@ class InterfaceMenu extends Component {
className="addcatmodal"
>
<AddInterfaceCatForm onCancel={() => this.changeModal('add_cat_modal_visible', false)} onSubmit={this.handleAddInterfaceCat} />
</Modal>
</Modal>:""}
<Modal
{this.state.change_cat_modal_visible?<Modal
title="修改分类"
visible={this.state.change_cat_modal_visible}
onCancel={() => this.changeModal('change_cat_modal_visible', false)}
@ -282,7 +282,7 @@ class InterfaceMenu extends Component {
className="addcatmodal"
>
<AddInterfaceCatForm catdata={this.state.curCatdata} onCancel={() => this.changeModal('change_cat_modal_visible', false)} onSubmit={this.handleChangeInterfaceCat} />
</Modal>
</Modal>:""}
</div>
if(menuList.length === 0){
return searchBox;

View File

@ -210,7 +210,7 @@ class ProjectMember extends Component {
return (
<div className="g-row">
<div className="m-panel">
<Modal
{this.state.visible?<Modal
title="添加成员"
visible={this.state.visible}
onOk={this.handleOk}
@ -232,7 +232,7 @@ class ProjectMember extends Component {
</Select>
</Col>
</Row>
</Modal>
</Modal>:""}
<Table columns={columns} dataSource={this.state.projectMemberList} pagination={false} locale={{emptyText: <ErrMsg type="noMemberInProject"/>}} className="setting-project-member"/>
<Card bordered={false} title={this.state.groupName + ' 分组成员 ' + '(' + this.state.groupMemberList.length + ') 人'} noHovering className="setting-group">
{this.state.groupMemberList.length ? this.state.groupMemberList.map((item, index) => {

View File

@ -25,6 +25,7 @@ function mock(mockJSON, context) {
c[i] = p[i];
if (filters.length > 1) {
for (var f = 1, l = filters.length, index; f < l; f++) {
filters[f] = filters[f].toLowerCase();
if (filters[f] in filtersMap) {
if ((index = newFilters.indexOf(filters[f])) !== -1) {
newFilters.splice(index, 1);

View File

@ -360,8 +360,10 @@ class interfaceController extends baseController {
catid: 'number'
});
params.method = params.method || 'GET';
params.method = params.method.toUpperCase();
if (!_.isUndefined(params.method)) {
params.method = params.method || 'GET';
params.method = params.method.toUpperCase();
}
let id = ctx.request.body.id;
@ -482,7 +484,7 @@ class interfaceController extends baseController {
if (data.catid) {
this.catModel.get(+data.catid).then((cate) => {
yapi.commons.saveLog({
content: `用户 "${username}" 更新了分类 "${cate.name}" 下的接口 "${data.title}"`,
content: `用户 "${username}" 更新了分类 "${cate.name}" 下的接口 "${interfaceData.title}"`,
type: 'project',
uid: this.getUid(),
username: username,
@ -494,7 +496,7 @@ class interfaceController extends baseController {
let cateid = interfaceData.catid;
this.catModel.get(cateid).then((cate) => {
yapi.commons.saveLog({
content: `用户 "${username}" 更新了分类 "${cate.name}" 下的接口 "${data.title}"`,
content: `用户 "${username}" 更新了分类 "${cate.name}" 下的接口 "${interfaceData.title}"`,
type: 'project',
uid: this.getUid(),
username: username,