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

sdocStartRevise

This commit is contained in:
skywalker
2023-06-28 14:48:59 +08:00
committed by er-pai-r
parent 0da16303f5
commit 5abb686efb
10 changed files with 250 additions and 54 deletions

View File

@@ -270,6 +270,9 @@ class DirentListItem extends React.Component {
case 'Unmask as draft':
this.onUnmaskAsDraft();
break;
case 'Start revise':
this.onStartRevise();
break;
case 'Comment':
this.props.onDirentClick(this.props.dirent);
this.props.showDirentDetail('comments');
@@ -381,6 +384,18 @@ class DirentListItem extends React.Component {
});
}
onStartRevise = () => {
let repoID = this.props.repoID;
let filePath = this.getDirentPath(this.props.dirent);
seafileAPI.sdocStartRevise(repoID, filePath).then((res) => {
let url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(res.data.file_path);
window.open(url);
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);
});
}
onHistory = () => {
let repoID = this.props.repoID;
let filePath = this.getDirentPath(this.props.dirent);