From 7b4e7d35422b4ff6dde31feef383f6670d0253be Mon Sep 17 00:00:00 2001 From: caishi Date: Fri, 8 Oct 2021 10:11:35 +0800 Subject: [PATCH 1/5] issue --- src/forge/Main/CoderDepot.jsx | 2 +- src/forge/Main/tag/Index.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 9bf831933..c3a2599a9 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -424,7 +424,7 @@ function CoderDepot(props){
{ projectDetail.type !== 2 && pullsFlag && - urlLink(`/${owner}/${projectsId}/pulls/new`)} >+ 合并请求 + urlLink(`/${owner}/${projectsId}/pulls/new/${branchName || defaultBranch}`)} >+ 合并请求 } { issuesFlag && diff --git a/src/forge/Main/tag/Index.jsx b/src/forge/Main/tag/Index.jsx index 5e296e131..c4a2b4200 100644 --- a/src/forge/Main/tag/Index.jsx +++ b/src/forge/Main/tag/Index.jsx @@ -59,7 +59,7 @@ function Tags(props) { return ( 提交ID - {truncateCommitId(item.id)} + {truncateCommitId(item.id)} ) } From 299c0d4abe87c4b6c08c7f01b82e2cf674d887ff Mon Sep 17 00:00:00 2001 From: hucong <1422588487@qq.com> Date: Fri, 8 Oct 2021 14:02:38 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=BA=93=E4=BA=8C?= =?UTF-8?q?=E7=BA=A7=E9=A1=B5=E9=9D=A2=E6=BB=9A=E5=8A=A8=E6=9D=A1issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Newfile/m_editor.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/forge/Newfile/m_editor.js b/src/forge/Newfile/m_editor.js index d0144254f..fd4636083 100644 --- a/src/forge/Newfile/m_editor.js +++ b/src/forge/Newfile/m_editor.js @@ -94,7 +94,6 @@ class m_editor extends Component {
Date: Fri, 8 Oct 2021 14:14:39 +0800 Subject: [PATCH 3/5] =?UTF-8?q?issue=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Branch/Select.jsx | 51 +++++++++++++++++++++++++++-------- src/forge/Main/Diff.jsx | 1 + src/forge/Main/tag/Index.jsx | 2 +- src/forge/Main/tree/Index.jsx | 2 +- src/forge/Merge/Files.jsx | 5 ++-- src/forge/Team/New.jsx | 2 +- 6 files changed, 46 insertions(+), 17 deletions(-) diff --git a/src/forge/Branch/Select.jsx b/src/forge/Branch/Select.jsx index 4937686d1..8083082da 100644 --- a/src/forge/Branch/Select.jsx +++ b/src/forge/Branch/Select.jsx @@ -1,28 +1,57 @@ -import React , { useState , useEffect } from 'react'; -import { Popover , Dropdown , Input , Spin } from 'antd'; +import React , { useState , useEffect , useRef } from 'react'; +import { Dropdown} from 'antd'; import './branch.scss'; -import { getBranch , getTag } from '../GetData/getData'; import SelectOverlay from './SelectOverlay'; +import { findDOMNode } from 'react-dom'; export default (({ projectsId , branch , owner , changeBranch , branchList , tagflag = true })=>{ const [ showValue , setShowValue ] = useState(branch); + const [ visible , setVisible ] = useState(false); + + const refFa = useRef(null); + const refBox = useRef(null); + + useEffect(() => { + document.addEventListener('click', clickMe , false); + }, []) + + const clickMe = ({ target }) => { + // 查找父组件 + const faComponent = findDOMNode(refFa.current); + const boxComponent = findDOMNode(refBox.current); + + if (faComponent && boxComponent) { + const isChild = faComponent.contains(target); + const isBox = boxComponent.contains(target); + if(!isChild && !isBox){ + setVisible(false); + } + } + } useEffect(()=>{ setShowValue(branch); },[branch]) + function ChangeB(params) { + setVisible(false); + changeBranch(params); + } + const menu = ( - + +
); return( - -
+ +
setVisible(true)}> {/* {nav === 0 ?"分支":"标签"} */} diff --git a/src/forge/Main/Diff.jsx b/src/forge/Main/Diff.jsx index fe9c130fe..457426eaa 100644 --- a/src/forge/Main/Diff.jsx +++ b/src/forge/Main/Diff.jsx @@ -121,6 +121,7 @@ export default (props) => { data={data} owner={owner} projectsId={projectsId} + parentsSha={parents && parents.length > 0 && parents[0].sha} />
diff --git a/src/forge/Main/tag/Index.jsx b/src/forge/Main/tag/Index.jsx index c4a2b4200..5e296e131 100644 --- a/src/forge/Main/tag/Index.jsx +++ b/src/forge/Main/tag/Index.jsx @@ -59,7 +59,7 @@ function Tags(props) { return ( 提交ID - {truncateCommitId(item.id)} + {truncateCommitId(item.id)} ) } diff --git a/src/forge/Main/tree/Index.jsx b/src/forge/Main/tree/Index.jsx index d38b48bb2..5d3480189 100644 --- a/src/forge/Main/tree/Index.jsx +++ b/src/forge/Main/tree/Index.jsx @@ -79,7 +79,7 @@ function Index(props) {
sha - {truncateCommitId(last_commit && last_commit.sha)} + {truncateCommitId(last_commit && last_commit.sha)} diff --git a/src/forge/Merge/Files.jsx b/src/forge/Merge/Files.jsx index fef63198b..2e5cd7cce 100644 --- a/src/forge/Merge/Files.jsx +++ b/src/forge/Merge/Files.jsx @@ -5,8 +5,7 @@ import { Button, Tooltip,Progress, Popover, Anchor } from 'antd'; import './merge.css'; import './Index.scss'; -function Files(props){ - const { data,history,owner,projectsId } = props; +function Files({ data,history,owner,projectsId , parentsSha }){ const [ files , setFiles ] = useState(data && data.files); const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径"); const [ isOpen, setIsOpen] = useState(false); @@ -116,7 +115,7 @@ function Files(props){ {item.addition+item.deletion}处 - {history.push(`/${owner}/${projectsId}/tree/${truncateCommitId(item.sha)}/${item.name}`)}}>查看文件 + {history.push(`/${owner}/${projectsId}${item.isDeleted ? `/commits/${truncateCommitId(parentsSha)}`:`/tree/${truncateCommitId(item.sha)}/${item.name}`}`)}}>查看文件
{ diff --git a/src/forge/Team/New.jsx b/src/forge/Team/New.jsx index 414a8d158..a6f567ebc 100644 --- a/src/forge/Team/New.jsx +++ b/src/forge/Team/New.jsx @@ -87,7 +87,7 @@ export default Form.create()( } ], )} From e0c8552c1e192e177dc17192a5bceb5c22f963eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Fri, 8 Oct 2021 14:41:02 +0800 Subject: [PATCH 4/5] issue --- src/forge/Main/CoderDepot.jsx | 4 +-- src/forge/Main/CoderRootCommit.js | 42 ++++++++++++++++++------------- src/forge/Main/Diff.jsx | 2 +- src/forge/Main/Index.scss | 2 +- src/forge/Main/version/New.jsx | 2 +- src/forge/Merge/Files.jsx | 21 +++------------- 6 files changed, 32 insertions(+), 41 deletions(-) diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 9bf831933..c6867c986 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -455,8 +455,8 @@ function CoderDepot(props){ lastCommit &&
-
props.history.push(`/${owner}/${projectsId}/commits/${truncateCommitId(lastCommit.sha)}`)} className={hideBtn && hide ? "ellipsistxt hidetxt" :"ellipsistxt"}> -
{lastCommit.message}
+
+
{lastCommit.message}
{ hideBtn && changeHide(hide)}> } diff --git a/src/forge/Main/CoderRootCommit.js b/src/forge/Main/CoderRootCommit.js index cdd8d59d9..f614006cd 100644 --- a/src/forge/Main/CoderRootCommit.js +++ b/src/forge/Main/CoderRootCommit.js @@ -25,10 +25,6 @@ function returnbar(str){ class CoderRootCommit extends Component{ constructor(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={ commitDatas:undefined, dataCount:undefined, @@ -61,13 +57,28 @@ class CoderRootCommit extends Component{ this.Init(); } } + + UrlParamHash(url){ + const params = {}; + let h; + let hash = url.slice(url.indexOf('?')+1).split('&'); + for(let i = 0; i{ 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({ - isSpining:true + isSpining:true, + page:realPage }) - this.getCommitList( branchName , page , limit ); + this.getCommitList( branchName , realPage , limit ); } getCommitList=(branch , page , limit)=>{ @@ -106,7 +117,7 @@ class CoderRootCommit extends Component{ isSpining:false }) } - }).catch((error)=>{console.log(error)}) + }).catch((error)=>{console.log('error',error)}) } // 切换分支 search:tag为根据标签搜索 @@ -116,19 +127,14 @@ class CoderRootCommit extends Component{ } ChangePage=(page)=>{ - const { branchName } = this.props.match.params; - const { limit } = this.state; - this.setState({ - page: page - }) - this.getCommitList(branchName , page , limit); + this.props.history.push({pathname: this.props.history.location.pathname,search: `page=${page}`}) } render(){ const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state; + console.log('page', page); const { projectDetail, commit_class , defaultBranch } = this.props; const { projectsId , owner , branchName } = this.props.match.params; - console.log(branchName); let branch = returnbar(branchName || defaultBranch); return( @@ -153,7 +159,7 @@ class CoderRootCommit extends Component{
-
{item.message}
+
{item.message}

sha - {truncateCommitId(`${item.sha}`)} + {truncateCommitId(`${item.sha}`)} @@ -188,7 +194,7 @@ class CoderRootCommit extends Component{ { dataCount > limit ?

- +
:"" } diff --git a/src/forge/Main/Diff.jsx b/src/forge/Main/Diff.jsx index fe9c130fe..03321ea90 100644 --- a/src/forge/Main/Diff.jsx +++ b/src/forge/Main/Diff.jsx @@ -90,7 +90,7 @@ export default (props) => {
    diff --git a/src/forge/Main/Index.scss b/src/forge/Main/Index.scss index 9a0bf5391..8c0e18488 100644 --- a/src/forge/Main/Index.scss +++ b/src/forge/Main/Index.scss @@ -253,7 +253,7 @@ background-color: #FAFCFF; .ellipsistxt{ margin-top: 6px; - cursor: pointer; + // cursor: pointer; #ptxt{ margin-bottom: 0px; word-break: break-all; diff --git a/src/forge/Main/version/New.jsx b/src/forge/Main/version/New.jsx index ca9057caa..a235f31d9 100644 --- a/src/forge/Main/version/New.jsx +++ b/src/forge/Main/version/New.jsx @@ -247,7 +247,7 @@ export default Form.create()(

    语义化版本

    - 如果你是第一次发布版本,我们强烈建议你阅读语义化版本。 + 如果你是第一次发布版本,我们强烈建议你阅读语义化版本

    diff --git a/src/forge/Merge/Files.jsx b/src/forge/Merge/Files.jsx index fef63198b..310d586b7 100644 --- a/src/forge/Merge/Files.jsx +++ b/src/forge/Merge/Files.jsx @@ -10,22 +10,7 @@ function Files(props){ const [ files , setFiles ] = useState(data && data.files); const [ copyfileTipTitle, setCopyfileTipTitle] = useState("复制文件路径"); 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(()=>{ if(data){ setFiles(data.files); @@ -64,7 +49,7 @@ function Files(props){ {item.name}
    - 0?item.addition+"处添加":""}${item.addition>0 && item.deletion>0 ?"和":""}${item.deletion>0?item.deletion+"处删除":""}`}> + 0 && ":"}${item.addition>0?item.addition+"处添加":""}${item.addition>0 && item.deletion>0 ?"和":""}${item.deletion>0?item.deletion+"处删除":""}`}> {item.addition >0 && +{item.addition}} {item.deletion >0 && -{item.deletion}} @@ -112,7 +97,7 @@ function Files(props){
    - 0?item.addition+"处添加":""}${item.addition>0 && item.deletion>0 ?"和":""}${item.deletion>0?item.deletion+"处删除":""}`}> + 0 && ":"} ${item.addition > 0 ? item.addition + "处添加" : ""}${item.addition > 0 && item.deletion > 0 ? "和" : ""}${item.deletion > 0 ? item.deletion + "处删除" : ""}`}> {item.addition+item.deletion}处 From 633a540fe761070898daad874180ff18652507a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Fri, 8 Oct 2021 14:46:39 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=88=A0=E9=99=A4consolo=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/CoderRootCommit.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/forge/Main/CoderRootCommit.js b/src/forge/Main/CoderRootCommit.js index f614006cd..604917ba0 100644 --- a/src/forge/Main/CoderRootCommit.js +++ b/src/forge/Main/CoderRootCommit.js @@ -117,7 +117,7 @@ class CoderRootCommit extends Component{ isSpining:false }) } - }).catch((error)=>{console.log('error',error)}) + }).catch((error)=>{console.log(error)}) } // 切换分支 search:tag为根据标签搜索 @@ -132,7 +132,6 @@ class CoderRootCommit extends Component{ render(){ const { commitDatas , dataCount , limit , page , isSpining , branchList } = this.state; - console.log('page', page); const { projectDetail, commit_class , defaultBranch } = this.props; const { projectsId , owner , branchName } = this.props.match.params; let branch = returnbar(branchName || defaultBranch);