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

Merge branch '7.0' into master2

This commit is contained in:
plt
2019-06-19 21:28:07 +08:00
12 changed files with 221 additions and 47 deletions

View File

@@ -34,8 +34,8 @@ class DeleteRepoDialog extends Component {
<p dangerouslySetInnerHTML={{__html: message}}></p>
</ModalBody>
<ModalFooter>
<Button color="primary" onClick={this.onDeleteRepo}>{gettext('Delete')}</Button>
<Button color="secondary" onClick={this.toggle}>{gettext('Cancel')}</Button>
<Button color="primary" onClick={this.onDeleteRepo}>{gettext('Delete')}</Button>
</ModalFooter>
</Modal>
);

View File

@@ -458,12 +458,10 @@ class DirentListItem extends React.Component {
}
renderItemOperation = () => {
let { dirent, selectedDirentList, currentRepoInfo } = this.props;
let { dirent, selectedDirentList, currentRepoInfo, showShareBtn } = this.props;
if (currentRepoInfo.permission === 'cloud-edit' || currentRepoInfo.permission === 'preview') {
return '';
}
let isShowShareBtn = (dirent.type === 'dir' && this.props.showShareBtn) || canGenerateShareLink;
return (
<Fragment>
@@ -475,7 +473,7 @@ class DirentListItem extends React.Component {
<li className="operation-group-item">
<i className="op-icon sf2-icon-download" title={gettext('Download')} onClick={this.onItemDownload}></i>
</li>
{isShowShareBtn &&
{showShareBtn &&
<li className="operation-group-item">
<i className="op-icon sf2-icon-share" title={gettext('Share')} onClick={this.onItemShare}></i>
</li>
@@ -505,7 +503,7 @@ class DirentListItem extends React.Component {
<li className="operation-group-item">
<i className="op-icon sf2-icon-download" title={gettext('Download')} onClick={this.onItemDownload}></i>
</li>
{isShowShareBtn &&
{showShareBtn &&
<li className="operation-group-item">
<i className="op-icon sf2-icon-share" title={gettext('Share')} onClick={this.onItemShare}></i>
</li>

View File

@@ -8,6 +8,7 @@ import { gettext, siteRoot, isPro, username, folderPermEnabled, isSystemStaff }
import ModalPortal from '../../components/modal-portal';
import ShareDialog from '../../components/dialog/share-dialog';
import LibSubFolderPermissionDialog from '../../components/dialog/lib-sub-folder-permission-dialog';
import DeleteRepoDialog from '../../components/dialog/delete-repo-dialog';
import Rename from '../rename';
import { seafileAPI } from '../../utils/seafile-api';
@@ -35,7 +36,8 @@ class SharedRepoListItem extends React.Component {
isShowSharedDialog: false,
isRenaming: false,
isStarred: this.props.repo.starred,
isFolderPermissionDialogOpen: false
isFolderPermissionDialogOpen: false,
isDeleteDialogShow: false
};
this.isDeparementOnwerGroupMember = false;
}
@@ -161,8 +163,8 @@ class SharedRepoListItem extends React.Component {
this.props.onItemUnshare(this.props.repo);
}
onItemDelete = () => {
this.props.onItemDelete(this.props.repo);
onItemDeleteToggle = () => {
this.setState({isDeleteDialogShow: !this.state.isDeleteDialogShow})
}
toggleShareDialog = () => {
@@ -284,7 +286,7 @@ class SharedRepoListItem extends React.Component {
}
const shareOperation = <a href="#" className="op-icon sf2-icon-share" title={gettext('Share')} onClick={this.onItemShare}></a>;
const unshareOperation = <a href="#" className="op-icon sf2-icon-x3" title={gettext('Unshare')} onClick={this.onItemUnshare}></a>;
const deleteOperation = <a href="#" className="op-icon sf2-icon-delete" title={gettext('Delete')} onClick={this.onItemDelete}></a>;
const deleteOperation = <a href="#" className="op-icon sf2-icon-delete" title={gettext('Delete')} onClick={this.onItemDeleteToggle}></a>;
if (this.isDeparementOnwerGroupMember) {
return (
@@ -391,6 +393,15 @@ class SharedRepoListItem extends React.Component {
/>
</ModalPortal>
)}
{this.state.isDeleteDialogShow &&
<ModalPortal>
<DeleteRepoDialog
repo={this.props.repo}
onDeleteRepo={this.props.onItemDelete}
toggle={this.onItemDeleteToggle}
/>
</ModalPortal>
}
</Fragment>
);
}