1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-24 04:48:03 +00:00

[my libs] modified 'op menu' (#4473)

This commit is contained in:
llj
2020-03-09 21:13:16 +08:00
committed by GitHub
parent e27c0350d0
commit cf6c54504a
2 changed files with 18 additions and 10 deletions

View File

@@ -107,7 +107,7 @@ class MylibRepoListItem extends React.Component {
case 'API Token':
this.onAPITokenToggle();
break;
case 'Share Links':
case 'Share Links Admin':
this.toggleRepoShareUploadLinksDialog();
break;
default:

View File

@@ -53,16 +53,18 @@ class MylibRepoMenu extends React.Component {
generatorOperations = () => {
let repo = this.props.repo;
let showResetPasswordMenuItem = repo.encrypted && enableResetEncryptedRepoPassword && isEmailConfigured;
let operations = ['Rename', 'Transfer', 'History Setting', 'API Token', 'Share Links'];
let operations = ['Rename', 'Transfer'];
if (folderPermEnabled) {
operations.push('Folder Permission');
}
operations.push('Share Links Admin', 'Divider');
if (repo.encrypted) {
operations.push('Change Password');
}
if (showResetPasswordMenuItem) {
operations.push('Reset Password');
}
if (folderPermEnabled) {
operations.push('Folder Permission');
}
operations.push('History Setting', 'API Token');
if (this.props.isPC && enableRepoSnapshotLabel) {
operations.push('Label Current State');
}
@@ -108,8 +110,8 @@ class MylibRepoMenu extends React.Component {
case 'API Token':
translateResult = 'API Token'; // translation is not needed here
break;
case 'Share Links':
translateResult = gettext('Share Links');
case 'Share Links Admin':
translateResult = gettext('Share Links Admin');
break;
default:
break;
@@ -135,7 +137,11 @@ class MylibRepoMenu extends React.Component {
/>
<DropdownMenu>
{operations.map((item, index)=> {
if (item == 'Divider') {
return <DropdownItem key={index} divider />;
} else {
return (<DropdownItem key={index} data-toggle={item} onClick={this.onMenuItemClick}>{this.translateOperations(item)}</DropdownItem>);
}
})}
</DropdownMenu>
</Dropdown>
@@ -161,7 +167,9 @@ class MylibRepoMenu extends React.Component {
<div className="mobile-operation-menu-bg-layer"></div>
<div className="mobile-operation-menu">
{operations.map((item, index) => {
if (item != 'Divider') {
return (<DropdownItem key={index} className="mobile-menu-item" data-toggle={item} onClick={this.onMenuItemClick}>{this.translateOperations(item)}</DropdownItem>);
}
})}
</div>
</div>