1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +00:00

[related files] removed all the related functions

This commit is contained in:
llj
2022-03-11 18:38:57 +08:00
parent c888a42782
commit 6993247423
15 changed files with 11 additions and 736 deletions

View File

@@ -47,7 +47,6 @@ class LibContentView extends React.Component {
isDraft: false,
hasDraft: false,
fileTags: [],
relatedFiles: [],
draftID: '',
draftCounts: 0,
usedRepoTags: [],
@@ -420,17 +419,6 @@ class LibContentView extends React.Component {
let errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);
});
seafileAPI.listRelatedFiles(repoID, filePath).then(res => {
let relatedFiles = res.data.related_files.map((relatedFile) => {
return relatedFile;
});
this.setState({relatedFiles: relatedFiles});
}).catch((error) => {
if (error.response.status === 500) {
this.setState({relatedFiles: []});
}
});
}
// update state
@@ -1733,22 +1721,6 @@ class LibContentView extends React.Component {
});
}
onToolbarRelatedFileChange = () => {
let repoID = this.props.repoID;
let filePath = this.state.path;
seafileAPI.listRelatedFiles(repoID, filePath).then(res => {
let relatedFiles = res.data.related_files.map((relatedFile) => {
return relatedFile;
});
this.setState({relatedFiles: relatedFiles});
}).catch((error) => {
if (error.response.status === 500) {
this.setState({relatedFiles: []});
}
});
}
unSelectDirent = () => {
this.setState({
isDirentSelected: false,
@@ -1818,9 +1790,7 @@ class LibContentView extends React.Component {
isDraft={this.state.isDraft}
hasDraft={this.state.hasDraft}
fileTags={this.state.fileTags}
relatedFiles={this.state.relatedFiles}
onFileTagChanged={this.onToolbarFileTagChanged}
onRelatedFileChange={this.onToolbarRelatedFileChange}
onSideNavMenuClick={this.props.onMenuClick}
repoID={this.props.repoID}
path={this.state.path}
@@ -1849,7 +1819,6 @@ class LibContentView extends React.Component {
updateDirent={this.updateDirent}
onDirentSelected={this.onDirentSelected}
showDirentDetail={this.showDirentDetail}
listRelatedFiles={this.listRelatedFiles}
unSelectDirent={this.unSelectDirent}
onFilesTagChanged={this.onFileTagChanged}
/>
@@ -1872,7 +1841,6 @@ class LibContentView extends React.Component {
isDraft={this.state.isDraft}
hasDraft={this.state.hasDraft}
fileTags={this.state.fileTags}
relatedFiles={this.state.relatedFiles}
goDraftPage={this.goDraftPage}
isFileLoading={this.state.isFileLoading}
isFileLoadedErr={this.state.isFileLoadedErr}