1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-02 15:57:31 +00:00

[fix] related-dailog (#2863)

This commit is contained in:
Michael An 2019-01-21 16:55:35 +08:00 committed by Daniel Pan
parent 405dfc9eeb
commit 910bdaa484
3 changed files with 3 additions and 25 deletions

View File

@ -5,6 +5,7 @@ import { gettext } from '../../utils/constants';
import { seafileAPI } from '../../utils/seafile-api';
import { Utils } from '../../utils/utils';
import FileChooser from '../file-chooser/file-chooser';
import '../../css/dirent-detail.css';
const propTypes = {
repoID: PropTypes.string.isRequired,

View File

@ -159,5 +159,5 @@
}
.sf-add-related-file .related-file-subtitle {
margin-bottom: 10px;
margin-bottom: 4px;
}

View File

@ -301,7 +301,6 @@ class MarkdownEditor extends React.Component {
collabServer: seafileCollabServer ? seafileCollabServer : null,
relatedFiles: [],
fileTagList: [],
dirent: {},
showRelatedFileDialog: false,
showEditFileTagDialog: false,
showAddRelatedFileDialog: false,
@ -382,7 +381,6 @@ class MarkdownEditor extends React.Component {
});
this.listRelatedFiles();
this.listFileTags();
this.listDirent();
}
listRelatedFiles = () => {
@ -405,27 +403,6 @@ class MarkdownEditor extends React.Component {
});
}
listDirent = () => {
seafileAPI.listDir(repoID, dirPath).then(res => {
let direntList = [];
res.data.forEach(item => {
if (this.props.isShowFile === true) {
let dirent = new Dirent(item);
direntList.push(dirent);
} else {
if (item.type === 'dir') {
let dirent = new Dirent(item);
direntList.push(dirent);
}
}
});
direntList = Utils.sortDirents(direntList, 'name', 'asc');
this.setState({
dirent: direntList[0]
});
});
}
onRelatedFileChange = () => {
this.listRelatedFiles();
}
@ -494,7 +471,7 @@ class MarkdownEditor extends React.Component {
repoID={repoID}
filePath={filePath}
toggleCancel={this.closeAddRelatedFileDialog}
dirent={this.state.dirent}
dirent={this.state.fileInfo}
onRelatedFileChange={this.onRelatedFileChange}
/>
}