1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 07:55:36 +00:00

repair encryption library move and copy bugs (#3082)

This commit is contained in:
zxj96
2019-03-08 17:38:28 +08:00
committed by Daniel Pan
parent 2fb1e9f866
commit e854970094
3 changed files with 8 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ const propTypes = {
onItemCopy: PropTypes.func,
onItemsCopy: PropTypes.func,
onCancelCopy: PropTypes.func.isRequired,
currentRepoInfo:PropTypes.object.isRequired,
};
// need dirent file Path
@@ -156,6 +157,7 @@ class CopyDirent extends React.Component {
} else {
title = gettext('Copy selected item(s) to:');
}
let mode = this.props.currentRepoInfo.encrypted ? 'only_current_library':'current_repo_and_other_repos'
return (
<Modal isOpen={true} toggle={this.toggle}>
<ModalHeader toggle={this.toggle}><div dangerouslySetInnerHTML={{__html: title}}></div></ModalHeader>
@@ -164,7 +166,7 @@ class CopyDirent extends React.Component {
repoID={this.props.repoID}
onDirentItemClick={this.onDirentItemClick}
onRepoItemClick={this.onRepoItemClick}
mode="current_repo_and_other_repos"
mode={mode}
/>
{this.state.errMessage && <Alert color="danger" style={{margin: '0.5rem'}}>{this.state.errMessage}</Alert>}
</ModalBody>

View File

@@ -14,6 +14,7 @@ const propTypes = {
onItemMove: PropTypes.func,
onItemsMove: PropTypes.func,
onCancelMove: PropTypes.func.isRequired,
currentRepoInfo:PropTypes.object.isRequired,
};
// need dirent file Path
@@ -156,6 +157,7 @@ class MoveDirent extends React.Component {
} else {
title = gettext('Move selected item(s) to:');
}
let mode = this.props.currentRepoInfo.encrypted ? 'only_current_library':'current_repo_and_other_repos'
return (
<Modal isOpen={true} toggle={this.toggle}>
<ModalHeader toggle={this.toggle}><div dangerouslySetInnerHTML={{__html: title}}></div></ModalHeader>
@@ -164,7 +166,7 @@ class MoveDirent extends React.Component {
repoID={this.props.repoID}
onDirentItemClick={this.onDirentItemClick}
onRepoItemClick={this.onRepoItemClick}
mode="current_repo_and_other_repos"
mode={mode}
/>
{this.state.errMessage && <Alert color="danger" style={{margin: '0.5rem'}}>{this.state.errMessage}</Alert>}
</ModalBody>