1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 22:54:11 +00:00

refactor: face ui (#6981)

* refactor: face ui

* feat: people pgotos

* feat: people pgotos

* feat: optimize ui

* feat: optimize ui

* feat: delete file

* optimize code

* feat: replace icon

* update

* feat: replace icon

* feat: optimize back btn

---------

Co-authored-by: 杨国璇 <ygx@Hello-word.local>
Co-authored-by: 杨国璇 <ygx@192.168.1.3>
Co-authored-by: ‘JoinTyang’ <yangtong1009@163.com>
This commit is contained in:
杨国璇
2024-11-05 17:37:24 +08:00
committed by GitHub
parent 8f04a770f7
commit 2cb758e302
39 changed files with 1593 additions and 927 deletions

View File

@@ -23,7 +23,7 @@ import DeleteFolderDialog from '../../components/dialog/delete-folder-dialog';
import { EVENT_BUS_TYPE } from '../../components/common/event-bus-type';
import { PRIVATE_FILE_TYPE } from '../../constants';
import { MetadataProvider, CollaboratorsProvider } from '../../metadata/hooks';
import { LIST_MODE, METADATA_MODE, FACE_RECOGNITION_MODE, DIRENT_DETAIL_MODE } from '../../components/dir-view-mode/constants';
import { LIST_MODE, METADATA_MODE, DIRENT_DETAIL_MODE } from '../../components/dir-view-mode/constants';
import CurDirPath from '../../components/cur-dir-path';
import DirTool from '../../components/cur-dir-path/dir-tool';
import Detail from '../../components/dirent-detail';
@@ -547,19 +547,6 @@ class LibContentView extends React.Component {
window.history.pushState({ url: url, path: '' }, '', url);
};
showFaceRecognition = (filePath, viewId) => {
const repoID = this.props.repoID;
const repoInfo = this.state.currentRepoInfo;
this.setState({
currentMode: FACE_RECOGNITION_MODE,
path: filePath,
viewId: viewId,
isDirentDetailShow: false
});
const url = `${siteRoot}library/${repoID}/${encodeURIComponent(repoInfo.repo_name)}/?view=${encodeURIComponent(viewId)}`;
window.history.pushState({ url: url, path: '' }, '', url);
};
hideFileMetadata = () => {
this.setState({
currentMode: LIST_MODE,
@@ -1891,10 +1878,6 @@ class LibContentView extends React.Component {
if (node.path !== this.state.path) {
this.showFileMetadata(node.path, node.view_id || '0000', node.view_type || VIEW_TYPE.TABLE);
}
} else if (Utils.isFaceRecognition(node?.object?.type)) {
if (node.path !== this.state.path) {
this.showFaceRecognition(node.path, node.view_id || '0000');
}
} else {
let url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(node.path);
let dirent = node.object;
@@ -2032,7 +2015,7 @@ class LibContentView extends React.Component {
isDirentSelected: false,
isAllDirentSelected: false,
});
if (this.state.currentMode === METADATA_MODE || this.state.currentMode === FACE_RECOGNITION_MODE) {
if (this.state.currentMode === METADATA_MODE) {
this.setState({
currentMode: cookie.load('seafile_view_mode') || LIST_MODE,
});
@@ -2422,6 +2405,7 @@ class LibContentView extends React.Component {
getMarkDownFileName={this.getMarkDownFileName}
openMarkdownFile={this.openMarkdownFile}
updateCurrentDirent={this.updateCurrentDirent}
closeDirentDetail={this.closeDirentDetail}
/>
:
<div className="message err-tip">{gettext('Folder does not exist.')}</div>