路由、分支

This commit is contained in:
caicai8 2020-03-20 16:49:41 +08:00
parent 7dbcdd7b77
commit 44366b8a26
38 changed files with 252 additions and 172 deletions

View File

@ -27,13 +27,13 @@ const ARRAY = [
name:'1个月'
}
]
const dataformat="YYYY-MM-DD HH:mm";
// const dataformat="YYYY-MM-DD HH:mm";
class Activity extends Component{
constructor(props){
super(props);
this.state={
time:'1',
time:'30',
type:undefined,
state:undefined,
page:1,
@ -105,6 +105,9 @@ class Activity extends Component{
</Menu>
);
let name = time && ARRAY.filter(item=>item.id === parseInt(time)) ;
// console.log(name);
const second_per = (parseInt(data && data.close_issues_count)/parseInt(data && data.issues_count)*100)+'%';
@ -155,7 +158,7 @@ class Activity extends Component{
<span className="color-grey-9 mr3">周期:</span>
<Dropdown overlay={menu} trigger={['click']} placement="bottomLeft">
<a className="ant-dropdown-link">
{time} <Icon type="down" />
{name && name.length>0 && name[0].name} <Icon type="down" />
</a>
</Dropdown>
</div>

View File

@ -6,7 +6,7 @@ import { getImageUrl } from 'educoder';
class ActivityItem extends Component{
render(){
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const { item } = this.props;
return(
<div className="activity_item">
@ -14,20 +14,20 @@ class ActivityItem extends Component{
{/* 如果是版本发布 */}
{ item.trend_type==="VersionRelease"? 
<p className="itemLine">
<Link to={`/projects/${projectsId}/version`} className="color-blue font-16">{item.name}</Link>
<Link to={`/projects/${projectsId}/${author}/version`} className="color-blue font-16">{item.name}</Link>
<span className="activity_type">{item.trend_type}</span>
</p >
:
// 如果是工单
item.trend_type==="Issue"?
<p className="itemLine">
<Link to={`/projects/${projectsId}/orders/${item.trend_id}/detail`} className="color-blue font-16">{item.name}</Link>
<Link to={`/projects/${projectsId}/${author}/orders/${item.trend_id}/detail`} className="color-blue font-16">{item.name}</Link>
<span className="activity_type">{item.trend_type}</span>
</p >
:
// 如果是合并请求
<p className="itemLine">
<Link to={`/projects/${projectsId}/merge/${item.trend_id}/Messagecount`} className="color-blue font-16">{item.name}</Link>
<Link to={`/projects/${projectsId}/${author}/merge/${item.trend_id}/Messagecount`} className="color-blue font-16">{item.name}</Link>
<span className="activity_type">{item.trend_type}</span>
</p >
}

View File

@ -4,27 +4,86 @@ import { Dropdown , Icon , Menu } from 'antd';
import "./branch.css"
class SelectBranch extends Component{
constructor(props){
super(props);
this.state={
visible:false,
value:undefined
}
}
componentDidMount() {
document.body.addEventListener('click', e => {
if (e.target && (e.target.matches('#m-btn') || e.target.matches("#input-btn")|| e.target.matches("#ul-btn"))) {
return;
}
this.setState({
visible:false,
value:undefined
})
});
}
ChangeVisible=(visible)=>{
this.setState({
visible:!visible
})
}
InputClick=(e)=>{
this.stopPropagations(e);
}
stopPropagations=(e)=>{
e.stopPropagation();
}
// 输入搜索内容
changeValue=(e)=>{
this.setState({
value:e.target.value
})
}
// 选择分支
changeBranch=(value)=>{
const { changeBranch } = this.props;
this.setState({
visible:false,
value:undefined
})
changeBranch && changeBranch(value);
}
render(){
const { branchs , branch , changeBranch } = this.props;
const { visible , value } = this.state;
const { branchs , branch } = this.props;
let branchsFilter = value ? (branchs && branchs.length>0 && branchs.filter(item=>item.name.indexOf(value)>-1)):branchs;
const menu = (
<Menu>
<div className="branchOptions" id="m-btn" onClick={this.stopPropagations}>
<input placeholder="请输入分支名称进行搜索" id="input-btn" value={value} className="OptionsInput" onChange={this.changeValue} onClick={this.InputClick}/>
<ul className="OptionsUl" id="ul-btn">
{
branchs && branchs.map((item,key)=>{
branchsFilter && branchsFilter.map((item,key)=>{
return(
<Menu.Item key={item.index} onClick={(value)=>changeBranch(value)}>{item.name}</Menu.Item>
<li key={key}><a className="task-hide" onClick={()=>this.changeBranch(item.name)}>{item.name}</a></li>
// <Menu.Item key={item.index} onClick={(value)=>changeBranch(value)}>{item.name}</Menu.Item>
)
})
}
</Menu>
</ul>
</div>
);
return(
<div className="branchDropdown f-wrap-alignCenter">
<div className="branchDropdown f-wrap-alignCenter" onClick={()=>this.ChangeVisible(visible)}>
<Dropdown overlay={menu} trigger={['click']} placement="bottomLeft" visible={visible}>
<span>
<span className="color-grey-9 mr3"><i className="iconfont icon-fenzhi font-20 color-grey-6 mr3"></i>:</span>
<Dropdown overlay={menu} trigger={['click']} placement="bottomLeft">
<a className="ant-dropdown-link">
{branch} <Icon type="down" />
</a>
</span>
</Dropdown>
</div>
)

View File

@ -7,3 +7,30 @@
height: 35px;
line-height: 35px;
}
.branchOptions{
width: 200px;
padding:10px;
box-shadow: 0px 0px 1px 1px rgba(134, 134, 134, 0.1);
border-radius: 3px;
background: #fff;
max-height: 200px;
}
.OptionsUl{
max-height: 100px;
overflow-y: auto;
}
.OptionsUl li{
height: 22px;
line-height: 22px;
cursor: pointer;;
}
.OptionsUl li a{
display: block;
padding-left: 2px;
}
.OptionsInput{
height: 32px;
padding-left: 4px;
line-height: 32px;
width: 100%;
}

View File

@ -68,7 +68,7 @@ class Index extends Component{
(props) => (<ProjectNew {...this.props} {...props} {...this.state} current_user={current_user}/>)
}
></Route>
<Route path="/projects/:projectsId"
<Route path="/projects/:projectsId/:author"
render={
(props) => (<ProjectDetail {...this.props} {...props} {...this.state} current_user={current_user}/>)
}

View File

@ -16,7 +16,7 @@ class CoderRootBranch extends Component {
render(){
const { branchList, projectDetail } = this.props;
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const list =()=>{
if(branchList && branchList.length>0){
return(
@ -29,7 +29,7 @@ class CoderRootBranch extends Component {
return(
<li>
<div>
<Link to={`/projects/${projectsId}/coder?branch=${item.name}`} className="color-blue font-15" style={{"maxWidth":"100px"}}>{item.name}</Link>
<Link to={`/projects/${projectsId}/${author}/coder?branch=${item.name}`} className="color-blue font-15" style={{"maxWidth":"100px"}}>{item.name}</Link>
{/*<span className="color-blue font-15">{item.name}</span>*/}
<p className="f-wrap-alignCenter">
<span className="mr5 color-blue">{item.last_commit && item.last_commit.id}</span>
@ -39,7 +39,7 @@ class CoderRootBranch extends Component {
</p>
</div>
<span>
<Link to={`/projects/${projectsId}/merge/new`} className="mr20 operationBtn">创建合并请求</Link>
<Link to={`/projects/${projectsId}/${author}/merge/new`} className="mr20 operationBtn">创建合并请求</Link>
<Dropdown overlay={menu(item.zip_url,item.tar_url)} trigger={['click']} placement="bottomRight" className="operationBtn">
<a className="ant-dropdown-link">

View File

@ -61,7 +61,7 @@ class CoderRootCommit extends Component{
// 切换分支
changeBranch=(value)=>{
const { branchList } = this.props;
let branchLastCommit = branchList[parseInt(value.key)];
let branchLastCommit = branchList && branchList.filter(item=>item.name === value)[0];
const { page , limit } = this.state;
this.setState({

View File

@ -200,11 +200,11 @@ class CoderRootDirectory extends Component{
changeBranch=(value)=>{
const { branchList } = this.props;
let branchLastCommit = branchList && branchList.length >0 && branchList[parseInt(value.key)];
let branchLastCommit = branchList && branchList.length >0 && branchList.filter(item=>item.name === value)[0];
this.setState({
branch:branchLastCommit.name,
branch:branchLastCommit && branchLastCommit.name,
branchLastCommit,
http_url:branchLastCommit.http_url,
http_url:branchLastCommit && branchLastCommit.http_url,
isSpin: true
})
this.getProjectRoot(branchLastCommit.name);
@ -213,7 +213,7 @@ class CoderRootDirectory extends Component{
render(){
const { rootList , branch ,filePath , fileDetail , subFileType , readMeContent, isSpin , rootData } = this.state;
const { branchLastCommit , http_url , isManager , isDeveloper } = this.props;
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const columns = [
{
@ -299,7 +299,7 @@ class CoderRootDirectory extends Component{
{
subFileType !== "file" && isManager && isDeveloper &&
<p className="addFile">
<Link to={`/projects/${projectsId}/coder/${branch}/newfile${urlRoot}`} >新建文件</Link>
<Link to={`/projects/${projectsId}/${author}/coder/${branch}/newfile${urlRoot}`} >新建文件</Link>
<Link to={``}>上传文件</Link>
</p>
}

View File

@ -51,6 +51,7 @@ class CoderRootFileDetail extends Component{
deleteFile=()=>{
const { author , branch , detail }= this.props;
const { projectsId } = this.props.match.params;
const authorLogin = this.props.match.params.author;
const url = `/${author.login}/${projectsId}/contents/files/delete.json`;
axios.delete(url,{
@ -61,7 +62,7 @@ class CoderRootFileDetail extends Component{
}).then(result=>{
if(result){
this.props.showNotification("删除成功!");
this.props.history.push(`/projects/${projectsId}`);
this.props.history.push(`/projects/${projectsId}/${authorLogin}`);
}
}).catch(error=>{
console.log(error);

View File

@ -28,22 +28,22 @@ class CoderRootIndex extends Component{
return(
<div className="main">
<Switch {...this.props}>
<Route path="/projects/:projectsId/coder/commit"
<Route path="/projects/:projectsId/:author/coder/commit"
render={
(props) => (<CoderRootCommit {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/projects/:projectsId/coder/branch"
<Route path="/projects/:projectsId/:author/coder/branch"
render={
(props) => (<CoderRootBranch {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/projects/:projectsId/coder"
<Route path="/projects/:projectsId/:author/coder"
render={
(props) => (<CoderRootDirectory {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/projects/:projectsId"
<Route path="/projects/:projectsId/:author"
render={
(props) => (<CoderRootDirectory {...this.props} {...props} {...this.state} />)
}

View File

@ -172,11 +172,8 @@ class Detail extends Component{
// }
getDetail=()=>{
console.log("state",this.props)
const { state } = this.props.history.location;
const { current_user } = this.props
const { projectsId } = this.props.match.params;
const url = `/${state ? state : current_user && current_user.login}/${projectsId}.json`;
const { projectsId , author } = this.props.match.params;
const url = `/${author}/${projectsId}.json`;
axios.get(url).then((result)=>{
if(result){
this.setState({
@ -253,11 +250,12 @@ class Detail extends Component{
// fork项目
forkFunc=()=>{
const { author } = this.props.match.params;
const { project_id } = this.state;
const url = `/projects/${project_id}/forks.json`;
axios.post(url).then(result=>{
if(result && result.data.status === 0){
this.props.history.push(`/projects/${result.data.identifier}/coder`);
this.props.history.push(`/projects/${result.data.identifier}/${author}/coder`);
}else{
this.props.showNotification(result.data.message);
}
@ -293,7 +291,7 @@ class Detail extends Component{
const url = this.props.history.location.pathname;
const urlFlag = (url.split("/").length === 3);
const { isManager , isDeveloper } = this.props;
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const { state } = this.props.history.location;
return(
@ -305,20 +303,20 @@ class Detail extends Component{
{projectDetail && projectDetail.author && projectDetail.author.name}
<span className="ml5 mr5">/</span>
<span className="hide-1 flex-1">
<Link to={`/projects/${projectsId}/coder`} className="color-white">{ projectDetail && projectDetail.identifier }</Link>
<Link to={`/projects/${projectsId}/${author}/coder`} className="color-white">{ projectDetail && projectDetail.identifier }</Link>
</span>
</p>
</div>
<div className="f-wrap-between">
<ul className="headerMenu-wrapper">
<li className={(url.indexOf("coder")>0 || urlFlag)? "active" : ""}><Link to={{pathname:`/projects/${projectsId}/coder`,state}}><img alt="" src={img_1} width="18" />代码</Link></li>
<li className={url.indexOf("orders")>0 ? "active" : ""}><Link to={{pathname:`/projects/${projectsId}/orders`,state}}><img alt="" src={img_2} width="12" />工单{projectDetail&&projectDetail.issues_count===0?"":projectDetail&&projectDetail.issues_count===0?projectDetail.issues_count:""}</Link></li>
<li className={url.indexOf("merge")>0 ? "active" : ""}><Link to={{pathname:`/projects/${projectsId}/merge`,state}}><img alt="" src={img_3} width="13" />合并请求{projectDetail&&projectDetail.pull_requests_count===0?"":projectDetail&&projectDetail.pull_requests_count===0?projectDetail.pull_requests_count:""}</Link></li>
<li className={url.indexOf("version")>0 ? "active" : ""}><Link to={{pathname:`/projects/${projectsId}/version`,state}}><img alt="" src={img_4} width="16" />版本发布</Link></li>
<li className={url.indexOf("trends")>0 ? "active" : ""}><Link to={{pathname:`/projects/${projectsId}/trends`,state}}><img alt="" src={img_6} width="16" />动态</Link></li>
<li className={(url.indexOf("coder")>0 || urlFlag)? "active" : ""}><Link to={{pathname:`/projects/${projectsId}/${author}/coder`,state}}><img alt="" src={img_1} width="18" />代码</Link></li>
<li className={url.indexOf("orders")>0 ? "active" : ""}><Link to={{pathname:`/projects/${projectsId}/${author}/orders`,state}}><img alt="" src={img_2} width="12" />工单{projectDetail&&projectDetail.issues_count===0?"":projectDetail&&projectDetail.issues_count===0?projectDetail.issues_count:""}</Link></li>
<li className={url.indexOf("merge")>0 ? "active" : ""}><Link to={{pathname:`/projects/${projectsId}/${author}/merge`,state}}><img alt="" src={img_3} width="13" />合并请求{projectDetail&&projectDetail.pull_requests_count===0?"":projectDetail&&projectDetail.pull_requests_count===0?projectDetail.pull_requests_count:""}</Link></li>
<li className={url.indexOf("version")>0 ? "active" : ""}><Link to={{pathname:`/projects/${projectsId}/${author}/version`,state}}><img alt="" src={img_4} width="16" />版本发布</Link></li>
<li className={url.indexOf("trends")>0 ? "active" : ""}><Link to={{pathname:`/projects/${projectsId}/${author}/trends`,state}}><img alt="" src={img_6} width="16" />动态</Link></li>
{
isManager &&
<li className={url.indexOf("setting")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/setting`}><img alt="" src={img_7} width="19" />仓库设置</Link></li>
<li className={url.indexOf("setting")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/${author}/setting`}><img alt="" src={img_7} width="19" />仓库设置</Link></li>
}
</ul>
<span className="df">
@ -348,55 +346,55 @@ class Detail extends Component{
<Switch {...this.props}>
{/* 新建文件 */}
<Route path="/projects/:projectsId/coder/:branch/newfile/:path"
<Route path="/projects/:projectsId/:author/coder/:branch/newfile/:path"
render={
(props) => (<FileNew {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId/coder/:branch/newfile"
<Route path="/projects/:projectsId/:author/coder/:branch/newfile"
render={
(props) => (<FileNew {...this.props} {...props} {...this.state}/>)
}
></Route>
{/* 标签列表 */}
<Route path="/projects/:projectsId/orders/tags"
<Route path="/projects/:projectsId/:author/orders/tags"
render={
(props) => (<TagList {...this.props} {...props} {...this.state}/>)
}
></Route>
{/* 仓库设置 */}
<Route path="/projects/:projectsId/setting"
<Route path="/projects/:projectsId/:author/setting"
render={
(props) => (<Setting {...this.props} {...props} {...this.state} getDetail={this.getDetail}/>)
}
></Route>
{/* 工单详情 */}
<Route path="/projects/:projectsId/orders/:orderId/detail"
<Route path="/projects/:projectsId/:author/orders/:orderId/detail"
render={
(props) => (<OrderDetail {...this.props} {...props} {...this.state}/>)
}
></Route>
{/* 里程碑 */}
<Route path="/projects/:projectsId/orders/Milepost"
<Route path="/projects/:projectsId/:author/orders/Milepost"
render={
(props) => (<OrderMilepost {...this.props} {...props} {...this.state}/>)
}
></Route>
{/* 新建里程碑 */}
<Route path="/projects/:projectsId/orders/meilpost"
<Route path="/projects/:projectsId/:author/orders/meilpost"
render={
(props) => (<OrdernewMilepost {...this.props} {...props} {...this.state}/>)
}
></Route>
{/*里程碑详情*/ }
<Route path="/projects/:projectsId/orders/:meilid/MilepostDetail"
<Route path="/projects/:projectsId/:author/orders/:meilid/MilepostDetail"
render={
(props) => (<MilepostDetail {...this.props} {...props} {...this.state}/>)
}
></Route>
{/*修改里程碑*/}
<Route path="/projects/:projectsId/orders/:meilid/meilpost"
<Route path="/projects/:projectsId/:author/orders/:meilid/meilpost"
render={
(props) => (<OrderupdateMilepost {...this.props} {...props} {...this.state}/>)
}
@ -405,28 +403,28 @@ class Detail extends Component{
{/* 新建工单 */}
<Route path="/projects/:projectsId/orders/new"
<Route path="/projects/:projectsId/:author/orders/new"
render={
(props) => (<OrderNew {...this.props} {...props} {...this.state}/>)
}
></Route>
{/* 修改详情 */}
<Route path="/projects/:projectsId/orders/:orderId/updatedetail"
<Route path="/projects/:projectsId/:author/orders/:orderId/updatedetail"
render={
(props) => (<OrderupdateDetail {...this.props} {...props} {...this.state}/>)
}
></Route>
{/* 复制详情 */}
<Route path="/projects/:projectsId/orders/:orderId/copyetail"
<Route path="/projects/:projectsId/:author/orders/:orderId/copyetail"
render={
(props) => (<OrdercopyDetail {...this.props} {...props} {...this.state}/>)
}
></Route>
{/* 动态 */}
<Route path="/projects/:projectsId/trends"
<Route path="/projects/:projectsId/:author/trends"
render={
(props) => (<TrendsIndex {...this.props} {...props} {...this.state}/>)
}
@ -434,66 +432,66 @@ class Detail extends Component{
{/* 代码Index */}
<Route path="/projects/:projectsId/orders"
<Route path="/projects/:projectsId/:author/orders"
render={
(props) => (<OrderIndex {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId/merge/new"
<Route path="/projects/:projectsId/:author/merge/new"
render={
(props) => (<CreateMerge {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId/merge/:mergeId/UpdateMerge"
<Route path="/projects/:projectsId/:author/merge/:mergeId/UpdateMerge"
render={
(props) => (<UpdateMerge {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId/merge/:mergeId/Messagecount"
<Route path="/projects/:projectsId/:author/merge/:mergeId/Messagecount"
render={
(props) => (<MessageCount {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId/merge/:mergeId/MergeSubmit"
<Route path="/projects/:projectsId/:author/merge/:mergeId/MergeSubmit"
render={
(props) => (<MergeSubmit {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId/version/new"
<Route path="/projects/:projectsId/:author/version/new"
render={
(props) => (<NewVersionIndex {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId/version/:versionId/upversion"
<Route path="/projects/:projectsId/:author/version/:versionId/upversion"
render={
(props) => (<UpVersionIndex {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId/version"
<Route path="/projects/:projectsId/:author/version"
render={
(props) => (<VersionIndex {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId/merge"
<Route path="/projects/:projectsId/:author/merge"
render={
(props) => (<MergeIndexDetail {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId/coder"
<Route path="/projects/:projectsId/:author/coder"
render={
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state}/>)
}
></Route>
<Route path="/projects/:projectsId"
<Route path="/projects/:projectsId/:author"
render={
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state}/>)
}

View File

@ -4,15 +4,15 @@ import { Link} from 'react-router-dom';
class DetailTop extends Component{
render(){
const { projectDetail } = this.props;
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const { pathname } = this.props.location;
return(
<p className="branch-wrapper">
<Link to={`/projects/${projectsId}/coder/commit`} className={ pathname.indexOf("/coder/commit") > 0 ? "active" : ""}>
<Link to={`/projects/${projectsId}/${author}/coder/commit`} className={ pathname.indexOf("/coder/commit") > 0 ? "active" : ""}>
<i className="iconfont icon-tijiaojilu font-18 mr3"></i>
<span className="mr3">{projectDetail && projectDetail.commits_count}</span>
</Link>
<Link to={`/projects/${projectsId}/coder/branch`} className={ pathname.indexOf("/coder/branch") > 0 ? "active" : ""}>
<Link to={`/projects/${projectsId}/${author}/coder/branch`} className={ pathname.indexOf("/coder/branch") > 0 ? "active" : ""}>
<i className="iconfont icon-fenzhi font-18 mr3"></i>
<span className="mr3">{projectDetail && projectDetail.branches_count}</span>
</Link>

View File

@ -25,7 +25,7 @@ class IndexItem extends Component{
<img className="p-r-photo" alt="" src={getImageUrl(`images/${item.author && item.author.image_url}`)} ></img>
<div className="p-r-Infos">
<div className="p-r-name">
<a onClick={()=>this.TurnToDetail(`${item.author && item.author.login}`,`/projects/${item.id}/coder`)} className="hide-1 font-16 color-grey-3" style={{whiteSpace:"wrap"}}>{item.name}</a>
<Link to={`/projects/${item.id}/${item.author && item.author.login}/coder`} className="hide-1 font-16 color-grey-3" style={{whiteSpace:"wrap"}}>{item.name}</Link>
</div>
<div className="p-r-content">
<p className="break_word task-hide flex1" style={{maxHeight:"40px"}}>{item.description}</p>

View File

@ -164,7 +164,7 @@ class MergeDetail extends Component{
})
}
render(){
const { projectsId,mergeid} = this.props.match.params;
const { projectsId , mergeid , author } = this.props.match.params;
const { data,journalsdata, showFiles } = this.state;
const { getFieldDecorator } = this.props.form;
const url = this.props.history.location.pathname;
@ -235,14 +235,14 @@ class MergeDetail extends Component{
<div className="main">
<div className="topWrapper">
<Nav {...this.props} {...this.state}/>
<Link to={`/projects/${projectsId}/merge/new`} className="topWrapper_btn">创建合并请求</Link>
<Link to={`/projects/${projectsId}/${author}/merge/new`} className="topWrapper_btn">创建合并请求</Link>
</div>
<div>
<div className="detailContent">
<p>
<span className="font-16" > { data && data.issue.subject}</span>
<div>
<Link to={`/projects/${projectsId}/merge/${mergeid}/updatemerge`} className="color-blue fr">编辑</Link>
<Link to={`/projects/${projectsId}/${author}/merge/${mergeid}/updatemerge`} className="color-blue fr">编辑</Link>
</div>
</p>
<p className="mt15">{ data && data.issue.description}</p>
@ -256,8 +256,8 @@ class MergeDetail extends Component{
<div className="detailHeader-wrapper">
<div className="normal f-wrap-between">
<ul className="headerMenu-wrapper">
<li className={url.indexOf("Messagecount")>0? "active" : ""}><Link to={`/projects/${projectsId}/merge/${mergeid}/Messagecount`}>对话内容</Link></li>
<li className={url.indexOf("MergeSubmit")>0 ? "active" : ""}><Link to={`projects/${projectsId}/merge/${mergeid}/MergeSubmit`}>代码提交</Link></li>
<li className={url.indexOf("Messagecount")>0? "active" : ""}><Link to={`/projects/${projectsId}/${author}/merge/${mergeid}/Messagecount`}>对话内容</Link></li>
<li className={url.indexOf("MergeSubmit")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/${author}/merge/${mergeid}/MergeSubmit`}>代码提交</Link></li>
</ul>
</div>
</div>

View File

@ -19,7 +19,7 @@ class MergeItem extends Component{
render(){
const { issues , search_count , page , limit } = this.props;
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const renderList =()=>{
if(issues && issues.length > 0){
return(
@ -29,7 +29,7 @@ class MergeItem extends Component{
<div className="flex-1">
<p className="mb15 df">
<span className="issueNo"># {search_count - (key + (page-1) * limit)}</span>
<Link to={`/projects/${projectsId}/merge/${item.pull_request_id}/Messagecount`} className="flex-1 hide-1 font-16 color-grey-3 lineh-30">{item.name}</Link>
<Link to={`/projects/${projectsId}/${author}/merge/${item.pull_request_id}/Messagecount`} className="flex-1 hide-1 font-16 color-grey-3 lineh-30">{item.name}</Link>
</p>
<p className="color-grey-6 font-12">
<span>{item.format_time}</span><span className="ml5"></span>

View File

@ -106,7 +106,7 @@ class MergeSubmit extends Component{
render(){
const { projectsId,mergeId} = this.props.match.params;
const { projectsId,mergeId , author} = this.props.match.params;
const { data,titledata} = this.state;
@ -159,7 +159,7 @@ class MergeSubmit extends Component{
<div className="main">
<div className="topWrapper">
<Nav {...this.props} {...this.state}/>
<Link to={`/projects/${projectsId}/merge/new`} className="topWrapper_btn">创建合并请求</Link>
<Link to={`/projects/${projectsId}/${author}/merge/new`} className="topWrapper_btn">创建合并请求</Link>
</div>
<div>
<div className="detailContent">
@ -179,7 +179,7 @@ class MergeSubmit extends Component{
{ data && data.issue.author_name} { data && data.issue.created_at }创建{ data && data.issue.journals_count && data.issue.journals_count > 0 ?` · ${data.issue.journals_count} 条评论`:""}
</span>
<span className="pull-right lineH32">
<Link to={`/projects/${projectsId}/merge/${mergeId}/UpdateMerge`} className="color-blue fr">编辑</Link>
<Link to={`/projects/${projectsId}/${author}/merge/${mergeId}/UpdateMerge`} className="color-blue fr">编辑</Link>
</span>
</p>
</div>
@ -188,8 +188,8 @@ class MergeSubmit extends Component{
<div className="detailHeader-wrapper">
<div className="normal f-wrap-between">
<ul className="headerMenu-wrapper" style={{paddingTop:42,paddingLeft:15}}>
<li className={url.indexOf("Messagecount")>0? "active" : ""}><Link to={`/projects/${projectsId}/merge/${mergeId}/Messagecount`}>对话内容</Link></li>
<li className={url.indexOf("MergeSubmit")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/merge/${mergeId}/MergeSubmit`}>代码提交</Link></li>
<li className={url.indexOf("Messagecount")>0? "active" : ""}><Link to={`/projects/${projectsId}/${author}/merge/${mergeId}/Messagecount`}>对话内容</Link></li>
<li className={url.indexOf("MergeSubmit")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/${author}/merge/${mergeId}/MergeSubmit`}>代码提交</Link></li>
</ul>
</div>
</div>

View File

@ -315,7 +315,7 @@ class MessageCount extends Component{
}
render(){
const { projectsId,mergeId} = this.props.match.params;
const { projectsId,mergeId , author } = this.props.match.params;
const { data,journalsdata, page, limit, search_count, isSpin, isedit, showFiles } = this.state;
const { getFieldDecorator } = this.props.form;
const { current_user } = this.props;
@ -411,7 +411,7 @@ class MessageCount extends Component{
<div className="main">
<div className="topWrapper">
<Nav {...this.props} {...this.state}/>
<Link to={`/projects/${projectsId}/merge/new`} className="topWrapper_btn">创建合并请求</Link>
<Link to={`/projects/${projectsId}/${author}/merge/new`} className="topWrapper_btn">创建合并请求</Link>
</div>
<div>
<div className="detailContent">
@ -431,7 +431,7 @@ class MessageCount extends Component{
{ data && data.issue.author_name} { data && data.issue.created_at }创建{ data && data.issue.journals_count && data.issue.journals_count > 0 ?` · ${data.issue.journals_count} 条评论`:""}
</span>
<span className="pull-right lineH32">
<Link to={`/projects/${projectsId}/merge/${mergeId}/UpdateMerge`} className="color-blue fr">编辑</Link>
<Link to={`/projects/${projectsId}/${author}/merge/${mergeId}/UpdateMerge`} className="color-blue fr">编辑</Link>
</span>
</p>
<div className="df mt20">
@ -445,8 +445,8 @@ class MessageCount extends Component{
<div className="detailHeader-wrapper">
<div className="normal f-wrap-between">
<ul className="headerMenu-wrapper" style={{paddingTop:42,paddingLeft:15}}>
<li className={url.indexOf("Messagecount")>0? "active" : ""}><Link to={`/projects/${projectsId}/merge/${mergeId}/Messagecount`}>对话内容</Link></li>
<li className={url.indexOf("MergeSubmit")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/merge/${mergeId}/MergeSubmit`}>代码提交</Link></li>
<li className={url.indexOf("Messagecount")>0? "active" : ""}><Link to={`/projects/${projectsId}/${author}/merge/${mergeId}/Messagecount`}>对话内容</Link></li>
<li className={url.indexOf("MergeSubmit")>0 ? "active" : ""}><Link to={`/projects/${projectsId}/${author}/merge/${mergeId}/MergeSubmit`}>代码提交</Link></li>
</ul>
</div>
</div>

View File

@ -139,7 +139,7 @@ class NewMerge extends Component{
submit=()=>{
this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const url = `/projects/${projectsId}/pull_requests.json`;
if(values.issue_tag_ids.length > 0){
@ -156,7 +156,7 @@ class NewMerge extends Component{
}).then(result=>{
if(result){
this.props.history.push(`/projects/${projectsId}/merge`);
this.props.history.push(`/projects/${projectsId}/${author}/merge`);
}
}).catch(error=>{
@ -224,7 +224,7 @@ class NewMerge extends Component{
render(){
const { getFieldDecorator } = this.props.form;
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const { current_user } = this.props;
const { issue_tag_ids , fixed_version_id ,assigned_to_id ,issue_chosen,data,titledata} = this.state;
@ -277,7 +277,7 @@ class NewMerge extends Component{
if(this.state.mergedata&&this.state.mergedata.status===-2){
return(
<div>
在这些分支直接合并请求已经存在<Link to={`/projects/${projectsId}/merge/${this.state.mergedata&&this.state.mergedata.pull_request_id}/Messagecount`} style={{color:'blue'}}>{this.state.mergedata&&this.state.mergedata.pull_request_name}</Link>
在这些分支直接合并请求已经存在<Link to={`/projects/${projectsId}/${author}/merge/${this.state.mergedata&&this.state.mergedata.pull_request_id}/Messagecount`} style={{color:'blue'}}>{this.state.mergedata&&this.state.mergedata.pull_request_name}</Link>
</div>
)
}else{

View File

@ -134,7 +134,7 @@ class UpdateMerge extends Component{
const { fileList } = this.state;
this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){
const { projectsId,mergeId} = this.props.match.params;
const { projectsId , mergeId , author } = this.props.match.params;
const { subject ,data} = this.state;
const url = `/projects/${projectsId}/pull_requests/${mergeId}.json`;
@ -155,7 +155,7 @@ class UpdateMerge extends Component{
...values
}).then(result=>{
if(result){
this.props.history.push(`/projects/${projectsId}/merge`);
this.props.history.push(`/projects/${projectsId}/${author}/merge`);
}
}).catch(error=>{
console.log(error);
@ -167,7 +167,7 @@ class UpdateMerge extends Component{
render(){
const { projectsId,mergeId } = this.props.match.params;
const { projectsId , mergeId , author } = 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,
@ -210,7 +210,7 @@ class UpdateMerge extends Component{
}
<p className="clearfix mt15 text-right">
<a className="topWrapper_btn fr" type="submit" style={{marginLeft:5}} onClick={this.handleSubmit}>保存</a>
<Link to={`/projects/${projectsId}/merge/${mergeId}/Messagecount`} className="a_btn cancel_btn fr">取消</Link>
<Link to={`/projects/${projectsId}/${author}/merge/${mergeId}/Messagecount`} className="a_btn cancel_btn fr">取消</Link>
</p>
</div>
</div>

View File

@ -225,7 +225,7 @@ class merge extends Component{
render(){
const { issue_chosen , issues , limit , page , search_count , data , isSpin,openselect,closeselect } = this.state;
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const menu = (
<Menu onClick={(e)=>this.arrayList(e)}>
@ -250,7 +250,7 @@ class merge extends Component{
<div className="main">
<div className="topWrapper">
<Nav {...this.props} {...this.state}/>
<Link to={`/projects/${projectsId}/merge/new`} className="topWrapper_btn">创建合并请求</Link>
<Link to={`/projects/${projectsId}/${author}/merge/new`} className="topWrapper_btn">创建合并请求</Link>
</div>
<div className="topWrapper" style={{borderBottom:"none"}}>
<p className="topWrapper_type">

View File

@ -114,7 +114,7 @@ class Index extends Component{
isSpin:false
})
this.props.showNotification(`${projectsType === "deposit" ? "托管" :"镜像"}项目创建成功!`);
this.props.history.push(`/projects/${result.data.identifier}/coder`);
this.props.history.push(`/projects/${result.data.identifier}/${current_user && current_user.login}/coder`);
}
}
}).catch((error)=>{

View File

@ -23,7 +23,7 @@ class UserSubmitComponent extends Component{
// 提交变更
subMitFrom=()=>{
const { current_user , filepath , content } = this.props;
const { branch , projectsId } = this.props.match.params;
const { branch , projectsId , author } = this.props.match.params;
const { submitType } = this.state;
let path = filepath.substr(1);
this.props.form.validateFieldsAndScroll((err, values) => {
@ -37,7 +37,7 @@ class UserSubmitComponent extends Component{
message:values.desc
}).then((result)=>{
if(result && result.data.name){
this.props.history.push(`/projects/${projectsId}/coder`);
this.props.history.push(`/projects/${projectsId}/${author}/coder`);
}
}).catch(error=>{
console.log(error);

View File

@ -109,7 +109,7 @@ class CopyDetail extends Component{
//删除工单
deleteorder=(id)=>{
const { projectsId , orderId} = this.props.match.params;
const { projectsId , orderId , author} = this.props.match.params;
const url = `/projects/${projectsId}/issues/${orderId}.json`;
axios.delete(url,{ data: {
project_id: projectsId,
@ -117,7 +117,7 @@ class CopyDetail extends Component{
}
}).then((result)=>{
if(result){
this.props.history.push(`/projects/${projectsId}/orders`);
this.props.history.push(`/projects/${projectsId}/${author}/orders`);
}
}).catch((error)=>{
console.log(error);
@ -157,9 +157,9 @@ class CopyDetail extends Component{
const { fileList } = this.state;
this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){
const { projectsId,orderId} = this.props.match.params;
const { projectsId , orderId , author } = this.props.match.params;
const { subject } = this.state;
const url = `/projects/${projectsId}/issues/${orderId}.json`;
const url = `/projects/${projectsId}/${author}/issues/${orderId}.json`;
if(values.issue_tag_ids===0){
values.issue_tag_ids = ""
}else{
@ -185,7 +185,7 @@ class CopyDetail extends Component{
...values
}).then(result=>{
if(result){
this.props.history.push(`/projects/${projectsId}/orders`);
this.props.history.push(`/projects/${projectsId}/${author}/orders`);
}
}).catch(error=>{
console.log(error);
@ -197,7 +197,7 @@ class CopyDetail extends Component{
render(){
const { projectsId,orderId } = this.props.match.params;
const { projectsId , orderId , author } = 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,
@ -259,7 +259,7 @@ class CopyDetail extends Component{
<p className="clearfix mt15 text-right">
<a className="topWrapper_btn fr" type="submit" style={{marginLeft: 5}}
onClick={this.handleSubmit}>保存</a>
<Link to={`/projects/${projectsId}/orders/${orderId}/detail`}
<Link to={`/projects/${projectsId}/${author}/orders/${orderId}/detail`}
className="a_btn cancel_btn fr">取消</Link>
</p>
</div>

View File

@ -144,7 +144,7 @@ class Detail extends Component{
//删除工单信息
deletedetail=(id)=>{
const { projectsId , orderId} = this.props.match.params;
const { projectsId , orderId , author } = this.props.match.params;
const url = `/projects/${projectsId}/issues/${orderId}.json`;
axios.delete(url,{ data: {
project_id: projectsId,
@ -152,7 +152,7 @@ class Detail extends Component{
}
}).then((result)=>{
if(result){
this.props.history.push(`/projects/${projectsId}/orders`);
this.props.history.push(`/projects/${projectsId}/${author}/orders`);
}
}).catch((error)=>{
console.log(error);
@ -269,14 +269,14 @@ class Detail extends Component{
//复制
copydetail=()=>{
const {projectsId,orderId} = this.props.match.params;
const {projectsId , orderId , author} = this.props.match.params;
const url = `/projects/${projectsId}/issues/${orderId}/copy.json`;
axios.post(url,{
project_id:projectsId,
id:orderId,
}).then(result=>{
if(result){
this.props.history.push(`/projects/${projectsId}/orders/${result.data.issue_id}/copyetail`);
this.props.history.push(`/projects/${projectsId}/${author}/orders/${result.data.issue_id}/copyetail`);
}
}).catch(error=>{
console.log(error);
@ -329,7 +329,7 @@ class Detail extends Component{
};
render(){
const { projectsId,orderId} = this.props.match.params;
const { projectsId , orderId , author} = this.props.match.params;
const { data,journalsdata, page, limit, search_count, isSpin, isedit, showFiles , quillValue , quillFlag } = this.state;
const { current_user } = this.props;
const Paginations = (
@ -422,7 +422,7 @@ class Detail extends Component{
<div className="main">
<div className="topWrapper">
<Nav {...this.props} {...this.state}/>
<Link to={`/projects/${projectsId}/orders/new`} className="topWrapper_btn">创建工单</Link>
<Link to={`/projects/${projectsId}/${author}/orders/new`} className="topWrapper_btn">创建工单</Link>
</div>
<div>
<div className="detailContent">
@ -449,7 +449,7 @@ class Detail extends Component{
<a className="color-blue fr" style={{marginLeft:20,marginRight:20}}>删除</a>
</Popconfirm>
<Link to={`/projects/${projectsId}/orders/${orderId}/updatedetail`} className="color-blue fr">编辑</Link>
<Link to={`/projects/${projectsId}/${author}/orders/${orderId}/updatedetail`} className="color-blue fr">编辑</Link>
</span>
:
""

View File

@ -146,7 +146,7 @@ class Milepost extends Component{
render(){
const { data , limit , page,openselect,closeselect } = this.state;
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const menu = (
<Menu onClick={this.arrayList}>
<Menu.Item key={'created_on'} value="desc">到期日从近到远</Menu.Item>
@ -181,7 +181,7 @@ class Milepost extends Component{
<div className="milepostwidth">
<div className="grid-item width100">
<i className="iconfont icon-lubiaosignpost3 font-12 mr3"></i>
<Link to={`/projects/${projectsId}/orders/${item.id}/MilepostDetail`} className="font-16">{item.name}</Link>
<Link to={`/projects/${projectsId}/${author}/orders/${item.id}/MilepostDetail`} className="font-16">{item.name}</Link>
</div>
</div>
@ -217,7 +217,7 @@ class Milepost extends Component{
<div className="milepostleft">
<div className="grid-item mr15 color-grey-9">
<i className="iconfont icon-bianji3 font-14 mr5"></i>
<Link to={`/projects/${projectsId}/orders/${item.id}/meilpost`} className="color-grey-9">编辑</Link>
<Link to={`/projects/${projectsId}/${author}/orders/${item.id}/meilpost`} className="color-grey-9">编辑</Link>
</div>
<div className="grid-item mr15 color-grey-9">
<i className="iconfont icon-yiguanbi1 font-14 mr5"></i>
@ -264,7 +264,7 @@ class Milepost extends Component{
<Nav {...this.props} {...this.state} />
{
data && data.user_admin_or_member ?
<Link to={`/projects/${projectsId}/orders/meilpost`} className="topWrapper_btn">新的里程碑</Link>
<Link to={`/projects/${projectsId}/${author}/orders/meilpost`} className="topWrapper_btn">新的里程碑</Link>
: ''
}

View File

@ -259,7 +259,7 @@ class MilepostDetail extends Component{
render(){
const { issue_chosen , issues , limit , page , search_count , data , isSpin,openselect,closeselect } = this.state;
const { projectsId,meilid } = this.props.match.params;
const { projectsId , meilid , author } = this.props.match.params;
const menu = (
<Menu onClick={(e)=>this.getOption(e)}>
@ -286,8 +286,8 @@ class MilepostDetail extends Component{
<div className="topmilepost">
<p>{data&&data.name}</p>
<div className="milepostdiv">
<Link to={`/projects/${projectsId}/orders/${meilid}/meilpost`} className="topWrapper_btn" style={{marginRight:15}} >编辑里程碑</Link>
<Link to={`/projects/${projectsId}/orders/new`} className="topWrapper_btn">创建工单</Link>
<Link to={`/projects/${projectsId}/${author}/orders/${meilid}/meilpost`} className="topWrapper_btn" style={{marginRight:15}} >编辑里程碑</Link>
<Link to={`/projects/${projectsId}/${author}/orders/new`} className="topWrapper_btn">创建工单</Link>
</div>
</div>
<div className="grid-item mr10">

View File

@ -10,11 +10,11 @@ class Nav extends Component{
}
render(){
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
return(
<p className="topWrapper_nav">
<NavLink activeClassName="active" className="issue-type-button" to={`/projects/${projectsId}/orders/tags`}>标签</NavLink>
<NavLink activeClassName="active" className="issue-type-button" to={`/projects/${projectsId}/orders/Milepost`}>里程碑</NavLink>
<NavLink activeClassName="active" className="issue-type-button" to={`/projects/${projectsId}/${author}/orders/tags`}>标签</NavLink>
<NavLink activeClassName="active" className="issue-type-button" to={`/projects/${projectsId}/${author}/orders/Milepost`}>里程碑</NavLink>
</p>
)

View File

@ -82,7 +82,7 @@ class New extends Component{
handleSubmit=()=>{
this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const { fileList } = this.state;
const url = `/projects/${projectsId}/issues.json`;
if(values.status_id==="新增"){
@ -112,7 +112,7 @@ class New extends Component{
}).then(result=>{
if(result){
this.props.showNotification("工单创建成功!");
this.props.history.push(`/projects/${projectsId}/orders`);
this.props.history.push(`/projects/${projectsId}/${author}/orders`);
}
}).catch(error=>{
console.log(error);

View File

@ -18,7 +18,7 @@ class OrderItem extends Component{
render(){
const { issues , search_count , page , limit } = this.props;
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const renderList =()=>{
if(issues && issues.length > 0){
@ -29,7 +29,7 @@ class OrderItem extends Component{
<div className="flex-1">
<p className="mb15 df">
<span className="issueNo"># {search_count - (key + (page-1) * limit)}</span>
<Link to={`/projects/${projectsId}/orders/${item.id}/detail`} className="flex-1 hide-1 font-16 color-grey-3 lineh-30">{item.name}</Link>
<Link to={`/projects/${projectsId}/${author}/orders/${item.id}/detail`} className="flex-1 hide-1 font-16 color-grey-3 lineh-30">{item.name}</Link>
</p>
<p className="color-grey-6 font-12">
<span>{item.format_time}</span><span className="ml5"></span>
@ -49,7 +49,7 @@ class OrderItem extends Component{
<li>{item.assign_user_name || "--"}</li>
<li>{item.priority || "--"}</li>
<li>{item.done_ratio || "--"}</li>
<li>{ item.journals_count ? <Link to={`/projects/${projectsId}/orders/${item.id}/detail`}><i className="iconfont icon-pinglun1 mr3 font-16"></i>{item.journals_count}</Link> : "" }</li>
<li>{ item.journals_count ? <Link to={`/projects/${projectsId}/${author}/orders/${item.id}/detail`}><i className="iconfont icon-pinglun1 mr3 font-16"></i>{item.journals_count}</Link> : "" }</li>
</ul>
</div>
)

View File

@ -146,7 +146,7 @@ class UpdateDetail extends Component{
const { fileList } = this.state;
this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){
const { projectsId,orderId} = this.props.match.params;
const { projectsId , orderId , author } = this.props.match.params;
const { subject } = this.state;
const url = `/projects/${projectsId}/issues/${orderId}.json`;
@ -169,7 +169,7 @@ class UpdateDetail extends Component{
...values
}).then(result=>{
if(result){
this.props.history.push(`/projects/${projectsId}/orders`);
this.props.history.push(`/projects/${projectsId}/${author}/orders`);
}
}).catch(error=>{
console.log(error);
@ -181,7 +181,7 @@ class UpdateDetail extends Component{
render(){
const { projectsId,orderId } = this.props.match.params;
const { projectsId , orderId , author } = 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,
@ -231,7 +231,7 @@ class UpdateDetail extends Component{
}
<p className="clearfix mt15 text-right">
<a className="topWrapper_btn fr" type="submit" style={{marginLeft:5}} onClick={this.handleSubmit}>保存</a>
<Link to={`/projects/${projectsId}/orders/${orderId}/detail`} className="a_btn cancel_btn fr">取消</Link>
<Link to={`/projects/${projectsId}/${author}/orders/${orderId}/detail`} className="a_btn cancel_btn fr">取消</Link>
</p>
</div>
</div>

View File

@ -68,7 +68,7 @@ class UpdateMilepost extends Component{
submit=()=>{
this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const { meilid } = this.props.match.params;
const url = `/projects/${projectsId}/versions/${meilid}.json`;
let time=undefined;
@ -85,7 +85,7 @@ class UpdateMilepost extends Component{
status:'open'
}).then(result=>{
if(result){
this.props.history.push(`/projects/${projectsId}/orders/Milepost`);
this.props.history.push(`/projects/${projectsId}/${author}/orders/Milepost`);
}

View File

@ -40,7 +40,7 @@ class NewMilepost extends Component{
submit=()=>{
this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const url = `/projects/${projectsId}/versions`;
let time=undefined;
if(this.state.selectedValue===undefined){
@ -56,7 +56,7 @@ class NewMilepost extends Component{
status:'open'
}).then(result=>{
if(result){
this.props.history.push(`/projects/${projectsId}/orders/Milepost`);
this.props.history.push(`/projects/${projectsId}/${author}/orders/Milepost`);
}
}).catch(error=>{

View File

@ -311,7 +311,7 @@ class order extends Component{
render(){
const { issue_chosen , issues , limit , page , search_count , data , assigned_to_id , author_id , isSpin,openselect,closeselect } = this.state;
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const menu = (
<Menu onClick={(e)=>this.getOption(e)}>
@ -338,7 +338,7 @@ class order extends Component{
<Nav {...this.props} {...this.state}/>
{
data && data.user_admin_or_member ?
<Link to={`/projects/${projectsId}/orders/new`} className="topWrapper_btn">创建工单</Link>
<Link to={`/projects/${projectsId}/${author}/orders/new`} className="topWrapper_btn">创建工单</Link>
: ''
}

View File

@ -21,34 +21,28 @@ const Collaborator = Loadable({
})
class Index extends Component{
render(){
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
console.log(this.props);
const { pathname } = this.props.history.location;
const flag = (pathname === `/projects/${projectsId}/setting`);
const flag = (pathname === `/projects/${projectsId}/${author}/setting`);
return(
<div>
<ul className="settingNav">
<li className={flag?"active":""}><Link to={`/projects/${projectsId}/setting`}>仓库</Link></li>
<li className={pathname.indexOf('setting/collaborator')>-1?"active":""}><Link to={`/projects/${projectsId}/setting/collaborator`}>协作者</Link></li>
<li className={flag?"active":""}><Link to={`/projects/${projectsId}/${author}/setting`}>仓库</Link></li>
<li className={pathname.indexOf('setting/collaborator')>-1?"active":""}><Link to={`/projects/${projectsId}/${author}/setting/collaborator`}>协作者</Link></li>
{/* <li className={pathname.indexOf('setting/branch')>-1?"active":""}><Link to={`/projects/${projectsId}/setting/branch`}>分支列表</Link></li> */}
</ul>
<div className="main">
<Switch {...this.props}>
{/* 分支列表 */}
{/* <Route path="/projects/:projectsId/setting/branch"
render={
(props) => (<Branch {...this.props} {...props} {...this.state}/>)
}
></Route> */}
{/* 协作者 */}
<Route path="/projects/:projectsId/setting/collaborator"
<Route path="/projects/:projectsId/:author/collaborator"
render={
(props) => (<Collaborator {...this.props} {...props} {...this.state}/>)
}
></Route>
{/* 修改仓库信息 */}
<Route path="/projects/:projectsId/setting"
<Route path="/projects/:projectsId/:author/setting"
render={
(props) => (<Setting {...this.props} {...props} {...this.state}/>)
}

View File

@ -68,7 +68,7 @@ class NewVersion extends Component{
handleSubmit=(draft)=>{
this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const { pull,tag_name,ischeck} = this.state;
const url = `/projects/${projectsId}/version_releases.json`;
// if(values.issue_type==="普通"){
@ -82,7 +82,7 @@ class NewVersion extends Component{
target_commitish:pull,
}).then(result=>{
if(result){
this.props.history.push(`/projects/${projectsId}/version`);
this.props.history.push(`/projects/${projectsId}/${author}/version`);
}
}).catch(error=>{
console.log(error);

View File

@ -48,7 +48,7 @@ class NewVersion extends Component{
//delete
deleteversion=()=>{
const { projectsId , versionId} = this.props.match.params;
const { projectsId , versionId , author} = this.props.match.params;
const url = `/projects/${projectsId}/version_releases/${versionId}.json`;
axios.delete(url,{ data: {
project_id: projectsId,
@ -56,7 +56,7 @@ class NewVersion extends Component{
}
}).then((result)=>{
if(result){
this.props.history.push(`/projects/${projectsId}/version`);
this.props.history.push(`/projects/${projectsId}/${author}/version`);
}
}).catch((error)=>{
@ -68,7 +68,7 @@ class NewVersion extends Component{
handleSubmit=()=>{
this.props.form.validateFieldsAndScroll((err, values) => {
if(!err){
const { projectsId,versionId} = this.props.match.params;
const { projectsId , versionId , author } = this.props.match.params;
const { pull,ischeck } = this.state;
const url = `/projects/${projectsId}/version_releases/${versionId}.json`;
// if(values.issue_type==="普通"){
@ -82,7 +82,7 @@ class NewVersion extends Component{
target_commitish:pull
}).then(result=>{
if(result){
this.props.history.push(`/projects/${projectsId}/version`);
this.props.history.push(`/projects/${projectsId}/${author}/version`);
}
}).catch(error=>{
console.log(error);

View File

@ -65,7 +65,7 @@ class version extends Component{
render(){
const { projectsId } = this.props.match.params;
const { projectsId , author } = this.props.match.params;
const{data}=this.state
const renderList =()=>{
if(data && data.releases && data.releases.length>0 ){
@ -84,7 +84,7 @@ class version extends Component{
{
data && data.user_permission ?
<div className="versionrighe">
<h1 style={{marginLeft:15,marginTop:5}}>{item.name}<Link to={`/projects/${projectsId}/version/${item.version_id}/upversion`} style={{color:'blue',fontSize:10,marginLeft:5}}>(编辑)</Link> </h1>
<h1 style={{marginLeft:15,marginTop:5}}>{item.name}<Link to={`/projects/${projectsId}/${author}/version/${item.version_id}/upversion`} style={{color:'blue',fontSize:10,marginLeft:5}}>(编辑)</Link> </h1>
</div>
: ''
}
@ -145,7 +145,7 @@ class version extends Component{
<h1>版本发布</h1>
{
data && data.user_permission ?
<Link to={`/projects/${projectsId}/version/new`} className="topWrapper_btn">发布新版</Link>
<Link to={`/projects/${projectsId}/${author}/version/new`} className="topWrapper_btn">发布新版</Link>
: ''
}

View File

@ -878,8 +878,6 @@ submittojoinclass=(value)=>{
let headtypes='/';
// console.log("mygetHelmetapi2");
// console.log(mygetHelmetapi2);
if(mygetHelmetapi2) {
if (mygetHelmetapi2.navbar) {
if (mygetHelmetapi2.navbar.length > 0) {