从分支页面跳转到分支提交页面

dev_forge
caicai8 6 years ago
parent 2e42ad82ca
commit 43e9c90439

@ -329,7 +329,7 @@ class ApplicationController < ActionController::Base
def current_user
# User.current
if Rails.env.development?
user_id = 36390
user_id = 50207
else
user_id = 130328
end

@ -15,6 +15,7 @@ class CoderRootBranch extends Component {
render(){
const { branchList, projectDetail } = this.props;
const { projectsId } = this.props.match.params;
const list =()=>{
if(branchList && branchList.length>0){
return(
@ -24,7 +25,7 @@ class CoderRootBranch extends Component {
return(
<li>
<div>
<Link to={``} className="color-blue font-15" style={{"maxWidth":"100px"}}>{item.name}</Link>
<Link to={`/projects/${projectsId}/coder/commit?branch=${item.name}`} className="color-blue font-15" style={{"maxWidth":"100px"}}>{item.name}</Link>
{/*<span className="color-blue font-15">{item.name}</span>*/}
<p className="f-wrap-alignCenter">
<span className="mr5 color-blue">{item.last_commit && item.last_commit.id}</span>

@ -19,11 +19,21 @@ class CoderRootCommit extends Component{
}
componentDidMount=()=>{
console.log(this.props);
let { search } = this.props.history.location;
let branchName = undefined;
if(search && search.indexOf("branch")>-1){
branchName = search.split("=")[1];
console.log(branchName);
this.setState({
branch:branchName
})
}
const { branch , page , limit } = this.state;
this.setState({
isSpin:true
})
this.getCommitList(branch , page , limit);
this.getCommitList( branchName || branch , page , limit );
}
getCommitList=(branch , page , limit)=>{

Loading…
Cancel
Save