diff --git a/src/forge/Activity/ActivityItem.js b/src/forge/Activity/ActivityItem.js index f1818d08..40887fdd 100644 --- a/src/forge/Activity/ActivityItem.js +++ b/src/forge/Activity/ActivityItem.js @@ -21,13 +21,13 @@ class ActivityItem extends Component { // 如果是任务 item.trend_type === "Issue" ?

- {item.name} + {item.name} {item.trend_type}

: // 如果是合并请求

- {item.name} + {item.name} {item.trend_type}

} diff --git a/src/forge/Main/CoderRootBranch.js b/src/forge/Main/CoderRootBranch.js index e19b1be3..34224ac4 100644 --- a/src/forge/Main/CoderRootBranch.js +++ b/src/forge/Main/CoderRootBranch.js @@ -40,7 +40,7 @@ export default ((props)=>{

- 创建合并请求 + 创建合并请求 diff --git a/src/forge/Main/CoderRootIndex.js b/src/forge/Main/CoderRootIndex.js index e9a5f367..8598769e 100644 --- a/src/forge/Main/CoderRootIndex.js +++ b/src/forge/Main/CoderRootIndex.js @@ -97,7 +97,7 @@ class CoderRootIndex extends Component{ (props) => () } > - () } @@ -108,19 +108,19 @@ class CoderRootIndex extends Component{ () => () } > - () } > - () } > - () } diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index b2d1074f..039067b6 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -151,7 +151,7 @@ class Detail extends Component { } componentDidUpdate = (prevState) => { - if ((prevState.match.params.projectsId !== this.props.match.params.projectsId)) { + if (prevState && this.props && (prevState.match.params.projectsId !== this.props.match.params.projectsId)) { this.getProject(); } } @@ -338,7 +338,7 @@ class Detail extends Component { forked from {projectDetail.fork_info.fork_project_user_name} / - {projectDetail.fork_info.fork_form_name} + {projectDetail.fork_info.fork_form_name} : "" ); @@ -362,7 +362,7 @@ class Detail extends Component { { projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ? - @@ -393,7 +393,7 @@ class Detail extends Component { {watched ? '取消关注' : '关注'} - + {watchers_count} @@ -402,7 +402,7 @@ class Detail extends Component { {praised ? '取消点赞' : '点赞'} - + {praises_count} @@ -425,16 +425,16 @@ class Detail extends Component { 代码库 -
  • -1 && !(url.indexOf("Milepost") > 0 || url.indexOf("meilpost") > 0 || url.indexOf("tags") > 0)) ? "active" : ""}> - +
  • -1 && !(url.indexOf("Milepost") > 0 || url.indexOf("meilpost") > 0 || url.indexOf("tags") > 0)) ? "active" : ""}> + 任务 {projectDetail && projectDetail.issues_count ? {projectDetail.issues_count} : ""}
  • { projectDetail && parseInt(projectDetail.type) !== 2 && -
  • -1 ? "active" : ""}> - +
  • -1 ? "active" : ""}> + 合并请求 {projectDetail && projectDetail.pull_requests_count ? {projectDetail.pull_requests_count} : ""} @@ -446,14 +446,14 @@ class Detail extends Component { {projectDetail && projectDetail.ops_count ? {projectDetail.ops_count} : ""}
  • */} -
  • -1 || url.indexOf("meilpost") > -1) ? "active" : ""}> - +
  • -1 ? "active" : ""}> + 里程碑 {projectDetail && projectDetail.versions_count ? {projectDetail.versions_count} :""}
  • -
  • -1 ? "active" : ""}> - +
  • -1 ? "active" : ""}> + 动态
  • @@ -482,7 +482,7 @@ class Detail extends Component { } > {/* 标签列表 */} - () } @@ -494,93 +494,93 @@ class Detail extends Component { } > {/* 任务详情 */} - () } > - {/* 里程碑 */} - () + (props) => () } > {/* 新建里程碑 */} - () } > {/*里程碑详情*/} - () } > - {/*修改里程碑*/} - () + (props) => () } > {/* 里程碑页面新建任务 */} - () } > {/* 新建任务 */} - () } > {/* 修改详情 */} - () } > {/* 复制详情 */} - () } > {/* 动态 */} - () } > {/* 代码Index */} - () } > - () } > - () } > - () } > - () } > - () } @@ -595,12 +595,12 @@ class Detail extends Component { (props) => () } > - () } > - () } diff --git a/src/forge/Main/DetailTop.js b/src/forge/Main/DetailTop.js index 6e890da4..01d9211c 100644 --- a/src/forge/Main/DetailTop.js +++ b/src/forge/Main/DetailTop.js @@ -8,7 +8,7 @@ class DetailTop extends Component { const { pathname } = this.props.location; return (

    - 0 ? "active" : ""}> + 0 ? "active" : ""}> {(coderCount && coderCount.commits_count) || 0}个提交 @@ -20,7 +20,7 @@ class DetailTop extends Component { {(coderCount && coderCount.tags_count) || 0}个标签 - 0 ? "active" : ""}> + 0 ? "active" : ""}> {(coderCount && coderCount.version_releasesed_count) || 0}个发行版 diff --git a/src/forge/Merge/MergeDetail.js b/src/forge/Merge/MergeDetail.js index cf73802c..a075fd52 100644 --- a/src/forge/Merge/MergeDetail.js +++ b/src/forge/Merge/MergeDetail.js @@ -32,8 +32,8 @@ class MergeDetail extends Component { } getDetail = () => { - const { projectsId, mergeid } = this.props.match.params; - const url = `/projects/${projectsId}/pull_requests/${mergeid}.json`; + const { projectsId, mergeid ,owner } = this.props.match.params; + const url = `/projects/${owner}/${projectsId}/pulls/${mergeid}.json`; axios.get(url).then((result) => { if (result) { this.setState({ @@ -107,8 +107,8 @@ class MergeDetail extends Component { //关闭任务 closedetail = (id) => { - const { projectsId, orderId } = this.props.match.params; - const url = `/projects/${projectsId}/issues/${orderId}/close_issue.json`; + const { projectsId, orderId , owner } = this.props.match.params; + const url = `/${owner}/${projectsId}/issues/${orderId}/close_issue.json`; axios.post(url, { project_id: projectsId, id: orderId, @@ -161,7 +161,7 @@ class MergeDetail extends Component { }) } render() { - const { projectsId, mergeid } = this.props.match.params; + const { projectsId, mergeid , owner } = this.props.match.params; const { data, journalsdata, showFiles } = this.state; const { getFieldDecorator } = this.props.form; const url = this.props.history.location.pathname; @@ -228,7 +228,7 @@ class MergeDetail extends Component {

    { data && data.issue.user_permission ? - 编辑 + 编辑 : '' }
    @@ -248,8 +248,8 @@ class MergeDetail extends Component {
      -
    • 0 ? "active" : ""}>对话内容
    • -
    • 0 ? "active" : ""}>代码提交
    • +
    • 0 ? "active" : ""}>对话内容
    • +
    • 0 ? "active" : ""}>代码提交
    diff --git a/src/forge/Merge/MergeItem.js b/src/forge/Merge/MergeItem.js index d960f7d3..3a8f6bd6 100644 --- a/src/forge/Merge/MergeItem.js +++ b/src/forge/Merge/MergeItem.js @@ -53,7 +53,7 @@ class MergeItem extends Component {

    @@ -158,7 +158,7 @@ class MergeItem extends Component { {item.journals_count ? ( {item.journals_count} diff --git a/src/forge/Merge/NewMerge.js b/src/forge/Merge/NewMerge.js index 68564c2d..961fef38 100644 --- a/src/forge/Merge/NewMerge.js +++ b/src/forge/Merge/NewMerge.js @@ -83,26 +83,24 @@ class NewMerge extends Component { this.ischeckmerge(); } - newMergelist = (projectsId) => { + newMergelist = (id) => { this.setState({isSpin: true}) - const { owner } = this.props.match.params; + const { owner , projectsId } = this.props.match.params; const url = `/${owner}/${projectsId}/pulls/get_branches.json`; - axios - .get(url) - .then((result) => { - if (result) { - this.setState({ - merge_branches: result.data - }) - this.set_default_merge() - } - this.setState({isSpin: false}) - }) - .catch((error) => { - this.setState({isSpin: false}) - console.log(error); - }); + axios.get(url).then((result) => { + if (result) { + this.setState({ + merge_branches: result.data + }) + this.set_default_merge() + } + this.setState({isSpin: false}) + }) + .catch((error) => { + this.setState({isSpin: false}) + console.log(error); + }); }; selectBrach = (type, value) => { @@ -112,6 +110,8 @@ class NewMerge extends Component { selectProjectName = (value) => { const { project_id, projects_names } = this.state; + const { owner } = this.props.match.params; + console.log(value); let is_fork_id = parseInt(value) !== parseInt(project_id) this.setState({ @@ -123,7 +123,7 @@ class NewMerge extends Component { merge_user_login: is_fork_id ? projects_names[0].project_user_login : undefined } }) - this.props.history.push(`/projects/${value}/merge/new`); + // this.props.history.push(`/projects/${owner}/${value}/pulls/new`); this.newMergelist(value); }; diff --git a/src/forge/Merge/merge.js b/src/forge/Merge/merge.js index d8f62291..ae01b110 100644 --- a/src/forge/Merge/merge.js +++ b/src/forge/Merge/merge.js @@ -221,11 +221,11 @@ class merge extends Component { this.props.showLoginDialog(); return; } else { - this.props.history.push(`/projects/${owner}/${projectsId}/merge/new`); + this.props.history.push(`/projects/${owner}/${projectsId}/pulls/new`); } } render() { - const { projectsId } = this.props.match.params; + const { projectsId , owner } = this.props.match.params; const { issue_chosen, issues, @@ -423,7 +423,7 @@ class merge extends Component {

    ) : ( - + )} {/*

    diff --git a/src/forge/Merge/merge_form.js b/src/forge/Merge/merge_form.js index 99d78381..87bdc8b4 100644 --- a/src/forge/Merge/merge_form.js +++ b/src/forge/Merge/merge_form.js @@ -161,7 +161,7 @@ class MergeForm extends Component { this.setState({ isSpin: false, }); - this.props.history.push(`/projects/${owner}/${projectsId}/merge`); + this.props.history.push(`/projects/${owner}/${projectsId}/pulls`); const { getDetail } = this.props; getDetail && getDetail(); } else { @@ -191,7 +191,7 @@ class MergeForm extends Component { isSpin: false, }); this.props.history.push( - `/projects/${owner}/${projectsId}/merge/${mergeId}/Messagecount` + `/projects/${owner}/${projectsId}/pulls/${mergeId}/Messagecount` ); } else { this.setState({ @@ -284,8 +284,8 @@ class MergeForm extends Component { className="ml30" href={ merge_type === "new" - ? `/projects/${owner}/${projectsId}/merge` - : `/projects/${owner}/${projectsId}/merge/${mergeId}/detail` + ? `/projects/${owner}/${projectsId}/pulls` + : `/projects/${owner}/${projectsId}/pulls/${mergeId}/detail` } > 取消 diff --git a/src/forge/Merge/no_data.js b/src/forge/Merge/no_data.js index 81c65f50..5b8c5539 100644 --- a/src/forge/Merge/no_data.js +++ b/src/forge/Merge/no_data.js @@ -2,7 +2,7 @@ import React , { Component } from 'react'; import { Link } from "react-router-dom"; class Nodata extends Component{ render(){ - const { _html, projectsId } = this.props; + const { _html, projectsId , owner } = this.props; return(

    @@ -12,7 +12,7 @@ class Nodata extends Component{

    欢迎使用合并请求!

    - 合并请求可以帮助您与他人协作编写代码。在使用之前,请先创建一个 合并请求 + 合并请求可以帮助您与他人协作编写代码。在使用之前,请先创建一个 合并请求
    diff --git a/src/forge/Order/Detail.js b/src/forge/Order/Detail.js index 8fad9895..c9c38610 100644 --- a/src/forge/Order/Detail.js +++ b/src/forge/Order/Detail.js @@ -85,7 +85,7 @@ class Detail extends Component { }) .then((result) => { if (result) { - this.props.history.push(`/projects/${projectsId}/orders`); + this.props.history.push(`/projects/${projectsId}/issues`); } }) .catch((error) => { @@ -132,7 +132,7 @@ class Detail extends Component { .then((result) => { if (result) { this.props.history.push( - `/projects/${owner}/${projectsId}/orders/${result.data.issue_id}/copyetail` + `/projects/${owner}/${projectsId}/issues/${result.data.issue_id}/copyetail` ); } }) @@ -269,7 +269,7 @@ class Detail extends Component { 编辑 diff --git a/src/forge/Order/Milepost.js b/src/forge/Order/Milepost.js index 32665e77..5432df33 100644 --- a/src/forge/Order/Milepost.js +++ b/src/forge/Order/Milepost.js @@ -184,7 +184,7 @@ class Milepost extends Component { { data && data.user_admin_or_member ? - 新的里程碑 + 新的里程碑 : '' }
    @@ -201,7 +201,7 @@ class Milepost extends Component {
    - {item.name} + {item.name}
    @@ -225,7 +225,7 @@ class Milepost extends Component {
    - 编辑 + 编辑
    diff --git a/src/forge/Order/MilepostDetail.js b/src/forge/Order/MilepostDetail.js index 1442aad0..89615035 100644 --- a/src/forge/Order/MilepostDetail.js +++ b/src/forge/Order/MilepostDetail.js @@ -203,8 +203,8 @@ class MilepostDetail extends Component {

    {data && data.name}

    - 编辑里程碑 - 创建任务 + 编辑里程碑 + 创建任务
    diff --git a/src/forge/Order/Milepostitem.js b/src/forge/Order/Milepostitem.js index 1f13cea4..665d9228 100644 --- a/src/forge/Order/Milepostitem.js +++ b/src/forge/Order/Milepostitem.js @@ -31,7 +31,7 @@ class OrderItem extends Component {
    - {item.name} + {item.name}
    @@ -66,7 +66,7 @@ class OrderItem extends Component {
    - 编辑 + 编辑
    diff --git a/src/forge/Order/Nav.js b/src/forge/Order/Nav.js index c7043e3f..93fbc101 100644 --- a/src/forge/Order/Nav.js +++ b/src/forge/Order/Nav.js @@ -4,11 +4,11 @@ import './order.css' class Nav extends Component{ render(){ - const { projectsId } = this.props.match.params; + const { projectsId , owner } = this.props.match.params; return(

    - 标签 - 里程碑 + 标签 + 里程碑

    ) } diff --git a/src/forge/Order/OrderItem.js b/src/forge/Order/OrderItem.js index 88eb6fc5..b09a630e 100644 --- a/src/forge/Order/OrderItem.js +++ b/src/forge/Order/OrderItem.js @@ -54,7 +54,7 @@ class OrderItem extends Component { {current_user && current_user.login && checkbox}

    - {item.name} + {item.name} {TagInfo(item.priority,"mr10")}

    @@ -91,12 +91,12 @@ class OrderItem extends Component {

  • {item.done_ratio || "--"}
  • - {item.journals_count} + {item.journals_count} { current_user && current_user.login ?
    - +
    this.deletedetail(item.id)}> diff --git a/src/forge/Order/UpdateMilepost.js b/src/forge/Order/UpdateMilepost.js index 51efa0b2..49a2b8d3 100644 --- a/src/forge/Order/UpdateMilepost.js +++ b/src/forge/Order/UpdateMilepost.js @@ -79,7 +79,7 @@ class UpdateMilepost extends Component { }).then(result => { if (result) { this.setState({ isSpin: false }) - this.props.history.push(`/projects/${owner}/${projectsId}/orders/Milepost`); + this.props.history.push(`/projects/${owner}/${projectsId}/milestones`); } diff --git a/src/forge/Order/newMilepost.js b/src/forge/Order/newMilepost.js index b16396c9..3c8058f0 100644 --- a/src/forge/Order/newMilepost.js +++ b/src/forge/Order/newMilepost.js @@ -66,7 +66,7 @@ class NewMilepost extends Component { }).then(result => { if (result) { this.setState({ isSpin: false }) - this.props.history.push(`/projects/${owner}/${projectsId}/orders/Milepost`); + this.props.history.push(`/projects/${owner}/${projectsId}/milestones`); } }).catch(error => { diff --git a/src/forge/Order/order.js b/src/forge/Order/order.js index 7d9f8269..784111fe 100644 --- a/src/forge/Order/order.js +++ b/src/forge/Order/order.js @@ -343,7 +343,7 @@ class order extends Component { const { projectsId , owner } = this.props.match.params; if (this.props.checkIfLogin()) { return( - + + 创建任务 ) @@ -415,7 +415,7 @@ class order extends Component { // 批量修改 updateIssues = () => { const { checkedValue, select_params } = this.state; - const { projectsId } = this.props.match.params; + const { projectsId , owner } = this.props.match.params; if (!select_params.update_author_id && !select_params.update_fixed_version_id && !select_params.update_status_id) { this.resetSelectParams(); @@ -424,7 +424,7 @@ class order extends Component { this.setState({ isSpin: true }) - const url = `/projects/${projectsId}/issues/series_update.json`; + const url = `/${owner}/${projectsId}/issues/series_update.json`; axios.post(url, { ids: checkedValue, assigned_to_id: select_params.update_author_id, diff --git a/src/forge/Order/order_form.js b/src/forge/Order/order_form.js index b3e5b958..f1eaf054 100644 --- a/src/forge/Order/order_form.js +++ b/src/forge/Order/order_form.js @@ -163,7 +163,7 @@ class order_form extends Component { }).then((result) => { if (result && result.data.id) { this.props.showNotification("任务创建成功!"); - this.props.history.push(`/projects/${owner}/${projectsId}/orders/${result.data.id}/detail`); + this.props.history.push(`/projects/${owner}/${projectsId}/issues/${result.data.id}/detail`); this.setState({ description: "", isSpin: false, @@ -189,7 +189,7 @@ class order_form extends Component { ...values, }).then((result) => { if (result) { - this.props.history.push(`/projects/${owner}/${projectsId}/orders/${orderId}/detail`); + this.props.history.push(`/projects/${owner}/${projectsId}/issues/${orderId}/detail`); this.props.showNotification("任务更新成功!"); } }) @@ -362,7 +362,7 @@ class order_form extends Component { type="default" className="ml30" onClick={()=> - this.props.history.push(form_type === "new" ? `/projects/${owner}/${projectsId || orderId}/orders` : `/projects/${owner}/${projectsId}/orders/${orderId}/detail`)} + this.props.history.push(form_type === "new" ? `/projects/${owner}/${projectsId || orderId}/issues` : `/projects/${owner}/${projectsId}/issues/${orderId}/detail`)} > 取消 diff --git a/src/forge/UsersList/common_users.js b/src/forge/UsersList/common_users.js index e73e1c73..0ccdf15c 100644 --- a/src/forge/UsersList/common_users.js +++ b/src/forge/UsersList/common_users.js @@ -11,6 +11,7 @@ class CommonUsers extends Component { user_type: this.props.user_type, type_title: this.props.type_title, project_id: this.props.project_id, + owner:this.props.owner, users: null, count: 0, limit: 20, @@ -27,28 +28,25 @@ class CommonUsers extends Component { this.setState({ isSpin: true, }); - const { user_type, project_id } = this.state; - - const url = `/projects/${project_id}/${user_type}.json`; - axios - .get(url, { - params: { - page, - limit, - }, - }) - .then((result) => { - if (result) { - this.setState({ - count: result.data.count, - users: result.data.users, - isSpin: false, - }); - } - }) - .catch((error) => { - console.log(error); - }); + const { user_type, project_id ,owner } = this.state; + const url = `/${owner}/${project_id}/${user_type}.json`; + axios.get(url, { + params: { + page, + limit, + }, + }).then((result) => { + if (result) { + this.setState({ + count: result.data.count, + users: result.data.users, + isSpin: false, + }); + } + }) + .catch((error) => { + console.log(error); + }); }; // 翻页 diff --git a/src/forge/UsersList/fork_users.js b/src/forge/UsersList/fork_users.js index 6446b94d..61a48a28 100644 --- a/src/forge/UsersList/fork_users.js +++ b/src/forge/UsersList/fork_users.js @@ -25,9 +25,9 @@ class ForkUsers extends Component { this.setState({ isSpin: true, }); - const { projectsId } = this.props.match.params; + const { projectsId , owner } = this.props.match.params; - const url = `/projects/${projectsId}/fork_users.json`; + const url = `/${owner}/${projectsId}/members.json`; axios .get(url, { params: { diff --git a/src/forge/UsersList/praise_users.js b/src/forge/UsersList/praise_users.js index 0feb0332..31f36421 100644 --- a/src/forge/UsersList/praise_users.js +++ b/src/forge/UsersList/praise_users.js @@ -1,28 +1,12 @@ import React, { Component } from "react"; import CommonUsers from "./common_users" class PraiseUsers extends Component { - constructor(props) { - super(props); - this.state = { - projectId: null - }; - } - - componentDidMount = () => { - this.get_projectId(); - }; - - get_projectId = () => { - this.setState({ - projectId: this.props.match.params.projectsId - }) - }; render() { - const { projectId } = this.state; + const { owner , projectsId } = this.props.match.params; return (
    - {projectId && } + {projectsId && }
    ); } diff --git a/src/forge/UsersList/watch_users.js b/src/forge/UsersList/watch_users.js index da4a1d7a..a78efcb0 100644 --- a/src/forge/UsersList/watch_users.js +++ b/src/forge/UsersList/watch_users.js @@ -1,28 +1,11 @@ import React, { Component } from "react"; import CommonUsers from "./common_users" class WatchUsers extends Component { - constructor(props) { - super(props); - this.state = { - projectId: null - }; - } - - componentDidMount = () => { - this.get_projectId(); - }; - - get_projectId = () => { - this.setState({ - projectId: this.props.match.params.projectsId - }) - }; - render() { - const { projectId } = this.state; + const { owner , projectsId } = this.props.match.params; return (
    - {projectId && } + {projectsId && }
    ); } diff --git a/src/forge/Version/New.jsx b/src/forge/Version/New.jsx index d42b780d..be100168 100644 --- a/src/forge/Version/New.jsx +++ b/src/forge/Version/New.jsx @@ -103,7 +103,7 @@ export default Form.create()( .then(result => { if (result) { showNotification("版本修改成功!"); - history.push(`/projects/${owner}/${projectsId}/coders/version`); + history.push(`/projects/${owner}/${projectsId}/coders/releases`); } }); } else { @@ -116,7 +116,7 @@ export default Form.create()( .then(result => { if (result) { showNotification("版本发布成功!"); - history.push(`/projects/${owner}/${projectsId}/coders/version`); + history.push(`/projects/${owner}/${projectsId}/coders/releases`); } }); } @@ -233,7 +233,7 @@ export default Form.create()(
    this.route_link("watch_users")} + to={`/users/${user && user.login}/watchers`} + className={`with50 text-center pull-left ${route_type === "watchers" ? "text-primary" : ""}`} + onClick={() =>this.route_link("watchers")} >
    {current_user && user && user.login === current_user.login ? "我关注的" : "TA关注的"}
    {user && user.watching_count} @@ -252,9 +252,9 @@ class Infos extends Component {
    { - return ; + return ; }} >
    -

    {userType === "watch_users" ? `${title_type}关注的` : `关注${title_type}的`}

    +

    {userType === "watchers" ? `${title_type}关注的` : `关注${title_type}的`}

    - {user && user.login && } + {user && user.login && }
    ); }