mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-15 06:44:16 +00:00
Fix searched dir then copy dir bug (#5727)
* fix warnings * fix search result path error
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Button, Modal, ModalHeader, Input, ModalBody, ModalFooter, Form, FormGroup, Label, Alert } from 'reactstrap';
|
||||
import { gettext, isDocs } from '../../utils/constants';
|
||||
import { gettext } from '../../utils/constants';
|
||||
import { Utils } from '../../utils/utils';
|
||||
|
||||
const propTypes = {
|
||||
@@ -141,7 +141,6 @@ class CreateFile extends React.Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { isSdocDraft } = this.state;
|
||||
const { toggleDialog } = this.props;
|
||||
return (
|
||||
<Modal isOpen={true} toggle={toggleDialog} onOpened={this.onAfterModelOpened}>
|
||||
|
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
|
||||
import ModalPortal from './modal-portal';
|
||||
import ListTaggedFilesDialog from './dialog/list-taggedfiles-dialog';
|
||||
import ListRepoDraftsDialog from './dialog/list-repo-drafts-dialog';
|
||||
import { gettext } from '../utils/constants';
|
||||
|
||||
import '../css/repo-info-bar.css';
|
||||
|
||||
|
@@ -219,7 +219,7 @@ class FileHistory extends React.Component {
|
||||
goBack = (e) => {
|
||||
e.preventDefault();
|
||||
window.history.back();
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
|
@@ -133,6 +133,10 @@ class LibContentView extends React.Component {
|
||||
location = decodeURIComponent(location);
|
||||
let path = location.slice(location.indexOf(repoID) + repoID.length + 1); // get the string after repoID
|
||||
path = path.slice(path.indexOf('/')); // get current path
|
||||
// If the path isn't a root path and ends with '/', delete the ending '/'
|
||||
if (path.length > 1 && path[path.length - 1] === '/') {
|
||||
path = path.slice(0, path.length - 1);
|
||||
}
|
||||
|
||||
try {
|
||||
const repoRes = await seafileAPI.getRepoInfo(repoID);
|
||||
|
@@ -255,7 +255,7 @@ class OrgGroupsSearchGroups extends Component {
|
||||
this.getItems();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { query, isSubmitBtnActive } = this.state;
|
||||
|
@@ -157,7 +157,7 @@ class OrgUsersSearchUsers extends Component {
|
||||
this.getItems();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { query, isSubmitBtnActive } = this.state;
|
||||
|
@@ -96,7 +96,7 @@ class SearchGroups extends Component {
|
||||
this.getGroups();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { name, isSubmitBtnActive } = this.state;
|
||||
|
@@ -93,7 +93,7 @@ class SearchOrgs extends Component {
|
||||
this.getItems();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { query, isSubmitBtnActive } = this.state;
|
||||
|
@@ -85,7 +85,7 @@ class SearchRepos extends Component {
|
||||
this.searchRepos();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { name, isSubmitBtnActive } = this.state;
|
||||
|
@@ -279,7 +279,7 @@ class SearchUsers extends Component {
|
||||
this.getItems();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { query, isSubmitBtnActive } = this.state;
|
||||
|
@@ -527,7 +527,7 @@ export const Utils = {
|
||||
|
||||
getFileOperationList: function(isRepoOwner, currentRepoInfo, dirent, isContextmenu) {
|
||||
let list = [];
|
||||
const { SHARE, DOWNLOAD, DELETE, RENAME, MOVE, COPY, TAGS, UNLOCK, LOCK, MARK_AS_DRAFT, UNMARK_AS_DRAFT,
|
||||
const { SHARE, DOWNLOAD, DELETE, RENAME, MOVE, COPY, TAGS, UNLOCK, LOCK,
|
||||
HISTORY, ACCESS_LOG, PROPERTIES, OPEN_VIA_CLIENT, ONLYOFFICE_CONVERT, CONVERT_TO_MARKDOWN, CONVERT_TO_SDOC } = TextTranslation;
|
||||
const permission = dirent.permission;
|
||||
const { isCustomPermission, customPermission } = Utils.getUserPermission(permission);
|
||||
|
Reference in New Issue
Block a user