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

feat: list revisions

This commit is contained in:
er-pai-r
2023-07-07 16:07:14 +08:00
parent 74f18d8b79
commit cee0349f3c
13 changed files with 312 additions and 11 deletions

View File

@@ -159,6 +159,9 @@ class DirentGridView extends React.Component{
case 'Start revise':
this.onStartRevise(currentObject);
break;
case 'List revisions':
this.openRevisionsPage(currentObject);
break;
case 'Comment':
this.onCommentItem();
break;
@@ -297,14 +300,22 @@ class DirentGridView extends React.Component{
let repoID = this.props.repoID;
let filePath = this.getDirentPath(currentObject);
seafileAPI.sdocStartRevise(repoID, filePath).then((res) => {
let url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(res.data.file_path);
const url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(res.data.file_path);
window.open(url);
}).catch(error => {
let errMessage = Utils.getErrorMsg(error);
const errMessage = Utils.getErrorMsg(error);
toaster.danger(errMessage);
});
}
openRevisionsPage = (currentObject) => {
const repoID = this.props.repoID;
const filePath = this.getDirentPath(currentObject);
const url = Utils.generateRevisionsURL(siteRoot, repoID, filePath);
if (!url) return;
window.open(url);
}
onCommentItem = () => {
this.props.showDirentDetail('comments');
}