1
0
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:
Michael An
2023-11-01 15:10:43 +08:00
committed by GitHub
parent 955c292ce8
commit eab8130ed8
11 changed files with 13 additions and 11 deletions

View File

@@ -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}>

View File

@@ -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';

View File

@@ -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 (

View File

@@ -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);

View File

@@ -255,7 +255,7 @@ class OrgGroupsSearchGroups extends Component {
this.getItems(); this.getItems();
} }
} }
} };
render() { render() {
const { query, isSubmitBtnActive } = this.state; const { query, isSubmitBtnActive } = this.state;

View File

@@ -157,7 +157,7 @@ class OrgUsersSearchUsers extends Component {
this.getItems(); this.getItems();
} }
} }
} };
render() { render() {
const { query, isSubmitBtnActive } = this.state; const { query, isSubmitBtnActive } = this.state;

View File

@@ -96,7 +96,7 @@ class SearchGroups extends Component {
this.getGroups(); this.getGroups();
} }
} }
} };
render() { render() {
const { name, isSubmitBtnActive } = this.state; const { name, isSubmitBtnActive } = this.state;

View File

@@ -93,7 +93,7 @@ class SearchOrgs extends Component {
this.getItems(); this.getItems();
} }
} }
} };
render() { render() {
const { query, isSubmitBtnActive } = this.state; const { query, isSubmitBtnActive } = this.state;

View File

@@ -85,7 +85,7 @@ class SearchRepos extends Component {
this.searchRepos(); this.searchRepos();
} }
} }
} };
render() { render() {
const { name, isSubmitBtnActive } = this.state; const { name, isSubmitBtnActive } = this.state;

View File

@@ -279,7 +279,7 @@ class SearchUsers extends Component {
this.getItems(); this.getItems();
} }
} }
} };
render() { render() {
const { query, isSubmitBtnActive } = this.state; const { query, isSubmitBtnActive } = this.state;

View File

@@ -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);