diff --git a/src/forge/Main/CoderRootCommit.js b/src/forge/Main/CoderRootCommit.js index 010086e41..bf2c14638 100644 --- a/src/forge/Main/CoderRootCommit.js +++ b/src/forge/Main/CoderRootCommit.js @@ -79,16 +79,6 @@ class CoderRootCommit extends Component{ const { branch , limit } = this.state; this.getCommitList(branch , page , limit); } - Paginations =(dataCount,limit,page)=> { - if(dataCount > limit){ - return( -
- -
- ) - } - } - render(){ const { branch , commitDatas , dataCount , limit , page , isSpining } = this.state; const { branchs , projectDetail, commit_class } = this.props; diff --git a/src/forge/Newfile/UserSubmitComponent.js b/src/forge/Newfile/UserSubmitComponent.js index 839187d02..0f723ce59 100644 --- a/src/forge/Newfile/UserSubmitComponent.js +++ b/src/forge/Newfile/UserSubmitComponent.js @@ -119,29 +119,6 @@ class UserSubmitComponent extends Component { const { current_user, filepath, projectDetail } = this.props; const { editor_type } = this.props; - const changeSubmitBranch = () => { - if (submitType === "1") { - return ( -
- - {getFieldDecorator("branchname", { - rules: [ - { - required: true, - message: "请输入分支名称", - }, - ], - })( - - )} - -
- ); - } - }; return (
@@ -216,7 +193,26 @@ class UserSubmitComponent extends Component { 并发起合并请求 - {changeSubmitBranch()} + { + submitType === "1" ? +
+ + {getFieldDecorator("branchname", { + rules: [ + { + required: true, + message: "请输入分支名称", + }, + ], + })( + + )} + +
:"" + }
diff --git a/src/forge/Order/CopyDetail.js b/src/forge/Order/CopyDetail.js index 3cfd09380..1f61e7369 100644 --- a/src/forge/Order/CopyDetail.js +++ b/src/forge/Order/CopyDetail.js @@ -2,15 +2,10 @@ import React, { Component } from "react"; import OrderItem from './order_form' class CopyDetail extends Component { - constructor(props) { - super(props); - } - render() { return ( ) } - } export default CopyDetail; diff --git a/src/forge/Order/Detail.js b/src/forge/Order/Detail.js index 8bd8de671..a9e81a956 100644 --- a/src/forge/Order/Detail.js +++ b/src/forge/Order/Detail.js @@ -3,13 +3,11 @@ import { Link } from "react-router-dom"; import axios from "axios"; import { getImageUrl } from "educoder"; -import { Modal, Form, Tooltip, Popconfirm, Pagination, Spin, Tag } from "antd"; +import { Form , Popconfirm , Tag } from "antd"; import Attachments from "../Upload/attachment"; -// import MDEditor from "../../modules/tpm/challengesnew/tpm-md-editor"; import RenderHtml from "../../components/render-html"; import Comments from "../comments/comments"; import "./order.css"; -// import AmplifyImg from "./AmplifyImg"; class Detail extends Component { constructor(props) { @@ -55,7 +53,6 @@ class Detail extends Component { this.setState({ data: result.data, }); - // this.getjournalslist(); } }) .catch((error) => { diff --git a/src/forge/Order/Milepost.js b/src/forge/Order/Milepost.js index 74b721ea7..5273c97bb 100644 --- a/src/forge/Order/Milepost.js +++ b/src/forge/Order/Milepost.js @@ -1,7 +1,6 @@ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import { Dropdown, Icon, Menu, Pagination, Typography, Popconfirm } from 'antd'; -import Nav from './Nav'; import NoneData from '../Nodata'; import axios from 'axios'; @@ -28,9 +27,6 @@ class Milepost extends Component { this.getList(1, this.state.status, 'desc'); } - - - getList = (page, status, order_type, order_name) => { const { projectsId } = this.props.match.params; const { limit } = this.state; diff --git a/src/forge/Order/MilepostDetail.js b/src/forge/Order/MilepostDetail.js index 597168924..b01f683a7 100644 --- a/src/forge/Order/MilepostDetail.js +++ b/src/forge/Order/MilepostDetail.js @@ -6,7 +6,6 @@ import './order.css'; import NoneData from '../Nodata'; import OrderItem from './OrderItem'; - import axios from 'axios'; /** @@ -249,7 +248,13 @@ class MilepostDetail extends Component { } } - + Paginations = (search_count) => { + const { limit, page } = this.state; + if(search_count > limit) + return
+ +
; + }; render() { @@ -265,17 +270,6 @@ class MilepostDetail extends Component { 最早更新 ) - - const Paginations = ( - - { - search_count > limit ? -
- -
: "" - } -
- ) return (
@@ -357,7 +351,7 @@ class MilepostDetail extends Component { ) }) } - {Paginations} + {this.Paginations(search_count)}
diff --git a/src/forge/Order/Milepostitem.js b/src/forge/Order/Milepostitem.js index 562b7b206..ddc36e408 100644 --- a/src/forge/Order/Milepostitem.js +++ b/src/forge/Order/Milepostitem.js @@ -21,84 +21,80 @@ class OrderItem extends Component { const { data } = this.props; const { projectsId } = this.props.match.params; - const renderList = () => { - data.versions.map((item, key) => { - return ( -
-
-
-
- - {item.name} -
- -
-
-
-
- -
- - - { - item.effective_date ? - {item.effective_date} - : - 暂无截止时间 - } -
-
- - - {item.open_issues_count}个开启 - -
-
- - - {item.close_issues_count}个关闭 - -
-
- { - data && data.user_admin_or_member ? -
-
- - 编辑 -
-
- - this.updatestatusemile(this.state.status === "closed" ? "open" : "closed", item)} className="color-grey-9">{this.state.status === "closed" ? "开启" : "关闭"} -
-
- - this.closemile(item)}> - 删除 - -
- -
- : '' - } - -
-
-
- - {item.description} -
-
-
- ) - }) - } return (
- {renderList()} + { + data && data.versions && data.versions.length > 0 && data.versions.map((item, key) => { + return ( +
+
+
+
+ + {item.name} +
+
+
+
+
+ +
+ + + { + item.effective_date ? + {item.effective_date} + : + 暂无截止时间 + } +
+
+ + + {item.open_issues_count}个开启 + +
+
+ + + {item.close_issues_count}个关闭 + +
+
+ { + data.user_admin_or_member ? +
+
+ + 编辑 +
+ +
+ + this.closemile(item)}> + 删除 + +
+
+ : '' + } +
+
+
+ + {item.description} +
+
+
+ ) + }) + }
) } diff --git a/src/forge/Order/Nav.js b/src/forge/Order/Nav.js index 65c8b51d4..d0a4b0cd8 100644 --- a/src/forge/Order/Nav.js +++ b/src/forge/Order/Nav.js @@ -8,7 +8,6 @@ class Nav extends Component{ projectTag: undefined } } - render(){ const { projectsId } = this.props.match.params; return( diff --git a/src/forge/Order/New.js b/src/forge/Order/New.js index d169cb636..f9562a7d0 100644 --- a/src/forge/Order/New.js +++ b/src/forge/Order/New.js @@ -7,6 +7,5 @@ class New extends Component { ) } - } export default New; diff --git a/src/forge/Order/OrderItem.js b/src/forge/Order/OrderItem.js index a30b53948..822c65db6 100644 --- a/src/forge/Order/OrderItem.js +++ b/src/forge/Order/OrderItem.js @@ -48,74 +48,68 @@ class OrderItem extends Component { const { projectsId } = this.props.match.params; const { current_user } = this.props - const renderList = () => { - if (item) { - return ( -
- {current_user && current_user.login && checkbox} -
-

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

-

- {item.format_time}发布 - { - item.updated_at === item.format_time ? "" : - {item.updated_at}更新 - } -

-
- -
- ) - } - } return ( - renderList() + item && +
+ {current_user && current_user.login && checkbox} +
+

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

+

+ {item.format_time}发布 + { + item.updated_at === item.format_time ? "" : + {item.updated_at}更新 + } +

+
+ +
) } } diff --git a/src/forge/Order/Tags.js b/src/forge/Order/Tags.js index d3af4ddf2..5183222b8 100644 --- a/src/forge/Order/Tags.js +++ b/src/forge/Order/Tags.js @@ -5,6 +5,46 @@ import NoneData from '../Nodata'; import { SketchPicker } from 'react-color' import reactCSS from 'reactcss' import axios from 'axios'; + + +const styles = reactCSS({ + 'default': { + color: { + width: '20px', + height: '20px', + borderRadius: '2px', + background: `rgba(${this.state.color.r}, ${this.state.color.g}, ${this.state.color.b}, ${this.state.color.a})`, + }, + swatch: { + padding: '5px', + background: '#fff', + borderRadius: '1px', + width: '100px', + marginTop: '5px', + height: '28px', + boxShadow: '0 0 0 1px rgba(0,0,0,.1)', + display: 'flex', + cursor: 'pointer', + }, + popover: { + position: 'absolute', + zIndex: '2', + }, + cover: { + position: 'fixed', + top: '0px', + right: '0px', + bottom: '0px', + left: '0px', + }, + modalcolor: { + width: '20px', + height: '20px', + borderRadius: '2px', + background: this.state.newcolor, + } + }, +}); class Tags extends Component { constructor(props) { super(props); @@ -210,120 +250,18 @@ class Tags extends Component { id: arr.id }); }; - + menu =()=> ( + + 按创建时间降序排序 + 按创建时间升序排序 + 按issue个数降序排序 + 按issue个数升序排序 + + ) render() { const { data, limit, page } = this.state; const { getFieldDecorator } = this.props.form; - const menu = ( - - 按创建时间降序排序 - 按创建时间升序排序 - 按issue个数降序排序 - 按issue个数升序排序 - - ) - const styles = reactCSS({ - 'default': { - color: { - width: '20px', - height: '20px', - borderRadius: '2px', - background: `rgba(${this.state.color.r}, ${this.state.color.g}, ${this.state.color.b}, ${this.state.color.a})`, - }, - swatch: { - padding: '5px', - background: '#fff', - borderRadius: '1px', - width: '100px', - marginTop: '5px', - height: '28px', - boxShadow: '0 0 0 1px rgba(0,0,0,.1)', - display: 'flex', - cursor: 'pointer', - }, - popover: { - position: 'absolute', - zIndex: '2', - }, - cover: { - position: 'fixed', - top: '0px', - right: '0px', - bottom: '0px', - left: '0px', - }, - modalcolor: { - width: '20px', - height: '20px', - borderRadius: '2px', - background: this.state.newcolor, - } - }, - }); - - - const Paginations = ( - - { - data && data.issue_tags_count > limit ? -
- -
: "" - } -
- ) - - const renderList = () => { - if (data && data.issue_tags && data.issue_tags.length > 0) { - return ( -
-
- 共{data && data.issue_tags_count}个标签 -
    -
  • - - 标签 - -
  • -
-
-
- { - data.issue_tags.map((item, key) => { - return ( -
- - - {item.name} - - {item.description} - {item.issues_count}个开启的任务 - { - data && data.user_admin_or_member ? -
- this.editshow(item)} className="topWrapper_btn fr" >编辑 - this.deletetag(item.id)}> - 删除 - - -
- : '' - } -
- ) - }) - } -
-
- ) - } else { - return ( - - ) - } - } - return (
@@ -363,7 +301,6 @@ class Tags extends Component { )} -
@@ -383,8 +320,56 @@ class Tags extends Component {
- {renderList()} - {Paginations} + { + data && data.issue_tags && data.issue_tags.length > 0 ? +
+
+ 共{data && data.issue_tags_count}个标签 +
    +
  • + + 标签 + +
  • +
+
+
+ { + data.issue_tags.map((item, key) => { + return ( +
+ + + {item.name} + + {item.description} + {item.issues_count}个开启的任务 + { + data && data.user_admin_or_member ? + + : '' + } +
+ ) + }) + } +
+
+ : + + } + { + data && data.issue_tags_count > limit ? +
+ +
:"" + }
+ ) } - } export default UpdateDetail; diff --git a/src/forge/Order/UpdateMilepost.js b/src/forge/Order/UpdateMilepost.js index 65f918d33..e89acf572 100644 --- a/src/forge/Order/UpdateMilepost.js +++ b/src/forge/Order/UpdateMilepost.js @@ -58,9 +58,6 @@ class UpdateMilepost extends Component { }).catch((error) => { console.log(error); }) - - - } submit = () => { diff --git a/src/forge/Order/newMilepost.js b/src/forge/Order/newMilepost.js index 4c09e8ad4..00d398e50 100644 --- a/src/forge/Order/newMilepost.js +++ b/src/forge/Order/newMilepost.js @@ -81,7 +81,6 @@ class NewMilepost extends Component { render() { const { getFieldDecorator } = this.props.form; - const { projectsId } = this.props.match.params; const { isSpin } = this.state return (
@@ -208,7 +207,6 @@ class NewMilepost extends Component { 创建里程碑 -
diff --git a/src/forge/Order/order.js b/src/forge/Order/order.js index 0e7dd9cad..53e314e5b 100644 --- a/src/forge/Order/order.js +++ b/src/forge/Order/order.js @@ -46,9 +46,9 @@ class order extends Component { status_ids: "状态", done_ratios: "完成度", paix: "排序", - update_author_ids:"更换负责人", - update_fixed_version_ids:'更换里程碑', - update_status_ids:"修改状态", + update_author_ids: "更换负责人", + update_fixed_version_ids: '更换里程碑', + update_status_ids: "修改状态", begin: '', end: '', checkedValue: [], @@ -65,9 +65,9 @@ class order extends Component { order_name: undefined, order_type: undefined, search: undefined, - update_author_id:undefined, - update_fixed_version_id:undefined, - update_status_id:undefined, + update_author_id: undefined, + update_fixed_version_id: undefined, + update_status_id: undefined, page: 1, limit: 15, }, @@ -100,7 +100,7 @@ class order extends Component { }; // 获取列表数据 - getIssueList = (status_type , begin, end) => { + getIssueList = (status_type, begin, end) => { this.setState({ isSpin: true }) @@ -169,7 +169,7 @@ class order extends Component { this.getIssueList(status_type); }; - getOption = (e, id, name,toGet) => { + getOption = (e, id, name, toGet) => { const { current_user } = this.props; let option_id = e.key === "all" ? undefined : e.key; @@ -182,26 +182,26 @@ class order extends Component { if (current_user) { author_id = (select_params.author_id && select_params.author_id === current_user.user_id) ? current_user.user_id : undefined; - + assigned_to_id = (select_params.assigned_to_id && select_params.assigned_to_id === current_user.user_id) ? current_user.user_id : undefined; } this.setState({ - [`${id}s`] : name, + [`${id}s`]: name, select_params, author_id, assigned_to_id }); - if(!toGet){ + if (!toGet) { const { status_type } = this.state; this.getIssueList(status_type); } }; - renderMenu = (array, name, id,toGet) => { + renderMenu = (array, name, id, toGet) => { return ( - this.getOption(e, id, name,toGet)}> + this.getOption(e, id, name, toGet)}> {name} {array && @@ -210,7 +210,7 @@ class order extends Component { return ( this.getOption(e, id, item.name,toGet)} + onClick={(e) => this.getOption(e, id, item.name, toGet)} > {item.name} @@ -351,14 +351,14 @@ class order extends Component { this.setState({ begin: value }) - this.getIssueList(status_type,value, this.state.end); + this.getIssueList(status_type, value, this.state.end); } changeEndTime = (data, value) => { const { status_type } = this.state; this.setState({ end: value }) - this.getIssueList(status_type,this.state.begin, value); + this.getIssueList(status_type, this.state.begin, value); } // 选择列表里面的checkbox @@ -371,15 +371,15 @@ class order extends Component { all: allValue && value && value.length === allValue.length, }) // 不勾选数据时清除右上角选择的项 - if(value.length === 0){ + if (value.length === 0) { this.setState({ - update_author_ids:"更换负责人", - update_fixed_version_ids:"更换里程碑", - update_status_ids:"修改状态", - select_params:{ - update_author_id:undefined, - update_fixed_version_id:undefined, - update_status_id:undefined + update_author_ids: "更换负责人", + update_fixed_version_ids: "更换里程碑", + update_status_ids: "修改状态", + select_params: { + update_author_id: undefined, + update_fixed_version_id: undefined, + update_status_id: undefined } }) } @@ -402,79 +402,94 @@ class order extends Component { } // 批量修改 - updateIssues=()=>{ - const {checkedValue , select_params} = this.state; + updateIssues = () => { + const { checkedValue, select_params } = this.state; const { projectsId } = this.props.match.params; - - if(!select_params.update_author_id && !select_params.update_fixed_version_id &&!select_params.update_status_id ){ + + if (!select_params.update_author_id && !select_params.update_fixed_version_id && !select_params.update_status_id) { this.resetSelectParams(); return; } this.setState({ - isSpin:true + isSpin: true }) const url = `/projects/${projectsId}/issues/series_update.json`; - axios.post(url,{ - ids:checkedValue, - assigned_to_id:select_params.update_author_id, - fixed_version_id:select_params.update_fixed_version_id, - status_id:select_params.update_status_id - }).then(result=>{ - if(result){ + axios.post(url, { + ids: checkedValue, + assigned_to_id: select_params.update_author_id, + fixed_version_id: select_params.update_fixed_version_id, + status_id: select_params.update_status_id + }).then(result => { + if (result) { this.props.showNotification("修改成功!"); this.successFunc(); } - }).catch(error=>{ + }).catch(error => { console.log(error); }) } - successFunc=()=>{ + successFunc = () => { this.resetSelectParams(); const { status_type } = this.state; this.getIssueList(status_type); } - resetSelectParams=()=>{ + resetSelectParams = () => { let select_params = this.state.select_params; select_params.update_author_id = undefined; select_params.update_fixed_version_id = undefined; select_params.update_status_id = undefined; this.setState({ - all:false, - checkedValue:[], - update_author_ids:"更换负责人", - update_fixed_version_ids:"更换里程碑", - update_status_ids:"修改状态", + all: false, + checkedValue: [], + update_author_ids: "更换负责人", + update_fixed_version_ids: "更换里程碑", + update_status_ids: "修改状态", select_params }) } // 批量删除 - deleteIssues=()=>{ + deleteIssues = () => { this.props.confirm({ content: "是否确认删除所有选中的任务?", - onOk:()=>{ + onOk: () => { this.setState({ - isSpin:true + isSpin: true }) const { checkedValue } = this.state; const { projectsId } = this.props.match.params; const url = `/projects/${projectsId}/issues/clean.json`; - axios.post(url,{ - ids:checkedValue - }).then(result=>{ - if(result){ + axios.post(url, { + ids: checkedValue + }).then(result => { + if (result) { this.props.showNotification("删除成功!"); this.successFunc(); } - }).catch(error=>{ + }).catch(error => { console.log(error); }) } }) } - + menu =()=> ( + this.getMenu(e)}> + + 最新创建 + + + 最早创建 + + + 最新更新 + + + 最早更新 + + + ); render() { const { current_user } = this.props; @@ -490,40 +505,7 @@ class order extends Component { select_params, begin, end, checkedValue, all } = this.state; - const menu = ( - this.getMenu(e)}> - - 最新创建 - - - 最早创建 - - - 最新更新 - - - 最早更新 - - - ); - - const Paginations = ( - - {search_count > select_params.limit ? ( -
- -
- ) : ( - "" - )} -
- ); + return (
@@ -577,7 +559,7 @@ class order extends Component { { current_user && current_user.login ? - :"" + : "" } {checkedValue && checkedValue.length > 0 ? 选中{checkedValue.length}个issue @@ -616,199 +598,199 @@ class order extends Component { }
{ - checkedValue && checkedValue.length>0 ? -
    -
  • - - - {this.state.update_author_ids} - - - -
  • -
  • - - - {this.state.update_fixed_version_ids} - - - -
  • -
  • - - - {this.state.update_status_ids} - - - -
  • - 确定 - 删除 -
- : -
    -
  • - - - {this.state.issue_tag_ids} - - - -
  • -
  • - - - {this.state.author_ids} - - - -
  • -
  • - - - {this.state.assigned_to_ids} - - - -
  • -
  • - - - {this.state.tracker_ids} - - - -
  • -
  • - - - {this.state.fixed_version_ids} - - - -
  • -
  • - - - {this.state.status_ids} - - - -
  • -
  • - - - {this.state.done_ratios} - - - -
  • -
  • - - - {this.state.paix} - - - -
  • -
+ checkedValue && checkedValue.length > 0 ? +
    +
  • + + + {this.state.update_author_ids} + + + +
  • +
  • + + + {this.state.update_fixed_version_ids} + + + +
  • +
  • + + + {this.state.update_status_ids} + + + +
  • + 确定 + 删除 +
+ : +
    +
  • + + + {this.state.issue_tag_ids} + + + +
  • +
  • + + + {this.state.author_ids} + + + +
  • +
  • + + + {this.state.assigned_to_ids} + + + +
  • +
  • + + + {this.state.tracker_ids} + + + +
  • +
  • + + + {this.state.fixed_version_ids} + + + +
  • +
  • + + + {this.state.status_ids} + + + +
  • +
  • + + + {this.state.done_ratios} + + + +
  • +
  • + + + {this.state.paix} + + + +
  • +
} - +
{search_count === 0 ? ( @@ -820,7 +802,7 @@ class order extends Component { :""} + checkbox={current_user ? : ""} search_count={search_count} page={select_params.page} limit={select_params.limit} @@ -833,7 +815,20 @@ class order extends Component {
)} - {Paginations} + { + search_count > select_params.limit ? +
+ +
+ : + "" + }
); diff --git a/src/forge/Order/order_form.js b/src/forge/Order/order_form.js index 3ee6e61cf..b69d8ac38 100644 --- a/src/forge/Order/order_form.js +++ b/src/forge/Order/order_form.js @@ -51,7 +51,6 @@ class order_form extends Component { get_detail = () => { const { form_type } = this.props; if (form_type === "new") { - this.InitData(); this.getSelectList(); } else { this.state.isSpin = true; @@ -96,8 +95,7 @@ class order_form extends Component { start_date: result.data.start_date, due_date: result.data.due_date, subject: result.data.subject, - }, - () => this.InitData() + } ); } }) diff --git a/src/forge/UsersList/common_users.js b/src/forge/UsersList/common_users.js index cae2a3c0d..e73e1c73c 100644 --- a/src/forge/UsersList/common_users.js +++ b/src/forge/UsersList/common_users.js @@ -1,11 +1,8 @@ import React, { Component } from "react"; - import axios from "axios"; -// import { Spin, Pagination } from "antd"; import "./list.css"; import NoneData from "../Nodata"; -// import FocusButton from "./focus_button"; import UserList from "./user_list" class CommonUsers extends Component { constructor(props) { @@ -63,10 +60,10 @@ class CommonUsers extends Component { const { limit } = this.state; this.getUsersList(page, limit); }; - - render() { - const { users, count, page, limit, isSpin, type_title } = this.state; - const Paginations = ( + + Paginations =() => { + const { count, page, limit } = this.state; + return( {count > limit ? (
@@ -82,7 +79,12 @@ class CommonUsers extends Component { "" )} - ); + ) + }; + + render() { + const { users, count , isSpin, type_title } = this.state; + return (
@@ -97,7 +99,7 @@ class CommonUsers extends Component { )}
- {Paginations} + {this.Paginations()}
diff --git a/src/forge/UsersList/focus_button.js b/src/forge/UsersList/focus_button.js index cb0511b41..74d1c8200 100644 --- a/src/forge/UsersList/focus_button.js +++ b/src/forge/UsersList/focus_button.js @@ -52,14 +52,14 @@ class FocusButton extends Component { } }) .catch((error) => { - this.setState({isSpin: false}) + this.setState({ isSpin: false }) console.log(error); }); }; render() { - const { is_watch, isSpin,fontClass,starText,is_block } = this.state; - + const { is_watch, isSpin, fontClass, starText, is_block } = this.state; + return ( ); } diff --git a/src/forge/UsersList/fork_users.js b/src/forge/UsersList/fork_users.js index 29236935e..6446b94df 100644 --- a/src/forge/UsersList/fork_users.js +++ b/src/forge/UsersList/fork_users.js @@ -5,7 +5,6 @@ import { getImageUrl } from "educoder"; import { Spin, Pagination } from "antd"; import "./list.css"; import NoneData from "../Nodata"; -// import FocusButton from "./focus_button"; class ForkUsers extends Component { constructor(props) { super(props); @@ -60,65 +59,64 @@ class ForkUsers extends Component { this.getUsersList(page, limit); }; - render() { - const { users, count, page, limit, isSpin } = this.state; - const Paginations = ( - - {count > limit ? ( -
- -
- ) : ( - "" - )} -
- ); - - const renderList = () => { - if (users && users.length > 0) { - return users.map((item, key) => { - return ( -
-
+ Paginations =()=> { + const { count, page, limit } = this.state; + if(count > limit){ + return( +
+ +
+ ) + } + }; + renderList = (users) => { + if (users && users.length > 0) { + return users.map((item, key) => { + return ( +
+
+
+ + + +
+
- + {item.name}
-
-
- - {item.name} - -
-
- - fork时间:{item.format_time} -
- {/* */} +
+ + fork时间:{item.format_time}
- ); - }); - } - }; +
+ ); + }); + } + } + + render() { + const { users, count, isSpin } = this.state; + return (
@@ -129,11 +127,11 @@ class ForkUsers extends Component { {count === 0 ? ( ) : ( - renderList() + this.renderList(users) )}
- {Paginations} + {this.Paginations()}
diff --git a/src/forge/UsersList/praise_users.js b/src/forge/UsersList/praise_users.js index ed8bca595..0feb03328 100644 --- a/src/forge/UsersList/praise_users.js +++ b/src/forge/UsersList/praise_users.js @@ -24,7 +24,6 @@ class PraiseUsers extends Component {
{projectId && }
- ); } } diff --git a/src/forge/UsersList/user_list.js b/src/forge/UsersList/user_list.js index 0e53f88dd..a214173de 100644 --- a/src/forge/UsersList/user_list.js +++ b/src/forge/UsersList/user_list.js @@ -4,58 +4,56 @@ import FocusButton from "./focus_button"; import { Button } from "antd"; import "./list.css"; class UserList extends Component { - constructor(props) { - super(props); - } - render() { - const { users, userClass, current_user } = this.props; - const renderList = () => { - if (users && users.length > 0) { - return users.map((item, key) => { - return ( -
-
+ renderList = (users, userClass, current_user) => { + if (users && users.length > 0) { + return users.map((item, key) => { + return ( +
+
+
+ + + +
+
-
- -
- - 加入时间:{item.format_time} -
- { - current_user && current_user.login === item.login ? - - : - - } +
+ + 加入时间:{item.format_time}
+ { + current_user && current_user.login === item.login ? + + : + + }
- ); - }); - } - }; +
+ ); + }); + } + } + render() { + const { users, userClass, current_user } = this.props; + return ( - renderList() + this.renderList(users, userClass, current_user) ); } } diff --git a/src/forge/UsersList/watch_users.js b/src/forge/UsersList/watch_users.js index 7817d639a..da4a1d7ab 100644 --- a/src/forge/UsersList/watch_users.js +++ b/src/forge/UsersList/watch_users.js @@ -20,12 +20,10 @@ class WatchUsers extends Component { render() { const { projectId } = this.state; - console.log("watcher_users", this.props.current_user) return (
{projectId && }
- ); } } diff --git a/src/forge/Version/version.js b/src/forge/Version/version.js index 081918d54..dc5dc4931 100644 --- a/src/forge/Version/version.js +++ b/src/forge/Version/version.js @@ -55,55 +55,56 @@ class version extends Component { }) } + renderList = (releases) => { + const { projectsId } = this.props.match.params; + if (releases && releases.length > 0) { + return ( +
+ { + releases.map((item, key) => { + return ( +
+ + {item.draft} + {item.created_at} + + + {item.tag_name} + + +
+ + {item.name} + (编辑) + + + this.showBody(key,item.bodyshow)}> + {item.user_name}:发布了这个版本,并在发布后提交给{item.target_commitish} + + { + item.bodyshow &&

{item.body}

+ } +

+ TAR + ZIP +

+
+
+ ) + }) + } +
+ ) + } else { + return ( + + ) + } + } + render() { const { projectsId } = this.props.match.params; const { data , releases } = this.state - const renderList = () => { - if (releases && releases.length > 0) { - return ( -
- { - releases.map((item, key) => { - return ( -
- - {item.draft} - {item.created_at} - - - {item.tag_name} - - -
- - {item.name} - (编辑) - - - this.showBody(key,item.bodyshow)}> - {item.user_name}:发布了这个版本,并在发布后提交给{item.target_commitish} - - { - item.bodyshow &&

{item.body}

- } -

- {/* {item.commit_id} */} - TAR - ZIP -

-
-
- ) - }) - } -
- ) - } else { - return ( - - ) - } - } return (
@@ -116,7 +117,7 @@ class version extends Component { }
- {renderList()} + {this.renderList(releases)}
diff --git a/src/forge/users/InfosUser.js b/src/forge/users/InfosUser.js index 7197bef32..88be56556 100644 --- a/src/forge/users/InfosUser.js +++ b/src/forge/users/InfosUser.js @@ -99,147 +99,147 @@ class InfosUser extends Component { }) this.get_projects(is_public); } + menu =()=> ( + + 更新时间排序 + 创建时间排序 + fork数据排序 + 点赞数量排序 + + ); + + newItem =()=> ( + + + 新建镜像项目 + + + 新建托管项目 + + + ); + + category_button=(category)=>{ + const { current_user, user } = this.props; + const button_lists = + user && current_user && user.login === current_user.login + ? [ + { type: undefined, name: "所有" }, + { type: "manage", name: "我创建的" }, + { type: "join", name: "我参与的" }, + { type: "watched", name: "我关注的" }, + { type: "forked", name: "我Fork的" }, + ] + : + [ + { type: undefined, name: "所有" }, + { type: "manage", name: "TA创建的" }, + { type: "join", name: "TA参与的" }, + { type: "watched", name: "TA关注的" }, + { type: "forked", name: "TAFork的" }, + ]; + + let list = button_lists.map((item, key) => { + return ( + + + + ); + }) + return list; + } render() { const { current_user, user } = this.props; const { category , is_public } = this.state; - const menu = ( - - 更新时间排序 - 创建时间排序 - fork数据排序 - 点赞数量排序 - - ); - const newItem = ( - - - 新建镜像项目 - - - 新建托管项目 - - - ); - const button_lists = - user && current_user && user.login === current_user.login - ? [ - { type: undefined, name: "所有" }, - { type: "manage", name: "我创建的" }, - { type: "join", name: "我参与的" }, - { type: "watched", name: "我关注的" }, - { type: "forked", name: "我Fork的" }, - // { type: "public", name: "公开的" }, - // { type: "private", name: "私有的" }, - ] - : [ - { type: undefined, name: "所有" }, - { type: "manage", name: "TA创建的" }, - { type: "join", name: "TA参与的" }, - { type: "watched", name: "TA关注的" }, - { type: "forked", name: "TAFork的" }, - // { type: "public", name: "公开的" }, - ]; - - const category_button = button_lists.map((item, key) => { - return ( - - - - ); - }); - const { projectsList, isSpin, total, search, limit, page } = this.state; - const pagination = - total && total > limit ? ( -
- -
- ) : ( - "" - ); - return (
- -
- {current_user && user && current_user.login === user.login && ( - - - - 新建 - - - - )} - - + +
+ {current_user && user && current_user.login === user.login && ( + - 排序 + 新建 -
-
-
-
{category_button}
- { - user && current_user && user.login === current_user.login ? -

- this.changeStatus("public")}>公有 - this.changeStatus("private")}>私有 -

- :"" - } -
+ )} - {projectsList && projectsList.length > 0 ? ( - +
+
+
{this.category_button(category)}
+ { + user && current_user && user.login === current_user.login ? +

+ this.changeStatus("public")}>公有 + this.changeStatus("private")}>私有 +

+ :"" + } +
+ + {projectsList && projectsList.length > 0 ? ( + + ) : ( + + )} + { + total && total > limit ? ( +
+
) : ( - - )} - {pagination} + "" + ) + }
); } diff --git a/src/forge/users/fan_users.js b/src/forge/users/fan_users.js index b487a687a..cf93cdb41 100644 --- a/src/forge/users/fan_users.js +++ b/src/forge/users/fan_users.js @@ -1,20 +1,13 @@ import React, { Component } from "react"; -// import { Input, Spin, Pagination } from "antd"; import CommonLists from "./common_lists" class FanUsers extends Component { - constructor(props) { - super(props); - this.state = { - - }; - } render() { const {user, current_user} = this.props return (
- {user && user.login && } -
+ {user && user.login && } +
); } } diff --git a/src/forge/users/undo_events.js b/src/forge/users/undo_events.js index e414a4f87..cea2792a9 100644 --- a/src/forge/users/undo_events.js +++ b/src/forge/users/undo_events.js @@ -1,11 +1,6 @@ import React, { Component } from "react"; import Nodata from "../Nodata"; class UndoEvents extends Component { - constructor(props) { - super(props); - this.state = { - }; - } render() { return ( diff --git a/src/forge/users/watch_users.js b/src/forge/users/watch_users.js index 624c2b046..8f40834ae 100644 --- a/src/forge/users/watch_users.js +++ b/src/forge/users/watch_users.js @@ -1,13 +1,6 @@ import React, { Component } from "react"; import CommonLists from "./common_lists" class WatcherUsers extends Component { - constructor(props) { - super(props); - this.state = { - - }; - } - render() { const {user, current_user} = this.props return (