diff --git a/README.md b/README.md index 7798769e2..0fac8ffaf 100644 --- a/README.md +++ b/README.md @@ -542,6 +542,40 @@ http://localhost:3000/api/projects/3263.json | jq ``` --- +#### 删除项目 +``` +DELETE api/projects/:id +``` +*示例* +``` +curl -X DELETE http://localhost:3000/api/projects/3263.json | jq +``` + +注:只有超级管理员和项目拥有者才能删除仓库 + +*请求参数说明:* + +|参数名|必选|类型|说明| +-|-|-|- +|id |是|int |项目id | + +*返回参数说明:* + +|参数名|类型|说明| +-|-|- +|status |int|返回状态, 0: 表示操作成功 | +|message |string|返回信息说明| + + +返回值 +``` +{ + "status": 0, + "message": "success" +} +``` +--- + #### 项目添加成员 ``` POST api/projects/:id/members @@ -1343,7 +1377,8 @@ http://localhost:3000/api/18816895620/mirror_demo | jq |default_branch |string|仓库默认分支| |full_name |string|仓库全名(带用户名)| |author |object|提交用户| -|-- login |string|用户名称| +|-- login |string|用户login| +|-- name |string|用户姓名| |-- image_url |string|用户头像| @@ -1373,7 +1408,8 @@ http://localhost:3000/api/18816895620/mirror_demo | jq "mirror": false, "private": false, "author": { - "name": "18816895620", + "login": "18816895620", + "name": "美女", "image_url": "avatars/User/b" } } diff --git a/public/react/src/forge/Order/CopyDetail.js b/public/react/src/forge/Order/CopyDetail.js index 89624d980..a819f0a94 100644 --- a/public/react/src/forge/Order/CopyDetail.js +++ b/public/react/src/forge/Order/CopyDetail.js @@ -4,10 +4,10 @@ import {Link} from 'react-router-dom'; import axios from 'axios'; import Nav from './Nav'; import UploadComponent from '../Upload/Index'; - +import { getImageUrl } from 'educoder'; import{ Modal,Col,Form,Input,Tooltip,Select } from 'antd' import NoneData from '../../modules/courses/coursesPublic/NoneData'; - +import Attachments from '../Upload/attachment' const TextArea = Input.TextArea; const Option = Select.Option; @@ -35,6 +35,8 @@ class CopyDetail extends Component{ priority_id:0, done_ratio:0, textcount:"", + fileList:undefined, + get_attachments: undefined } } @@ -65,7 +67,13 @@ class CopyDetail extends Component{ status_id:result.data.status_id, priority_id:result.data.priority_id, done_ratio:result.data.done_ratio, - textcount:result.data.description + textcount:result.data.description, + branch_name: result.data.branch_name, + get_attachments: result.data.attachments, + fileList:undefined, + issue_tag_ids: result.data.issue_tags && result.data.issue_tags[0].id, + fixed_version_id: result.data.fixed_version_id, + assigned_to_id: result.data.assigned_to_id }) this.getjournalslist(); @@ -133,6 +141,7 @@ class CopyDetail extends Component{ } handleSubmit=()=>{ + const { fileList } = this.state; this.props.form.validateFieldsAndScroll((err, values) => { if(!err){ const { projectsId,orderId} = this.props.match.params; @@ -145,10 +154,11 @@ class CopyDetail extends Component{ } axios.put(url,{ - project_id:projectsId, - subject:subject, - id: orderId, - description:this.state.textcount, + project_id:projectsId, + subject:subject, + id: orderId, + description:this.state.textcount, + attachment_ids:fileList, ...values }).then(result=>{ if(result){ @@ -166,176 +176,192 @@ class CopyDetail extends Component{ render(){ const { projectsId,orderId } = this.props.match.params; const { getFieldDecorator } = this.props.form; + const { current_user } = this.props; const { issue_tag_ids , fixed_version_id , branch_name , status_id , tracker_id , issue_type ,assigned_to_id , priority_id , done_ratio, - issue_chosen , branches } = this.state; + issue_chosen , branches, subject, textcount,get_attachments } = this.state; return(
-
-
-
-
-
-
-
    -
  • -
    -
    标题
    - -
    -
  • -
  • -
    - -
    -