diff --git a/frontend/src/components/shared-repo-list-view/shared-repo-list-item.js b/frontend/src/components/shared-repo-list-view/shared-repo-list-item.js index caa7c21467..5e9772aecd 100644 --- a/frontend/src/components/shared-repo-list-view/shared-repo-list-item.js +++ b/frontend/src/components/shared-repo-list-view/shared-repo-list-item.js @@ -277,11 +277,11 @@ class SharedRepoListItem extends React.Component { if (this.props.libraryType && this.props.libraryType === 'public') { let isRepoOwner = this.props.repo.owner_email === username; if (isSystemStaff || isRepoOwner) { - operations.push('unshare'); + operations.push('Unshare'); } } else { - // scene one: (share, delete, itemToggle and other operations); - // scene two: (share, unshare), (share), (unshare) + // scene one: (Share, Delete, itemToggle and other operations); + // scene two: (Share, Unshare), (Share), (Unshare) operations = this.generatorOperations(); } const shareOperation = ; @@ -319,11 +319,11 @@ class SharedRepoListItem extends React.Component { ); } - if (operations.length == 1 && operations[0] === 'share') { + if (operations.length == 1 && operations[0] === 'Share') { return shareOperation; } - if (operations.length == 1 && operations[0] === 'unshare') { + if (operations.length == 1 && operations[0] === 'Unshare') { return unshareOperation; } } diff --git a/frontend/src/pages/lib-content-view/lib-content-view.js b/frontend/src/pages/lib-content-view/lib-content-view.js index 19e7e9256d..14d2cd339e 100644 --- a/frontend/src/pages/lib-content-view/lib-content-view.js +++ b/frontend/src/pages/lib-content-view/lib-content-view.js @@ -1484,7 +1484,11 @@ class LibContentView extends React.Component { let { currentRepoInfo, userPerm } = this.state; let showShareBtn = Utils.isHasPermissionToShare(currentRepoInfo, userPerm); let isRepoOwner = currentRepoInfo.owner_email === username; - + let isVirtual = currentRepoInfo.is_virtual; + let isAdmin = currentRepoInfo.is_admin; + if (!isVirtual && (isRepoOwner || isAdmin)) { + enableDirPrivateShare = true; + } let direntItemsList = this.state.direntList.filter((item, index) => { return index < this.state.itemsShowLength; });