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

feat: side properties (#6485)

* feat: side properties

* feat: show metadata

* feat: delete record expand

* feat: optimzie code

* fix: bug

---------

Co-authored-by: 杨国璇 <ygx@Hello-word.local>
This commit is contained in:
杨国璇
2024-08-06 17:30:11 +08:00
committed by GitHub
parent 1c169b5329
commit b043cb8491
63 changed files with 408 additions and 2490 deletions

View File

@@ -2,7 +2,7 @@ import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { gettext } from '../../utils/constants';
import CurDirPath from '../../components/cur-dir-path';
import { LibDetail, DirentDetail } from '../../components/dirent-detail';
import Detail from '../../components/dirent-detail';
import DirColumnView from '../../components/dir-view-mode/dir-column-view';
import ToolbarForSelectedDirents from '../../components/toolbar/selected-dirents-toolbar';
@@ -319,23 +319,16 @@ class LibContentContainer extends React.Component {
)}
{this.props.isDirentDetailShow && (
<div className="cur-view-detail">
{(this.props.path === '/' && !this.state.currentDirent) ?
<LibDetail
currentRepo={this.props.currentRepoInfo}
closeDetails={this.props.closeDirentDetail}
/> :
<DirentDetail
repoID={repoID}
path={this.props.path}
dirent={this.state.currentDirent}
currentRepoInfo={this.props.currentRepoInfo}
repoTags={this.props.repoTags}
fileTags={this.props.isViewFile ? this.props.fileTags : []}
onFileTagChanged={this.props.onFileTagChanged}
onItemDetailsClose={this.props.closeDirentDetail}
direntDetailPanelTab={this.props.direntDetailPanelTab}
/>
}
<Detail
path={path}
repoID={repoID}
currentRepoInfo={this.props.currentRepoInfo}
dirent={this.state.currentDirent}
repoTags={this.props.repoTags}
fileTags={this.props.isViewFile ? this.props.fileTags : []}
onFileTagChanged={this.props.onFileTagChanged}
onClose={this.props.closeDirentDetail}
/>
</div>
)}
</div>

View File

@@ -416,7 +416,7 @@ class LibContentView extends React.Component {
let repoID = this.props.repoID;
if (!this.state.isSessionExpired) {
// update stste
// update state
this.setState({
isDirentListLoading: true,
isViewFile: false,
@@ -494,7 +494,7 @@ class LibContentView extends React.Component {
showFileMetadata = (filePath, viewId) => {
const repoID = this.props.repoID;
this.setState({ path: filePath, isViewFile: true, isFileLoading: false, isFileLoadedErr: false, content: '__sf-metadata', metadataViewId: viewId });
this.setState({ path: filePath, isViewFile: true, isFileLoading: false, isFileLoadedErr: false, content: '__sf-metadata', metadataViewId: viewId, isDirentDetailShow: false });
const repoInfo = this.state.currentRepoInfo;
const url = siteRoot + 'library/' + repoID + '/' + encodeURIComponent(repoInfo.repo_name);
window.history.pushState({ url: url, path: '' }, '', url);