Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouwenxuan authored and zhouwenxuan committed Jan 14, 2025
1 parent 5503eee commit 614832e
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 149 deletions.
21 changes: 17 additions & 4 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"@emoji-mart/data": "^1.2.1",
"@emoji-mart/react": "^1.1.1",
"@gatsbyjs/reach-router": "1.3.9",
"@seafile/react-image-lightbox": "3.0.5",
"@seafile/resumablejs": "1.1.16",
"@seafile/sdoc-editor": "1.0.203",
"@seafile/seafile-calendar": "0.0.28",
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/assets/icons/left_arrow.svg

This file was deleted.

2 changes: 0 additions & 2 deletions frontend/src/assets/icons/right_arrow.svg

This file was deleted.

15 changes: 6 additions & 9 deletions frontend/src/components/dialog/image-dialog/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
background-color: #333;
border: 1px solid #666;
transition: width 0.3s ease;
z-index: 1052;
}

.lightbox-side-panel.expanded {
Expand All @@ -25,7 +24,7 @@
border-left: 1px solid #666;
}

.side-panel-controller {
.lightbox-side-panel-button-container {
display: flex;
justify-content: center;
align-items: center;
Expand All @@ -44,15 +43,15 @@
cursor: pointer;
}

.side-panel-controller .expand-button {
.lightbox-side-panel-button-container .switch-button {
width: 32px;
height: 32px;
transform: scale(0.67);
transform: scale(0.6875);
opacity: 0.7;
border: none;
}

.side-panel-controller:hover .expand-button {
.lightbox-side-panel-button-container:hover .switch-button {
opacity: 1;
}

Expand Down Expand Up @@ -101,8 +100,6 @@
background-color: #666;
}

.lightbox-side-panel .dirent-detail-divider {
height: 1px;
background-color: #999;
margin-bottom: 20px;
.lightbox-side-panel .dirent-detail-people {
border-top: 1px solid #999;
}
13 changes: 1 addition & 12 deletions frontend/src/components/dialog/image-dialog/index.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
import React, { useCallback, useEffect, useState } from 'react';
import React, { useCallback } from 'react';
import PropTypes from 'prop-types';
import { gettext } from '../../../utils/constants';
import Lightbox from '@seafile/react-image-lightbox';
import { useMetadataAIOperations } from '../../../hooks/metadata-ai-operation';
import { SYSTEM_FOLDERS } from '../../../constants';
import { Utils } from '../../../utils/utils';
import { Dirent } from '../../../models';
import { seafileAPI } from '../../../utils/seafile-api';
import DirentDetails from '../../dirent-detail/dirent-details';

import '@seafile/react-image-lightbox/style.css';
import './index.css';

const ImageDialog = ({ repoID, repoInfo, enableRotate: oldEnableRotate, imageItems, imageIndex, closeImagePopup, moveToPrevImage, moveToNextImage, onDeleteImage, onRotateImage, isShared }) => {
const [direntDetail, setDirentDetail] = useState(null);
const { enableOCR, enableMetadata, canModify, onOCR: onOCRAPI, OCRSuccessCallBack } = useMetadataAIOperations();

useEffect(() => {
const path = Utils.joinPath(imageItems[imageIndex].parentDir, imageItems[imageIndex].name);
seafileAPI.getFileInfo(repoID, path).then(res => {
setDirentDetail(res.data);
});
}, [imageIndex, imageItems, repoID, repoInfo]);

const downloadImage = useCallback((url) => {
location.href = url;
}, []);
Expand Down Expand Up @@ -61,7 +51,6 @@ const ImageDialog = ({ repoID, repoInfo, enableRotate: oldEnableRotate, imageIte
currentRepoInfo={repoInfo}
path={mainImg.parentDir}
dirent={dirent}
direntDetail={direntDetail}
onClose={() => {}}
repoTags={[]}
fileTags={[]}
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/components/dir-view-mode/dir-column-nav/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ const propTypes = {
onItemsMove: PropTypes.func.isRequired,
getMenuContainerSize: PropTypes.func,
updateDirent: PropTypes.func,
repoTags: PropTypes.array,
fileTags: PropTypes.array,
onFileTagChanged: PropTypes.func,
};

class DirColumnNav extends React.Component {
Expand Down Expand Up @@ -74,9 +71,6 @@ class DirColumnNav extends React.Component {
onItemMove={this.props.onItemMove}
onItemsMove={this.props.onItemsMove}
updateDirent={this.props.updateDirent}
repoTags={this.props.repoTags}
fileTags={this.props.fileTags}
onFileTagChanged={this.props.onFileTagChanged}
/>
<DirViews repoID={repoID} currentPath={currentPath} userPerm={userPerm} currentRepoInfo={currentRepoInfo} />
<DirTags repoID={repoID} currentPath={currentPath} userPerm={userPerm} currentRepoInfo={currentRepoInfo} />
Expand Down
4 changes: 0 additions & 4 deletions frontend/src/components/dir-view-mode/dir-column-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ const propTypes = {
eventBus: PropTypes.object,
updateCurrentDirent: PropTypes.func.isRequired,
updateCurrentPath: PropTypes.func,
fileTags: PropTypes.array,
};

class DirColumnView extends React.Component {
Expand Down Expand Up @@ -183,9 +182,6 @@ class DirColumnView extends React.Component {
getMenuContainerSize={this.getMenuContainerSize}
direntList={this.props.direntList}
updateDirent={this.props.updateDirent}
repoTags={this.props.repoTags}
fileTags={this.props.fileTags}
onFileTagChanged={this.props.onFileTagChanged}
/>
<ResizeBar
resizeBarRef={this.resizeBarRef}
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/dir-view-mode/dir-list-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const propTypes = {
fullDirentList: PropTypes.array,
getMenuContainerSize: PropTypes.func,
eventBus: PropTypes.object,
fileTags: PropTypes.array,
};

class DirListView extends React.Component {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Title from './title';

import './index.css';

const Header = ({ title, icon, iconSize = 32, onClose, children, component = {}, withinPreviewer }) => {
const Header = ({ title, icon, iconSize = 32, onClose, children, component = {}, withinPreviewer = false }) => {
const { closeIcon } = component;
return (
<div className="detail-header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
flex-wrap: wrap;
gap: 12px;
margin-bottom: 20px;
border-top: 1px solid #eee;
padding-top: 20px;
}

.dirent-detail-people .dirent-detail-people-item {
Expand All @@ -11,9 +13,3 @@
border-radius: 50%;
overflow: hidden;
}

.dirent-detail-divider {
height: 1px;
background-color: #eee;
margin-bottom: 20px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ const People = ({ repoID, record }) => {
if (!images.length) return null;

return (
<>
{images.length > 0 && <div className="dirent-detail-divider"></div>}
<div className="dirent-detail-people">
{images.map(img => (
<div className="dirent-detail-people-item" key={img.row_id} title={img.display_value || gettext('Unknown people')}>
<img src={img.url} alt={img.display_value || gettext('Unknown people')} onError={onImgLoadError} height={32} width={32} />
</div>
))}
</div>
</>
<div className="dirent-detail-people">
{images.map(img => (
<div className="dirent-detail-people-item" key={img.row_id} title={img.display_value || gettext('Unknown people')}>
<img src={img.url} alt={img.display_value || gettext('Unknown people')} onError={onImgLoadError} height={32} width={32} />
</div>
))}
</div>
);
};

Expand Down
Empty file.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import { lang, serviceURL } from '../../../../utils/constants';
import { LONG_TEXT_EXCEED_LIMIT_MESSAGE, LONG_TEXT_EXCEED_LIMIT_SUGGEST } from '../../../constants';
import i18n from '../../../../_i18n/i18n-seafile-editor';

import './index.css';

class LongTextEditor extends React.PureComponent {

constructor(props) {
Expand Down
1 change: 0 additions & 1 deletion frontend/src/pages/lib-content-view/lib-content-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -2395,7 +2395,6 @@ class LibContentView extends React.Component {
eventBus={this.props.eventBus}
updateCurrentDirent={this.updateCurrentDirent}
updateCurrentPath={this.updatePath}
fileTags={this.state.isViewFile ? this.state.fileTags : []}
/>
:
<div className="message err-tip">{gettext('Folder does not exist.')}</div>
Expand Down

0 comments on commit 614832e

Please sign in to comment.