issue
This commit is contained in:
parent
0080a07734
commit
e0c8552c1e
|
@ -455,8 +455,8 @@ function CoderDepot(props){
|
||||||
lastCommit &&
|
lastCommit &&
|
||||||
<div className="listtablehead">
|
<div className="listtablehead">
|
||||||
<User url={getImageUrl(`/${lastCommitAuthor && lastCommitAuthor.image_url}`)} name={lastCommitAuthor && lastCommitAuthor.name} id={lastCommitAuthor && lastCommitAuthor.id} login={lastCommitAuthor && lastCommitAuthor.login}/>
|
<User url={getImageUrl(`/${lastCommitAuthor && lastCommitAuthor.image_url}`)} name={lastCommitAuthor && lastCommitAuthor.name} id={lastCommitAuthor && lastCommitAuthor.id} login={lastCommitAuthor && lastCommitAuthor.login}/>
|
||||||
<div onClick={()=>props.history.push(`/${owner}/${projectsId}/commits/${truncateCommitId(lastCommit.sha)}`)} className={hideBtn && hide ? "ellipsistxt hidetxt" :"ellipsistxt"}>
|
<div className={hideBtn && hide ? "ellipsistxt hidetxt" :"ellipsistxt"}>
|
||||||
<pre id="ptxt">{lastCommit.message}</pre>
|
<pre id="ptxt"><Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(lastCommit.sha)}`}>{lastCommit.message}</Link></pre>
|
||||||
</div>
|
</div>
|
||||||
{ hideBtn && <span className="ellipsis" onClick={()=>changeHide(hide)}><i className="iconfont icon-shenglvehao"></i></span> }
|
{ hideBtn && <span className="ellipsis" onClick={()=>changeHide(hide)}><i className="iconfont icon-shenglvehao"></i></span> }
|
||||||
|
|
||||||
|
|
|
@ -25,10 +25,6 @@ function returnbar(str){
|
||||||
class CoderRootCommit extends Component{
|
class CoderRootCommit extends Component{
|
||||||
constructor(props){
|
constructor(props){
|
||||||
super(props);
|
super(props);
|
||||||
// const params = new URLSearchParams(location && location.search);
|
|
||||||
// const [commitPage] = [params.get('commitPage')];
|
|
||||||
// console.log('111',commitPage);
|
|
||||||
// commitPage && this.setState({page:commitPage});
|
|
||||||
this.state={
|
this.state={
|
||||||
commitDatas:undefined,
|
commitDatas:undefined,
|
||||||
dataCount:undefined,
|
dataCount:undefined,
|
||||||
|
@ -61,13 +57,28 @@ class CoderRootCommit extends Component{
|
||||||
this.Init();
|
this.Init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UrlParamHash(url){
|
||||||
|
const params = {};
|
||||||
|
let h;
|
||||||
|
let hash = url.slice(url.indexOf('?')+1).split('&');
|
||||||
|
for(let i = 0; i<hash.length;i++){
|
||||||
|
h = hash[i].split('=');
|
||||||
|
params[h[0]] = h[1];
|
||||||
|
}
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
Init =()=>{
|
Init =()=>{
|
||||||
const { branchName } = this.props.match.params;
|
const { branchName } = this.props.match.params;
|
||||||
const { page , limit } = this.state;
|
const { limit } = this.state;
|
||||||
|
const {search} = this.props.location;
|
||||||
|
const realPage = (search && this.UrlParamHash(search).page) ? parseInt(this.UrlParamHash(search).page) : 1;
|
||||||
this.setState({
|
this.setState({
|
||||||
isSpining:true
|
isSpining:true,
|
||||||
|
page:realPage
|
||||||
})
|
})
|
||||||
this.getCommitList( branchName , page , limit );
|
this.getCommitList( branchName , realPage , limit );
|
||||||
}
|
}
|
||||||
|
|
||||||
getCommitList=(branch , page , limit)=>{
|
getCommitList=(branch , page , limit)=>{
|
||||||
|
@ -106,7 +117,7 @@ class CoderRootCommit extends Component{
|
||||||
isSpining:false
|
isSpining:false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch((error)=>{console.log(error)})
|
}).catch((error)=>{console.log('error',error)})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 切换分支 search:tag为根据标签搜索
|
// 切换分支 search:tag为根据标签搜索
|
||||||
|
@ -116,19 +127,14 @@ class CoderRootCommit extends Component{
|
||||||
}
|
}
|
||||||
|
|
||||||
ChangePage=(page)=>{
|
ChangePage=(page)=>{
|
||||||
const { branchName } = this.props.match.params;
|
this.props.history.push({pathname: this.props.history.location.pathname,search: `page=${page}`})
|
||||||
const { limit } = this.state;
|
|
||||||
this.setState({
|
|
||||||
page: page
|
|
||||||
})
|
|
||||||
this.getCommitList(branchName , page , limit);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render(){
|
render(){
|
||||||
const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state;
|
const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state;
|
||||||
|
console.log('page', page);
|
||||||
const { projectDetail, commit_class , defaultBranch } = this.props;
|
const { projectDetail, commit_class , defaultBranch } = this.props;
|
||||||
const { projectsId , owner , branchName } = this.props.match.params;
|
const { projectsId , owner , branchName } = this.props.match.params;
|
||||||
console.log(branchName);
|
|
||||||
let branch = returnbar(branchName || defaultBranch);
|
let branch = returnbar(branchName || defaultBranch);
|
||||||
return(
|
return(
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
|
@ -153,7 +159,7 @@ class CoderRootCommit extends Component{
|
||||||
<div className="commitList-item f-wrap-between">
|
<div className="commitList-item f-wrap-between">
|
||||||
<div>
|
<div>
|
||||||
<AlignTop>
|
<AlignTop>
|
||||||
<div className="commitDesc"><Link to={{pathname:`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`,query:{commitPage:page}}} className="font-14 color-grey-3 font-bd">{item.message}</Link></div>
|
<div className="commitDesc"><Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="font-14 color-grey-3 font-bd">{item.message}</Link></div>
|
||||||
</AlignTop>
|
</AlignTop>
|
||||||
<p className="f-wrap-alignCenter mt15 pb5">
|
<p className="f-wrap-alignCenter mt15 pb5">
|
||||||
<User
|
<User
|
||||||
|
@ -170,7 +176,7 @@ class CoderRootCommit extends Component{
|
||||||
<div>
|
<div>
|
||||||
<span className="treecopy-cont shadow">
|
<span className="treecopy-cont shadow">
|
||||||
<img src={Tree} alt="sha" width={"16px"}/>
|
<img src={Tree} alt="sha" width={"16px"}/>
|
||||||
<Link to={{pathname:`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`,query:{page:page}}}>{truncateCommitId(`${item.sha}`)}</Link>
|
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`}>{truncateCommitId(`${item.sha}`)}</Link>
|
||||||
<input type="text" id={`value${k}`} value={`${truncateCommitId(`${item.sha}`)}`}/>
|
<input type="text" id={`value${k}`} value={`${truncateCommitId(`${item.sha}`)}`}/>
|
||||||
</span>
|
</span>
|
||||||
<CopyTool beforeText="复制commit id" afterText="复制成功" inputId={`value${k}`}/>
|
<CopyTool beforeText="复制commit id" afterText="复制成功" inputId={`value${k}`}/>
|
||||||
|
@ -188,7 +194,7 @@ class CoderRootCommit extends Component{
|
||||||
{
|
{
|
||||||
dataCount > limit ?
|
dataCount > limit ?
|
||||||
<div className="edu-txt-center pt30 mb30">
|
<div className="edu-txt-center pt30 mb30">
|
||||||
<Pagination simple defaultCurrent={page} total={dataCount} pageSize={limit} onChange={this.ChangePage}></Pagination>
|
<Pagination simple current={page} total={dataCount} pageSize={limit} onChange={this.ChangePage}></Pagination>
|
||||||
</div>
|
</div>
|
||||||
:""
|
:""
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ export default (props) => {
|
||||||
<ul className="df">
|
<ul className="df">
|
||||||
<User
|
<User
|
||||||
id = {committer && committer.id}
|
id = {committer && committer.id}
|
||||||
url={(committer && getImageUrl(`/${committer.image_url}`))|| "https://dss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3025493530,1989042357&fm=26&gp=0.jpg"}
|
url={(committer && getImageUrl(`/${committer.image_url}`))}
|
||||||
name={committer && committer.name}
|
name={committer && committer.name}
|
||||||
login={committer && committer.login}
|
login={committer && committer.login}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -253,7 +253,7 @@
|
||||||
background-color: #FAFCFF;
|
background-color: #FAFCFF;
|
||||||
.ellipsistxt{
|
.ellipsistxt{
|
||||||
margin-top: 6px;
|
margin-top: 6px;
|
||||||
cursor: pointer;
|
// cursor: pointer;
|
||||||
#ptxt{
|
#ptxt{
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
|
|
|
@ -247,7 +247,7 @@ export default Form.create()(
|
||||||
<div className="infosTip">
|
<div className="infosTip">
|
||||||
<p className="font-16 mb14 weight">语义化版本</p>
|
<p className="font-16 mb14 weight">语义化版本</p>
|
||||||
<p>
|
<p>
|
||||||
如果你是第一次发布版本,我们强烈建议你阅读<a className="color-blue">语义化版本</a>。
|
如果你是第一次发布版本,我们强烈建议你阅读<a href='https://semver.org/lang/zh-CN' className="color-blue">语义化版本</a>。
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="infosTip">
|
<div className="infosTip">
|
||||||
|
|
|
@ -10,22 +10,7 @@ function Files(props){
|
||||||
const [ files , setFiles ] = useState(data && data.files);
|
const [ files , setFiles ] = useState(data && data.files);
|
||||||
const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径");
|
const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径");
|
||||||
const [ isOpen, setIsOpen] = useState(false);
|
const [ isOpen, setIsOpen] = useState(false);
|
||||||
const commitPage = history && history.location && history.location.query && history.location.query.commitPage;
|
|
||||||
// console.log('222',commitPage);
|
|
||||||
// const nextHref = useRef(null);
|
|
||||||
|
|
||||||
// useEffect(()=>{
|
|
||||||
// const unlisten = history.listen((location)=>{
|
|
||||||
// if(nextHref.current !== location.pathname){
|
|
||||||
// nextHref.current = location.pathname;
|
|
||||||
// history.replace({pathname:location.pathname,search:`commitPage=${commitPage}`});
|
|
||||||
// // history.replace({pathname:location.pathname, query:{page:commitPage}});
|
|
||||||
// } else{
|
|
||||||
// unlisten;
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(data){
|
if(data){
|
||||||
setFiles(data.files);
|
setFiles(data.files);
|
||||||
|
@ -64,7 +49,7 @@ function Files(props){
|
||||||
<span className="cursor-pointer" data-clipboard-text={item.name}>{item.name}</span>
|
<span className="cursor-pointer" data-clipboard-text={item.name}>{item.name}</span>
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
<div className="see-file">
|
<div className="see-file">
|
||||||
<Tooltip placement="top" title={`${item.addition+item.deletion}处更改:${item.addition>0?item.addition+"处添加":""}${item.addition>0 && item.deletion>0 ?"和":""}${item.deletion>0?item.deletion+"处删除":""}`}>
|
<Tooltip placement="top" title={`${item.addition+item.deletion}处更改${item.addition + item.deletion > 0 && ":"}${item.addition>0?item.addition+"处添加":""}${item.addition>0 && item.deletion>0 ?"和":""}${item.deletion>0?item.deletion+"处删除":""}`}>
|
||||||
<Progress showInfo = {false} strokeColor = "#2DB44D" size="small" percent={item.addition/(item.addition+item.deletion)*100} />
|
<Progress showInfo = {false} strokeColor = "#2DB44D" size="small" percent={item.addition/(item.addition+item.deletion)*100} />
|
||||||
{item.addition >0 && <span className="color-green ml10">+{item.addition}</span>}
|
{item.addition >0 && <span className="color-green ml10">+{item.addition}</span>}
|
||||||
{item.deletion >0 && <span className="color-red ml10">-{item.deletion}</span>}
|
{item.deletion >0 && <span className="color-red ml10">-{item.deletion}</span>}
|
||||||
|
@ -112,7 +97,7 @@ function Files(props){
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
<div className="see-file">
|
<div className="see-file">
|
||||||
<Tooltip placement="top" title={`${item.addition+item.deletion}处更改:${item.addition>0?item.addition+"处添加":""}${item.addition>0 && item.deletion>0 ?"和":""}${item.deletion>0?item.deletion+"处删除":""}`}>
|
<Tooltip placement="top" title={`${item.addition + item.deletion}处更改${item.addition + item.deletion > 0 && ":"} ${item.addition > 0 ? item.addition + "处添加" : ""}${item.addition > 0 && item.deletion > 0 ? "和" : ""}${item.deletion > 0 ? item.deletion + "处删除" : ""}`}>
|
||||||
<Progress showInfo = {false} strokeColor = "#2DB44D" size="small" percent={item.addition/(item.addition+item.deletion)*100} />
|
<Progress showInfo = {false} strokeColor = "#2DB44D" size="small" percent={item.addition/(item.addition+item.deletion)*100} />
|
||||||
<span className="ml10">{item.addition+item.deletion}处</span>
|
<span className="ml10">{item.addition+item.deletion}处</span>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
Loading…
Reference in New Issue