1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-19 18:29:23 +00:00

conflict fixed

This commit is contained in:
shanshuirenjia
2020-04-01 11:19:09 +08:00
25 changed files with 369 additions and 76 deletions

View File

@@ -77,6 +77,7 @@ class LibContentView extends React.Component {
isSessionExpired: false,
isCopyMoveProgressDialogShow: false,
asyncCopyMoveTaskId: '',
asyncOperationType: 'move',
asyncOperationProgress: 0,
asyncOperatedFilesLength: 0,
};
@@ -632,18 +633,18 @@ class LibContentView extends React.Component {
// toolbar operations
onMoveItems = (destRepo, destDirentPath) => {
let repoID = this.props.repoID;
let direntPaths = this.getSelectedDirentPaths();
let dirNames = this.getSelectedDirentNames();
let selectedDirentList = this.state.selectedDirentList;
if (repoID !== destRepo.repo_id) {
this.setState({
asyncOperatedFilesLength: dirNames.length,
this.setState(() => ({
asyncOperatedFilesLength: selectedDirentList.length,
asyncOperationProgress: 0,
asyncOperationType: 'move',
isCopyMoveProgressDialogShow: true
});
}));
}
let dirNames = this.getSelectedDirentNames();
let direntPaths = this.getSelectedDirentPaths();
seafileAPI.moveDir(repoID, destRepo.repo_id, destDirentPath, this.state.path, dirNames).then(res => {
if (repoID !== destRepo.repo_id) {
this.setState({
@@ -682,17 +683,18 @@ class LibContentView extends React.Component {
onCopyItems = (destRepo, destDirentPath) => {
let repoID = this.props.repoID;
let dirNames = this.getSelectedDirentNames();
let selectedDirentList = this.state.selectedDirentList;
if (repoID !== destRepo.repo_id) {
this.setState({
asyncOperatedFilesLength: dirNames.length,
asyncOperatedFilesLength: selectedDirentList.length,
asyncOperationProgress: 0,
asyncOperationType: 'copy',
isCopyMoveProgressDialogShow: true
});
}
let dirNames = this.getSelectedDirentNames();
seafileAPI.copyDir(repoID, destRepo.repo_id, destDirentPath, this.state.path, dirNames).then(res => {
if (repoID !== destRepo.repo_id) {
this.setState({
@@ -1715,7 +1717,7 @@ class LibContentView extends React.Component {
}
let enableDirPrivateShare = false;
let { currentRepoInfo, userPerm } = this.state;
let { currentRepoInfo, userPerm, isCopyMoveProgressDialogShow } = this.state;
let showShareBtn = Utils.isHasPermissionToShare(currentRepoInfo, userPerm);
let isRepoOwner = currentRepoInfo.owner_email === username;
let isVirtual = currentRepoInfo.is_virtual;
@@ -1860,7 +1862,7 @@ class LibContentView extends React.Component {
)}
</div>
</div>
{this.state.isCopyMoveProgressDialogShow && (
{isCopyMoveProgressDialogShow && (
<CopyMoveDirentProgressDialog
type={this.state.asyncOperationType}
asyncOperatedFilesLength={this.state.asyncOperatedFilesLength}

View File

@@ -1,12 +1,11 @@
import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import { gettext, repoID, slug, siteRoot, username } from '../../utils/constants';
import CommonToolbar from '../../components/toolbar/common-toolbar';
import { gettext, repoID, slug, siteRoot, username, isPro } from '../../utils/constants';
import WikiMarkdownViewer from '../../components/wiki-markdown-viewer';
import WikiDirListView from '../../components/wiki-dir-list-view/wiki-dir-list-view';
import Loading from '../../components/loading';
import { Utils } from '../../utils/utils';
import Search from '../../components/search/wiki-search';
import Search from '../../components/search/search';
import Notification from '../../components/common/notification';
import Account from '../../components/common/account';
@@ -78,6 +77,8 @@ class MainPanel extends Component {
render() {
let { onSearchedClick, permission } = this.props;
let searchPlaceholder = gettext('Search files in this library');
const errMessage = (<div className="message err-tip">{gettext('Folder does not exist.')}</div>);
const isViewingFile = this.props.pathExist && !this.props.isDataLoading && this.props.isViewFile;
@@ -90,11 +91,9 @@ class MainPanel extends Component {
<span className="sf2-icon-menu hidden-md-up d-md-none side-nav-toggle" title="Side Nav Menu" onClick={this.onMenuClick}></span>
</div>
<div className="common-toolbar">
<Search
repoID={repoID}
onSearchedClick={this.props.onSearchedClick}
placeholder={gettext('Search')}
/>
{isPro && (
<Search isPublic={true} repoID={repoID} onSearchedClick={onSearchedClick} placeholder={searchPlaceholder}/>
)}
</div>
</Fragment>
}
@@ -109,12 +108,10 @@ class MainPanel extends Component {
)}
</div>
<div className="common-toolbar">
<Search
repoID={repoID}
onSearchedClick={this.props.onSearchedClick}
placeholder={gettext('Search')}
/>
<Notification />
{isPro && (
<Search isPublic={true} repoID={repoID} onSearchedClick={onSearchedClick} placeholder={searchPlaceholder}/>
)}
<Notification />
<Account />
</div>
</Fragment>