1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 15:38:15 +00:00

fix readonly shared repo dir toolbar name (#7517)

This commit is contained in:
Michael An
2025-02-25 11:57:58 +08:00
committed by GitHub
parent 4385020918
commit ec68ff1bcd
2 changed files with 14 additions and 2 deletions

View File

@@ -203,11 +203,19 @@ class DirOperationToolbar extends React.Component {
render() { render() {
let { path, repoName, userPerm } = this.props; let { path, repoName, userPerm } = this.props;
const { isCustomPermission, customPermission } = Utils.getUserPermission(userPerm);
const isShowDropdownMenu = (userPerm === 'rw' || userPerm === 'admin' || userPerm === 'cloud-edit' || isCustomPermission);
if (!isShowDropdownMenu) {
return (
<div className="dir-operation dir-operation-no-dropdown">
{this.props.children}
</div>
);
}
let itemType = path === '/' ? 'library' : 'dir'; let itemType = path === '/' ? 'library' : 'dir';
let itemName = path == '/' ? repoName : Utils.getFolderName(path); let itemName = path == '/' ? repoName : Utils.getFolderName(path);
const { isCustomPermission, customPermission } = Utils.getUserPermission(userPerm);
let canUpload = true; let canUpload = true;
let canCreate = true; let canCreate = true;
if (isCustomPermission) { if (isCustomPermission) {
@@ -372,7 +380,7 @@ class DirOperationToolbar extends React.Component {
return ( return (
<Fragment> <Fragment>
{(userPerm === 'rw' || userPerm === 'admin' || userPerm === 'cloud-edit' || isCustomPermission) && ( {isShowDropdownMenu && (
<div className="dir-operation"> <div className="dir-operation">
{content} {content}
</div> </div>

View File

@@ -280,6 +280,10 @@
align-items: center; align-items: center;
} }
.dir-view-path .dir-operation.dir-operation-no-dropdown {
margin-left: 6px;
}
.dir-view-path .dir-operation .path-item { .dir-view-path .dir-operation .path-item {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;