secret_repository_tab

dev_cs
hjm 6 years ago
parent a03a1682f7
commit 29e31216c7

@ -303,7 +303,7 @@ class TPMIndex extends Component {
/>) />)
}></Route> }></Route>
<Route path="/shixuns/:shixunId/secret_repository" render={ <Route path="/shixuns/:shixunId/secret_repository" render={
(props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} secret_repository={true} (props) => (<TPMRepositoryComponent {...this.props} {...this.state} {...props} secret_repository_tab={true}
/>) />)
}></Route> }></Route>

@ -31,7 +31,7 @@ class TPMRepositoryComponent extends Component {
} }
} }
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
if (this.props.secret_repository != prevProps.secret_repository) { if (this.props.secret_repository_tab != prevProps.secret_repository_tab) {
this.fetchRepo() this.fetchRepo()
} }
} }

@ -85,7 +85,7 @@ class Repository extends Component {
className=" guideBtn" >Git使用指南</a> className=" guideBtn" >Git使用指南</a>
{ {
this.props.current_user && (this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ? this.props.current_user && (this.props.current_user.admin ==true || (TPMRightSectionData && TPMRightSectionData.creator && TPMRightSectionData.creator.login == this.props.current_user.login)) ?
!this.props.secret_repository && !this.props.secret_repository_tab &&
<ActionBtn style="orangeLine" className="ml20" to={`/shixuns/${match.params.shixunId}/repository/add_file`}>+添加文件</ActionBtn> <ActionBtn style="orangeLine" className="ml20" to={`/shixuns/${match.params.shixunId}/repository/add_file`}>+添加文件</ActionBtn>
:"" :""
} }
@ -158,7 +158,7 @@ class Repository extends Component {
</div> </div>
</div> </div>
{this.props.secret_repository && <RepositoryCombinePath {...this.props}> {this.props.secret_repository_tab && <RepositoryCombinePath {...this.props}>
</RepositoryCombinePath>} </RepositoryCombinePath>}

Loading…
Cancel
Save