mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-31 14:42:10 +00:00
[fix] related-dailog (#2863)
This commit is contained in:
@@ -5,6 +5,7 @@ import { gettext } from '../../utils/constants';
|
|||||||
import { seafileAPI } from '../../utils/seafile-api';
|
import { seafileAPI } from '../../utils/seafile-api';
|
||||||
import { Utils } from '../../utils/utils';
|
import { Utils } from '../../utils/utils';
|
||||||
import FileChooser from '../file-chooser/file-chooser';
|
import FileChooser from '../file-chooser/file-chooser';
|
||||||
|
import '../../css/dirent-detail.css';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
repoID: PropTypes.string.isRequired,
|
repoID: PropTypes.string.isRequired,
|
||||||
|
@@ -159,5 +159,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.sf-add-related-file .related-file-subtitle {
|
.sf-add-related-file .related-file-subtitle {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 4px;
|
||||||
}
|
}
|
@@ -301,7 +301,6 @@ class MarkdownEditor extends React.Component {
|
|||||||
collabServer: seafileCollabServer ? seafileCollabServer : null,
|
collabServer: seafileCollabServer ? seafileCollabServer : null,
|
||||||
relatedFiles: [],
|
relatedFiles: [],
|
||||||
fileTagList: [],
|
fileTagList: [],
|
||||||
dirent: {},
|
|
||||||
showRelatedFileDialog: false,
|
showRelatedFileDialog: false,
|
||||||
showEditFileTagDialog: false,
|
showEditFileTagDialog: false,
|
||||||
showAddRelatedFileDialog: false,
|
showAddRelatedFileDialog: false,
|
||||||
@@ -382,7 +381,6 @@ class MarkdownEditor extends React.Component {
|
|||||||
});
|
});
|
||||||
this.listRelatedFiles();
|
this.listRelatedFiles();
|
||||||
this.listFileTags();
|
this.listFileTags();
|
||||||
this.listDirent();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
listRelatedFiles = () => {
|
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 = () => {
|
onRelatedFileChange = () => {
|
||||||
this.listRelatedFiles();
|
this.listRelatedFiles();
|
||||||
}
|
}
|
||||||
@@ -494,7 +471,7 @@ class MarkdownEditor extends React.Component {
|
|||||||
repoID={repoID}
|
repoID={repoID}
|
||||||
filePath={filePath}
|
filePath={filePath}
|
||||||
toggleCancel={this.closeAddRelatedFileDialog}
|
toggleCancel={this.closeAddRelatedFileDialog}
|
||||||
dirent={this.state.dirent}
|
dirent={this.state.fileInfo}
|
||||||
onRelatedFileChange={this.onRelatedFileChange}
|
onRelatedFileChange={this.onRelatedFileChange}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user