fork项目不能修改可见性(公有私有)

This commit is contained in:
caishi 2021-06-29 17:29:35 +08:00
parent 4b832f40c0
commit 45f188e6f4
1 changed files with 7 additions and 3 deletions

View File

@ -29,14 +29,15 @@ class Setting extends Component {
loading:true,
project_units:['home',"activity","code"],
divertVisible:false,
is_transfering:undefined,
is_transfering:undefined
};
}
componentDidUpdate=(prevPros)=>{
if(prevPros && this.props && !this.props.checkIfLogin()){
this.props.history.push("/403")
return
return;
}
}
componentDidMount = () => {
@ -233,6 +234,7 @@ class Setting extends Component {
const { CategoryList, LanguageList, private_check ,loading , divertVisible , is_transfering, transfer } = this.state;
let mirror = projectDetail && projectDetail.mirror;
let type = projectDetail && projectDetail.type;
const forked_from_project_id = this.props && this.props.projectDetail && this.props.projectDetail.forked_from_project_id;
return (
<div>
<DivertModal
@ -265,8 +267,10 @@ class Setting extends Component {
<Checkbox
checked={private_check}
onChange={this.changePrivate}
disabled={forked_from_project_id}
>
将仓库设为私有
<span className="color-grey-9">将仓库设为私有</span>
{ forked_from_project_id && <span className="color-grey-6">修改仓库的可见性将会影响到该仓库下所有Fork仓库的可见性</span>}
</Checkbox>
)}
</Form.Item>