diff --git a/frontend/src/components/dialog/repo-share-upload-links-dialog.js b/frontend/src/components/dialog/repo-share-upload-links-dialog.js index 90f61dd91e..10591b1bd8 100644 --- a/frontend/src/components/dialog/repo-share-upload-links-dialog.js +++ b/frontend/src/components/dialog/repo-share-upload-links-dialog.js @@ -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 = '' + Utils.HTMLescape(this.props.repo.repo_name) + ''; const title = gettext('{placeholder} Share/Upload Links').replace('{placeholder}', itemName); @@ -172,7 +173,12 @@ class RepoShareUploadLinksDialog extends React.Component {
{loading && } {!loading && errorMsg &&

{errorMsg}

} - {!loading && !errorMsg && + {!loading && !errorMsg && !repoShareUploadLinkList.length && + +

{activeTab == 'shareLinks' ? gettext('No share links') : gettext('No upload links')}

+
+ } + {!loading && !errorMsg && repoShareUploadLinkList.length > 0 && diff --git a/frontend/src/components/empty-tip.js b/frontend/src/components/empty-tip.js index 37ee713e85..4459444784 100644 --- a/frontend/src/components/empty-tip.js +++ b/frontend/src/components/empty-tip.js @@ -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 ( -
+
{this.props.children}
@@ -14,4 +19,6 @@ class EmptyTip extends React.Component { } } +EmptyTip.propTypes = propTypes; + export default EmptyTip;