|
|
|
@ -32,6 +32,7 @@ class TPMRepositoryComponent extends Component {
|
|
|
|
|
pathArray: pathArray,
|
|
|
|
|
isContentWidth100: this._isFileInPathArray(pathArray)
|
|
|
|
|
}
|
|
|
|
|
this.props.setpathArray(pathArray)
|
|
|
|
|
}
|
|
|
|
|
componentDidUpdate(prevProps, prevState) {
|
|
|
|
|
if (this.props.secret_repository_tab != prevProps.secret_repository_tab) {
|
|
|
|
@ -106,6 +107,7 @@ class TPMRepositoryComponent extends Component {
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.setState({ repositoryLoading: true, pathArray: newPathArray })
|
|
|
|
|
this.props.setpathArray(newPathArray)
|
|
|
|
|
this.setState({
|
|
|
|
|
fileContent: response.data.content,
|
|
|
|
|
repositoryLoading: false
|
|
|
|
@ -113,7 +115,7 @@ class TPMRepositoryComponent extends Component {
|
|
|
|
|
|
|
|
|
|
if(response.data.content){
|
|
|
|
|
this.props.history
|
|
|
|
|
.replace(`/shixuns/${id}/repository` +
|
|
|
|
|
.replace(`/shixuns/${id}/${this.props.secret_repository_tab ? 'secret_repository' : 'repository'}` +
|
|
|
|
|
(newPathArray.length ? `/master/shixun_show/${newPathArray.join('/')}` : ''))
|
|
|
|
|
// this.props.history.replace(`${this.props.match.url}/master/shixun_show/${newPathArray.join('/')}`)
|
|
|
|
|
}
|
|
|
|
@ -174,6 +176,7 @@ class TPMRepositoryComponent extends Component {
|
|
|
|
|
}
|
|
|
|
|
// https://testeduplus2.educoder.net/shixuns/3ozvy5f8/repository.json
|
|
|
|
|
this.setState({ repositoryLoading: true, pathArray: newPathArray })
|
|
|
|
|
this.props.setpathArray(newPathArray)
|
|
|
|
|
let urlNewPathArray = newPathArray;
|
|
|
|
|
let fileInPathArray = false;
|
|
|
|
|
if (newPathArray.length) {
|
|
|
|
@ -215,7 +218,7 @@ class TPMRepositoryComponent extends Component {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.props.history
|
|
|
|
|
.replace(`/shixuns/${id}/repository` +
|
|
|
|
|
.replace(`/shixuns/${id}/${this.props.secret_repository_tab ? 'secret_repository' : 'repository'}` +
|
|
|
|
|
(newPathArray.length ? `/master/shixun_show/${newPathArray.join('/')}` : ''))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -237,16 +240,7 @@ class TPMRepositoryComponent extends Component {
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
const { listItemtypes } = this.state;
|
|
|
|
|
let matchpath =this.props.match.path;
|
|
|
|
|
let flag =false;
|
|
|
|
|
|
|
|
|
|
// if(matchpath==="/shixuns/:shixunId/repository"){
|
|
|
|
|
// flag =true;
|
|
|
|
|
// }else if(matchpath==="/shixuns/:shixunId/secret_repository"){
|
|
|
|
|
// flag =true;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// 需要重构
|
|
|
|
|
return (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
{ listItemtypes===false? <TPMRepository
|
|
|
|
|