diff --git a/frontend/src/components/back-icon.js b/frontend/src/components/back-icon.js new file mode 100644 index 0000000000..a3aa73f7c1 --- /dev/null +++ b/frontend/src/components/back-icon.js @@ -0,0 +1,22 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { gettext } from '../utils/constants'; + +function BackIcon({ onClick }) { + return ( + + + ); +} + +BackIcon.propTypes = { + onClick: PropTypes.func +}; + +export default BackIcon; diff --git a/frontend/src/components/dialog/custom-permission/custom-permission-editor.js b/frontend/src/components/dialog/custom-permission/custom-permission-editor.js index ef16f15166..2a1408d5d1 100644 --- a/frontend/src/components/dialog/custom-permission/custom-permission-editor.js +++ b/frontend/src/components/dialog/custom-permission/custom-permission-editor.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { Alert, FormGroup, Input, Label, Tooltip } from 'reactstrap'; import { gettext } from '../../../utils/constants'; import Loading from '../../loading'; -import OpIcon from '../../op-icon'; +import BackIcon from '../../back-icon'; class CustomPermissionEditor extends React.Component { constructor(props) { @@ -102,11 +102,7 @@ class CustomPermissionEditor extends React.Component {
{data.platform} | {data.device_name} | {data.last_login_ip} | {dayjs(data.last_accessed).fromNow()} | - + + | ||||||||||||||||||
{dayjs(item.ctime).format('YYYY-MM-DD HH:mm:ss')}
{this.props.index === 0 && {gettext('(current version)')}}
@@ -115,7 +119,7 @@ class MoreMenu extends React.PureComponent {
{item.accepter} |
{dayjs(item.invite_time).format('YYYY-MM-DD')} |
{dayjs(item.expire_time).format('YYYY-MM-DD')} |
@@ -84,7 +100,7 @@ class Item extends React.Component {
item.accept_time ?
:
@@ -342,7 +342,7 @@ class MylibRepoListItem extends React.Component {
{(repo.repo_name && this.state.isOpIconShow) && (
- |
+
+ {item.folder_name} |
{item.repo_name} |
@@ -215,34 +220,26 @@ class Item extends Component {
{item.user_name} : item.group_name}
- {!isShowPermEditor && (
- |
+
- {Utils.sharePerms(share_permission) || share_permission_name}
- {isOpIconShown && (
-
-
- )}
-
- )}
- {isShowPermEditor && (
-
+
+
|
-
| {item.repo_name} |
{item.share_type == 'personal' ? {shareTo} : shareTo}
|
- {!isShowPermEditor && (
- |
+
- {Utils.sharePerms(share_permission) || share_permission_name}
- {isOpIconShown && (
-
-
- )}
-
- )}
- {isShowPermEditor && (
-
+
+
|
-
| {item.view_cnt} |
{this.renderExpiration()} |
- {!item.is_expired &&
-
+ {!item.is_expired &&
+
-
- }
-
-
+
+ }
+
+
+
|
{item.view_cnt} |
{this.renderExpiration()} |
- {!item.is_expired && }
-
+ |
+ {!item.is_expired &&
+
+
+ }
+
+
+
|
- {(isPro && data.is_admin) &&
-
- }
-
- {enableMonitorRepo &&
- |
{data.size} | {dayjs(data.last_modified).fromNow()} | @@ -258,7 +260,7 @@ class Item extends Component { {data.monitored &&
{ data.thumbnail_url ? @@ -237,7 +249,7 @@ class Item extends Component { |
{item.user_name} |
{item.platform}{' / '}{item.client_version} |
{item.device_name} |
@@ -150,7 +164,12 @@ class Item extends Component {
{dayjs(item.last_accessed).fromNow()}
-
+
+
|
@@ -142,7 +131,7 @@ class InstitutionInfo extends Component {
{item.name} |
{dayjs(item.ctime).fromNow()} |
-
+
+
|
{item.obj_name} |
{item.token} |
|
@@ -168,7 +177,12 @@ class Item extends Component {
{item.view_cnt} |
{this.renderExpiration()} |
-
+
+
|
{item.path} |
{item.token} |
|
@@ -145,7 +154,12 @@ class Item extends Component {
{item.view_cnt} |
{this.renderExpiration()} |
-
+
+
|
@@ -242,7 +233,7 @@ class OrgInfo extends Component {
|
- + + | |
{repo.name} |
diff --git a/frontend/src/pages/sys-admin/terms-and-conditions/item.js b/frontend/src/pages/sys-admin/terms-and-conditions/item.js
index a4861584a7..b2c083b89b 100644
--- a/frontend/src/pages/sys-admin/terms-and-conditions/item.js
+++ b/frontend/src/pages/sys-admin/terms-and-conditions/item.js
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import { processor } from '@seafile/seafile-editor';
+import classnames from 'classnames';
import { gettext } from '../../../utils/constants';
import { Utils } from '../../../utils/utils';
import getPreviewContent from '../../../utils/markdown-utils';
@@ -20,6 +21,7 @@ class Item extends Component {
super(props);
this.state = {
itemContent: '...',
+ isHighlighted: false,
isOpIconShown: false,
isUpdateDialogOpen: false,
isDeleteDialogOpen: false,
@@ -49,7 +51,7 @@ class Item extends Component {
if (!this.props.isItemFreezed) {
this.setState({
isOpIconShown: true,
- highlight: true
+ isHighlighted: true
});
}
};
@@ -58,7 +60,7 @@ class Item extends Component {
if (!this.props.isItemFreezed) {
this.setState({
isOpIconShown: false,
- highlight: false
+ isHighlighted: false
});
}
};
@@ -88,7 +90,7 @@ class Item extends Component {
onUnfreezedItem = () => {
this.setState({
- highlight: false,
+ isHighlighted: false,
isOpIconShow: false
});
this.props.onUnfreezedItem();
@@ -122,13 +124,19 @@ class Item extends Component {
render() {
let { item } = this.props;
- let { isDeleteDialogOpen, isUpdateDialogOpen, isTermsPreviewDialogOpen } = this.state;
+ let { isDeleteDialogOpen, isUpdateDialogOpen, isTermsPreviewDialogOpen, isHighlighted } = this.state;
let previewContent = getPreviewContent(item.text);
let itemName = '' + Utils.HTMLescape(item.name) + '';
let deleteDialogMsg = gettext('Are you sure you want to delete {placeholder} ?').replace('{placeholder}', itemName);
return (
{item.name} |
{item.version_number} |
diff --git a/frontend/src/pages/sys-admin/users/user-info.js b/frontend/src/pages/sys-admin/users/user-info.js
index 5bef503f79..1b2d7fd3ee 100644
--- a/frontend/src/pages/sys-admin/users/user-info.js
+++ b/frontend/src/pages/sys-admin/users/user-info.js
@@ -1,4 +1,4 @@
-import React, { Component, Fragment } from 'react';
+import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { FormGroup, Label, Input, Button } from 'reactstrap';
import { Utils } from '../../../utils/utils';
@@ -6,6 +6,7 @@ import { systemAdminAPI } from '../../../utils/system-admin-api';
import { gettext, isPro } from '../../../utils/constants';
import toaster from '../../../components/toast';
import Loading from '../../../components/loading';
+import EditIcon from '../../../components/edit-icon';
import SysAdminSetQuotaDialog from '../../../components/dialog/sysadmin-dialog/set-quota';
import SysAdminSetUploadDownloadRateLimitDialog from '../../../components/dialog/sysadmin-dialog/set-upload-download-rate-limit';
import SysAdminUpdateUserDialog from '../../../components/dialog/sysadmin-dialog/update-user';
@@ -83,16 +84,6 @@ class Content extends Component {
this.toggleDialog('', '');
};
- showEditIcon = (action) => {
- return (
-
-
- );
- };
-
render() {
const { loading, errorMsg } = this.props;
const { highlight } = this.state;
@@ -108,7 +99,7 @@ class Content extends Component {
isSetUserUploadRateLimitDialogOpen, isSetUserDownloadRateLimitDialogOpen
} = this.state;
return (
- |
@@ -367,7 +358,7 @@ class User extends Component {
{`${Utils.bytesToSize(item.quota_usage)} / ${item.quota_total > 0 ? Utils.bytesToSize(item.quota_total) : '--'}`}
-
-
+
|
{(multiInstitution && !isAdmin) &&
diff --git a/frontend/src/repo-snapshot.js b/frontend/src/repo-snapshot.js
index 2b03120ce1..195bf208f9 100644
--- a/frontend/src/repo-snapshot.js
+++ b/frontend/src/repo-snapshot.js
@@ -1,6 +1,7 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import PropTypes from 'prop-types';
+import classnames from 'classnames';
import { navigate } from '@gatsbyjs/reach-router';
import { Utils } from './utils/utils';
import { gettext, siteRoot, mediaUrl, logoPath, logoWidth, logoHeight, siteTitle } from './utils/constants';
@@ -249,21 +250,26 @@ class FolderItem extends React.Component {
constructor(props) {
super(props);
this.state = {
+ isHighlighted: false,
isIconShown: false
};
}
handleMouseOver = () => {
- this.setState({ isIconShown: true });
+ this.setState({
+ isHighlighted: true,
+ isIconShown: true
+ });
};
handleMouseOut = () => {
- this.setState({ isIconShown: false });
+ this.setState({
+ isHighlighted: false,
+ isIconShown: false
+ });
};
- restoreItem = (e) => {
- e.preventDefault();
-
+ restoreItem = () => {
const item = this.props.item;
const path = Utils.joinPath(this.props.folderPath, item.name);
const request = item.type == 'dir' ?
@@ -287,26 +293,56 @@ class FolderItem extends React.Component {
render() {
const item = this.props.item;
- const { isIconShown } = this.state;
+ const { isIconShown, isHighlighted } = this.state;
const { folderPath } = this.props;
return item.type == 'dir' ? (
- | {item.name} |
|
-
+
+
|
{item.name} |
{Utils.bytesToSize(item.size)} |
-
-
+
|
@@ -1155,7 +1170,14 @@ class Item extends React.Component {
const fileURL = `${siteRoot}d/${token}/files/?p=${encodeURIComponent(item.file_path)}`;
const thumbnailURL = item.encoded_thumbnail_src ? `${siteRoot}${item.encoded_thumbnail_src}?mtime=${item.last_modified}` : '';
return isDesktop ? (
- |
diff --git a/media/css/seahub_react.css b/media/css/seahub_react.css
index c3eebe2679..fb36eb22f9 100644
--- a/media/css/seahub_react.css
+++ b/media/css/seahub_react.css
@@ -564,7 +564,32 @@ a, a:hover {
}
/** op-icon **/
-.op-icon,
+.op-icon {
+ font-size: 1rem;
+ line-height: 1;
+ color: #999;
+ cursor: pointer;
+ display: inline-flex;
+ width: 24px;
+ height: 24px;
+ align-items: center;
+ justify-content: center;
+ border-radius: 3px;
+ margin-right: 0.25rem;
+}
+
+.op-icon:focus,
+.op-icon:hover {
+ color: #666;
+ text-decoration: none;
+ background: #e5e5e5;
+}
+
+.op-icon-bg-light:focus,
+.op-icon-bg-light:hover {
+ background: #efefef; /* for .op-icon shown in white containers */
+}
+
.action-icon,
.attr-action-icon {
margin-left: 0.5rem;
@@ -575,16 +600,6 @@ a, a:hover {
vertical-align: middle;
}
-.op-icon {
- font-size: 1rem;
- color: #999;
-}
-
-.op-icon:focus,
-.op-icon:hover {
- color: #212529;
- text-decoration: none;
-}
.action-icon,
.attr-action-icon {
| |