1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 16:10:26 +00:00

repair share btn control bug

This commit is contained in:
shanshuirenjia
2019-06-21 17:54:06 +08:00
parent 1b1df904f5
commit d5d6472186
10 changed files with 67 additions and 51 deletions

View File

@@ -34,7 +34,6 @@ const propTypes = {
onItemClick: PropTypes.func.isRequired,
isDirentListLoading: PropTypes.bool.isRequired,
isGroupOwnedRepo: PropTypes.bool.isRequired,
showShareBtn: PropTypes.bool.isRequired,
enableDirPrivateShare: PropTypes.bool.isRequired,
updateDirent: PropTypes.func.isRequired,
isDirentDetailShow: PropTypes.bool.isRequired,
@@ -407,12 +406,15 @@ class DirentGridView extends React.Component{
let type = dirent.type;
let permission = dirent.permission;
let showShareBtn = Utils.isHasPermissionToShare(currentRepoInfo, permission, dirent);
let menuList = [];
let contextmenuList = [];
if (isContextmenu) {
let { SHARE, DOWNLOAD, DELETE } = TextTranslation;
contextmenuList = this.props.showShareBtn ? [SHARE] : [];
if (showShareBtn) {
contextmenuList = [SHARE];
}
if (dirent.permission === 'rw' || dirent.permission === 'r') {
contextmenuList = [...contextmenuList, DOWNLOAD];