mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-17 07:41:26 +00:00
[related files] removed all the related functions
This commit is contained in:
@@ -14,9 +14,7 @@ const propTypes = {
|
||||
isDraft: PropTypes.bool.isRequired,
|
||||
hasDraft: PropTypes.bool.isRequired,
|
||||
fileTags: PropTypes.array.isRequired,
|
||||
relatedFiles: PropTypes.array.isRequired,
|
||||
onFileTagChanged: PropTypes.func.isRequired, // for file-view-toolbar
|
||||
onRelatedFileChange: PropTypes.func.isRequired,
|
||||
// side-panel
|
||||
onSideNavMenuClick: PropTypes.func.isRequired,
|
||||
// mutiple-dir
|
||||
@@ -75,9 +73,7 @@ class LibContentToolbar extends React.Component {
|
||||
isDraft={this.props.isDraft}
|
||||
hasDraft={this.props.hasDraft}
|
||||
fileTags={this.props.fileTags}
|
||||
relatedFiles={this.props.relatedFiles}
|
||||
onFileTagChanged={this.props.onFileTagChanged}
|
||||
onRelatedFileChange={this.props.onRelatedFileChange}
|
||||
showShareBtn={this.props.showShareBtn}
|
||||
/>
|
||||
<ViewModeToolbar currentMode={this.props.currentMode} switchViewMode={this.props.switchViewMode} isCustomPermission={isCustomPermission} />
|
||||
@@ -107,7 +103,6 @@ class LibContentToolbar extends React.Component {
|
||||
currentRepoInfo={this.props.currentRepoInfo}
|
||||
enableDirPrivateShare={this.props.enableDirPrivateShare}
|
||||
updateDirent={this.props.updateDirent}
|
||||
relatedFiles={this.props.relatedFiles}
|
||||
unSelectDirent={this.props.unSelectDirent}
|
||||
onFilesTagChanged={this.props.onFilesTagChanged}
|
||||
showShareBtn={this.props.showShareBtn}
|
||||
|
@@ -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}
|
||||
|
Reference in New Issue
Block a user