mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-13 22:01:06 +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 React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Button, Modal, ModalHeader, Input, ModalBody, ModalFooter, Form, FormGroup, Label, Alert } from 'reactstrap';
|
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';
|
import { Utils } from '../../utils/utils';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
@@ -141,7 +141,6 @@ class CreateFile extends React.Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { isSdocDraft } = this.state;
|
|
||||||
const { toggleDialog } = this.props;
|
const { toggleDialog } = this.props;
|
||||||
return (
|
return (
|
||||||
<Modal isOpen={true} toggle={toggleDialog} onOpened={this.onAfterModelOpened}>
|
<Modal isOpen={true} toggle={toggleDialog} onOpened={this.onAfterModelOpened}>
|
||||||
|
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
|
|||||||
import ModalPortal from './modal-portal';
|
import ModalPortal from './modal-portal';
|
||||||
import ListTaggedFilesDialog from './dialog/list-taggedfiles-dialog';
|
import ListTaggedFilesDialog from './dialog/list-taggedfiles-dialog';
|
||||||
import ListRepoDraftsDialog from './dialog/list-repo-drafts-dialog';
|
import ListRepoDraftsDialog from './dialog/list-repo-drafts-dialog';
|
||||||
import { gettext } from '../utils/constants';
|
|
||||||
|
|
||||||
import '../css/repo-info-bar.css';
|
import '../css/repo-info-bar.css';
|
||||||
|
|
||||||
|
@@ -219,7 +219,7 @@ class FileHistory extends React.Component {
|
|||||||
goBack = (e) => {
|
goBack = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
window.history.back();
|
window.history.back();
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
|
@@ -133,6 +133,10 @@ class LibContentView extends React.Component {
|
|||||||
location = decodeURIComponent(location);
|
location = decodeURIComponent(location);
|
||||||
let path = location.slice(location.indexOf(repoID) + repoID.length + 1); // get the string after repoID
|
let path = location.slice(location.indexOf(repoID) + repoID.length + 1); // get the string after repoID
|
||||||
path = path.slice(path.indexOf('/')); // get current path
|
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 {
|
try {
|
||||||
const repoRes = await seafileAPI.getRepoInfo(repoID);
|
const repoRes = await seafileAPI.getRepoInfo(repoID);
|
||||||
|
@@ -255,7 +255,7 @@ class OrgGroupsSearchGroups extends Component {
|
|||||||
this.getItems();
|
this.getItems();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { query, isSubmitBtnActive } = this.state;
|
const { query, isSubmitBtnActive } = this.state;
|
||||||
|
@@ -157,7 +157,7 @@ class OrgUsersSearchUsers extends Component {
|
|||||||
this.getItems();
|
this.getItems();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { query, isSubmitBtnActive } = this.state;
|
const { query, isSubmitBtnActive } = this.state;
|
||||||
|
@@ -96,7 +96,7 @@ class SearchGroups extends Component {
|
|||||||
this.getGroups();
|
this.getGroups();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { name, isSubmitBtnActive } = this.state;
|
const { name, isSubmitBtnActive } = this.state;
|
||||||
|
@@ -93,7 +93,7 @@ class SearchOrgs extends Component {
|
|||||||
this.getItems();
|
this.getItems();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { query, isSubmitBtnActive } = this.state;
|
const { query, isSubmitBtnActive } = this.state;
|
||||||
|
@@ -85,7 +85,7 @@ class SearchRepos extends Component {
|
|||||||
this.searchRepos();
|
this.searchRepos();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { name, isSubmitBtnActive } = this.state;
|
const { name, isSubmitBtnActive } = this.state;
|
||||||
|
@@ -279,7 +279,7 @@ class SearchUsers extends Component {
|
|||||||
this.getItems();
|
this.getItems();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { query, isSubmitBtnActive } = this.state;
|
const { query, isSubmitBtnActive } = this.state;
|
||||||
|
@@ -527,7 +527,7 @@ export const Utils = {
|
|||||||
|
|
||||||
getFileOperationList: function(isRepoOwner, currentRepoInfo, dirent, isContextmenu) {
|
getFileOperationList: function(isRepoOwner, currentRepoInfo, dirent, isContextmenu) {
|
||||||
let list = [];
|
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;
|
HISTORY, ACCESS_LOG, PROPERTIES, OPEN_VIA_CLIENT, ONLYOFFICE_CONVERT, CONVERT_TO_MARKDOWN, CONVERT_TO_SDOC } = TextTranslation;
|
||||||
const permission = dirent.permission;
|
const permission = dirent.permission;
|
||||||
const { isCustomPermission, customPermission } = Utils.getUserPermission(permission);
|
const { isCustomPermission, customPermission } = Utils.getUserPermission(permission);
|
||||||
|
Reference in New Issue
Block a user