mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 23:20:51 +00:00
repair code error
This commit is contained in:
@@ -431,27 +431,28 @@ class DirentGridView extends React.Component{
|
|||||||
if (dirent.permission === 'rw') {
|
if (dirent.permission === 'rw') {
|
||||||
contextmenuList = [...contextmenuList, DELETE];
|
contextmenuList = [...contextmenuList, DELETE];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
contextmenuList = contextmenuList.length > 0 ? [...contextmenuList, 'Divider'] : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
let { RENAME, MOVE, COPY, PERMISSION, OPEN_VIA_CLIENT, LOCK, UNLOCK, COMMENT, HISTORY, ACCESS_LOG } = TextTranslation;
|
let { RENAME, MOVE, COPY, PERMISSION, OPEN_VIA_CLIENT, LOCK, UNLOCK, COMMENT, HISTORY, ACCESS_LOG } = TextTranslation;
|
||||||
if (type === 'dir' && permission === 'rw') {
|
if (type === 'dir' && permission === 'rw') {
|
||||||
menuList = [...contextmenuList, 'Divider'];
|
|
||||||
if (can_set_folder_perm) {
|
if (can_set_folder_perm) {
|
||||||
menuList = [...menuList, RENAME, MOVE, COPY, 'Divider', PERMISSION, 'Divider', OPEN_VIA_CLIENT];
|
menuList = [...contextmenuList, RENAME, MOVE, COPY, 'Divider', PERMISSION, 'Divider', OPEN_VIA_CLIENT];
|
||||||
} else {
|
} else {
|
||||||
menuList = [...menuList, RENAME, MOVE, COPY, 'Divider', OPEN_VIA_CLIENT];
|
menuList = [...contextmenuList, RENAME, MOVE, COPY, 'Divider', OPEN_VIA_CLIENT];
|
||||||
}
|
}
|
||||||
return menuList;
|
return menuList;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'dir' && permission === 'r') {
|
if (type === 'dir' && permission === 'r') {
|
||||||
menuList = [...contextmenuList];
|
menuList = [...contextmenuList];
|
||||||
menuList = currentRepoInfo.encrypted ? [...menuList, COPY] : [...menuList];
|
menuList = currentRepoInfo.encrypted ? [...menuList, COPY] : menuList.slice(0, menuList.length - 1);
|
||||||
return menuList;
|
return menuList;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'file' && permission === 'rw') {
|
if (type === 'file' && permission === 'rw') {
|
||||||
menuList = [...contextmenuList, 'Divider'];
|
menuList = [...contextmenuList];
|
||||||
if (!dirent.is_locked || (dirent.is_locked && dirent.locked_by_me)) {
|
if (!dirent.is_locked || (dirent.is_locked && dirent.locked_by_me)) {
|
||||||
menuList.push(RENAME);
|
menuList.push(RENAME);
|
||||||
menuList.push(MOVE);
|
menuList.push(MOVE);
|
||||||
@@ -480,7 +481,7 @@ class DirentGridView extends React.Component{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'file' && permission === 'r') {
|
if (type === 'file' && permission === 'r') {
|
||||||
menuList = [...contextmenuList, 'Divider'];
|
menuList = [...contextmenuList];
|
||||||
if (!currentRepoInfo.encrypted) {
|
if (!currentRepoInfo.encrypted) {
|
||||||
menuList.push(COPY);
|
menuList.push(COPY);
|
||||||
}
|
}
|
||||||
|
@@ -464,7 +464,7 @@ class DirentListView extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getDirentItemMenuList = (dirent, isContextmenu) => {
|
getDirentItemMenuList = (dirent, isContextmenu) => {
|
||||||
|
console.log(dirent.permission);
|
||||||
let isRepoOwner = this.isRepoOwner;
|
let isRepoOwner = this.isRepoOwner;
|
||||||
let currentRepoInfo = this.props.currentRepoInfo;
|
let currentRepoInfo = this.props.currentRepoInfo;
|
||||||
let can_set_folder_perm = folderPermEnabled && ((isRepoOwner && currentRepoInfo.has_been_shared_out) || currentRepoInfo.is_admin);
|
let can_set_folder_perm = folderPermEnabled && ((isRepoOwner && currentRepoInfo.has_been_shared_out) || currentRepoInfo.is_admin);
|
||||||
@@ -490,28 +490,27 @@ class DirentListView extends React.Component {
|
|||||||
if (dirent.permission === 'rw') {
|
if (dirent.permission === 'rw') {
|
||||||
contextmenuList = [...contextmenuList, DELETE];
|
contextmenuList = [...contextmenuList, DELETE];
|
||||||
}
|
}
|
||||||
|
contextmenuList = contextmenuList.length > 0 ? [...contextmenuList, 'Divider'] : [];
|
||||||
}
|
}
|
||||||
|
|
||||||
let { RENAME, MOVE, COPY, PERMISSION, OPEN_VIA_CLIENT, LOCK, UNLOCK, COMMENT, HISTORY, ACCESS_LOG, TAGS } = TextTranslation;
|
let { RENAME, MOVE, COPY, PERMISSION, OPEN_VIA_CLIENT, LOCK, UNLOCK, COMMENT, HISTORY, ACCESS_LOG, TAGS } = TextTranslation;
|
||||||
if (type === 'dir' && permission === 'rw') {
|
if (type === 'dir' && permission === 'rw') {
|
||||||
menuList = [...contextmenuList, 'Divider'];
|
|
||||||
if (can_set_folder_perm) {
|
if (can_set_folder_perm) {
|
||||||
menuList = [...menuList, RENAME, MOVE, COPY, 'Divider', PERMISSION, 'Divider', OPEN_VIA_CLIENT];
|
menuList = [...contextmenuList, RENAME, MOVE, COPY, 'Divider', PERMISSION, 'Divider', OPEN_VIA_CLIENT];
|
||||||
} else {
|
} else {
|
||||||
menuList = [...menuList, RENAME, MOVE, COPY, 'Divider', OPEN_VIA_CLIENT];
|
menuList = [...contextmenuList, RENAME, MOVE, COPY, 'Divider', OPEN_VIA_CLIENT];
|
||||||
}
|
}
|
||||||
return menuList;
|
return menuList;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'dir' && permission === 'r') {
|
if (type === 'dir' && permission === 'r') {
|
||||||
menuList = [...contextmenuList];
|
menuList = [...contextmenuList];
|
||||||
menuList = currentRepoInfo.encrypted ? [...menuList, COPY] : [...menuList];
|
menuList = currentRepoInfo.encrypted ? [...menuList, COPY] : menuList.slice(0, menuList.length - 1);
|
||||||
return menuList;
|
return menuList;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'file' && permission === 'rw') {
|
if (type === 'file' && permission === 'rw') {
|
||||||
menuList = [...contextmenuList, 'Divider'];
|
menuList = [...contextmenuList];
|
||||||
if (!dirent.is_locked || (dirent.is_locked && dirent.locked_by_me)) {
|
if (!dirent.is_locked || (dirent.is_locked && dirent.locked_by_me)) {
|
||||||
menuList.push(RENAME);
|
menuList.push(RENAME);
|
||||||
menuList.push(MOVE);
|
menuList.push(MOVE);
|
||||||
@@ -541,7 +540,7 @@ class DirentListView extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'file' && permission === 'r') {
|
if (type === 'file' && permission === 'r') {
|
||||||
menuList = [...contextmenuList, 'Divider'];
|
menuList = [...contextmenuList];
|
||||||
if (!currentRepoInfo.encrypted) {
|
if (!currentRepoInfo.encrypted) {
|
||||||
menuList.push(COPY);
|
menuList.push(COPY);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user