1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-10-21 19:00:12 +00:00

feat: add file list view (#8283)

* feat: add file list view

* feat: update app setup

* fix: update window seafile setup

* fix: update setup

* fix: optimize code
This commit is contained in:
Guodong SU
2025-10-11 16:05:08 +08:00
committed by GitHub
parent b4c5cd81ea
commit 22302cf1f3
4 changed files with 100 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ import toaster from '../../../components/toast';
import InternalLinkDialog from '../../../components/dialog/internal-link-dialog';
import ShareDialog from '../../../components/dialog/share-dialog';
import CreateFile from '../../../components/dialog/create-file-dialog';
import SearchedItemDetails from '../../../components/search/details';
const propTypes = {
repoID: PropTypes.string.isRequired,
@@ -48,6 +49,7 @@ class ExternalOperations extends React.Component {
this.unsubscribeCreateSdocFile = eventBus.subscribe(EXTERNAL_EVENT.CREATE_SDOC_FILE, this.onCreateSdocFile);
this.unsubscribeCreateWhiteboardFile = eventBus.subscribe(EXTERNAL_EVENT.CREATE_WHITEBOARD_FILE, this.onCreateWhiteboardFile);
this.unsubscribeGenerateExdrawReadOnlyLink = eventBus.subscribe(EXTERNAL_EVENT.GENERATE_EXDRAW_READ_ONLY_LINK, this.generateExdrawReadOnlyLink);
this.unsubscribeUseFileMetadataComponent = eventBus.subscribe(EXTERNAL_EVENT.FILE_METADATA_COMPONENT, this.useFileMetadataComponent);
}
componentWillUnmount() {
@@ -61,8 +63,15 @@ class ExternalOperations extends React.Component {
this.unsubscribeClearNotification();
this.unsubscribeCreateWhiteboardFile();
this.unsubscribeGenerateExdrawReadOnlyLink();
this.unsubscribeUseFileMetadataComponent();
}
useFileMetadataComponent = (callback) => {
if (typeof callback === 'function') {
callback(SearchedItemDetails);
}
};
onInternalLinkToggle = (options) => {
if (options && options.internalLink) {
this.setState({ internalLink: options.internalLink });

View File

@@ -6,6 +6,7 @@ import Dirent from '../../../models/dirent';
import { Utils } from '../../../utils/utils';
import { useCollaborators } from '../../../metadata';
import EmbeddedFileDetails from '../../../components/dirent-detail/embedded-file-details';
import { useMetadataStatus } from '../../../hooks';
import './index.css';
@@ -15,6 +16,7 @@ const SdocEditor = () => {
const [direntList, setDirentList] = useState([]);
const [currentDirent, setCurrentDirent] = useState(null);
const { collaborators } = useCollaborators();
const { enableMetadata } = useMetadataStatus();
const plugins = useMemo(() => {
const { repoID, docPath, docPerm, isRepoAdmin } = window.seafile;
return [
@@ -94,6 +96,7 @@ const SdocEditor = () => {
useEffect(() => {
onSetFavicon();
getDirentList();
window.seafile = { ...window.seafile, enableMetadata };
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);