1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 10:50:24 +00:00

View repo content in list mode (#2579)

This commit is contained in:
杨顺强
2018-11-29 17:55:14 +08:00
committed by Daniel Pan
parent 4f38e393d5
commit c00d4f30bd
23 changed files with 773 additions and 107 deletions

View File

@@ -11,7 +11,7 @@ const propTypes = {
dirent: PropTypes.object.isRequired,
direntType: PropTypes.string.isRequired,
direntDetail: PropTypes.object.isRequired,
direntPath: PropTypes.string.isRequired,
path: PropTypes.string.isRequired,
fileTagList: PropTypes.array.isRequired,
onFileTagChanged: PropTypes.func.isRequired,
};
@@ -26,7 +26,8 @@ class DetailListView extends React.Component {
}
getDirentPostion = () => {
let { repo, direntPath } = this.props;
let { repo } = this.props;
let direntPath = this.getDirentPath();
let position = repo.repo_name;
if (direntPath !== '/') {
let index = direntPath.lastIndexOf('/');
@@ -43,12 +44,19 @@ class DetailListView extends React.Component {
}
onFileTagChanged = () => {
this.props.onFileTagChanged(this.props.dirent, this.props.direntPath);
let direntPath = this.getDirentPath();
this.props.onFileTagChanged(this.props.dirent, direntPath);
}
getDirentPath = () => {
let { dirent, path } = this.props;
return Utils.joinPath(path, dirent.name);
}
render() {
let { direntType, direntDetail, fileTagList } = this.props;
let position = this.getDirentPostion();
let direntPath = this.getDirentPath();
if (direntType === 'dir') {
return (
<table>
@@ -93,7 +101,7 @@ class DetailListView extends React.Component {
<EditFileTagDialog
repoID={this.props.repoID}
fileTagList={fileTagList}
filePath={this.props.direntPath}
filePath={direntPath}
toggleCancel={this.onEditFileTagToggle}
onFileTagChanged={this.onFileTagChanged}
/>