diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 9915ade4e..39ec3726c 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -65,7 +65,7 @@ function CoderDepot(props){ let pathname = props.history.location.pathname; const { platform , mirror_status } = props ; //distribution:判断此用户是否可以创建发行版 - const distribution = details && details.type !== 2 && ( details.permission && details.permission !== "Reporter"); + const distribution = details && details.type ===0 && ( details.permission && details.permission !== "Reporter"); const { bannerList } = props; useEffect(()=>{ if(bannerList && bannerList.length>0){ @@ -93,7 +93,7 @@ function CoderDepot(props){ useEffect(()=>{ - if(details && mirror_status!==2){ + if(details && mirror_status===0){ setProjectDetail(details); setTopics(details.topics); setDesc(details.description); @@ -126,7 +126,7 @@ function CoderDepot(props){ },[treeValue]) useEffect(()=>{ - if (projectsId && owner && defaultBranch && mirror_status!==2){ + if (projectsId && owner && defaultBranch && mirror_status===0){ let b = turnbar(branchName) ; if(pathname.indexOf(`/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${b}/`) > -1) { let url = pathname.split(`/tree/${b}/`)[1]; @@ -142,7 +142,7 @@ function CoderDepot(props){ },[projectsId,owner,pathname,defaultBranch,mirror_status]) useEffect(()=>{ - if(platform && mirror_status!==2){ + if(platform && mirror_status===0){ setReadOnly(props.history.location.search.indexOf('edit') !== -1); axios.get(`/${owner}/${projectsId}/releases.json`).then((result)=>{ if(result && result.data){ @@ -386,14 +386,14 @@ function CoderDepot(props){ const { current_user , checkIfLogin , showLoginDialog } = props; const baseOper = current_user && current_user.login && issuesFlag; - const baseOperate = projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter" && projectDetail.type !== 2 && pullsFlag && props.platform; - const fileOperate = type === "dir" && projectDetail && projectDetail.type !== 2 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin)); + const baseOperate = projectDetail && projectDetail.permission && projectDetail.permission !=="Reporter" && projectDetail.type ===0 && pullsFlag && props.platform; + const fileOperate = type === "dir" && projectDetail && projectDetail.type ===0 && ((projectDetail.permission && projectDetail.permission !=="Reporter") || (current_user && current_user.admin)); return( - {mirror_status !== 2 && setOpenModal(false)} onOk={okUpdate} showNotification={props.showNotification}/> } + {mirror_status ===0 && setOpenModal(false)} onOk={okUpdate}/> } { - ((dirInfo || fileInfo) && mirror_status!==2 ) && + ((dirInfo || fileInfo) && mirror_status===0 ) &&
{ - props && (props.platform && mirror_status !== 2) ? + props && (props.platform && mirror_status ===0) ? } {/* 贡献者 */} - {mirror_status !==2 && } + {mirror_status ===0 && } {/* 语言 */} - { mirror_status !== 2 && } + { mirror_status ===0 && } } diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 4ce2d4181..75cdf8871 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -198,8 +198,6 @@ class Detail extends Component { componentDidMount = () => { - const { mirror_status } = this.state - this.props.showNotification("getProject getProject getProject",mirror_status); this.getProject(); let history = this.props.location; this.clearIssueCookies(history); @@ -242,7 +240,6 @@ class Detail extends Component { open_devops: result.data.open_devops, platform: result.data.platform && result.data.platform !== 'educoder' }) - if (result.data.type !== 0 && result.data.mirror_status === 1) { console.log("--------start channel --------"); // 是镜像项目,且未完成迁移 @@ -262,11 +259,11 @@ class Detail extends Component { mirror_status:1 }) } else if (result.data.mirror_status === 2) { - this.deleteProjectBack(); this.setState({ mirror_status:2, firstSync: false }) + this.deleteProjectBack(); } else { this.getBanner(); this.getDetail(); diff --git a/src/forge/Main/sub/UpdateDescModal.jsx b/src/forge/Main/sub/UpdateDescModal.jsx index a2f9ade4a..0043b865a 100644 --- a/src/forge/Main/sub/UpdateDescModal.jsx +++ b/src/forge/Main/sub/UpdateDescModal.jsx @@ -4,7 +4,7 @@ import "./sub.scss"; import axios from 'axios'; import { useState } from 'react'; const { TextArea } = Input; -function UpdateDescModal({form , visible , onCancel , onOk,desc,website,lesson_url, topicsInfo,showNotification}){ +function UpdateDescModal({form , visible , onCancel , onOk,desc,website,lesson_url, topicsInfo}){ const { getFieldDecorator, validateFields , setFieldsValue } = form; const [topics, setTopics] = useState(undefined);