1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-05-11 17:34:56 +00:00

Optimize draft code ()

* optimize code

* optimize code
This commit is contained in:
杨顺强 2023-09-02 11:19:58 +08:00 committed by GitHub
parent 785cf8227d
commit b457231bda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 20 deletions

View File

@ -13,8 +13,7 @@
"@seafile/resumablejs": "1.1.16",
"@seafile/sdoc-editor": "0.1.140",
"@seafile/seafile-calendar": "0.0.12",
"@seafile/seafile-editor": "0.4.5",
"@seafile/slate-react": "0.54.13",
"@seafile/seafile-editor": "0.4.6",
"@uiw/codemirror-extensions-langs": "^4.19.4",
"@uiw/react-codemirror": "^4.19.4",
"classnames": "^2.2.6",
@ -5394,9 +5393,9 @@
}
},
"node_modules/@seafile/seafile-editor": {
"version": "0.4.5",
"resolved": "https://registry.npmjs.org/@seafile/seafile-editor/-/seafile-editor-0.4.5.tgz",
"integrity": "sha512-tGb9qcbiRYa9YyuV1OieVSvj/mzfp1LzwQYBWkAKMA6BkY0rqQ0GHMJYObiWJmNaLTMKvkCIrdg/OpuynpA9sA==",
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/@seafile/seafile-editor/-/seafile-editor-0.4.6.tgz",
"integrity": "sha512-IjtmOCXmNSeAQtYetdrcrwoInNIO9yKQhp8SoEVn22dnYFq6YsRe5kXANNgReZ1nOYZRuaI8yD6ezrG9Iim/8g==",
"dependencies": {
"@seafile/react-image-lightbox": "2.0.2",
"@seafile/slate-react": "0.54.13",
@ -33523,9 +33522,9 @@
}
},
"@seafile/seafile-editor": {
"version": "0.4.5",
"resolved": "https://registry.npmjs.org/@seafile/seafile-editor/-/seafile-editor-0.4.5.tgz",
"integrity": "sha512-tGb9qcbiRYa9YyuV1OieVSvj/mzfp1LzwQYBWkAKMA6BkY0rqQ0GHMJYObiWJmNaLTMKvkCIrdg/OpuynpA9sA==",
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/@seafile/seafile-editor/-/seafile-editor-0.4.6.tgz",
"integrity": "sha512-IjtmOCXmNSeAQtYetdrcrwoInNIO9yKQhp8SoEVn22dnYFq6YsRe5kXANNgReZ1nOYZRuaI8yD6ezrG9Iim/8g==",
"requires": {
"@seafile/react-image-lightbox": "2.0.2",
"@seafile/slate-react": "0.54.13",

View File

@ -8,8 +8,7 @@
"@seafile/resumablejs": "1.1.16",
"@seafile/sdoc-editor": "0.1.140",
"@seafile/seafile-calendar": "0.0.12",
"@seafile/seafile-editor": "0.4.5",
"@seafile/slate-react": "0.54.13",
"@seafile/seafile-editor": "0.4.6",
"@uiw/codemirror-extensions-langs": "^4.19.4",
"@uiw/react-codemirror": "^4.19.4",
"classnames": "^2.2.6",

View File

@ -5,7 +5,7 @@ import { Button } from 'reactstrap';
/* eslint-disable */
import Prism from 'prismjs';
/* eslint-enable */
import { DiffViewer, serialize } from '@seafile/seafile-editor';
import { ReactEditor, DiffViewer, serialize } from '@seafile/seafile-editor';
import { siteRoot, gettext, draftOriginFilePath, draftFilePath, author, authorAvatar, originFileExists, draftFileExists, draftID, draftFileName, draftRepoID, draftStatus, draftPublishVersion, originFileVersion, filePermission, serviceURL, mediaUrl } from './utils/constants';
import { seafileAPI } from './utils/seafile-api';
import axios from 'axios';
@ -14,7 +14,6 @@ import ReviewComments from './components/review-list-view/review-comments';
import ReviewCommentDialog from './components/review-list-view/review-comment-dialog.js';
import { Tooltip } from 'reactstrap';
import AddReviewerDialog from './components/dialog/add-reviewer-dialog.js';
import { ReactEditor } from '@seafile/slate-react';
import { Nav, NavItem, NavLink, TabContent, TabPane } from 'reactstrap';
import classnames from 'classnames';
import HistoryList from './pages/review/history-list';

View File

@ -241,11 +241,9 @@ class Item extends Component {
</td>
<td>{item.shared_by}</td>
<td title={moment(item.last_modified).format('llll')}>{moment(item.ctime).fromNow()}</td>
<td>
{item.is_dir ? "" : <a href="#" className={`action-icon sf2-icon-download ${isOpIconShown ? '' : 'invisible'}`} title={gettext('Download')} onClick={this.downloadFile}></a>}
<td>{item.is_dir ? "" : <a href="#" className={`action-icon sf2-icon-download ${isOpIconShown ? '' : 'invisible'}`} title={gettext('Download')} onClick={this.downloadFile}></a>}
</td>
<td>
{this.props.path ? "" : <a href="#" className={`action-icon sf2-icon-x3 ${isOpIconShown ? '' : 'invisible'}`} title={gettext('Leave Share')} onClick={this.leaveShare}></a>}
<td>{this.props.path ? "" : <a href="#" className={`action-icon sf2-icon-x3 ${isOpIconShown ? '' : 'invisible'}`} title={gettext('Leave Share')} onClick={this.leaveShare}></a>}
</td>
</tr>
);

View File

@ -248,10 +248,6 @@ class RepoItem extends React.Component {
this.props.deleteRepoItem(this.props.repo);
}
toggleTransfer = () => {
this.props.transferRepoItem(this.props.repo);
}
renderLibIcon = (repo) => {
let href;
let iconTitle;