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

isPro lock file (#3149)

* isPro lock file

* scroll to bottom
This commit is contained in:
Michael An
2019-03-20 15:53:31 +08:00
committed by Daniel Pan
parent 1c417e9e71
commit c61e6354d9
2 changed files with 16 additions and 10 deletions

View File

@@ -26,16 +26,19 @@ class DirentMenu extends React.Component {
const length = dirents.length;
let menuList = [];
if (length === 1) {
if (dirents[0].type === 'dir') {
const dirent = dirents[0];
if (dirent.type === 'dir') {
menuList = ['Share'];
} else if (dirents[0].type === 'file') {
if (dirents[0].is_locked) {
menuList = ['Share', 'Unlock', 'Tags', 'Related Files', 'Divider', 'History', 'Details', 'Divider', 'Open via Client'];
} else {
menuList = ['Share', 'Lock', 'Tags', 'Related Files', 'Divider', 'History', 'Details', 'Divider', 'Open via Client'];
}
if (!(currentRepoInfo.is_admin && currentRepoInfo.permission === 'rw' || isRepoOwner)) {
menuList.splice(1, 1);
} else if (dirent.type === 'file') {
menuList = ['Share', 'Tags', 'Related Files', 'Divider', 'History', 'Details', 'Divider', 'Open via Client'];
if (isPro) {
if (dirent.is_locked) {
if (dirent.locked_by_me || (dirent.lock_owner === 'OnlineOffice' && currentRepoInfo.permission === 'rw')) {
menuList.splice(1, 0, 'Unlock');
}
} else {
menuList.splice(1, 0, 'Lock');
}
}
}
} else {