forked from Gitlink/forgeplus-react
Merge branch 'develop_new' into develop_educoder
This commit is contained in:
commit
93994cb785
|
@ -3,6 +3,7 @@ import { WhiteBack , Box , LongWidth , ShortWidth , Gap , AlignCenter , FlexAJ
|
||||||
import { Dropdown , Menu , Divider , Spin } from 'antd';
|
import { Dropdown , Menu , Divider , Spin } from 'antd';
|
||||||
import { getImageUrl } from "educoder";
|
import { getImageUrl } from "educoder";
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
import CloneAddress from '../Branch/CloneAddress';
|
||||||
|
|
||||||
import SelectBranch from '../Branch/Select';
|
import SelectBranch from '../Branch/Select';
|
||||||
import User from '../Component/User';
|
import User from '../Component/User';
|
||||||
|
@ -142,8 +143,8 @@ function CoderDepot(props){
|
||||||
// 文件相关的下拉项
|
// 文件相关的下拉项
|
||||||
const fileMenu =(
|
const fileMenu =(
|
||||||
<Menu>
|
<Menu>
|
||||||
<Menu.Item><Link to={`/projects/${owner}/${projectsId}/${branchName || (projectDetail && projectDetail.default_branch)}/uploadfile${treeValue === undefined ? "" : `/${treeValue}`}`}>上传文件</Link></Menu.Item>
|
<Menu.Item><a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/${branchName || (projectDetail && projectDetail.default_branch)}/uploadfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>上传文件</a></Menu.Item>
|
||||||
<Menu.Item><Link to={`/projects/${owner}/${projectsId}/${branchName || (projectDetail && projectDetail.default_branch)}/newfile${treeValue === undefined ? "" : `/${treeValue}`}`}>新建文件</Link></Menu.Item>
|
<Menu.Item><a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/${branchName || (projectDetail && projectDetail.default_branch)}/newfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>新建文件</a></Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -186,11 +187,26 @@ function CoderDepot(props){
|
||||||
setHide(!hide);
|
setHide(!hide);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function urlLink(link){
|
||||||
|
if(props.checkIfLogin()===false){
|
||||||
|
props.showLoginDialog()
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
props.history.push(link);
|
||||||
|
}
|
||||||
|
|
||||||
const downloadMenu = (
|
const downloadMenu = (
|
||||||
<Menu>
|
<div className="downMenu">
|
||||||
<Menu.Item><a href={zip_url}>ZIP</a></Menu.Item>
|
<div style={{padding:"20px",borderBottom:"1px solid #eee"}}>
|
||||||
<Menu.Item><a href={tar_url}>TAR.GZ</a></Menu.Item>
|
<CloneAddress
|
||||||
</Menu>
|
http_url={projectDetail && projectDetail.clone_url}
|
||||||
|
showNotification={props.showNotification}/>
|
||||||
|
</div>
|
||||||
|
<Menu className="edu-txt-center">
|
||||||
|
<Menu.Item><a href={zip_url}>下载 ZIP</a></Menu.Item>
|
||||||
|
<Menu.Item><a href={tar_url}>下载 TAR.GZ</a></Menu.Item>
|
||||||
|
</Menu>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
return(
|
return(
|
||||||
<WhiteBack>
|
<WhiteBack>
|
||||||
|
@ -250,8 +266,8 @@ function CoderDepot(props){
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
<AlignCenter>
|
<AlignCenter>
|
||||||
<div className="mr20 addOptionBtn">
|
<div className="mr20 addOptionBtn">
|
||||||
<Link to={`/projects/${owner}/${projectsId}/pulls/new`}>+ 合并请求</Link>
|
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求</a>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/issues/new`}>+ 任务</Link>
|
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务</a>
|
||||||
</div>
|
</div>
|
||||||
{ type === "dir" && <Dropdown.Button overlay={fileMenu} className="mr20">文件</Dropdown.Button>}
|
{ type === "dir" && <Dropdown.Button overlay={fileMenu} className="mr20">文件</Dropdown.Button>}
|
||||||
<Dropdown.Button overlay={downloadMenu} type={'primary'}>下载</Dropdown.Button>
|
<Dropdown.Button overlay={downloadMenu} type={'primary'}>下载</Dropdown.Button>
|
||||||
|
|
|
@ -269,4 +269,8 @@
|
||||||
i{
|
i{
|
||||||
color: #d9d9d9;
|
color: #d9d9d9;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.downMenu{
|
||||||
|
box-shadow: 0px 0px 9px rgba(134, 134, 134,0.4);
|
||||||
|
background-color: #fff;
|
||||||
}
|
}
|
Loading…
Reference in New Issue