This commit is contained in:
caishi 2020-12-29 16:18:20 +08:00
parent 7b2f233cae
commit 1bab0b01f7
2 changed files with 16 additions and 11 deletions

View File

@ -24,16 +24,21 @@ class IndexItem extends Component {
})
}
projectHref=(link , user_apply_signatures,project_id,is_secret)=>{
let signa = user_apply_signatures && user_apply_signatures[0];
if(is_secret && (signa && signa.status !== "passed")){
this.setState({
visible:true,
user_apply_signatures:user_apply_signatures.length>0 ? user_apply_signatures[0] : undefined,
project_id
})
projectHref=(link , user_apply_signatures,project_id,is_secret , id)=>{
const { user , showLoginDialog } = this.props;
if(user && user.login){
let signa = user_apply_signatures && user_apply_signatures[0];
if((is_secret && (!signa || (signa && signa.status !== "passed"))) && user.login !== id ){
this.setState({
visible:true,
user_apply_signatures:user_apply_signatures.length>0 ? user_apply_signatures[0] : undefined,
project_id
})
}else{
this.props.history.push(link);
}
}else{
this.props.history.push(link);
showLoginDialog && showLoginDialog();
}
}
hideModal=()=>{
@ -67,7 +72,7 @@ class IndexItem extends Component {
}
<div className="p-r-Infos">
<div className="p-r-name">
<a onClick={()=>this.projectHref(`/projects/${item.author.login}/${item.identifier}`,item.user_apply_signatures, item.id,item.is_secret)} className="hide-1 color-grey-3 font-18 task-hide fwt-500 " style={{ whiteSpace: "wrap", display: 'flex', width: 400 }}>
<a onClick={()=>this.projectHref(`/projects/${item.author.login}/${item.identifier}`,item.user_apply_signatures, item.id,item.is_secret,item.author.login)} className="hide-1 color-grey-3 font-18 task-hide fwt-500 " style={{ whiteSpace: "wrap", display: 'flex', width: 400 }}>
{item.author.name}/{item.name}
{
item.forked_from_project_id ?

View File

@ -54,7 +54,7 @@ function Single({ children , showNotification , className , load , size }) {
if(!size) return;
const isLt100M = file.size / 1024 / 1024 < size;
if (!isLt100M) {
this.props.showNotification(`文件大小必须小于${size}MB!`);
showNotification(`文件大小必须小于${size}MB!`);
}
return isLt100M;
}