issue修改
This commit is contained in:
parent
affbe87dfd
commit
5140bfbe77
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||
import { AlignCenter , AlignTop , FlexAJ } from '../Component/layout';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
function Releases({owner,projectsId,releaseVersions}){
|
||||
function Releases({owner,projectsId,releaseVersions , baseOperate}){
|
||||
|
||||
return(
|
||||
<div>
|
||||
|
@ -13,7 +13,7 @@ function Releases({owner,projectsId,releaseVersions}){
|
|||
{ releaseVersions && releaseVersions.total_count > 0 ?
|
||||
<Link className="font-12 color-grey-9" to={`/projects/${owner}/${projectsId}/releases`}>全部</Link>
|
||||
:
|
||||
<Link className="font-12 color-blue" to={`/projects/${owner}/${projectsId}/releases/new`}>新建</Link>
|
||||
baseOperate && <Link className="font-12 color-blue" to={`/projects/${owner}/${projectsId}/releases/new`}>新建</Link>
|
||||
}
|
||||
</FlexAJ>
|
||||
{
|
||||
|
|
|
@ -277,6 +277,7 @@ function CoderDepot(props){
|
|||
const mdFlag = n && n.substring(n.length-3,n.length) === ".md";
|
||||
|
||||
const { current_user } = props;
|
||||
const baseOperate = projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter";
|
||||
const fileOperate = type === "dir" && projectDetail && projectDetail.type !== 2 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin));
|
||||
return(
|
||||
<WhiteBack>
|
||||
|
@ -339,13 +340,16 @@ function CoderDepot(props){
|
|||
</AlignCenter>
|
||||
</AlignCenter>
|
||||
<AlignCenter>
|
||||
<div className="mr20 addOptionBtn">
|
||||
{
|
||||
projectDetail.type !== 2 &&
|
||||
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求</a>
|
||||
}
|
||||
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务</a>
|
||||
</div>
|
||||
{
|
||||
baseOperate &&
|
||||
<div className="mr20 addOptionBtn">
|
||||
{
|
||||
projectDetail.type !== 2 &&
|
||||
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求</a>
|
||||
}
|
||||
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务</a>
|
||||
</div>
|
||||
}
|
||||
{ fileOperate &&
|
||||
<Dropdown overlay={fileMenu()} className="mr20" trigger={['click']}>
|
||||
<Button type="default">文件 <i className="iconfont icon-sanjiaoxing-down ml3 font-14 color-grey-9"></i></Button>
|
||||
|
@ -370,7 +374,9 @@ function CoderDepot(props){
|
|||
{ hideBtn && <span className="ellipsis" onClick={()=>changeHide(hide)}><i className="iconfont icon-shenglvehao"></i></span> }
|
||||
|
||||
<span className="ml12 color-grey-9 mt3">{lastCommit && lastCommit.time_from_now}</span>
|
||||
{ commitCount ? <Link to={`/projects/${owner}/${projectsId}/commits`} className="ml12 color-grey-9"><i className="iconfont icon-tijiao mr3 font-17 color-grey-9"></i>{commitCount}次提交</Link>:"" }
|
||||
{ commitCount ? <Link to={`/projects/${owner}/${projectsId}/commits/branch/${turnbar(branchName || defaultBranch)}`} className="ml12 color-grey-9">
|
||||
<i className="iconfont icon-tijiao mr3 font-17 color-grey-9"></i>{commitCount}次提交
|
||||
</Link>:"" }
|
||||
</div>
|
||||
}
|
||||
<ul className="listtablebody">
|
||||
|
@ -472,7 +478,13 @@ function CoderDepot(props){
|
|||
projectDetail && projectDetail.release_versions &&
|
||||
<React.Fragment>
|
||||
<Divider />
|
||||
<Releases owner={owner} projectsId={projectsId} releaseVersions={projectDetail.release_versions} history={props.history}/>
|
||||
<Releases
|
||||
owner={owner}
|
||||
projectsId={projectsId}
|
||||
releaseVersions={projectDetail.release_versions}
|
||||
history={props.history}
|
||||
baseOperate={baseOperate}
|
||||
/>
|
||||
</React.Fragment>
|
||||
}
|
||||
{/* 贡献者 */}
|
||||
|
|
|
@ -17,7 +17,8 @@ export default ((props)=>{
|
|||
const [ isSpin , setIsSpin ] =useState(true);
|
||||
|
||||
const { projectsId , owner } = props.match.params;
|
||||
|
||||
const { isManager , isDeveloper} = props;
|
||||
console
|
||||
useEffect(()=>{
|
||||
getBranchs(projectsId, owner);
|
||||
},[projectsId])
|
||||
|
@ -46,7 +47,10 @@ export default ((props)=>{
|
|||
</p>
|
||||
</div>
|
||||
<span>
|
||||
<Link to={`/projects/${owner}/${projectsId}/pulls/new/${item.name}`} className="mr20 color-blue mr30">创建合并请求</Link>
|
||||
{
|
||||
(isManager || isDeveloper) &&
|
||||
<Link to={`/projects/${owner}/${projectsId}/pulls/new/${item.name}`} className="mr20 color-blue mr30">创建合并请求</Link>
|
||||
}
|
||||
<Dropdown overlay={menu(item.zip_url,item.tar_url)} trigger={['click']} placement="bottomRight" className="color-green-file">
|
||||
<a className="ant-dropdown-link">
|
||||
<Tooltip title={`下载分支${item.name}`}><Icon type="cloud-download" className="font-18"/></Tooltip>
|
||||
|
@ -70,6 +74,7 @@ export default ((props)=>{
|
|||
<Menu.Item key={'1'}><a href={tar_url}>TAR.GZ</a></Menu.Item>
|
||||
</Menu>
|
||||
)
|
||||
|
||||
return(
|
||||
<React.Fragment>
|
||||
<div className="main">
|
||||
|
|
|
@ -9,6 +9,12 @@ import Nodata from '../Nodata';
|
|||
import axios from 'axios';
|
||||
import {Link} from "react-router-dom";
|
||||
|
||||
function returnbar(str){
|
||||
if(str && str.length>0 && str.indexOf("%2F")>-1){
|
||||
return str.replaceAll('%2F','/');
|
||||
}
|
||||
return str;
|
||||
}
|
||||
class CoderRootCommit extends Component{
|
||||
constructor(props){
|
||||
super(props)
|
||||
|
@ -57,11 +63,12 @@ class CoderRootCommit extends Component{
|
|||
this.setState({
|
||||
isSpining:true
|
||||
})
|
||||
console.log(returnbar(branch));
|
||||
const { projectsId , owner } = this.props.match.params;
|
||||
const url = `/${owner}/${projectsId}/commits.json`;
|
||||
axios.get(url,{
|
||||
params:{
|
||||
sha:branch,
|
||||
sha:returnbar(branch),
|
||||
page,
|
||||
limit
|
||||
}
|
||||
|
@ -106,7 +113,7 @@ class CoderRootCommit extends Component{
|
|||
const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state;
|
||||
const { projectDetail, commit_class , defaultBranch } = this.props;
|
||||
const { projectsId , owner , branchName } = this.props.match.params;
|
||||
let branch = branchName || defaultBranch;
|
||||
let branch = returnbar(branchName || defaultBranch);
|
||||
return(
|
||||
<React.Fragment>
|
||||
<div className={"main"}style={{padding:"0px",border:"none"}}>
|
||||
|
|
|
@ -102,6 +102,11 @@ class CoderRootIndex extends Component{
|
|||
(props) => (<FileNew {...this.props} {...props} {...this.state} getTopCount={this.getTopCount} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/commits/branch/:branchName"
|
||||
render={
|
||||
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/projects/:owner/:projectsId/commits/:sha"
|
||||
render={
|
||||
(props) => (<Diff {...this.props} {...props} {...this.state}/>)
|
||||
|
|
|
@ -183,7 +183,7 @@ class MergeItem extends Component {
|
|||
) : (
|
||||
""
|
||||
)}
|
||||
{user_admin_or_member && item.pull_request_status !== 2 ? (
|
||||
{user_admin_or_member && item.pull_request_status === 0 ? (
|
||||
<div
|
||||
className="milepostleft"
|
||||
style={{
|
||||
|
|
|
@ -154,10 +154,10 @@ class Milepost extends Component {
|
|||
const { projectsId , owner } = this.props.match.params;
|
||||
const menu = (
|
||||
<Menu className="orderCondition" onClick={this.arrayList}>
|
||||
<Menu.Item key={'created_on'} value="desc">到期日从近到远</Menu.Item>
|
||||
<Menu.Item key={'created_on'} value="asc">到期日从远到近</Menu.Item>
|
||||
<Menu.Item key={'percent'} value="desc">完成度从低到高</Menu.Item>
|
||||
<Menu.Item key={'percent'} value="asc">完成度从高到低</Menu.Item>
|
||||
<Menu.Item key={'effective_date'} value="desc">到期日从近到远</Menu.Item>
|
||||
<Menu.Item key={'effective_date'} value="asc">到期日从远到近</Menu.Item>
|
||||
<Menu.Item key={'percent'} value="asc">完成度从低到高</Menu.Item>
|
||||
<Menu.Item key={'percent'} value="desc">完成度从高到低</Menu.Item>
|
||||
<Menu.Item key={'issues_count'} value="desc">任务从多到少</Menu.Item>
|
||||
<Menu.Item key={'issues_count'} value="asc">任务从少到多</Menu.Item>
|
||||
</Menu>
|
||||
|
|
|
@ -180,8 +180,8 @@ class UpdateMilepost extends Component {
|
|||
<Row type="flex" justify="space-between">
|
||||
<Col>
|
||||
<Group size="small" onChange={e => onTypeChange(e.target.value)} value={type}>
|
||||
<Button value="month">月份</Button>
|
||||
<Button value="year">年份</Button>
|
||||
<Button value="month">日期</Button>
|
||||
<Button value="year">月份</Button>
|
||||
</Group>
|
||||
</Col>
|
||||
<Col>
|
||||
|
|
|
@ -58,8 +58,12 @@ function CollaboratorMember({projectsId,owner,project_id,author,showNotification
|
|||
})
|
||||
.then((result) => {
|
||||
if (result) {
|
||||
setListData(result.data.members);
|
||||
setTotal(result.data.total_count);
|
||||
if(page > 1 && ( listData && listData.length === 1)){
|
||||
setPage(page-1);
|
||||
}else{
|
||||
setListData(result.data.members);
|
||||
setTotal(result.data.total_count);
|
||||
}
|
||||
setIsSpin(false);
|
||||
}
|
||||
})
|
||||
|
|
|
@ -58,6 +58,8 @@ class version extends Component {
|
|||
|
||||
renderList = (releases) => {
|
||||
const { projectsId , owner } = this.props.match.params;
|
||||
const { isManager , isDeveloper , isReporter } = this.props;
|
||||
console.log(isDeveloper,isManager,isReporter);
|
||||
if (releases && releases.length > 0) {
|
||||
return (
|
||||
releases.map((item, key) => {
|
||||
|
@ -74,7 +76,10 @@ class version extends Component {
|
|||
<div className="versionInfo_right">
|
||||
<span className="versionName">
|
||||
<span className="task-hide">{item.name}</span>
|
||||
<Link to={`/projects/${owner}/${projectsId}/releases/${item.version_id}/update`} className="color-blue ml3 font-12">(编辑)</Link>
|
||||
{
|
||||
(isManager || isDeveloper) &&
|
||||
<Link to={`/projects/${owner}/${projectsId}/releases/${item.version_id}/update`} className="color-blue ml3 font-12">(编辑)</Link>
|
||||
}
|
||||
</span>
|
||||
<span className="color-grey-3">
|
||||
<i className={`${item.bodyshow ? "iconfont icon-sanjiaoxing-down color-grey-8 mr3 font-14":"iconfont icon-triangle color-grey-8 mr3 font-14"}`} onClick={()=>this.showBody(key,item.bodyshow)}></i>
|
||||
|
@ -100,7 +105,7 @@ class version extends Component {
|
|||
|
||||
render() {
|
||||
const { projectsId ,owner } = this.props.match.params;
|
||||
const { data , releases , isSpin } = this.state
|
||||
const { data , releases , isSpin } = this.state;
|
||||
|
||||
return (
|
||||
<div className="main" style={{padding:"0px"}}>
|
||||
|
|
Loading…
Reference in New Issue