mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 17:02:47 +00:00
[share links admin dialog] added 'empty tip' (#4474)
This commit is contained in:
@@ -6,6 +6,7 @@ import { siteRoot, gettext } from '../../utils/constants';
|
|||||||
import { Utils } from '../../utils/utils';
|
import { Utils } from '../../utils/utils';
|
||||||
import toaster from '../toast';
|
import toaster from '../toast';
|
||||||
import Loading from '../loading';
|
import Loading from '../loading';
|
||||||
|
import EmptyTip from '../empty-tip';
|
||||||
|
|
||||||
const repoShareUploadLinkItemPropTypes = {
|
const repoShareUploadLinkItemPropTypes = {
|
||||||
item: PropTypes.object.isRequired,
|
item: PropTypes.object.isRequired,
|
||||||
@@ -146,7 +147,7 @@ class RepoShareUploadLinksDialog extends React.Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
const { loading, errorMsg, activeTab } = this.state;
|
const { loading, errorMsg, activeTab, repoShareUploadLinkList } = this.state;
|
||||||
|
|
||||||
const itemName = '<span class="op-target">' + Utils.HTMLescape(this.props.repo.repo_name) + '</span>';
|
const itemName = '<span class="op-target">' + Utils.HTMLescape(this.props.repo.repo_name) + '</span>';
|
||||||
const title = gettext('{placeholder} Share/Upload Links').replace('{placeholder}', itemName);
|
const title = gettext('{placeholder} Share/Upload Links').replace('{placeholder}', itemName);
|
||||||
@@ -172,7 +173,12 @@ class RepoShareUploadLinksDialog extends React.Component {
|
|||||||
<div className="cur-view-content" style={{minHeight: '20rem', maxHeight: '20rem'}}>
|
<div className="cur-view-content" style={{minHeight: '20rem', maxHeight: '20rem'}}>
|
||||||
{loading && <Loading />}
|
{loading && <Loading />}
|
||||||
{!loading && errorMsg && <p className="error text-center mt-8">{errorMsg}</p>}
|
{!loading && errorMsg && <p className="error text-center mt-8">{errorMsg}</p>}
|
||||||
{!loading && !errorMsg &&
|
{!loading && !errorMsg && !repoShareUploadLinkList.length &&
|
||||||
|
<EmptyTip forDialog={true}>
|
||||||
|
<p className="text-secondary">{activeTab == 'shareLinks' ? gettext('No share links') : gettext('No upload links')}</p>
|
||||||
|
</EmptyTip>
|
||||||
|
}
|
||||||
|
{!loading && !errorMsg && repoShareUploadLinkList.length > 0 &&
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@@ -2,11 +2,16 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { mediaUrl } from '../utils/constants';
|
import { mediaUrl } from '../utils/constants';
|
||||||
|
|
||||||
|
const propTypes = {
|
||||||
|
forDialog: PropTypes.bool,
|
||||||
|
children: PropTypes.object.isRequired
|
||||||
|
};
|
||||||
|
|
||||||
class EmptyTip extends React.Component {
|
class EmptyTip extends React.Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="empty-tip">
|
<div className={this.props.forDialog ? 'text-center mt-8' : 'empty-tip'}>
|
||||||
<img src={`${mediaUrl}img/no-items-tip.png`} alt="" width="100" height="100" className="no-items-img-tip" />
|
<img src={`${mediaUrl}img/no-items-tip.png`} alt="" width="100" height="100" className="no-items-img-tip" />
|
||||||
{this.props.children}
|
{this.props.children}
|
||||||
</div>
|
</div>
|
||||||
@@ -14,4 +19,6 @@ class EmptyTip extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EmptyTip.propTypes = propTypes;
|
||||||
|
|
||||||
export default EmptyTip;
|
export default EmptyTip;
|
||||||
|
Reference in New Issue
Block a user