1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 23:20:51 +00:00

Optimized code structure (#2430)

* combine utils file

* modify file position
This commit is contained in:
shanshuirenjia
2018-10-09 10:56:59 +08:00
committed by Daniel Pan
parent a2cc17778c
commit c0d645962f
45 changed files with 87 additions and 96 deletions

View File

@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { isPro, gettext } from '../../components/constants';
import { isPro, gettext } from '../../utils/constants';
import Search from '../search/search';
import Notification from '../common/notification';
import Account from '../common/account';

View File

@@ -1,6 +1,6 @@
import React from 'react';
import { gettext, repoID, slug, permission, siteRoot } from '../constants';
import { encodePath } from '../utils';
import { gettext, repoID, slug, permission, siteRoot } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import PropTypes from 'prop-types';
const propTypes = {
@@ -35,7 +35,7 @@ class PathToolbar extends React.Component {
</ul>
);
} else if (permission) {
historyUrl = siteRoot + 'repo/file_revisions/' + repoID + '/?p=' + encodePath(this.props.filePath) + '&referer=' + encodeURIComponent(location.href);
historyUrl = siteRoot + 'repo/file_revisions/' + repoID + '/?p=' + Utils.encodePath(this.props.filePath) + '&referer=' + encodeURIComponent(location.href);
return (
<ul className="path-toolbar">
<li className="toolbar-item"><a className="op-link sf2-icon-history" href={historyUrl} title={gettext('History')} aria-label={gettext('History')}></a></li>