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)) && +
{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(
{commit.message}
}
-
+
- + 分支设置