diff --git a/public/index.html b/public/index.html index 1969fa0e..f039d86e 100755 --- a/public/index.html +++ b/public/index.html @@ -8,18 +8,9 @@ - - - + + + <%= htmlWebpackPlugin.tags.headTags %> @@ -30,6 +21,7 @@
+ diff --git a/src/forge/Branch/Select.jsx b/src/forge/Branch/Select.jsx index 30e7d59c..55bb0345 100644 --- a/src/forge/Branch/Select.jsx +++ b/src/forge/Branch/Select.jsx @@ -4,7 +4,7 @@ import './branch.css'; import { getBranch , getTag } from '../GetData/getData'; -export default (({ projectsId , repo_id , changeBranch , branch , owner })=>{ +export default (({ projectsId , branch , owner , history , changeBranch })=>{ const [ showValue , setShowValue ] = useState(branch); const [ inputValue , setInputValue] = useState(undefined); const [ nav , setNav ] = useState(0); @@ -17,6 +17,7 @@ export default (({ projectsId , repo_id , changeBranch , branch , owner })=>{ useEffect(()=>{ setShowValue(branch); },[branch]) + useEffect(()=>{ document.body.addEventListener('click', e => { let name = e.target.className; @@ -63,7 +64,7 @@ export default (({ projectsId , repo_id , changeBranch , branch , owner })=>{ } } function chooseitem(value){ - setShowValue(value); + // setShowValue(value); changeBranch(value); } diff --git a/src/forge/DevOps/About.jsx b/src/forge/DevOps/About.jsx index 107b351f..d3e5c184 100644 --- a/src/forge/DevOps/About.jsx +++ b/src/forge/DevOps/About.jsx @@ -8,7 +8,7 @@ import axios from "axios"; const P = styled.p` { - width: 200px; + width: 230px; line-height: 30px; font-size: 16px; color: #333; @@ -33,7 +33,6 @@ function About(props, ref) { const AuthorLogin = props.author && props.author.login; const CurrentLogin = props.current_user && props.current_user.login; - useEffect(()=>{ if(CurrentLogin === AuthorLogin){ auth('get'); @@ -127,9 +126,16 @@ function About(props, ref) {

定义DevOps工作流,帮助您检测bug、发布代码…

+ { + CurrentLogin !== AuthorLogin && (step === undefined || (step && step < 1)) && +
DevOps开启功能暂未对项目创建者以外的角色开放,可以联系项目创建者进行开启,开启后便可查看构建信息。
+ } 了解什么是DevOps? + + 如何使用DevOps? + { AuthorLogin === CurrentLogin ? diff --git a/src/forge/DevOps/ops.scss b/src/forge/DevOps/ops.scss index 6e0c4fa1..7a98d240 100644 --- a/src/forge/DevOps/ops.scss +++ b/src/forge/DevOps/ops.scss @@ -307,3 +307,10 @@ margin-bottom: 0px; } } +.noOperation{ + margin-bottom:20px; + width:380px; + text-align:center; + line-height:22px; + color:#666; +} \ No newline at end of file diff --git a/src/forge/Main/CoderRootBranch.js b/src/forge/Main/CoderRootBranch.js index 4fde90e4..4369d2fe 100644 --- a/src/forge/Main/CoderRootBranch.js +++ b/src/forge/Main/CoderRootBranch.js @@ -32,7 +32,7 @@ export default ((props)=>{ return(
  • - {item.name} + {item.name}

    {item.last_commit && truncateCommitId(item.last_commit.sha)} {item.last_commit && item.last_commit.message} diff --git a/src/forge/Main/CoderRootCommit.js b/src/forge/Main/CoderRootCommit.js index 36585fe3..ddb47a2b 100644 --- a/src/forge/Main/CoderRootCommit.js +++ b/src/forge/Main/CoderRootCommit.js @@ -12,7 +12,6 @@ class CoderRootCommit extends Component{ constructor(props){ super(props) this.state={ - branch:"master", commitDatas:undefined, dataCount:undefined, limit:20, @@ -22,11 +21,23 @@ class CoderRootCommit extends Component{ } componentDidMount=()=>{ - const { branch , page , limit } = this.state; + this.Init(); + } + + componentDidUpdate=(prevProps)=>{ + const { location } = this.props; + const prevlocation = prevProps && prevProps.location; + if (location !== prevlocation) { + this.Init(); + } + } + Init =()=>{ + const { branchName } = this.props.match.params; + const { page , limit } = this.state; this.setState({ isSpining:true }) - this.getCommitList( branch , page , limit ); + this.getCommitList( branchName , page , limit ); } getCommitList=(branch , page , limit)=>{ @@ -68,26 +79,28 @@ class CoderRootCommit extends Component{ // 切换分支 search:tag为根据标签搜索 changeBranch=(value)=>{ - const { page , limit } = this.state; - const { getTopCount } = this.props; - this.setState({ - isSpining:true, - branch:value, - }) - this.getCommitList(value , page , limit); - getTopCount && getTopCount(value); + // const { page , limit } = this.state; + // const { getTopCount } = this.props; + // this.setState({ + // isSpining:true, + // branch:value, + // }) + // this.getCommitList(value , page , limit); + // getTopCount && getTopCount(value); + const { projectsId , owner } = this.props.match.params; + this.props.history.push(`/projects/${owner}/${projectsId}/commits/branch/${value}`); } ChangePage=(page)=>{ - - const { branch , limit } = this.state; - this.getCommitList(branch , page , limit); + const { branchName } = this.props.match.params; + const { limit } = this.state; + this.getCommitList(branchName , page , limit); } render(){ - const { branch , commitDatas , dataCount , limit , page , isSpining } = this.state; - const { branchs , projectDetail, commit_class } = this.props; - const { projectsId , owner } = this.props.match.params; - + const { commitDatas , dataCount , limit , page , isSpining } = this.state; + const { projectDetail, commit_class } = this.props; + const { projectsId , owner , branchName } = this.props.match.params; + let branch = branchName || "master"; return(

    @@ -98,6 +111,7 @@ class CoderRootCommit extends Component{ branch={branch} changeBranch={this.changeBranch} owner={owner} + history={this.props.history} >
    diff --git a/src/forge/Main/CoderRootDirectory.js b/src/forge/Main/CoderRootDirectory.js index 507fa48a..41dc9b51 100644 --- a/src/forge/Main/CoderRootDirectory.js +++ b/src/forge/Main/CoderRootDirectory.js @@ -34,7 +34,7 @@ class CoderRootDirectory extends Component { super(props); this.state = { address: "http", - branch: "master", + branch: props.match.params.branchName || "master", filePath: undefined, subFileType: undefined, readMeContent: undefined, @@ -79,31 +79,16 @@ class CoderRootDirectory extends Component { Init = () => { let { search } = this.props.history.location; - let branchName = undefined; - if (search && (search.indexOf("?branch=") > -1 || search.indexOf("&branch=") > -1)) { - branchName = search.split("branch=")[1]; - - if(branchName && branchName.indexOf("&")){ - branchName=branchName.split("&")[0]; - } - this.setState({ - branch: branchName, - }); - }else{ - branchName = undefined; - this.setState({ - branch: "master", - }); - } + const { branchName } = this.props.match.params; + let branch = branchName || "master"; if (search && (search.indexOf("?url=") > -1 || search.indexOf("&url=") > -1)) { let url = search.split("url=")[1]; if(url && decodeURI(url).indexOf("&")){ url=decodeURI(url).split("&")[0]; } - this.getFileDetail(decodeURI(url),branchName); + this.getFileDetail(decodeURI(url),branch); } else { - const { branch } = this.state; - this.getProjectRoot(branchName || branch); + this.getProjectRoot(branch); } }; @@ -194,13 +179,13 @@ class CoderRootDirectory extends Component { this.setState({ filePath: decodeURI(path), }); - const { projectsId ,owner } = this.props.match.params; - const { branch , chooseType } = this.state; + const { projectsId , owner , branchName } = this.props.match.params; + const { chooseType } = this.state; const url = `/${owner}/${projectsId}/sub_entries.json`; axios.get(url,{ params:{ filepath:path, - ref:ref || branch, + ref:ref || branchName, type:chooseType } }).then((result)=>{ @@ -325,24 +310,27 @@ class CoderRootDirectory extends Component { // 选择分支 changeBranch = (value) => { - this.setState({ - branch: value, - isSpin: true, - readOnly:true - }); - const { getTopCount } = this.props; - getTopCount && getTopCount(value); + // this.setState({ + // branch: value, + // isSpin: true, + // readOnly:true + // }); + // const { getTopCount } = this.props; + // getTopCount && getTopCount(value); + + // let { search } = this.props.history.location; + // if (search && search.indexOf("?url=") > -1) { + // let url = search.split("?url=")[1]; + // this.setState({ + // filePath: decodeURI(url), + // }); + // this.getFileDetail(decodeURI(url), value); + // } else { + // this.getProjectRoot(value); + // } + const { projectsId , owner } = this.props.match.params; + this.props.history.push(`/projects/${owner}/${projectsId}/branch/${value}`); - let { search } = this.props.history.location; - if (search && search.indexOf("?url=") > -1) { - let url = search.split("?url=")[1]; - this.setState({ - filePath: decodeURI(url), - }); - this.getFileDetail(decodeURI(url), value); - } else { - this.getProjectRoot(value); - } } // 子目录路径返回链接 @@ -421,10 +409,11 @@ class CoderRootDirectory extends Component { } render(){ - const { branchLastCommit , lastCommitAuthor , rootList , branch ,filePath , fileDetail , subFileType , readMeContent, isSpin , zip_url , tar_url} = this.state; + const { branchLastCommit , lastCommitAuthor , rootList ,filePath , fileDetail , subFileType , readMeContent, isSpin , zip_url , tar_url} = this.state; const { isManager , isDeveloper , projectDetail , platform } = this.props; - const { projectsId , owner } = this.props.match.params; + const { projectsId , owner , branchName } = this.props.match.params; + let branch = branchName || "master"; const columns = [ { dataIndex: 'name', @@ -473,6 +462,7 @@ class CoderRootDirectory extends Component { branch={branch} changeBranch={this.changeBranch} owner={owner} + history={this.props.history} > : 分支:master @@ -551,7 +541,6 @@ class CoderRootDirectory extends Component { { !rootList && !fileDetail && } - {/* readme.txt (isManager || isDeveloper)*/} { rootList && this.renderReadMeContent(readMeContent, isManager || isDeveloper)}
    diff --git a/src/forge/Main/CoderRootIndex.js b/src/forge/Main/CoderRootIndex.js index 2aa8218f..0649c5dd 100644 --- a/src/forge/Main/CoderRootIndex.js +++ b/src/forge/Main/CoderRootIndex.js @@ -55,12 +55,19 @@ class CoderRootIndex extends Component{ } componentDidMount=()=>{ - let { search } = this.props.history.location; - let branchName = undefined; - if (search && search.indexOf("?branch=") > -1) { - branchName = search.split("?branch=")[1]; + this.Init(); + } + componentDidUpdate=(prevProps)=>{ + const { location } = this.props; + const prevlocation = prevProps && prevProps.location; + if (location !== prevlocation) { + this.Init(); } - this.getTopCount(branchName); + } + + Init=()=>{ + const { branchName } = this.props.match.params; + this.getTopCount(branchName || "master"); } getTopCount=(branch)=>{ @@ -99,6 +106,11 @@ class CoderRootIndex extends Component{ > {/* diff */} + () + } + > () @@ -132,7 +144,12 @@ class CoderRootIndex extends Component{ () => () } > - () + } + > + () } diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 2dcdcac3..431c1f4d 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -708,6 +708,16 @@ class Detail extends Component { (props) => () } > + () + } + > + () + } + > () diff --git a/src/forge/Main/DetailTop.js b/src/forge/Main/DetailTop.js index 5dcd240d..260ff1e6 100644 --- a/src/forge/Main/DetailTop.js +++ b/src/forge/Main/DetailTop.js @@ -16,7 +16,7 @@ class DetailTop extends Component { {(coderCount && coderCount.commits_count) || 0}个提交 - 0 ? "active" : ""}> + 0 ? "active" : ""}> {(coderCount && coderCount.branches_count) || 0}个分支 diff --git a/src/forge/Main/Diff.jsx b/src/forge/Main/Diff.jsx index 8926ec6d..8007e1fc 100644 --- a/src/forge/Main/Diff.jsx +++ b/src/forge/Main/Diff.jsx @@ -59,7 +59,7 @@ export default ({ match , history }) => { {commit && commit.message &&
    {commit.message}
    } - +
  • diff --git a/src/forge/Merge/Files.jsx b/src/forge/Merge/Files.jsx index 4061889e..08983266 100644 --- a/src/forge/Merge/Files.jsx +++ b/src/forge/Merge/Files.jsx @@ -47,7 +47,7 @@ function Files({data,history,owner,projectsId}){ {item.name} - + +{item.addition} -{item.deletion} diff --git a/src/forge/Merge/MergeItem.js b/src/forge/Merge/MergeItem.js index 2585b9d4..77a8a62a 100644 --- a/src/forge/Merge/MergeItem.js +++ b/src/forge/Merge/MergeItem.js @@ -98,7 +98,7 @@ class MergeItem extends Component { {item.is_original @@ -116,7 +116,7 @@ class MergeItem extends Component { {/* {item.is_fork ? item.pull_request_base : `${item.author_name}:${item.pull_request_base}`} */} diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index 2aff7771..87f19d38 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -300,7 +300,7 @@ class MessageCount extends Component {
    {data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}:{data.pull_request.head} @@ -315,7 +315,7 @@ class MessageCount extends Component { {/* {data.pull_request.is_fork ? data.pull_request.base : `${data.pull_request.pull_request_user}:${data.pull_request.base}`} */} diff --git a/src/forge/Newfile/UserSubmitComponent.js b/src/forge/Newfile/UserSubmitComponent.js index 42e636c1..e2c57d72 100644 --- a/src/forge/Newfile/UserSubmitComponent.js +++ b/src/forge/Newfile/UserSubmitComponent.js @@ -55,7 +55,7 @@ class UserSubmitComponent extends Component { getTopCount && getTopCount(values.branchname); } let url = values.branchname - ? `/projects/${owner}/${projectsId}?branch=${values.branchname}` + ? `/projects/${owner}/${projectsId}/branch/${values.branchname}` : `/projects/${owner}/${projectsId}`; this.props.history.push(url); } @@ -92,7 +92,7 @@ class UserSubmitComponent extends Component { this.setState({ isSpin: false }); if (result.data && result.data.status === 1) { let url = values.branchname - ? `/projects/${owner}/${projectsId}?branch=${values.branchname}` + ? `/projects/${owner}/${projectsId}/branch/${values.branchname}` : `/projects/${owner}/${projectsId}`; this.props.history.push(url); diff --git a/src/forge/Order/order.js b/src/forge/Order/order.js index 10e25951..412d7490 100644 --- a/src/forge/Order/order.js +++ b/src/forge/Order/order.js @@ -329,16 +329,16 @@ class order extends Component { id: id, }, }) - .then((result) => { - if (result) { - const { status_type } = this.state; + .then((result) => { + if (result) { + const { status_type } = this.state; - this.getIssueList(status_type); - } - }) - .catch((error) => { - console.log(error); - }); + this.getIssueList(status_type); + } + }) + .catch((error) => { + console.log(error); + }); }; islogin=()=>{ @@ -354,9 +354,7 @@ class order extends Component { ) }else{ return( - - + 创建任务 - + + 创建任务 ) } } diff --git a/src/forge/Settings/Branch.js b/src/forge/Settings/Branch.js index 1de276f3..b23eb985 100644 --- a/src/forge/Settings/Branch.js +++ b/src/forge/Settings/Branch.js @@ -16,6 +16,9 @@ export default ((props)=>{ function resetSetting(){ + } + function settingRule(){ + props.history.push(`/projects/${owner}/${projectsId}/setting/branch/new`); } return( @@ -31,6 +34,7 @@ export default ((props)=>{ projectsId={projectsId} changeBranch={setBranch} owner={owner} + history={props.history} /> 设为默认分支 @@ -38,7 +42,7 @@ export default ((props)=>{
    保护分支规则 - + 新建规则 + settingRule()}>+ 新建规则
  • 限制分支的推送、合并。强制推送相关请去仓库设置
  • diff --git a/src/forge/Settings/Index.js b/src/forge/Settings/Index.js index 542f12c7..31ecdefd 100644 --- a/src/forge/Settings/Index.js +++ b/src/forge/Settings/Index.js @@ -71,7 +71,7 @@ class Index extends Component { } >

    - + 分支设置