Skip to content

Commit

Permalink
New: Improve empty list messaging
Browse files Browse the repository at this point in the history
(cherry picked from commit ee843259bca2d9764a3919b123524a51a3a16cce)

Closes #2621
  • Loading branch information
mynameisbogdan committed Jun 27, 2023
1 parent 07451cb commit 55959e1
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 21 deletions.
6 changes: 4 additions & 2 deletions frontend/src/Settings/Tags/Tags.js
@@ -1,8 +1,10 @@
import PropTypes from 'prop-types';
import React from 'react';
import Alert from 'Components/Alert';
import FieldSet from 'Components/FieldSet';
import Link from 'Components/Link/Link';
import PageSectionContent from 'Components/Page/PageSectionContent';
import { kinds } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
import TagConnector from './TagConnector';
import styles from './Tags.css';
Expand All @@ -16,9 +18,9 @@ function Tags(props) {
if (!items.length) {
const wikiLink = <Link to='https://wiki.servarr.com/readarr/settings#tags'>here</Link>;
return (
<div>
<Alert kind={kinds.INFO}>
{translate('NoTagsHaveBeenAddedYet', [wikiLink])}
</div>
</Alert>
);
}

Expand Down
9 changes: 5 additions & 4 deletions frontend/src/System/Events/LogsTable.js
@@ -1,5 +1,6 @@
import PropTypes from 'prop-types';
import React from 'react';
import Alert from 'Components/Alert';
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
import FilterMenu from 'Components/Menu/FilterMenu';
import PageContent from 'Components/Page/PageContent';
Expand All @@ -11,7 +12,7 @@ import Table from 'Components/Table/Table';
import TableBody from 'Components/Table/TableBody';
import TableOptionsModalWrapper from 'Components/Table/TableOptions/TableOptionsModalWrapper';
import TablePager from 'Components/Table/TablePager';
import { align, icons } from 'Helpers/Props';
import { align, icons, kinds } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
import LogsTableRow from './LogsTableRow';

Expand Down Expand Up @@ -82,9 +83,9 @@ function LogsTable(props) {

{
isPopulated && !error && !items.length &&
<div>
No events found
</div>
<Alert kind={kinds.INFO}>
{translate('NoEventsFound')}
</Alert>
}

{
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/System/Logs/Files/LogFiles.js
Expand Up @@ -11,7 +11,7 @@ import PageToolbarSection from 'Components/Page/Toolbar/PageToolbarSection';
import PageToolbarSeparator from 'Components/Page/Toolbar/PageToolbarSeparator';
import Table from 'Components/Table/Table';
import TableBody from 'Components/Table/TableBody';
import { icons } from 'Helpers/Props';
import { icons, kinds } from 'Helpers/Props';
import translate from 'Utilities/String/translate';
import LogsNavMenu from '../LogsNavMenu';
import LogFilesTableRow from './LogFilesTableRow';
Expand Down Expand Up @@ -118,9 +118,9 @@ class LogFiles extends Component {

{
!isFetching && !items.length &&
<div>
<Alert kind={kinds.INFO}>
{translate('NoLogFiles')}
</div>
</Alert>
}
</PageContentBody>
</PageContent>
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/System/Updates/Updates.js
@@ -1,6 +1,7 @@
import _ from 'lodash';
import PropTypes from 'prop-types';
import React, { Component, Fragment } from 'react';
import Alert from 'Components/Alert';
import Icon from 'Components/Icon';
import Label from 'Components/Label';
import SpinnerButton from 'Components/Link/SpinnerButton';
Expand Down Expand Up @@ -61,9 +62,9 @@ class Updates extends Component {

{
noUpdates &&
<div>
<Alert kind={kinds.INFO}>
{translate('NoUpdatesAreAvailable')}
</div>
</Alert>
}

{
Expand Down
11 changes: 6 additions & 5 deletions frontend/src/Wanted/CutoffUnmet/CutoffUnmet.js
@@ -1,5 +1,6 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import Alert from 'Components/Alert';
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
import FilterMenu from 'Components/Menu/FilterMenu';
import ConfirmModal from 'Components/Modal/ConfirmModal';
Expand Down Expand Up @@ -190,16 +191,16 @@ class CutoffUnmet extends Component {

{
!isAnyFetching && error &&
<div>
<Alert kind={kinds.DANGER}>
Error fetching cutoff unmet
</div>
</Alert>
}

{
isAllPopulated && !error && !items.length &&
<div>
No cutoff unmet items
</div>
<Alert kind={kinds.INFO}>
{translate('NoCutoffUnmetItems')}
</Alert>
}

{
Expand Down
11 changes: 6 additions & 5 deletions frontend/src/Wanted/Missing/Missing.js
@@ -1,5 +1,6 @@
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import Alert from 'Components/Alert';
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
import FilterMenu from 'Components/Menu/FilterMenu';
import ConfirmModal from 'Components/Modal/ConfirmModal';
Expand Down Expand Up @@ -207,16 +208,16 @@ class Missing extends Component {

{
!isAnyFetching && error &&
<div>
<Alert kind={kinds.DANGER}>
Error fetching missing items
</div>
</Alert>
}

{
isAllPopulated && !error && !items.length &&
<div>
No missing items
</div>
<Alert kind={kinds.INFO}>
{translate('NoMissingItems')}
</Alert>
}

{
Expand Down
3 changes: 3 additions & 0 deletions src/NzbDrone.Core/Localization/Core/en.json
Expand Up @@ -515,12 +515,15 @@
"New": "New",
"NewBooks": "New Books",
"NoBackupsAreAvailable": "No backups are available",
"NoCutoffUnmetItems": "No cutoff unmet items",
"NoEventsFound": "No events found",
"NoHistory": "No history.",
"NoHistoryBlocklist": "No history blocklist",
"NoLeaveIt": "No, Leave It",
"NoLimitForAnyRuntime": "No limit for any runtime",
"NoLogFiles": "No log files",
"NoMinimumForAnyRuntime": "No minimum for any runtime",
"NoMissingItems": "No missing items",
"NoName": "Do not show name",
"NoTagsHaveBeenAddedYet": "No tags have been added yet. Add tags to link authors with delay profiles, restrictions, or notifications. Click {0} to find out more about tags in Readarr.",
"NoUpdatesAreAvailable": "No updates are available",
Expand Down

0 comments on commit 55959e1

Please sign in to comment.