forked from Gitlink/forgeplus-react
Merge branch 'newVersion_forge' into dev_devOps
This commit is contained in:
commit
b6bc59a775
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from "react";
|
||||
import { Menu, Spin, Button } from "antd";
|
||||
import { Menu, Spin } from "antd";
|
||||
import { getImageUrl } from "educoder";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
|
@ -10,6 +10,7 @@ import RootTable from './RootTable';
|
|||
import CoderRootFileDetail from './CoderRootFileDetail';
|
||||
import { truncateCommitId } from '../common/util';
|
||||
import RenderHtml from '../../components/render-html';
|
||||
import Nodata from '../Nodata';
|
||||
|
||||
import axios from "axios";
|
||||
/**
|
||||
|
@ -198,7 +199,7 @@ class CoderRootDirectory extends Component {
|
|||
ref:ref || branch
|
||||
}
|
||||
}).then((result)=>{
|
||||
let entries = result.data && result.data.entries
|
||||
let entries = result.data && result.data.entries;
|
||||
if( entries && entries.length > 0){
|
||||
let { chooseType } = this.state;
|
||||
// 当前返回的子目录只有一条数据,且这条数据返回的是文件类型
|
||||
|
@ -219,11 +220,19 @@ class CoderRootDirectory extends Component {
|
|||
})
|
||||
this.renderData(entries);
|
||||
}
|
||||
}else{
|
||||
console.log("均为undefined");
|
||||
this.setState({
|
||||
fileDetail:undefined,
|
||||
rootList:undefined,
|
||||
isSpin:false,
|
||||
subFileType:false
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
};
|
||||
|
||||
renderData = (data) => {
|
||||
|
@ -526,8 +535,11 @@ class CoderRootDirectory extends Component {
|
|||
onEdit={this.onEdit}
|
||||
></CoderRootFileDetail>
|
||||
)}
|
||||
{
|
||||
!rootList && !fileDetail && <Nodata _html="暂未发现当前文件!"/>
|
||||
}
|
||||
{/* readme.txt (isManager || isDeveloper)*/}
|
||||
{this.renderReadMeContent(readMeContent, isManager || isDeveloper)}
|
||||
{ rootList && this.renderReadMeContent(readMeContent, isManager || isDeveloper)}
|
||||
</div>
|
||||
</Spin>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue