1
0
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:
llj
2020-03-10 12:00:31 +08:00
committed by GitHub
parent cf6c54504a
commit af55315113
2 changed files with 16 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ import { siteRoot, gettext } from '../../utils/constants';
import { Utils } from '../../utils/utils';
import toaster from '../toast';
import Loading from '../loading';
import EmptyTip from '../empty-tip';
const repoShareUploadLinkItemPropTypes = {
item: PropTypes.object.isRequired,
@@ -146,7 +147,7 @@ class RepoShareUploadLinksDialog extends React.Component {
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 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'}}>
{loading && <Loading />}
{!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>
<thead>
<tr>

View File

@@ -2,11 +2,16 @@ import React from 'react';
import PropTypes from 'prop-types';
import { mediaUrl } from '../utils/constants';
const propTypes = {
forDialog: PropTypes.bool,
children: PropTypes.object.isRequired
};
class EmptyTip extends React.Component {
render() {
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" />
{this.props.children}
</div>
@@ -14,4 +19,6 @@ class EmptyTip extends React.Component {
}
}
EmptyTip.propTypes = propTypes;
export default EmptyTip;